雷竞技电竞平台对话半导体客户支持- DA14850 https://support.dialog-semiconductor.com/resource-keywords/da14850 DA14850与Si705温度传感器通信。 https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/da14850-communicating-si705-temperature < 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 >你好,我试图从Si705读取温度。我有connectiong传感器,我已经测试它,当我读到固件版本使用pdf中描述的测量过程(https://www.silabs.com/documents/public/data-sheets/Si7050-1-3-4-5-A20.pdf < a href = " https://www.silabs.com/documents/public/data-sheets/Si7050-1-3-4-5-A20.pdf " > < / >) 16页。然而,当我试图读取温度时,我的输出结果是0,0。

cmd = Temp_H;< p>

user_i2c_set_slave_address(Si705_I2C_ADDRESS);< p>

user_i2c_multi_byte_read(cmd, data,

degrees = convert_to_celsius(degrees);< p>

degrees = convert_to_celsius(degrees);< p>

return degrees;< p>

我使用的代码读取字节如下:

void user_i2c_multi_byte_read(uint32_t reg_address, uint8_t *rd_data, uint8_t *rd_data)

Uint32_t index = 0;< p>

for(Uint32_t I = 0;我& lt;

SEND_I2C_COMMAND(0x0100 &0 x3ff); // Set R/W bit to 1 (read access) MSB

if(!(++i % 24)){ //FIFO is 32 bits

WAIT_UNTIL_I2C_FIFO_IS_EMPTY(); // Wait until Tx FIFO is empty

WAIT_UNTIL_NO_MASTER_ACTIVITY(); // wait until no master activity

for (uint8_t j = 0; j < 24; j++){

//Store the FIFO contents in ram

rd_data[index++] = (0xFF & GetWord16(I2C_DATA_CMD_REG)); // Get received byte

}

reg_address += 24/(i2c_cfg_env.register_width + 1);//Calculate the next register to read out

user_i2c_send_address(reg_address); //Restart the read

}

}

WAIT_UNTIL_I2C_FIFO_IS_EMPTY(); // Wait until I2C Tx FIFO empty

WAIT_UNTIL_NO_MASTER_ACTIVITY();

while(index < num_bytes){

rd_data[index++] = (0xFF & GetWord16(I2C_DATA_CMD_REG)); // Get received byte

}

WAIT_UNTIL_I2C_FIFO_IS_EMPTY(); // Wait until Tx FIFO is empty

WAIT_UNTIL_NO_MASTER_ACTIVITY(); // wait until no master activity }

Keywords: 
Device: 
2019年9月19日星期四12:29:49 +0000 kaptajnen 323663年https://support.dialog-semiconductor.com https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/da14850-communicating-si705-temperature#comments