mirror of
https://github.com/Fishwaldo/bl_mcu_sdk.git
synced 2025-07-23 05:08:45 +00:00
[update] update lhal, soc and demos
* 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
This commit is contained in:
parent
9f241971e3
commit
d6fab307bf
232 changed files with 26802 additions and 1471 deletions
|
@ -2,14 +2,14 @@
|
|||
#include "bflb_uart.h"
|
||||
#include "board.h"
|
||||
|
||||
struct bflb_device_s *uart1;
|
||||
struct bflb_device_s *uartx;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
board_init();
|
||||
board_uart1_gpio_init();
|
||||
board_uartx_gpio_init();
|
||||
|
||||
uart1 = bflb_device_get_by_name("uart1");
|
||||
uartx = bflb_device_get_by_name(DEFAULT_TEST_UART);
|
||||
|
||||
struct bflb_uart_config_s cfg;
|
||||
|
||||
|
@ -20,18 +20,18 @@ int main(void)
|
|||
cfg.flow_ctrl = 0;
|
||||
cfg.tx_fifo_threshold = 7;
|
||||
cfg.rx_fifo_threshold = 7;
|
||||
bflb_uart_init(uart1, &cfg);
|
||||
|
||||
bflb_uart_feature_control(uart1, UART_CMD_SET_BAUD_RATE, 2000000);
|
||||
bflb_uart_feature_control(uart1, UART_CMD_SET_DATA_BITS, UART_DATA_BITS_8);
|
||||
bflb_uart_feature_control(uart1, UART_CMD_SET_STOP_BITS, UART_STOP_BITS_1);
|
||||
bflb_uart_feature_control(uart1, UART_CMD_SET_PARITY_BITS, UART_PARITY_EVEN);
|
||||
bflb_uart_init(uartx, &cfg);
|
||||
|
||||
bflb_uart_feature_control(uartx, UART_CMD_SET_BAUD_RATE, 2000000);
|
||||
bflb_uart_feature_control(uartx, UART_CMD_SET_DATA_BITS, UART_DATA_BITS_8);
|
||||
bflb_uart_feature_control(uartx, UART_CMD_SET_STOP_BITS, UART_STOP_BITS_1);
|
||||
bflb_uart_feature_control(uartx, UART_CMD_SET_PARITY_BITS, UART_PARITY_EVEN);
|
||||
|
||||
int ch;
|
||||
while (1) {
|
||||
ch = bflb_uart_getchar(uart1);
|
||||
ch = bflb_uart_getchar(uartx);
|
||||
if (ch != -1) {
|
||||
bflb_uart_putchar(uart1, ch);
|
||||
bflb_uart_putchar(uartx, ch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue