5#include "luat_uart_legacy.h"
31#define LUAT_PARITY_NONE 0
32#define LUAT_PARITY_ODD 1
33#define LUAT_PARITY_EVEN 2
38#define LUAT_BIT_ORDER_LSB 0
39#define LUAT_BIT_ORDER_MSB 1
44#define LUAT_0_5_STOP_BITS 0xf0
45#define LUAT_1_5_STOP_BITS 0xf1
47#define LUAT_VUART_ID_0 0x20
167#ifdef LUAT_USE_SOFT_UART
168#ifndef __BSP_COMMON_H__
178int luat_uart_soft_setup_hwtimer_callback(
int hwtimer_id, CommonFun_t callback);
179void luat_uart_soft_gpio_fast_output(
int pin, uint8_t value);
180uint8_t luat_uart_soft_gpio_fast_input(
int pin);
181void luat_uart_soft_gpio_fast_irq_set(
int pin, uint8_t onoff);
188uint32_t luat_uart_soft_cal_baudrate(uint32_t baudrate);
196void luat_uart_soft_hwtimer_onoff(
int hwtimer_id, uint32_t period);
198void luat_uart_soft_sleep_enable(uint8_t is_enable);
int luat_uart_setup(luat_uart_t *uart)
uart初始化
struct luat_uart_ctrl_param luat_uart_ctrl_param_t
串口控制参数
enum LUAT_UART_CTRL_CMD LUAT_UART_CTRL_CMD_E
串口控制参数
int luat_uart_exist(int uart_id)
检测串口是否存在
int luat_uart_close(int uart_id)
关闭串口
int luat_uart_read(int uart_id, void *buffer, size_t length)
串口读数据
int luat_uart_ctrl(int uart_id, LUAT_UART_CTRL_CMD_E cmd, void *param)
串口控制
void(* luat_uart_sent_callback_t)(int uart_id, void *param)
发送回调函数
struct luat_uart luat_uart_t
luat_uart
int luat_uart_write(int uart_id, void *data, size_t length)
串口写数据
void luat_uart_clear_rx_cache(int uart_id)
清除uart的接收缓存数据
int luat_uart_pre_setup(int uart_id, uint8_t use_alt_type)
串口复用函数,目前支持UART0,UART2
void(* luat_uart_recv_callback_t)(int uart_id, uint32_t data_len)
接收回调函数
@ LUAT_UART_SET_RECV_CALLBACK
@ LUAT_UART_SET_SENT_CALLBACK
luat_uart_sent_callback_t sent_callback_fun
luat_uart_recv_callback_t recv_callback_fun