44 lines
997 B
C
44 lines
997 B
C
#ifndef _APP_COM_H_
|
|
#define _APP_COM_H_
|
|
|
|
#include "main.h"
|
|
#include "app_leakage.h"
|
|
#include "bsp_uart.h"
|
|
|
|
#define APP_COM_NUM (4)
|
|
|
|
#define APP_COM1 (0)
|
|
#define APP_COM2 (1)
|
|
#define APP_COM3 (2)
|
|
#define APP_COM4 (3)
|
|
|
|
typedef struct
|
|
{
|
|
u8 baudrate; /*波特率*/
|
|
}app_com_flash_data_t;
|
|
|
|
typedef struct app_com_class_t app_com_class_t;
|
|
|
|
struct app_com_class_t
|
|
{
|
|
app_com_flash_data_t flash_data; /*flash数据*/
|
|
|
|
bsp_uart_t *com_uart; /*绑定的实际物理串口*/
|
|
struct
|
|
{
|
|
void (*baud_rate)(app_com_class_t *,u16); /*设置波特率*/
|
|
}set;
|
|
//void (*init)(app_com_class_t *); /*初始化*/
|
|
};
|
|
|
|
typedef struct
|
|
{
|
|
app_com_class_t com[APP_COM_NUM];
|
|
void (*init)(void); /*初始化*/
|
|
void (*class_update)(void ); /*com区域分类*/
|
|
}app_com_t;
|
|
|
|
extern app_com_t app_com;
|
|
extern bsp_uart_t *com_to_uart[APP_COM_NUM];
|
|
|
|
#endif |