< div class = "字段field-name-taxonomy-forums field-type-taxonomy-term-reference field-label-above”> < div class = "字段标签" >论坛:,< / div > < div class = "字段条目" > < div class =”field-item甚至“rel = " sioc: has_container " > < a href = " /论坛/ dialog-smartbond-bluetooth-low-energy - % E2 % 80% 93 -软件”“=“sioc:容器sioc:论坛”属性= " rdfs: label skos: prefLabel”数据类型= " " >对话框Smartbond蓝牙低能量-软件< / > < / div > < / div > < / div > < div class =”字段field-name-body field-type-text-with-summary field-label-hidden”> < div class = "字段条目" > < div class =”field-item甚至“财产=“内容:编码”> < p >你好,对话框中,< br / >我I2C装置有两个程序的一部分:initialiazing /操作。
我把它放在项目hrp_sensor中。初始化代码在函数system_init上:(过程定义)< br /> //----------------------------------------< br / >静态孔隙system_init (void * pvParameters) < br / > {< br / > OS_TASK处理;无符号字符d < br / >, < br / > i2c_device dev; < / p > < p > #如果定义CONFIG_RETARGET < br / >走读生空白retarget_init(空白);< br / > # endif < br / >…< br / >…
#if define CONFIG_RETARGET
retarget_init();
#endif printf("BLE hrp demo" NEWLINE);/ /——I2C设备初始化 ---------------------- p > < p > MAX30100_reset (dev); < br / > d = MAX30100_read (dev MAX30100_PART_ID); < br / > printf(换行符" ID = % 02 x”一部分,d);
d = MAX30100_read(dev,MAX30100_REVISION_ID);< /p>
//设置LED current
MAX30100_setLEDs(dev,i11, i8)< br / >…< br /> //---------------------------------------------------------------- p > < p > DA14681跑的时候,我的UART终端显示如下:< br /> //------------------------------< br / >”“BLE合演示< br / > ID = 11部分< br /> //------------------------------< br / >下一个输出的修订ID = 05 '将会在当你连接这个祝福通过移动设备。
后台发生了什么?
如何改进我的代码?
Note: my I2C device is controlled by function ad_i2c_read(), ad_i2c_write() --- they works in async mode.
Thanks