generated from hulk/gd32e23x_template
rewrite write/read function
This commit is contained in:
@@ -44,8 +44,13 @@ typedef enum {
|
||||
I2C_STOP
|
||||
} i2c_process_enum;
|
||||
|
||||
#define I2C_TIME_OUT (uint16_t)(10000)
|
||||
#define I2C_OK 1
|
||||
#define I2C_FAIL 0
|
||||
#define I2C_END 1
|
||||
|
||||
#define I2C_SPEED 100000
|
||||
#define RCU_IR_GPIO RCU_GPIOF
|
||||
#define RCU_GPIO_I2C RCU_GPIOF
|
||||
#define RCU_I2C RCU_I2C0
|
||||
#define I2C_SCL_PORT GPIOF
|
||||
#define I2C_SCL_PIN GPIO_PIN_1
|
||||
@@ -53,13 +58,19 @@ typedef enum {
|
||||
#define I2C_SDA_PIN GPIO_PIN_0
|
||||
#define I2C_GPIO_AF GPIO_AF_1
|
||||
|
||||
#define I2C_TIME_OUT (uint16_t)(10000)
|
||||
|
||||
|
||||
void I2C_config(void);
|
||||
void gpio_config(void);
|
||||
void i2c_config(void);
|
||||
void i2c_bus_reset(void);
|
||||
void I2C_scan(void);
|
||||
|
||||
int LDC1612_IIC_read_16bits(uint8_t reg, uint16_t *data);
|
||||
void ldc1612_iic_get_sensor_infomation(void);
|
||||
uint16_t ldc1612_get_manufacturer_id(void);
|
||||
uint16_t ldc1612_get_deveice_id(void);
|
||||
uint8_t ldc1612_iic_read_16bits(uint8_t reg_addr, uint8_t *data);
|
||||
int ldc1612_iic_write_16bits(uint8_t reg_addr, uint8_t data[2]);
|
||||
|
||||
#endif //LDC1612_H
|
||||
|
Reference in New Issue
Block a user