/* * Copyright (c) 2022-2024, ArtInChip Technology Co., Ltd * * SPDX-License-Identifier: Apache-2.0 * * Authors: weilin.peng@artinchip.com */ #include #include #include "board.h" #include struct aic_pinmux aic_pinmux_config[] = { //调试串口 #ifdef AIC_USING_UART0 /* uart0 */ {5, PIN_PULL_DIS, 3, "PA.0"}, {5, PIN_PULL_UP, 3, "PA.1"}, #endif //没用到 #ifdef AIC_USING_UART1 /* uart1 */ {5, PIN_PULL_DIS, 3, "PA.2"}, {5, PIN_PULL_UP, 3, "PA.3"}, #endif //CI1103通讯口 #ifdef AIC_USING_UART2 /* uart2 */ {5, PIN_PULL_DIS, 3, "PD.4"}, {5, PIN_PULL_UP, 3, "PD.5"}, #endif //zigbee通讯口 #ifdef AIC_USING_UART3 /* uart3 */ {5, PIN_PULL_DIS, 3, "PB.10"}, {5, PIN_PULL_UP, 3, "PB.11"}, #endif #ifdef AIC_USING_RTP {2, PIN_PULL_DIS, 3, "PA.8"}, {2, PIN_PULL_DIS, 3, "PA.9"}, {2, PIN_PULL_DIS, 3, "PA.10"}, {2, PIN_PULL_DIS, 3, "PA.11"}, #endif #ifdef AIC_USING_I2C0 {4, PIN_PULL_DIS, 3, "PA.8"}, // SCK {4, PIN_PULL_DIS, 3, "PA.9"}, // SDA #endif #ifdef AIC_USING_I2C1 {4, PIN_PULL_DIS, 3, "PA.2"}, // SCK {4, PIN_PULL_DIS, 3, "PA.3"}, // SDA #endif #ifdef AIC_USING_CTP {1, PIN_PULL_DIS, 3, AIC_TOUCH_PANEL_RST_PIN}, {1, PIN_PULL_DIS, 3, AIC_TOUCH_PANEL_INT_PIN},//硬件没贴上拉电阻 芯片的上拉打开 #endif #if defined(AIC_USING_QSPI0) && !defined(AIC_SYSCFG_SIP_FLASH_ENABLE) /* qspi0 */ {2, PIN_PULL_DIS, 3, "PB.0"}, {2, PIN_PULL_DIS, 3, "PB.1"}, {2, PIN_PULL_DIS, 3, "PB.2"}, {2, PIN_PULL_DIS, 3, "PB.3"}, {2, PIN_PULL_DIS, 3, "PB.4"}, {2, PIN_PULL_DIS, 3, "PB.5"}, #endif #if defined(AIC_USING_QSPI1) && defined(AIC_SYSCFG_SIP_FLASH_ENABLE) /* qspi1 */ {3, PIN_PULL_DIS, 3, "PB.0"}, {3, PIN_PULL_DIS, 3, "PB.1"}, {3, PIN_PULL_DIS, 3, "PB.2"}, {3, PIN_PULL_DIS, 3, "PB.3"}, {3, PIN_PULL_DIS, 3, "PB.4"}, {3, PIN_PULL_DIS, 3, "PB.5"}, #endif #ifdef AIC_USING_SDMC0 {2, PIN_PULL_UP, 7, "PB.6"}, {2, PIN_PULL_UP, 7, "PB.7"}, {2, PIN_PULL_UP, 7, "PB.8"}, {2, PIN_PULL_UP, 7, "PB.9"}, {2, PIN_PULL_UP, 7, "PB.10"}, {2, PIN_PULL_UP, 7, "PB.11"}, #endif #ifdef AIC_WIRELESS_LAN {1, PIN_PULL_DIS, 3, "PD.1"}, // WIFI_PWR_ON #endif #ifdef AIC_USING_SDMC1 {2, PIN_PULL_UP, 3, "PC.0"}, {2, PIN_PULL_UP, 3, "PC.1"}, {2, PIN_PULL_UP, 3, "PC.2"}, {2, PIN_PULL_UP, 3, "PC.3"}, {2, PIN_PULL_UP, 3, "PC.4"}, {2, PIN_PULL_UP, 3, "PC.5"}, {2, PIN_PULL_UP, 3, "PC.6"}, #endif //lcd背光 如果用GPIO在这配置 如果调亮度 在PWM地方配置 #ifdef AIC_PANEL_ENABLE_GPIO {1, PIN_PULL_DIS, 3, AIC_PANEL_ENABLE_GPIO}, #endif #ifdef AIC_PRGB_24BIT {2, PIN_PULL_DIS, 3, "PD.0"}, {2, PIN_PULL_DIS, 3, "PD.1"}, {2, PIN_PULL_DIS, 3, "PD.2"}, {2, PIN_PULL_DIS, 3, "PD.3"}, {2, PIN_PULL_DIS, 3, "PD.4"}, {2, PIN_PULL_DIS, 3, "PD.5"}, {2, PIN_PULL_DIS, 3, "PD.6"}, {2, PIN_PULL_DIS, 3, "PD.7"}, {2, PIN_PULL_DIS, 3, "PD.8"}, {2, PIN_PULL_DIS, 3, "PD.9"}, {2, PIN_PULL_DIS, 3, "PD.10"}, {2, PIN_PULL_DIS, 3, "PD.11"}, {2, PIN_PULL_DIS, 3, "PD.12"}, {2, PIN_PULL_DIS, 3, "PD.13"}, {2, PIN_PULL_DIS, 3, "PD.14"}, {2, PIN_PULL_DIS, 3, "PD.15"}, {2, PIN_PULL_DIS, 3, "PD.16"}, {2, PIN_PULL_DIS, 3, "PD.17"}, {2, PIN_PULL_DIS, 3, "PD.18"}, {2, PIN_PULL_DIS, 3, "PD.19"}, {2, PIN_PULL_DIS, 3, "PD.20"}, {2, PIN_PULL_DIS, 3, "PD.21"}, {2, PIN_PULL_DIS, 3, "PD.22"}, {2, PIN_PULL_DIS, 3, "PD.23"}, {2, PIN_PULL_DIS, 3, "PD.24"}, {2, PIN_PULL_DIS, 3, "PD.25"}, {2, PIN_PULL_DIS, 3, "PD.26"}, {2, PIN_PULL_DIS, 3, "PD.27"}, #endif #ifdef AIC_PRGB_18BIT_LD {2, PIN_PULL_DIS, 3, "PD.6"}, {2, PIN_PULL_DIS, 3, "PD.7"}, {2, PIN_PULL_DIS, 3, "PD.8"}, {2, PIN_PULL_DIS, 3, "PD.9"}, {2, PIN_PULL_DIS, 3, "PD.10"}, {2, PIN_PULL_DIS, 3, "PD.11"}, {2, PIN_PULL_DIS, 3, "PD.12"}, {2, PIN_PULL_DIS, 3, "PD.13"}, {2, PIN_PULL_DIS, 3, "PD.14"}, {2, PIN_PULL_DIS, 3, "PD.15"}, {2, PIN_PULL_DIS, 3, "PD.16"}, {2, PIN_PULL_DIS, 3, "PD.17"}, {2, PIN_PULL_DIS, 3, "PD.18"}, {2, PIN_PULL_DIS, 3, "PD.19"}, {2, PIN_PULL_DIS, 3, "PD.20"}, {2, PIN_PULL_DIS, 3, "PD.21"}, {2, PIN_PULL_DIS, 3, "PD.22"}, {2, PIN_PULL_DIS, 3, "PD.23"}, {2, PIN_PULL_DIS, 3, "PD.24"}, {2, PIN_PULL_DIS, 3, "PD.25"}, {2, PIN_PULL_DIS, 3, "PD.26"}, {2, PIN_PULL_DIS, 3, "PD.27"}, #endif #ifdef AIC_PRGB_18BIT_HD {2, PIN_PULL_DIS, 3, "PD.0"}, {2, PIN_PULL_DIS, 3, "PD.1"}, {2, PIN_PULL_DIS, 3, "PD.2"}, {2, PIN_PULL_DIS, 3, "PD.3"}, {2, PIN_PULL_DIS, 3, "PD.4"}, {2, PIN_PULL_DIS, 3, "PD.5"}, {2, PIN_PULL_DIS, 3, "PD.6"}, {2, PIN_PULL_DIS, 3, "PD.7"}, {2, PIN_PULL_DIS, 3, "PD.8"}, {2, PIN_PULL_DIS, 3, "PD.9"}, {2, PIN_PULL_DIS, 3, "PD.10"}, {2, PIN_PULL_DIS, 3, "PD.11"}, {2, PIN_PULL_DIS, 3, "PD.12"}, {2, PIN_PULL_DIS, 3, "PD.13"}, {2, PIN_PULL_DIS, 3, "PD.14"}, {2, PIN_PULL_DIS, 3, "PD.15"}, {2, PIN_PULL_DIS, 3, "PD.16"}, {2, PIN_PULL_DIS, 3, "PD.17"}, {2, PIN_PULL_DIS, 3, "PD.24"}, {2, PIN_PULL_DIS, 3, "PD.25"}, {2, PIN_PULL_DIS, 3, "PD.26"}, {2, PIN_PULL_DIS, 3, "PD.27"}, #endif #ifdef AIC_PRGB_16BIT_LD {2, PIN_PULL_DIS, 3, "PD.8"}, {2, PIN_PULL_DIS, 3, "PD.9"}, {2, PIN_PULL_DIS, 3, "PD.10"}, {2, PIN_PULL_DIS, 3, "PD.11"}, {2, PIN_PULL_DIS, 3, "PD.12"}, {2, PIN_PULL_DIS, 3, "PD.13"}, {2, PIN_PULL_DIS, 3, "PD.14"}, {2, PIN_PULL_DIS, 3, "PD.15"}, {2, PIN_PULL_DIS, 3, "PD.16"}, {2, PIN_PULL_DIS, 3, "PD.17"}, {2, PIN_PULL_DIS, 3, "PD.18"}, {2, PIN_PULL_DIS, 3, "PD.19"}, {2, PIN_PULL_DIS, 3, "PD.20"}, {2, PIN_PULL_DIS, 3, "PD.21"}, {2, PIN_PULL_DIS, 3, "PD.22"}, {2, PIN_PULL_DIS, 3, "PD.23"}, {2, PIN_PULL_DIS, 3, "PD.24"}, {2, PIN_PULL_DIS, 3, "PD.25"}, {2, PIN_PULL_DIS, 3, "PD.26"}, {2, PIN_PULL_DIS, 3, "PD.27"}, #endif #ifdef AIC_PRGB_16BIT_HD {2, PIN_PULL_DIS, 3, "PD.0"}, {2, PIN_PULL_DIS, 3, "PD.1"}, {2, PIN_PULL_DIS, 3, "PD.2"}, {2, PIN_PULL_DIS, 3, "PD.3"}, {2, PIN_PULL_DIS, 3, "PD.4"}, {2, PIN_PULL_DIS, 3, "PD.5"}, {2, PIN_PULL_DIS, 3, "PD.6"}, {2, PIN_PULL_DIS, 3, "PD.7"}, {2, PIN_PULL_DIS, 3, "PD.8"}, {2, PIN_PULL_DIS, 3, "PD.9"}, {2, PIN_PULL_DIS, 3, "PD.10"}, {2, PIN_PULL_DIS, 3, "PD.11"}, {2, PIN_PULL_DIS, 3, "PD.12"}, {2, PIN_PULL_DIS, 3, "PD.13"}, {2, PIN_PULL_DIS, 3, "PD.14"}, {2, PIN_PULL_DIS, 3, "PD.15"}, {2, PIN_PULL_DIS, 3, "PD.24"}, {2, PIN_PULL_DIS, 3, "PD.25"}, {2, PIN_PULL_DIS, 3, "PD.26"}, {2, PIN_PULL_DIS, 3, "PD.27"}, #endif #ifdef AIC_SRGB_8BIT {2, PIN_PULL_DIS, 3, "PD.16"}, {2, PIN_PULL_DIS, 3, "PD.17"}, {2, PIN_PULL_DIS, 3, "PD.18"}, {2, PIN_PULL_DIS, 3, "PD.19"}, {2, PIN_PULL_DIS, 3, "PD.20"}, {2, PIN_PULL_DIS, 3, "PD.21"}, {2, PIN_PULL_DIS, 3, "PD.22"}, {2, PIN_PULL_DIS, 3, "PD.23"}, {2, PIN_PULL_DIS, 3, "PD.24"}, {2, PIN_PULL_DIS, 3, "PD.25"}, {2, PIN_PULL_DIS, 3, "PD.26"}, {2, PIN_PULL_DIS, 3, "PD.27"}, #endif #ifdef AIC_SRGB_6BIT {2, PIN_PULL_DIS, 3, "PD.16"}, {2, PIN_PULL_DIS, 3, "PD.17"}, {2, PIN_PULL_DIS, 3, "PD.18"}, {2, PIN_PULL_DIS, 3, "PD.19"}, {2, PIN_PULL_DIS, 3, "PD.20"}, {2, PIN_PULL_DIS, 3, "PD.21"}, {2, PIN_PULL_DIS, 3, "PD.24"}, {2, PIN_PULL_DIS, 3, "PD.25"}, {2, PIN_PULL_DIS, 3, "PD.26"}, {2, PIN_PULL_DIS, 3, "PD.27"}, #endif //lcd背光 如果调亮度 在PWM地方配置 如果只是点亮 在GPIO配置 //t3e #ifdef AIC_USING_PWM0//PWM0_A B // {3, PIN_PULL_DIS, 3, "PC.4"}, // {3, PIN_PULL_DIS, 3, "PC.5"}, {3, PIN_PULL_DIS, 3, "PE.13"}, #endif //model3c #ifdef AIC_USING_PWM1//PWM1_A B //{3, PIN_PULL_DIS, 3, "PC.6"}, {3, PIN_PULL_DIS, 3, "PC.7"}, #endif #ifdef AIC_USING_AUDIO #ifdef AIC_AUDIO_PLAYBACK {5, PIN_PULL_DIS, 3, "PE.12"}, {1, PIN_PULL_DIS, 3, AIC_AUDIO_PA_ENABLE_GPIO}, #endif #endif //继电器控制口 #ifdef AIC_BOARD_T3E {1, PIN_PULL_DIS, 3, "PA.4"}, {1, PIN_PULL_DIS, 3, "PA.5"}, {1, PIN_PULL_DIS, 3, "PC.4"}, {1, PIN_PULL_DIS, 3, "PC.5"}, #endif //st7701s软spi {1, PIN_PULL_DIS, 3, "PD.3"},//lcd_reset {1, PIN_PULL_DIS, 3, "PB.6"},//st7701s_cs {1, PIN_PULL_DIS, 3, "PB.8"},//st7701s_mosi {1, PIN_PULL_DIS, 3, "PB.9"},//st7701s_clk }; uint32_t aic_pinmux_config_size = ARRAY_SIZE(aic_pinmux_config); void aic_board_pinmux_init(void) { uint32_t i = 0; long pin = 0; unsigned int g; unsigned int p; for (i=0; i