| | |
| | | #define UART_ERR_LINE 0x40000000 |
| | | #define UART_ERR_TIMEOUT 0x20000000 |
| | | #define UART_ERR_BUSY 0x10000000 |
| | | //ÒÆÖ² |
| | | |
| | | |
| | | |
| | | #define SerialPutString(x) Serial_PutString((uint8_t*)(x)) |
| | | #define Serial0PutString(x) Serial0_PutString((uint8_t*)(x)) |
| | | uint32_t SerialKeyPressed(uint8_t *key); |
| | | void SerialPutChar(uint8_t c); |
| | | void SerialPutChar(uint8_t c); |
| | | void Serial_PutString(uint8_t *s); |
| | | void Serial0PutChar(uint8_t c); |
| | | void Serial0_PutString(uint8_t *s); |
| | | /** |
| | |
| | | int uart_receive(enum UART_DEV_T id, uint8_t *rx_buf, uint32_t len, drv_callback_t callback); |
| | | |
| | | /** |
| | | * @brief Sends an amount of data over internal FIFO |
| | | * @param[in] id UART device ID. \n |
| | | * This parameter should be one of the UART_DEV_T enum values as below |
| | | * @arg UART_ID0 uart0 |
| | | * @arg UART_ID1 uart1 |
| | | * @param[in] tx_buf Pointer to data buffer |
| | | * @param[in] len Bytes of data to be sent |
| | | * @return void |
| | | * @note This is an unsafe interface thus the USER MUST ensure that following things \n |
| | | * 1. @P len MUST NOT exceeds 16 bytes \n |
| | | * 2. DO NOT call this interface while HW is sending data \n |
| | | * 3. The uart @p id MUST be opened before this interface gets called \n |
| | | * 4. DO NOT enable \ref UART_HANDLE_T::int_tx while uart @p id gets opened |
| | | */ |
| | | void uart_send_over_fifo(enum UART_DEV_T id, uint8_t *tx_buf, uint32_t len); |
| | | |
| | | /** |
| | | * @brief Receive an amount of data from internal FIFO |
| | | * @param[in] id UART device ID. \n |
| | | * This parameter should be one of the UART_DEV_T enum values as below |
| | | * @arg UART_ID0 uart0 |
| | | * @arg UART_ID1 uart1 |
| | | * @param[in] tx_buf Pointer to data buffer |
| | | * @param[in] len Bytes of data to be sent |
| | | * @return The bytes of data receive from interval FIFO |
| | | * @note This is an unsafe interface thus the USER MUST ensure that following things \n |
| | | * 1. @P len MUST NOT exceeds 16 bytes \n |
| | | * 2. The uart @p id MUST be opened before this interface gets called \n |
| | | * 3. DO NOT enable \ref UART_HANDLE_T::int_rx while uart @p id gets opened |
| | | */ |
| | | uint32_t uart_receive_from_fifo(enum UART_DEV_T id, uint8_t *rx_buf, uint32_t len); |
| | | |
| | | /** |
| | | * @brief Abort ongoing Transmit transfer. |
| | | * @note This function is used to abort the ongoing uart TX transfer, if the |
| | | * TX transfer is completed before uart dma abort, the abort_tx_callback |
| | |
| | | * @return None |
| | | */ |
| | | void uart_printf(enum UART_DEV_T id, const char *fmt, ...); |
| | | /** |
| | | * @brief This function get USART1 rxcount to DMA handler |
| | | * @param[in] id void default usart1 |
| | | * @param[in] fmt |
| | | * @return rx count from usart1 |
| | | */ |
| | | uint32_t get_rx_count_from_uart1(void); |
| | | |
| | | #ifdef __cplusplus |
| | | } |
| | | #endif |