generated from hulk/gd32e23x_template
使用硬件IIC实现回去数据,并且,间隔缩小到300ms
This commit is contained in:
34
inc/gd60914.h
Normal file
34
inc/gd60914.h
Normal file
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// Created by dell on 25-1-7.
|
||||
//
|
||||
|
||||
#ifndef GD60914_H
|
||||
#define GD60914_H
|
||||
|
||||
#include "gd32e23x_it.h"
|
||||
#include "gd32e23x.h"
|
||||
|
||||
#include "board_config.h"
|
||||
|
||||
#ifdef SOFTWARE_IIC
|
||||
#include "soft_i2c.h"
|
||||
#else
|
||||
#include "i2c.h"
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#define GD60914_ADDR (0x18 << 1)
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#define GD60914_HUM_TEMP 0x1A
|
||||
#define GD60914_OBJ_TEMP 0x1F
|
||||
#define GD60914_AMB_TEMP 0x1E
|
||||
#define GD60914_TEMP_REG 0x1C
|
||||
|
||||
void gd60914_get_object_tempture(void);
|
||||
|
||||
void gd60914_read_temp(void);
|
||||
|
||||
#endif //GD60914_H
|
@@ -19,7 +19,7 @@
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#define I2C_SPEED 20000
|
||||
#define I2C_SPEED 100000
|
||||
|
||||
#define I2C_TIME_OUT (uint16_t)(5000)
|
||||
#define I2C_OK 1
|
||||
|
@@ -43,6 +43,7 @@ OF SUCH DAMAGE.
|
||||
#include "usart.h"
|
||||
#include "fwdgt.h"
|
||||
#include "board_config.h"
|
||||
#include "gd60914.h"
|
||||
|
||||
#ifdef SOFTWARE_IIC
|
||||
#include "soft_i2c.h"
|
||||
|
Reference in New Issue
Block a user