添加I2C

This commit is contained in:
2024-03-02 01:06:06 +08:00
parent deafcfed1a
commit bef8342c93
21 changed files with 20646 additions and 18411 deletions
+25 -3
View File
@@ -9,7 +9,9 @@
#define BSP_DRV_UART_H_
#include "ch32v20x.h"
#include "string.h"
#include <string.h>
#include <stdlib.h>
#include <string.h>
#define RingBuffSize 128
@@ -65,14 +67,34 @@ typedef struct sUART
size_t buffer_tx_len_2;
size_t byt_rx;
size_t byt_tx;
size_t pkg_rx;
size_t pkg_tx;
size_t last_byt_rx;
size_t last_byt_tx;
size_t last_pkg_rx;
size_t last_pkg_tx;
size_t Bps_rx;
size_t Pps_rx;
size_t Bps_tx;
size_t Pps_tx;
size_t err_tx;
size_t err_rx;
size_t buffer_rx_max;
size_t buffer_tx_max;
GPIO_TypeDef *GPIOx;
uint32_t GPIO_Pin;
struct sUART *next_ptr;
}UART_t;
typedef UART_t* UART_ptr;
extern UART_t uart1;
extern UART_t uart2;
extern UART_t uart3;
void usart_init(void);