generated from hulk/gd32e23x_template
new function
This commit is contained in:
@@ -13,12 +13,25 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define LED_PORT GPIOA
|
||||
#define LED_PIN GPIO_PIN_7
|
||||
#define LED_RCU RCU_GPIOA
|
||||
#define LED_TIMER_RCU RCU_TIMER16
|
||||
#define LED_TIMER TIMER16
|
||||
#define LED_IRQ TIMER16_IRQn
|
||||
/*Register Rddr*/
|
||||
/***************************************************************************/
|
||||
#define CONVERTION_RESULT_REG_START 0X00
|
||||
#define SET_CONVERSION_TIME_REG_START 0X08
|
||||
#define SET_CONVERSION_OFFSET_REG_START 0X0C
|
||||
#define SET_LC_STABILIZE_REG_START 0X10
|
||||
#define SET_FREQ_REG_START 0X14
|
||||
|
||||
#define SENSOR_STATUS_REG 0X18
|
||||
#define ERROR_CONFIG_REG 0X19
|
||||
#define SENSOR_CONFIG_REG 0X1A
|
||||
#define MUL_CONFIG_REG 0X1B
|
||||
#define SENSOR_RESET_REG 0X1C
|
||||
#define SET_DRIVER_CURRENT_REG 0X1E
|
||||
|
||||
#define READ_MANUFACTURER_ID 0X7E
|
||||
#define READ_DEVICE_ID 0X7F
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#define I2C_TIME_OUT (uint16_t)(10000)
|
||||
#define LDC_I2C I2C0
|
||||
@@ -55,7 +68,10 @@ typedef enum {
|
||||
#define DRIVE_CURRENT0_ADDR 0x1E
|
||||
#define CONFIG_ADDR 0x1A
|
||||
|
||||
void led_config(void);
|
||||
|
||||
|
||||
void LDC1612_read_sensor_infomation(void);
|
||||
|
||||
void LDC1612_I2CConfig(void);
|
||||
void LDC1612_Init(void);
|
||||
int LDC1612_read_reg(uint8_t device_address, uint8_t reg_address, uint8_t *data, uint16_t length);
|
||||
@@ -65,6 +81,8 @@ uint8_t eeprom_byte_write_timeout(uint8_t device_address, uint8_t *data);
|
||||
|
||||
void I2C_Scan(void);
|
||||
|
||||
uint8_t IIC_read_16bit(uint8_t reg, uint16_t *value);
|
||||
|
||||
int LDC_getID(void);
|
||||
|
||||
#endif //LDC1612_H
|
||||
|
@@ -35,4 +35,13 @@ OF SUCH DAMAGE.
|
||||
#ifndef MAIN_H
|
||||
#define MAIN_H
|
||||
|
||||
#define LED_PORT GPIOA
|
||||
#define LED_PIN GPIO_PIN_7
|
||||
#define LED_RCU RCU_GPIOA
|
||||
#define LED_TIMER_RCU RCU_TIMER16
|
||||
#define LED_TIMER TIMER16
|
||||
#define LED_IRQ TIMER16_IRQn
|
||||
|
||||
void led_config(void);
|
||||
|
||||
#endif /* MAIN_H */
|
||||
|
Reference in New Issue
Block a user