STONE HMI+BC1110蓝牙透明传输 手机显示屏同步显示TONE HMI+BC1110 蓝牙透明传输手机显示屏同步显示HMI+BC1110

STONE HMI+BC1110蓝牙透明传输 手机显示屏同步显示TONE HMI+BC1110 蓝牙透明传输手机显示屏同步显示HMI+BC1110

系统概述STVC070WT-01

STONE-STVC070WT-01+BC1110-Bluetooth+transparent-transmission-mobile-phone-display-synchronously

STVC070WT-01 是由北京STONE科技有限公司生产的 7 英寸彩色触摸屏

色智能显示屏内置 128M 存储空间

与外部设备通信。S485/RS232与外部设备通信。

北京 STON电子科技有限公司

系统设计

如下图所示,传GL等GUI代

然而,采用智能显示终端开发可消除GUI元素的代码抽象过程。

ST

使用官方提供的电源适配器板和适配器电缆将智能显示屏

STVC070WT-01适配器板和适配器电缆将智能显示屏 STVC070WT-01

此时,点击进入“坏点”& gra试。此时,渐变显示,点击切换后退出

STONE-STVC070WT-01+BC1110-Bluetooth+transparent-transmission-mobile-phone-display-synchronously

如上图所示,传统显示终端的GUI开发将经历一个GUI元素代码抽象的过程。这一抽象过程需要使用QT、EmWin、LVGL等GUI代码库。此过程会将GUI模块与其他代码模块耦合,从而增加项目复杂性和不确定性。

然而,采用智能显示终端开发可消除GUI元素的代码抽象过程。开发人员可直接根据艺术设计在原始图像上划分功能并切换逻辑,实现模块化设计,可独立于其他产品模块进行执行和测试。保留外部功能接口(串行通信),可与整个产品有机集成。简化GUI开发流程,提升产品开发速度,降低项目复杂性和不确定性。

STVC070WT-01 智能显示开发

STVC070WT-01 是 STONE Tech 的民用级智能显示终端。只需获取产品,即可首先检查设备是否处于良好状态(左下图),打开屏幕上的塑料膜,即可清晰感受到屏幕的透亮光泽。

STONE-STVC070WT-01+BC1110-Bluetooth+transparent-transmission-mobile-phone-display-synchronously

使用官方提供的电源适配器板和适配器电缆将智能显示幕- 12EST V C070W T0接口到2电源,随后设备将运行工厂测试程序(测试案例)。此时,我们可以点击图中的“HWE”按钮执行硬件测试

STONE-STVC070WT-01+BC1110-Bluetooth+transparent-transmission-mobile-phone-display-synchronously

此时,我们点击进入“坏点与灰度”模式,进行死点检测和灰度测试。此时,屏幕将进入纯色和灰度渐变显示状态,点击切换后退出。

STONE-STVC070WT-01+BC1110-Bluetooth+transparent-transmission-mobile-phone-display-synchronously

确认屏幕无异常后,我们按照以下地址从STONE网站下载开发工具TOOL及其教程。
该程序使用两个变量存储空间0x1251和0x1253,分别用于存储指示灯显示的开/关状态(对应数据:1和0)以及是否显示蓝牙连接标记(对应数据:1和0)。关于TOOL的开发细节,请参阅上述文档,此处不再赘述。
使用STONE TOOL完成GUI界面设计与开发后,将电脑通过USB数据线连接至STVC070WT-01智能显示屏并建立连接。屏幕将显示程序下载提示信息“下载完成后,请拔出USB mini”。

STONE-STVC070WT-01+BC1110-Bluetooth+transparent-transmission-mobile-phone-display-synchronously

点击下图左侧的下载按钮,将我们程序下载到STV070WT-0-01。下载成功后,将显示下图右侧的界面。。

STONE-STVC070WT-01+BC1110-Bluetooth+transparent-transmission-mobile-phone-display-synchronously

STONE-STVC070WT-01+BC1110-Bluetooth+transparent-transmission-mobile-phone-display-synchronously

如图所示,点击右下角的开关按钮,即可调节中间小灯的亮度。.

STONE-STVC070WT-01+BC1110-Bluetooth+transparent-transmission-mobile-phone-display-synchronously

B蓝牙开发

STONE-STVC070WT-01+BC1110-Bluetooth+transparent-transmission-mobile-phone-display-synchronously

The CC2541 是一款专为蓝牙低功耗及专有 2.4 GHz 应用优化的低功耗系统级芯片(SoC)解决方案。它使能够以低总物料成本构建健壮的网络节点。CC2541将领先的射频收发器的卓越性能与符合行业标准的增强型8051微控制器、系统内可编程闪存、8KB RAM以及众多其他强大支持功能和外设相结合。CC2541非常适合需要超低功耗的系统。这通过多种工作模式实现。工作模式之间的快速切换进一步降低了功耗。若CC2540未启用USB接口且CC2541未启用I2C/额外I/O接口,则CC2541与CC2540在6毫米×6毫米QFN40封装下引脚兼容。与 CC25

特性

RF

  • 2.4 GHz 蓝牙低功耗兼容及专有 RF RF 系统级芯片
  • 支持 250 kbps、500 kbps、1 Mbps、2 Mbps 数据速率
  • 卓越的链路预用
  • 可编程输出功率最高达 0 dBm
  • 卓越的M选择性和阻塞性能
  • 适用于符合全球射频法规的系统规的系统:ETSI EN 300 EN STD-T66(日本)

布局

  • 外部组件少
  • 提供参考设计
  • 6 mm × 6 mm QFN-40 封装
  • 与 CC2540 引脚兼容(不使用 USB 或 I2C 时)

低功耗

  • 主动模式接收电流:低至 17.9 毫安
  • 主动模式发射电流(0 dBm):18.2 毫安
  • 电源模式1(4 µs 唤醒):270 µA
  • 电源模式 2(式 2(睡眠定时器开启):1 µA
  • 电源模式 3(外部中断):0.5 微安
  • 宽供电电压范围(2 V–3.6 V

TPS62730 兼容低功耗主动模式

  • 接收电流低mA(3 V供电)
  • 发3 mA(3 V供电)
  • 高性能低功耗 8051微控制器内核,支持代码预取
  • 片内可编程闪存,128 KB 或 256 KB
  • 8 KB RAM,所有电源模式下均保留
  • 硬件调试支持
  • 全面的基带自动化,和地址解码
  • 所有相关寄存器在所有电源模式下均保留

外设

  • 强大的五通道 五通道 DMA
  • 通用定时器(一个16位,两个8位)
  • 红外线生成电路
  • 32 kHz睡眠定时器带捕获功能
  • 准确的数字RSSI支持
  • 电池监控和温度传感器
  • 12位ADC,8个通道和可配置分辨率
  • AES安全协处理器
  • 两个强大的USART,支持多种串行协议
  • 23个通用I/O引脚(21×4 m个通用I/个通用I/O引脚(21×4 mA毫安,2×20AA,2×20 毫安
  • I2C接口
  • 2个I/O引脚具有LED驱动能力
  • 看门狗定时器
  • 集成高性能比高性能比较器

开发工具

  • CC2541评估模块EMK)
  • CC2541 迷你开发套件(CC2541DK-MINI)
  • SmartRF™ 软件
  • IAR嵌嵌入式工作台
  • 嵌入式工作台™ 可用

软件功能

符合蓝牙 v4.0 协议栈的单模BLUE 解决方案

  • 完整的电源优化协,包括控制器和主机
  • GAP – 中央、外设、观察者或广播器(包括组合角色)
  • ATTT/GATT – 客户端– 客户端和服务器
  • SMP – AES-128 加密和解密
  • L2CAP
  • 示例应用程序和配置文件
  • 通用应用程序,适用于 GAP 中央和外围角色
  • 接近检测、加速度计、简简单键盘和电池 、加速度计、简简单键盘和电池 GATT 服务
  • BLE 软件堆栈支持更多应用程序
  • 多种配置选项
  • 单芯片配置,支持应用程将应用程序运行在 CC2541 上
  • 网络处理器接口,适用于在外部微控制器上运行的应用程序
  • BTool – 用应用程序

应用程序

  • 2.4 GHz 蓝牙低功耗系统
  • 专有 2.4 GHz 系统
  • 人机接口设备(键盘、鼠标、遥控器)
  • 体育及休闲设备
  • 手机配件
  • 消费电子

CC2541 搭配 TPS62730

  • TPS62730 是一款带
  • 延长电池寿命最高达
  • 所有活动模式下电流降低
  • 射频性能不变不变频性能不变不变性能不变不变
  • 小型封装,支持小型解决方案决方案

STONE-STVC070WT-01+BC1110-Bluetooth+transparent-transmission-mobile-phone-display-synchronously

输入:B

将BP将BPS_C将BP将BPS_C并将将BP将BPSBP将BPS_CMD_SET设置设置为‘T’。T设置设置为‘T’。设置为‘T’。T设置设置为‘T’。

#define BPS_NULL 0
#define BPS_INLINE extern inline
/** @Brief: BPS command set */
#define BPS_CMD_SET_B   'B'
#define BPS_CMD_SET_T   'T'
#define BPS_CMD_SET_C   'C'
#ifdef WIN32
#define EXPORT_API __declspec(dllexport)
#else
#define EXPORT_API
#endif
/***************************************************************************************************************
*** #define BPS_CPU64/BPS_CPU32/BPS_CPU16/BPS_CPU8, MUST BE DEFINED BY YOUR OWN
***************************************************************************************************************/
/**
* @Brief: BPS_CPU64/32/16/8 uncomment one of the following line to indicate the CPU type.
*/
// #define BPS_CPU64
// #define BPS_CPU32
// #define BPS_CPU16
#define BPS_CPU8
/**
* @Brief: BPS_MEM_DYN for system that can alloc memory dynamically(malloc/free)
* it will enable to compile functions 'ParseXXXReqDyn/ParseXXXRspDyn',
* which are more efficient for memory usage.
*/
#define BPS_MEM_DYN
/**
* @Brief: BPS_CMD_SET define the command set for BPS_CMD_SET_B/BPS_CMD_SET_T/BPS_CMD_SET_C
*/
#define BPS_CMD_SET    BPS_CMD_SET_T
/**
* @Brief: BPS_USE_STD define this macro to use standard c library, otherwise we will use the ones from BPS
*/
#define BPS_USE_STD
/**
* @Brief: BPCPUXX define determine the cpu type
* @Note: Must define one of "BPS_CPU64/BPS_CPU32/BPS_CPU16/BPS_CPU8" to match your cpu, NO DEFAULT VALUE
*/
#ifdef BPS_CPU64
typedef unsigned char BPS_UINT8;
typedef char BPS_INT8;
typedef unsigned short BPS_UINT16;
typedef short BPS_INT16;
typedef unsigned int BPS_UINT32;
typedef int BPS_INT32;
typedef unsigned long long BPS_UINT64;
typedef long long BPS_INT64;
typedef float BPS_FLOAT;
typedef BPS_UINT64 BPS_WORD;
#elif defined BPS_CPU32
typedef unsigned char BPS_UINT8;
typedef char BPS_INT8;
typedef unsigned short BPS_UINT16;
typedef short BPS_INT16;
typedef unsigned int BPS_UINT32;
typedef int BPS_INT32;
typedef float BPS_FLOAT;
typedef BPS_UINT32 BPS_WORD;
#elif defined BPS_CPU16
typedef unsigned char BPS_UINT8;
typedef char BPS_INT8;
typedef unsigned short BPS_UINT16;
typedef short BPS_INT16;
typedef unsigned long BPS_UINT32;
typedef long BPS_INT32;
typedef float BPS_FLOAT;
typedef BPS_UINT16 BPS_WORD;
#elif defined BPS_CPU8
typedef unsigned char BPS_UINT8;
typedef char BPS_INT8;
typedef unsigned short BPS_UINT16;
typedef short BPS_INT16;
typedef unsigned long BPS_UINT32;
typedef long BPS_INT32;
typedef float BPS_FLOAT;
typedef BPS_UINT8 BPS_WORD;
#else
#error Please define your cpu macro first: BPS_CPU64/BPS_CPU32/BPS_CPU16/BPS_CPU8
#endif
#define BPS_BOOL        BPS_UINT8
#define BPS_TRUE        1
#define BPS_FALSE       0

我们使用风信物联网的蓝牙透明传输模块BC1110,并对其代码进行修改,以每秒一次的频率将连接状态数据发送至STVC070WT-01。同时,将适配器电缆的DIN、DOUT和GND引出,并连接至BC1110的TX、RX和GND。

注意:当STONE智能显示屏STVC070WT-01出厂时,背板焊盘的J17与J18连接,以方便计算机串口通信,但这会导致与蓝牙模块通信失败,因此需确保在此处断开连接。

APP开发

APP连接至蓝牙后,使用STONEn官方串行通信协议读写0x1251地址的数据,并控制智能显示屏STVC070WT-01的灯光同时开关。Android源代码如下

import static android.bluetooth.BluetoothAdapter.STATE_CONNECTED;
import static android.bluetooth.BluetoothAdapter.STATE_CONNECTING;
import static android.bluetooth.BluetoothAdapter.STATE_DISCONNECTED;
public class MainActivity extends AppCompatActivity {
private BluetoothAdapter mBluetoothAdapter;
private BluetoothLeScanner mBluetoothLeScanner;
private boolean mScanning;
private static final int RQS_ENABLE_BLUETOOTH = 1;
public final static String UUID_BLE_DATA_CHANNEL_WRITE = "0000fff1-0000-1000-8000-00805f9b34fb";
public final static String UUID_BLE_DATA_CHANNEL_NOTIFY = "00002902-0000-1000-8000-00805f9b34fb";
private static final int PERMISSION_REQUEST_COARSE_LOCATION = 2;
private static String LOG_TAG = "Main";
public static final int SCAN_PERIOD = 15000;
private String address = "";
private Handler mHandler;
private ImageView light;
private ProgressBar link;
int mConnectionState = STATE_DISCONNECTED;
private BluetoothGatt mBluetoothGatt;
private boolean isLight = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
light = findViewById(R.id.id_image_light);
link = findViewById(R.id.id_progress_link);
light.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
byte[] data;
if(isLight) {
light.setColorFilter(Color.GRAY);
data = new byte[] {(byte)0xA5, 0x5A, 0x05, (byte)0x82, 0x12, 0x51, 0x00, 0x00};
} else {
light.setColorFilter(Color.YELLOW);
data = new byte[] {(byte)0xA5, 0x5A, 0x05, (byte)0x82, 0x12, 0x51, 0x00, 0x01};
}
isLight = !isLight;
List supportedGattServices = mBluetoothGatt.getServices();
for (BluetoothGattService gattService : supportedGattServices) {
//Service的Characteristics
List gattCharacteristics = gattService.getCharacteristics();
for (BluetoothGattCharacteristic gattCharacteristic : gattCharacteristics) {
int charaProp = gattCharacteristic.getProperties();
if ((charaProp & BluetoothGattCharacteristic.PROPERTY_WRITE) > 0 && gattCharacteristic.getUuid().toString().contains(UUID_BLE_DATA_CHANNEL_WRITE)) {
gattCharacteristic.setValue(data);
mBluetoothGatt.writeCharacteristic(gattCharacteristic);
break;
}
}
}
}
});
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
// Android M Permission check
if (this.checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION}, PERMISSION_REQUEST_COARSE_LOCATION);
}
}
mHandler = new Handler();
getBluetoothAdapterAndLeScanner();
}
private void getBluetoothAdapterAndLeScanner(){
// Get BluetoothAdapter and BluetoothLeScanner.
final BluetoothManager bluetoothManager =
(BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);
mBluetoothAdapter = bluetoothManager.getAdapter();
mBluetoothLeScanner = mBluetoothAdapter.getBluetoothLeScanner();
mScanning = false;
}
@Override
protected void onResume() {
super.onResume();
if (!mBluetoothAdapter.isEnabled()) {
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBtIntent, RQS_ENABLE_BLUETOOTH);
} else {
scanLeDevice(true, 10000);
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == RQS_ENABLE_BLUETOOTH && resultCode == Activity.RESULT_CANCELED) {
finish();
return;
}
getBluetoothAdapterAndLeScanner();
// Checks if Bluetooth is supported on the device.
if (mBluetoothAdapter == null) {
Toast.makeText(this,
"bluetoothManager.getAdapter()==null",
Toast.LENGTH_SHORT).show();
finish();
return;
}
super.onActivityResult(requestCode, resultCode, data);
}
public void scanLeDevice(final boolean enable, int timeout) {
try {
if (enable) {
// bluetoothDeviceListNew.clear();
if (timeout < 0) {
timeout = SCAN_PERIOD;
}
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
if (true == mScanning) {
mScanning = false;
mBluetoothAdapter.stopLeScan(mLeScanCallback);
}
}
}, timeout);
mScanning = true;
mBluetoothAdapter.startLeScan(mLeScanCallback);
} else {
mScanning = false;
mBluetoothAdapter.stopLeScan(mLeScanCallback);
}
} catch(Exception e) {
Log.d(LOG_TAG, e.getMessage());
}
}
private BluetoothAdapter.LeScanCallback mLeScanCallback =
new BluetoothAdapter.LeScanCallback() {
@Override
public void onLeScan(final BluetoothDevice device, int rssi, byte[] scanRecord) {
if(null == device || null == device.getName()) return;
Log.d(LOG_TAG, device.getName());
if(device.getName().contains("BC1110")) {
address = device.getAddress();
scanLeDevice(false, 0);
mBluetoothGatt = device.connectGatt(getApplicationContext(), false, mGattCallback);
mConnectionState = STATE_CONNECTING;
}
}
};
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
switch (requestCode) {
case PERMISSION_REQUEST_COARSE_LOCATION:
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
// TODO request success
}
break;
}
}
private final BluetoothGattCallback mGattCallback = new BluetoothGattCallback() {
@Override
public void onConnectionStateChange(BluetoothGatt gatt, int status,
int newState) {
String intentAction;
Log.d(LOG_TAG, "CONNECTING: " + status);
if (newState == STATE_CONNECTED) {
mConnectionState = STATE_CONNECTED;
gatt.discoverServices();
}

如需完整代码和项目文档,请联系我们:代码和项目文档,请联系我们:

https://www.stone-hmi.com//联系

蓝牙透明传输手机显示同步项目演示

结论

STONE 智能显示屏

滚动至顶部