generated from hulk/gd32e23x_template
	Porting the seeed open source library
This commit is contained in:
		| @@ -12,6 +12,7 @@ | ||||
| #include <string.h> | ||||
| #include <stdio.h> | ||||
| #include <stdlib.h> | ||||
| #include <math.h> | ||||
|  | ||||
| #define LDC1612_ADDR         (0x2B << 1) | ||||
|  | ||||
| @@ -48,9 +49,19 @@ | ||||
|  | ||||
| /******************************************************************************/ | ||||
|  | ||||
| #define CONVERSION_TIME_CH0                     0X0546  //0536 | ||||
| #define CONVERSION_OFFSET_CH0                   0X0000 | ||||
| #define LC_STABILIZE_TIME_CH0                   0X001E //30 | ||||
| #define LDC1612_CONVERSION_TIME_CH0        0X0546  //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_ERROR_CONFIG               0x0000 | ||||
| #define LC_STABILIZE_TIME_CH0              0X001E //30 | ||||
|  | ||||
| /******************************************************************************/ | ||||
|  | ||||
| #define COIL_RP_KOM  15.727 | ||||
| #define COIL_L_UH    18.147 | ||||
| #define COIL_C_PF    150 | ||||
| #define COIL_Q_FACTOR  35.97 | ||||
|  | ||||
| typedef enum { | ||||
|     I2C_START = 0, | ||||
| @@ -80,9 +91,19 @@ void I2C_config(void); | ||||
| void gpio_config(void); | ||||
| void i2c_config(void); | ||||
| void i2c_bus_reset(void); | ||||
| void I2C_scan(void); | ||||
| void i2c_scan(void); | ||||
|  | ||||
| void ldc1612_set_conversion_time(uint8_t channel, uint16_t result); | ||||
| void ldc1612_set_conversion_offset(uint8_t channel, uint16_t result); | ||||
| void ldc1612_set_LC_stabilize_time(uint8_t channel, uint16_t result); | ||||
| void ldc1612_set_freq_divide(uint8_t channel); | ||||
| void ldc1612_set_error_config(uint16_t value); | ||||
| void ldc1612_set_mux_config(uint16_t value); | ||||
| void ldc1612_reset_sensor(void); | ||||
| void ldc1612_set_drive_current(uint8_t channel, uint16_t value); | ||||
| void ldc1612_set_sensor_config(uint16_t value); | ||||
| void ldc1612_single_ch0_config(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); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user