1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef RTE_UART_H__
#define RTE_UART_H__
#include "stdint.h"
#include "uart.h"
/***************************************************************/
/***************************************************************/
typedef enum
{
UART_CH0 = 0U,
UART_CH1 = 1U,
UART_CH2 = 2U,
UART_CH_MAX,
} UART_Channel_en_t;
typedef void (*UART_Confirm)(void);
typedef void (*UART_Read_Msg)(uint16_t u16UARTData);
typedef struct
{
uint32_t u32UARTChEn; /*通道是否使能*/
uint32_t u32UARTbps; /*通道实际波特率*/
UART_Confirm pfnUARTConfirmCallBack;
UART_Read_Msg pfnUARTReadMsgCallBack;
} UART_Channel_Config_st_t;
typedef enum
{
MFS_UART_OptSt_OK = 0, /* 操作完成 */
MFS_UART_OptSt_BUSY, /* 当前忙 */
}EMFS_UART_OptSt;
/****************************************************************/
void UART_CH0_TX_ISR(void);
void UART_CH1_TX_ISR(void);
void UART_CH2_TX_ISR(void);
void UART_CH0_RX_ISR(void);
void UART_CH1_RX_ISR(void);
void UART_CH2_RX_ISR(void);
uint8_t UART_Ch0_Get_TX_Busy_Flag(void);
uint8_t UART_Ch1_Get_TX_Busy_Flag(void);
uint8_t UART_Ch2_Get_TX_Busy_Flag(void);
void UART_Ch0_Send_Multiple_Byte(uint8_t *Data, uint8_t Len);
void UART_Ch1_Send_Multiple_Byte(uint8_t *Data, uint8_t Len);
void UART_Ch2_Send_Multiple_Byte(uint8_t *Data, uint8_t Len);
/*首次上30和每次唤醒时调用*/
extern uint32_t RTE_UART_Init(UART_Channel_en_t enUARTCh, UART_Channel_Config_st_t *penUARTCfg);
/*休眠时调用*/
extern void RTE_UART_Sleep_Init(UART_Channel_en_t enUARTCh);
#endif