generated from hulk/gd32e23x_template
代码美化
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#define I2C_SPEED 20000
|
||||
#define RCU_GPIO_I2C RCU_GPIOF
|
||||
#define RCU_I2C RCU_I2C0
|
||||
@@ -23,11 +25,15 @@
|
||||
#define I2C_SDA_PIN GPIO_PIN_0
|
||||
#define I2C_GPIO_AF GPIO_AF_1
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#define I2C_TIME_OUT (uint16_t)(10000)
|
||||
#define I2C_OK 1
|
||||
#define I2C_FAIL 0
|
||||
#define I2C_END 1
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
typedef enum {
|
||||
I2C_START = 0,
|
||||
I2C_SEND_ADDRESS,
|
||||
@@ -36,6 +42,8 @@ typedef enum {
|
||||
I2C_STOP
|
||||
} i2c_process_enum;
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
void i2c_gpio_config(void);
|
||||
|
||||
void i2c_config(void);
|
||||
|
Reference in New Issue
Block a user