From 9b1cdedb33543cd3a5d3a88f0786311af3aeb08e Mon Sep 17 00:00:00 2001 From: chen <15335560115@163.com> Date: 星期四, 15 八月 2024 13:50:30 +0800 Subject: [PATCH] 增加了闪灯逻辑以及gps解析逻辑以及添加了搜索模式逻辑等,并且为之前的chm5 未改为110k波特率,成功测距闪灯demo,加速度计未驱动有问题 --- uwb_MK8000_example_ss_twr_qiang_Anchor_gai/pin_config.c | 31 ++++++++++++++++++++++++++++--- 1 files changed, 28 insertions(+), 3 deletions(-) diff --git a/uwb_MK8000_example_ss_twr_qiang_Anchor_gai/pin_config.c b/uwb_MK8000_example_ss_twr_qiang_Anchor_gai/pin_config.c index 14a1418..d0009d6 100644 --- a/uwb_MK8000_example_ss_twr_qiang_Anchor_gai/pin_config.c +++ b/uwb_MK8000_example_ss_twr_qiang_Anchor_gai/pin_config.c @@ -41,17 +41,42 @@ #include "mk_io.h" #include "board.h" +extern struct UART_CFG_T test_uart_cfg; void board_pins_config(void) { // UART0 TX/RX io_pin_mux_set(IO_PIN_5, IO_FUNC4); io_pin_mux_set(IO_PIN_6, IO_FUNC4); - // UART1 RX/TX已修改复用引脚为ADC留出空间 - io_pin_mux_set(IO_PIN_10, IO_FUNC4); - io_pin_mux_set(IO_PIN_9, IO_FUNC4); +// // UART1 RX/TX已修改复用引脚为ADC留出空间调试串口 +// io_pin_mux_set(IO_PIN_10, IO_FUNC4); +// io_pin_mux_set(IO_PIN_9, IO_FUNC4); + // UART1 RX/TX GPS端口 + io_pin_mux_set(IO_PIN_14, IO_FUNC4); + io_pin_mux_set(IO_PIN_13, IO_FUNC4); // Single ADC, If IO0 is set to negative input, the positive input is Vref, and vice versa io_pin_mux_set(IO_PIN_0, IO_FUNC1); io_pull_set(IO_PIN_0, IO_HIGH_Z, IO_PULL_UP_NONE); } +void uart1_change_from_gps_to_debug(void) +{ +io_pin_mux_set(IO_PIN_14, IO_FUNC0);//把原先uart变为普通GPIO +io_pin_mux_set(IO_PIN_13, IO_FUNC0); +uart_close(UART_ID1);//解绑原来串口1 +// UART1 RX/TX已修改复用引脚为ADC留出空间调试串口 +io_pin_mux_set(IO_PIN_10,IO_FUNC4); +io_pin_mux_set(IO_PIN_9,IO_FUNC4); +uart_open(UART_ID1, &test_uart_cfg); + +} +void uart1_change_from_debug_to_gps(void) +{ +io_pin_mux_set(IO_PIN_10,IO_FUNC0);//把原先uart变为普通GPIO +io_pin_mux_set(IO_PIN_9,IO_FUNC0); +uart_close(UART_ID1);//解绑原来串口1 + // UART1 RX/TX GPS端口 +io_pin_mux_set(IO_PIN_14, IO_FUNC4); +io_pin_mux_set(IO_PIN_13, IO_FUNC4); +uart_open(UART_ID1, &test_uart_cfg); +} -- Gitblit v1.9.3