代码美化

This commit is contained in:
2024-12-25 00:37:53 +08:00
parent ed8b6b3f6d
commit 6702703031
6 changed files with 26 additions and 14 deletions

View File

@@ -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);