1 /* 2 * Copyright (c) 2022 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef APP_DEMO_UART_H 17 #define APP_DEMO_UART_H 18 19 #define UART_BUFF_SIZE 11 20 #define WRITE_BY_INT 21 #define UART_DEMO_TASK_STAK_SIZE 2048 22 #define UART_DEMO_TASK_PRIORITY 25 23 #define DEMO_UART_NUM HI_UART_IDX_1 24 25 /** 26 * @brief Adapter plate selection 27 * ʹ��ʱѡ��꣬ʹ��������չ���#define BOARD_SELECT_IS_EXPANSION_BOARD����� 28 * ʹ��Robot���Լ�����#define BOARD_SELECT_IS_ROBOT_BOARD����꣬ע�͵�#define BOARD_SELECT_IS_EXPANSION_BOARD 29 **/ 30 31 #define BOARD_SELECT_IS_EXPANSION_BOARD 32 #ifdef BOARD_SELECT_IS_EXPANSION_BOARD 33 #define EXPANSION_BOARD 34 #else 35 #define ROBOT_BOARD 36 #endif 37 38 typedef enum { 39 UART_RECEIVE_FLAG = 0, 40 UART_RECVIVE_LEN, 41 UART_SEND_FLAG = 2, 42 UART_SEND_LEN 43 }UartDefType; 44 45 typedef enum { 46 UART_RECV_TRUE = 0, 47 UART_RECV_FALSE, 48 }UartRecvDef; 49 50 typedef struct { 51 unsigned int uartChannel; 52 unsigned char g_receiveUartBuff[UART_BUFF_SIZE]; 53 int g_uartReceiveFlag; 54 int g_uartLen; 55 }UartDefConfig; 56 57 int SetUartRecvFlag(UartRecvDef def); 58 int GetUartConfig(UartDefType type); 59 void ResetUartReceiveMsg(void); 60 unsigned char *GetUartReceiveMsg(void); 61 #endif