| | |
| | | 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); |
| | | io_pin_mux_set(IO_PIN_13, IO_FUNC4); |
| | | io_pin_mux_set(IO_PIN_14, IO_FUNC4); |
| | | |
| | | // // UART1 RX/TX GPS端口 |
| | | // io_pin_mux_set(IO_PIN_14, IO_FUNC4); |
| | |
| | | // io_pull_set(IO_PIN_13 , IO_HIGH_Z, IO_PULL_UP_NONE); |
| | | // gpio_pin_set_dir(IO_PIN_13 ,GPIO_DIR_IN, 0); |
| | | |
| | | // 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); |
| | | |
| | | //5V输入检测,下拉GPIO |
| | | gpio_pin_set_dir(INPUT_5V_Pin , GPIO_DIR_IN, 0); |
| | | io_pull_set(INPUT_5V_Pin , IO_HIGH_Z, IO_PULL_UP_NONE); |
| | | // // 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); |
| | | // |
| | | // //5V输入检测,下拉GPIO |
| | | // gpio_pin_set_dir(INPUT_5V_Pin , GPIO_DIR_IN, 0); |
| | | // io_pull_set(INPUT_5V_Pin , IO_HIGH_Z, IO_PULL_UP_NONE); |
| | | } |
| | | void key_board_init(void) |
| | | { |
| | | //行线输出默认高电平 |
| | | io_pin_mux_set(CN1, IO_FUNC0); |
| | | io_pin_mux_set(CN2, IO_FUNC0); |
| | | io_pin_mux_set(CN3, IO_FUNC0); |
| | | io_pin_mux_set(CN4, IO_FUNC0); |
| | | io_pull_set(CN1 , IO_PULL_UP, IO_PULL_UP_LEVEL4); |
| | | gpio_pin_set_dir(CN1 , GPIO_DIR_OUT, 1); |
| | | io_pull_set(CN2 , IO_PULL_UP, IO_PULL_UP_LEVEL4); |
| | | gpio_pin_set_dir(CN2 , GPIO_DIR_OUT, 1); |
| | | io_pull_set(CN3 , IO_PULL_UP, IO_PULL_UP_LEVEL4); |
| | | gpio_pin_set_dir(CN3 , GPIO_DIR_OUT, 1); |
| | | io_pull_set(CN4 , IO_PULL_UP, IO_PULL_UP_LEVEL4); |
| | | gpio_pin_set_dir(CN4 , GPIO_DIR_OUT, 1); |
| | | //列线输入 |
| | | io_pin_mux_set(COM1, IO_FUNC0); |
| | | io_pin_mux_set(COM2, IO_FUNC0); |
| | | io_pin_mux_set(COM3, IO_FUNC0); |
| | | io_pin_mux_set(COM4, IO_FUNC0); |
| | | io_pull_set(COM1 , IO_PULL_UP, IO_PULL_UP_LEVEL4); |
| | | gpio_pin_set_dir(COM1 , GPIO_DIR_IN, 1); |
| | | io_pull_set(COM2 , IO_PULL_UP, IO_PULL_UP_LEVEL4); |
| | | gpio_pin_set_dir(COM2 , GPIO_DIR_IN, 1); |
| | | io_pull_set(COM3 , IO_PULL_UP, IO_PULL_UP_LEVEL4); |
| | | gpio_pin_set_dir(COM3 , GPIO_DIR_IN, 1); |
| | | io_pull_set(COM4 , IO_PULL_UP, IO_PULL_UP_LEVEL4); |
| | | gpio_pin_set_dir(COM4 , GPIO_DIR_IN, 1); |
| | | } |
| | | void led_init(void) |
| | | { |
| | | io_pin_mux_set(LED_ENABLE, IO_FUNC0); |
| | | io_pull_set(LED_ENABLE , IO_PULL_UP, IO_PULL_UP_LEVEL4); |
| | | gpio_pin_set_dir(LED_ENABLE , GPIO_DIR_OUT, 1); |
| | | } |
| | | void board_gpio_init() |
| | | { |
| | | //键盘 |
| | | key_board_init(); |
| | | //gps power 默认开启 |
| | | io_pin_mux_set(GPS_Power_Pin, IO_FUNC0); |
| | | io_pull_set(GPS_Power_Pin , IO_PULL_UP, IO_PULL_UP_LEVEL4); |
| | | gpio_pin_set_dir(GPS_Power_Pin , GPIO_DIR_OUT, 1); |
| | | //键盘LED |
| | | led_init(); |
| | | } |
| | | void Uart1GpsRecDebugSend(void) |
| | | { |