资源简介
本文件为TI温湿度传感器HDC1080的C语言驱动程序,可以正常配置寄存器,读取温度值,I2C接口,内含注释。
代码片段和文件信息
//This file is an example for using HDC1080.
//The I2C function is based on your own I2C subroutine you should replace the related I2C subroutines by your owns.
//Here is the I2C function definition: dev_addr -the i2c address of HDC1080 (1000000 7bit address) register_addr - the register in HDC1080 SPEC
#define HDC1080_I2C_ADDR 0x80 //0x40 << 1
#define Temperature 0x00//0x0000 Temperature measurement output
#define Humidity 0x01//0x0000 Relative Humidity measurement output
#define Configuration 0x02// 0x1000 HDC1080 configuration and status
#define Manufacturer_ID 0xFE//0x5449 ID of Texas Instruments
#define Device_ID 0xFF//0x1050 ID of the device
#define Manufacturer_ID_value 0x5449
#define Device_ID_value 0x1050
#define Configuratio
- 上一篇:bmp位图文件的读取与保存
- 下一篇:计算机图形学作业源程序
评论
共有 条评论