diff --git a/inc/ldc1612.h b/inc/ldc1612.h index 744debe..e88dbe5 100644 --- a/inc/ldc1612.h +++ b/inc/ldc1612.h @@ -47,13 +47,13 @@ /******************************************************************************/ -#define LDC1612_CONVERSION_TIME_CH0 0x0546 //0536 +#define LDC1612_CONVERSION_TIME_CH0 0x1000 //0536 #define LDC1612_DRIVE_CURRENT 0x9000 //A000 #define LDC1612_MUX_CONFIG 0x020C // no auto scan and filter bandwidth 3.3MHz -#define LDC1612_SENSOR_CONFIG 0x1601 +#define LDC1612_SENSOR_CONFIG 0x1A23 #define LDC1612_SLEEP_MODE 0x2801 #define LDC1612_ERROR_CONFIG 0x0000 -#define LC_STABILIZE_TIME_CH0 0x001E //30 +#define LC_STABILIZE_TIME_CH0 0x00A0 //30 #define LDC1612_RESET_DEV 0x8000 //[15:0] 0b1000 0000 0000 0000 /******************************************************************************/ diff --git a/src/ldc1612.c b/src/ldc1612.c index 3c9cb06..2b04c03 100644 --- a/src/ldc1612.c +++ b/src/ldc1612.c @@ -283,11 +283,11 @@ void ldc1612_drvie_current_detect(uint8_t channel) { ldc1612_set_sensor_config(LDC1612_SLEEP_MODE); ldc1612_set_freq_divide(channel); - soft_i2c_read_16bits(LDC1612_ADDR, SENSOR_CONFIG_REG, data); + i2c_read_16bits(LDC1612_ADDR, SENSOR_CONFIG_REG, data); ldc1612_set_sensor_config(LDC1612_SLEEP_MODE); ldc1612_set_sensor_config(LDC1612_SENSOR_CONFIG); //0x1A --0x1601 delay_ms(10); - soft_i2c_read_16bits(LDC1612_ADDR, SET_DRIVER_CURRENT_REG, data); + i2c_read_16bits(LDC1612_ADDR, SET_DRIVER_CURRENT_REG, data); init_value = (((data[0] << 8) | data[1]) >> 6) & 0x1F; drive_current = (init_value << 11) | 0x0000;