change iic speed to 20K

This commit is contained in:
2024-12-19 20:12:28 +08:00
parent fd06d54fdc
commit e2c2e81247
3 changed files with 67 additions and 16 deletions

View File

@@ -30,11 +30,27 @@
#define SENSOR_RESET_REG 0X1C
#define SET_DRIVER_CURRENT_REG 0X1E
#define RCOUNT_CH0_REG 0x08
#define SETTLECOUNT_CH0_REG 0x10
#define CLOCK_DIVIDERS_CH0_REG 0x14
#define ERROR_CONFIG_REG 0X19
#define MUX_CONFIG_REG 0x1B
#define DRIVE_CURRENT_CH0_REG 0x1E
#define SENSOR_CONFIG_REG 0X1A
#define READ_MANUFACTURER_ID 0X7E
#define READ_DEVICE_ID 0X7F
/******************************************************************************/
#define CHANNEL_0 0
#define CHANNEL_1 1
/******************************************************************************/
#define CONVERSION_TIME_CH0 0X0546 //0536
#define CONVERSION_OFFSET_CH0 0X0000
#define LC_STABILIZE_TIME_CH0 0X001E //30
typedef enum {
I2C_START = 0,
@@ -49,7 +65,7 @@ typedef enum {
#define I2C_FAIL 0
#define I2C_END 1
#define I2C_SPEED 100000
#define I2C_SPEED 20000
#define RCU_GPIO_I2C RCU_GPIOF
#define RCU_I2C RCU_I2C0
#define I2C_SCL_PORT GPIOF