generated from hulk/gd32e23x_template
更新ldc配置
This commit is contained in:
@@ -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_DRIVE_CURRENT 0x9000 //A000
|
||||||
#define LDC1612_MUX_CONFIG 0x020C // no auto scan and filter bandwidth 3.3MHz
|
#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_SLEEP_MODE 0x2801
|
||||||
#define LDC1612_ERROR_CONFIG 0x0000
|
#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
|
#define LDC1612_RESET_DEV 0x8000 //[15:0] 0b1000 0000 0000 0000
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
@@ -283,11 +283,11 @@ void ldc1612_drvie_current_detect(uint8_t channel) {
|
|||||||
|
|
||||||
ldc1612_set_sensor_config(LDC1612_SLEEP_MODE);
|
ldc1612_set_sensor_config(LDC1612_SLEEP_MODE);
|
||||||
ldc1612_set_freq_divide(channel);
|
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_SLEEP_MODE);
|
||||||
ldc1612_set_sensor_config(LDC1612_SENSOR_CONFIG); //0x1A --0x1601
|
ldc1612_set_sensor_config(LDC1612_SENSOR_CONFIG); //0x1A --0x1601
|
||||||
delay_ms(10);
|
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;
|
init_value = (((data[0] << 8) | data[1]) >> 6) & 0x1F;
|
||||||
drive_current = (init_value << 11) | 0x0000;
|
drive_current = (init_value << 11) | 0x0000;
|
||||||
|
Reference in New Issue
Block a user