【已解决】把uart1更改为别的引脚
Posted: 2023年 Jul 22日 21:59
PA01 I/O 烧录引脚,SWCLK,对应IC的PA01(Pin18)
uart1 用的也是这个引脚 怎么把uart1更改为别的引脚
下面是我初始化 uart1的代码 需要把 uart1更改为别的引脚
Code: Select all
//初始化串口1
#define BUF_SIZE_1 256
OPERATE_RET user_uart1_init(VOID_T)
{
TAL_UART_CFG_T uart_cfg = {
.rx_buffer_size = 256,
.open_mode = 0,
{
.baudrate = 460800,
.parity = TUYA_UART_PARITY_TYPE_NONE,
.databits = TUYA_UART_DATA_LEN_8BIT,
.stopbits = TUYA_UART_STOP_LEN_1BIT,
.flowctrl = TUYA_UART_FLOWCTRL_NONE,
}
};
tal_uart_init(USER_UART1, &uart_cfg);
// tal_uart_rx_reg_irq_cb(USER_UART1, uart1_rx_cb);
tal_uart_write(USER_UART1, "111no recv da12\r\n", 15);
//回调
user_uart1_task();
}