49 lines
1.1 KiB
C
49 lines
1.1 KiB
C
#ifndef HARDWARE_RS485_UART_H_
|
|
#define HARDWARE_RS485_UART_H_
|
|
|
|
#include "ch32v30x.h"
|
|
|
|
#define J0_USART USART3
|
|
#define J1_USART USART3
|
|
#define J2_USART UART4
|
|
#define J3_USART UART4
|
|
#define J4_USART UART5
|
|
#define J5_USART UART5
|
|
#define J6_USART UART6
|
|
#define J7_USART UART6
|
|
#define J8_USART UART8
|
|
#define J9_USART UART7
|
|
// #define Host_USART USART2
|
|
// #define Slave_USART USART2
|
|
#define Mcu_USART USART2
|
|
#define Su806_USART UART8
|
|
#define Lora_USART UART7
|
|
|
|
void uart2Init(int baud);
|
|
void uart3Init(int baud);
|
|
void uart4Init(int baud);
|
|
void uart5Init(int baud);
|
|
void uart6Init(int baud);
|
|
void uart7Init(int baud);
|
|
void uart8Init(int baud);
|
|
|
|
void setIDLE(USART_TypeDef *USARTx, FunctionalState state);
|
|
void setTXE(USART_TypeDef *USARTx, FunctionalState state);
|
|
|
|
extern void J0_Interrupt();
|
|
extern void J1_Interrupt();
|
|
extern void J2_Interrupt();
|
|
extern void J3_Interrupt();
|
|
extern void J4_Interrupt();
|
|
extern void J5_Interrupt();
|
|
extern void J6_Interrupt();
|
|
extern void J7_Interrupt();
|
|
extern void J8_Interrupt();
|
|
extern void J9_Interrupt();
|
|
extern void Mcu_Interrupt();
|
|
extern void Su806_Interrupt();
|
|
extern void Lora_Interrupt();
|
|
|
|
|
|
#endif /* HARDWARE_RS485_UART_H_ */
|