mirror of
https://github.com/Fishwaldo/bl_mcu_sdk.git
synced 2025-07-11 15:28:53 +00:00
* Add flash driver and init in boards. * Add timeout for all poll wait apis * Add 808 d0 startup to bringup * Update lhal device tables * Update demos
32 lines
665 B
C
32 lines
665 B
C
#include "bflb_mtimer.h"
|
|
#include "bflb_uart.h"
|
|
#include "board.h"
|
|
|
|
struct bflb_device_s *uartx;
|
|
|
|
int main(void)
|
|
{
|
|
board_init();
|
|
board_uartx_gpio_init();
|
|
|
|
uartx = bflb_device_get_by_name(DEFAULT_TEST_UART);
|
|
|
|
struct bflb_uart_config_s cfg;
|
|
|
|
cfg.baudrate = 2000000;
|
|
cfg.data_bits = UART_DATA_BITS_8;
|
|
cfg.stop_bits = UART_STOP_BITS_1;
|
|
cfg.parity = UART_PARITY_NONE;
|
|
cfg.flow_ctrl = 0;
|
|
cfg.tx_fifo_threshold = 7;
|
|
cfg.rx_fifo_threshold = 7;
|
|
bflb_uart_init(uartx, &cfg);
|
|
|
|
int ch;
|
|
while (1) {
|
|
ch = bflb_uart_getchar(uartx);
|
|
if (ch != -1) {
|
|
bflb_uart_putchar(uartx, ch);
|
|
}
|
|
}
|
|
}
|