arm: nxp: kinetis: Remove explicity setting of pincfg to GPIO
Remove board code and a few associated samples/tests that explicitly call pinmux_pin_set() to set a given pin as GPIO. This is handled as part of gpio_mcux_configure() so we don't need to do it again. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
b55ad01898
commit
6b8fa2a85e
13 changed files with 2 additions and 251 deletions
|
@ -54,26 +54,11 @@ static int frdm_k22f_pinmux_init(const struct device *dev)
|
|||
pinmux_pin_set(portd, 3, PORT_PCR_MUX(kPORT_MuxAlt3));
|
||||
#endif
|
||||
|
||||
/* SW2 */
|
||||
pinmux_pin_set(portc, 1, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
/* SW3 */
|
||||
pinmux_pin_set(portb, 17, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
/* FXOS8700 INT1 */
|
||||
pinmux_pin_set(portd, 0, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
/* FXOS8700 INT2 */
|
||||
pinmux_pin_set(portd, 1, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(ftm0), nxp_kinetis_ftm_pwm, okay) && CONFIG_PWM
|
||||
/* Red, green, blue LEDs as PWM channels*/
|
||||
pinmux_pin_set(porta, 1, PORT_PCR_MUX(kPORT_MuxAlt3));
|
||||
pinmux_pin_set(porta, 2, PORT_PCR_MUX(kPORT_MuxAlt3));
|
||||
pinmux_pin_set(portd, 5, PORT_PCR_MUX(kPORT_MuxAlt4));
|
||||
#else
|
||||
/* Red, green, blue LEDs as GPIO channels*/
|
||||
pinmux_pin_set(porta, 1, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(porta, 2, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portd, 5, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
#endif
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi0), okay) && CONFIG_SPI
|
||||
|
@ -92,18 +77,6 @@ static int frdm_k22f_pinmux_init(const struct device *dev)
|
|||
| PORT_PCR_ODE_MASK);
|
||||
#endif
|
||||
|
||||
#if CONFIG_SHIELD_FRDM_STBC_AGM01
|
||||
/* FXOS8700 INT1 */
|
||||
pinmux_pin_set(portb, 16, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
/* FXOS8700 INT2 */
|
||||
pinmux_pin_set(porta, 4, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
/* FXAS21002 INT1 */
|
||||
pinmux_pin_set(portb, 18, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
/* FXAS21002 INT2 */
|
||||
pinmux_pin_set(portb, 19, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -57,54 +57,6 @@ static int frdm_k64f_pinmux_init(const struct device *dev)
|
|||
pinmux_pin_set(portc, 16, PORT_PCR_MUX(kPORT_MuxAlt3));
|
||||
pinmux_pin_set(portc, 17, PORT_PCR_MUX(kPORT_MuxAlt3));
|
||||
#endif
|
||||
/* SW2 / FXOS8700 INT1 */
|
||||
pinmux_pin_set(portc, 6, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
/* FXOS8700 INT2 */
|
||||
pinmux_pin_set(portc, 13, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
/* SW3 */
|
||||
pinmux_pin_set(porta, 4, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
/* Red, green, blue LEDs */
|
||||
pinmux_pin_set(portb, 22, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(porte, 26, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portb, 21, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
#ifdef CONFIG_MODEM_WNCM14A2A
|
||||
/* WNC-M14A2A Modem POWER_ON */
|
||||
pinmux_pin_set(portb, 9, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
/* WNC-M14A2A Shield PMOD_D1 */
|
||||
pinmux_pin_set(portb, 10, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
/* WNC-M14A2A Shield PMOD_D2 */
|
||||
pinmux_pin_set(portb, 11, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
/* WNC-M14A2A Modem WWAN_STATE */
|
||||
pinmux_pin_set(portb, 23, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
/* WNC-M14A2A Modem WAKEUP_ENABLE */
|
||||
pinmux_pin_set(portc, 2, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
/* WNC-M14A2A Modem HTS221_DRDY */
|
||||
pinmux_pin_set(portc, 3, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
/* WNC-M14A2A Shield LEVEL_TRANSFORM_ENABLE */
|
||||
pinmux_pin_set(portc, 4, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
/* WNC-M14A2A Modem RESET */
|
||||
pinmux_pin_set(portc, 12, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
/* WNC-M14A2A Modem BOOT_MODE_SELECT */
|
||||
pinmux_pin_set(portc, 17, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MODEM_UBLOX_SARA_R4
|
||||
/* Modem RESET */
|
||||
pinmux_pin_set(portc, 2, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
/* Modem POWER_ON */
|
||||
pinmux_pin_set(porta, 2, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IEEE802154_MCR20A
|
||||
/* FRDM-MCR20A Reset (D5) */
|
||||
pinmux_pin_set(porta, 2, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
/* FRDM-MCR20A IRQ_B (D2) */
|
||||
pinmux_pin_set(portb, 9, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
#endif
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi0), okay) && CONFIG_SPI
|
||||
/* SPI0 CS0, SCK, SOUT, SIN */
|
||||
|
@ -164,18 +116,6 @@ static int frdm_k64f_pinmux_init(const struct device *dev)
|
|||
PORT_PCR_PE_MASK | PORT_PCR_PS_MASK);
|
||||
#endif
|
||||
|
||||
#if CONFIG_SHIELD_ADAFRUIT_2_8_TFT_TOUCH_V2
|
||||
pinmux_pin_set(portb, 23, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portc, 4, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
#endif
|
||||
|
||||
#if CONFIG_SHIELD_ADAFRUIT_WINC1500
|
||||
/* IRQ, ENable, RST */
|
||||
pinmux_pin_set(portc, 3, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portc, 2, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(porta, 2, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,20 +43,8 @@ static int frdm_k82f_pinmux_init(const struct device *dev)
|
|||
pinmux_pin_set(portc, 8, PORT_PCR_MUX(kPORT_MuxAlt3));
|
||||
pinmux_pin_set(portc, 9, PORT_PCR_MUX(kPORT_MuxAlt3));
|
||||
pinmux_pin_set(portc, 10, PORT_PCR_MUX(kPORT_MuxAlt4));
|
||||
#else
|
||||
/* Red, green, blue LEDs as GPIOs */
|
||||
pinmux_pin_set(portc, 8, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portc, 9, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portc, 10, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
#endif
|
||||
|
||||
/* Buttons */
|
||||
pinmux_pin_set(porta, 4, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portc, 6, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
/* FXOS8700 INT1 */
|
||||
pinmux_pin_set(portc, 13, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c3), okay) && CONFIG_I2C
|
||||
/* I2C3 SDA, SCL */
|
||||
pinmux_pin_set(porta, 1, PORT_PCR_MUX(kPORT_MuxAlt4)
|
||||
|
@ -71,9 +59,6 @@ static int frdm_k82f_pinmux_init(const struct device *dev)
|
|||
pinmux_pin_set(porte, 2, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||
pinmux_pin_set(porte, 4, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||
pinmux_pin_set(porte, 5, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||
/* SPI1 NOR RESET, WP */
|
||||
pinmux_pin_set(porte, 0, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(porte, 3, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
#endif
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(lpuart4), okay) && CONFIG_SERIAL
|
||||
|
|
|
@ -44,19 +44,6 @@ static int frdm_kl25z_pinmux_init(const struct device *dev)
|
|||
pinmux_pin_set(porta, 2, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||
#endif
|
||||
|
||||
/* SW0 and SW1 */
|
||||
pinmux_pin_set(porta, 16, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(porta, 17, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
/* Red, green, blue LEDs. */
|
||||
pinmux_pin_set(portd, 1, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portb, 18, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portb, 19, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
/* MMA8451 INT1, INT2 */
|
||||
pinmux_pin_set(porta, 14, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(porta, 15, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c0), okay) && CONFIG_I2C
|
||||
/* I2C0 SCL, SDA */
|
||||
pinmux_pin_set(porte, 24, PORT_PCR_MUX(kPORT_MuxAlt5)
|
||||
|
|
|
@ -33,16 +33,11 @@ static int frdm_kw41z_pinmux_init(const struct device *dev)
|
|||
*/
|
||||
#if defined(CONFIG_PWM) && DT_NODE_HAS_STATUS(DT_NODELABEL(tpm0), okay)
|
||||
pinmux_pin_set(portc, 1, PORT_PCR_MUX(kPORT_MuxAlt5));
|
||||
#else
|
||||
pinmux_pin_set(portc, 1, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_PWM) && DT_NODE_HAS_STATUS(DT_NODELABEL(tpm2), okay)
|
||||
pinmux_pin_set(porta, 19, PORT_PCR_MUX(kPORT_MuxAlt5));
|
||||
pinmux_pin_set(porta, 18, PORT_PCR_MUX(kPORT_MuxAlt5));
|
||||
#else
|
||||
pinmux_pin_set(porta, 19, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(porta, 18, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
#endif
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C
|
||||
|
@ -58,10 +53,6 @@ static int frdm_kw41z_pinmux_init(const struct device *dev)
|
|||
pinmux_pin_set(portb, 2, PORT_PCR_MUX(kPORT_PinDisabledOrAnalog));
|
||||
#endif
|
||||
|
||||
/* SW3, SW4 */
|
||||
pinmux_pin_set(portc, 4, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portc, 5, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(lpuart0), okay) && CONFIG_SERIAL
|
||||
/* UART0 RX, TX */
|
||||
pinmux_pin_set(portc, 6, PORT_PCR_MUX(kPORT_MuxAlt4));
|
||||
|
|
|
@ -39,11 +39,6 @@ static int hexiwear_k64_pinmux_init(const struct device *dev)
|
|||
pinmux_pin_set(portc, 8, PORT_PCR_MUX(kPORT_MuxAlt3));
|
||||
pinmux_pin_set(portc, 9, PORT_PCR_MUX(kPORT_MuxAlt3));
|
||||
pinmux_pin_set(portd, 0, PORT_PCR_MUX(kPORT_MuxAlt4));
|
||||
#else
|
||||
/* Red, green, blue LEDs as GPIOs */
|
||||
pinmux_pin_set(portc, 8, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portc, 9, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portd, 0, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
#endif
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c0), okay) && CONFIG_I2C
|
||||
|
@ -53,9 +48,6 @@ static int hexiwear_k64_pinmux_init(const struct device *dev)
|
|||
pinmux_pin_set(portb, 1, PORT_PCR_MUX(kPORT_MuxAlt2)
|
||||
| PORT_PCR_ODE_MASK);
|
||||
|
||||
/* 3V3B_EN */
|
||||
pinmux_pin_set(portb, 12, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
const struct device *gpiob =
|
||||
device_get_binding(DT_LABEL(DT_NODELABEL(gpiob)));
|
||||
|
||||
|
@ -69,11 +61,6 @@ static int hexiwear_k64_pinmux_init(const struct device *dev)
|
|||
pinmux_pin_set(portc, 11, PORT_PCR_MUX(kPORT_MuxAlt2)
|
||||
| PORT_PCR_ODE_MASK);
|
||||
#endif
|
||||
/* FXAS21002 INT2 */
|
||||
pinmux_pin_set(portc, 18, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
/* FXOS8700 INT2 */
|
||||
pinmux_pin_set(portd, 13, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(uart0), okay) && CONFIG_SERIAL
|
||||
/* UART0 RX, TX */
|
||||
|
@ -88,13 +75,6 @@ static int hexiwear_k64_pinmux_init(const struct device *dev)
|
|||
#endif
|
||||
|
||||
#if defined(CONFIG_MAX30101) && DT_NODE_HAS_STATUS(DT_NODELABEL(gpioa), okay)
|
||||
const struct device *porta =
|
||||
DEVICE_DT_GET(DT_NODELABEL(porta));
|
||||
__ASSERT_NO_MSG(device_is_ready(porta));
|
||||
|
||||
/* LDO - MAX30101 power supply */
|
||||
pinmux_pin_set(porta, 29, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
const struct device *gpioa =
|
||||
device_get_binding(DT_LABEL(DT_NODELABEL(gpioa)));
|
||||
|
||||
|
@ -102,8 +82,6 @@ static int hexiwear_k64_pinmux_init(const struct device *dev)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_BATTERY_SENSE
|
||||
pinmux_pin_set(portc, 14, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
const struct device *gpioc =
|
||||
device_get_binding(DT_LABEL(DT_NODELABEL(gpioc)));
|
||||
|
||||
|
|
|
@ -38,10 +38,6 @@ static int ip_k66f_pinmux_init(const struct device *dev)
|
|||
__ASSERT_NO_MSG(device_is_ready(porte));
|
||||
#endif
|
||||
|
||||
/* Red0, Red2 LEDs */
|
||||
pinmux_pin_set(porta, 8, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(porta, 10, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(enet), okay) && CONFIG_NET_L2_ETHERNET
|
||||
pinmux_pin_set(porta, 12, PORT_PCR_MUX(kPORT_MuxAlt4));/* RMII_RXD1 */
|
||||
pinmux_pin_set(porta, 13, PORT_PCR_MUX(kPORT_MuxAlt4));/* RMII_RXD0 */
|
||||
|
@ -49,9 +45,6 @@ static int ip_k66f_pinmux_init(const struct device *dev)
|
|||
pinmux_pin_set(porta, 15, PORT_PCR_MUX(kPORT_MuxAlt4));/* RMII_RX_EN */
|
||||
pinmux_pin_set(porta, 16, PORT_PCR_MUX(kPORT_MuxAlt4));/* RMII_TXD0 */
|
||||
pinmux_pin_set(porta, 17, PORT_PCR_MUX(kPORT_MuxAlt4));/* RMII_TXD1 */
|
||||
pinmux_pin_set(porta, 24, PORT_PCR_MUX(kPORT_MuxAsGpio));/* !ETH_RST */
|
||||
pinmux_pin_set(porta, 25, PORT_PCR_MUX(kPORT_MuxAsGpio));/* !ETH_PME */
|
||||
pinmux_pin_set(porta, 26, PORT_PCR_MUX(kPORT_MuxAsGpio));/* !ETH_INT */
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(porte), okay)
|
||||
/* RMII_REF_CLK */
|
||||
pinmux_pin_set(porte, 26, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||
|
|
|
@ -43,11 +43,6 @@ static int twr_ke18f_pinmux_init(const struct device *dev)
|
|||
pinmux_pin_set(portb, 5, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||
pinmux_pin_set(portd, 15, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||
pinmux_pin_set(portd, 16, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||
#else
|
||||
/* Tri-color LED as GPIO */
|
||||
pinmux_pin_set(portb, 5, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portd, 15, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portd, 16, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
#endif
|
||||
|
||||
#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(ftm2), nxp_kinetis_ftm_pwm, okay) && CONFIG_PWM
|
||||
|
@ -61,12 +56,6 @@ static int twr_ke18f_pinmux_init(const struct device *dev)
|
|||
pinmux_pin_set(portc, 11, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||
pinmux_pin_set(portc, 12, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||
pinmux_pin_set(portc, 13, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||
#else
|
||||
/* User LEDs as GPIO */
|
||||
pinmux_pin_set(portc, 10, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portc, 11, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portc, 12, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portc, 13, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
#endif
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(pwt), okay) && CONFIG_PWM_CAPTURE
|
||||
|
@ -74,10 +63,6 @@ static int twr_ke18f_pinmux_init(const struct device *dev)
|
|||
pinmux_pin_set(porte, 11, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||
#endif
|
||||
|
||||
/* Buttons */
|
||||
pinmux_pin_set(portd, 3, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portd, 6, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(lpuart0), okay) && CONFIG_SERIAL
|
||||
/* UART0 RX, TX */
|
||||
pinmux_pin_set(portb, 0, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||
|
@ -93,8 +78,6 @@ static int twr_ke18f_pinmux_init(const struct device *dev)
|
|||
#ifdef CONFIG_BOARD_TWR_KE18F_SPI_0_PCS2
|
||||
/* SPI0 PCS2 */
|
||||
pinmux_pin_set(porte, 6, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||
#else
|
||||
pinmux_pin_set(porte, 6, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
#endif
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(lpspi1), okay) && CONFIG_SPI
|
||||
|
@ -106,14 +89,10 @@ static int twr_ke18f_pinmux_init(const struct device *dev)
|
|||
#ifdef CONFIG_BOARD_TWR_KE18F_SPI_1_PCS0
|
||||
/* SPI1 PCS0 */
|
||||
pinmux_pin_set(portd, 3, PORT_PCR_MUX(kPORT_MuxAlt3));
|
||||
#else
|
||||
pinmux_pin_set(portd, 3, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
#endif
|
||||
#ifdef CONFIG_BOARD_TWR_KE18F_SPI_1_PCS2
|
||||
/* SPI1 PCS2 */
|
||||
pinmux_pin_set(porta, 16, PORT_PCR_MUX(kPORT_MuxAlt3));
|
||||
#else
|
||||
pinmux_pin_set(porta, 16, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BOARD_TWR_KE18F_FLEXIO_CLKOUT
|
||||
|
@ -139,15 +118,6 @@ static int twr_ke18f_pinmux_init(const struct device *dev)
|
|||
pinmux_pin_set(porte, 5, PORT_PCR_MUX(kPORT_MuxAlt5));
|
||||
#endif
|
||||
|
||||
/* FXOS8700 INT1, INT2, RST */
|
||||
#if DT_NODE_HAS_PROP(DT_INST(0, nxp_fxos8700), int1_gpios)
|
||||
pinmux_pin_set(porta, 14, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
#endif
|
||||
#if DT_NODE_HAS_PROP(DT_INST(0, nxp_fxos8700), int2_gpios)
|
||||
pinmux_pin_set(portc, 17, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
#endif
|
||||
pinmux_pin_set(portc, 15, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc0), okay) && CONFIG_ADC
|
||||
/* Thermistor A, B */
|
||||
pinmux_pin_set(porta, 0, PORT_PCR_MUX(kPORT_PinDisabledOrAnalog));
|
||||
|
|
|
@ -38,22 +38,6 @@ static int twr_kv58f220m_pinmux_init(const struct device *dev)
|
|||
__ASSERT_NO_MSG(device_is_ready(porte));
|
||||
#endif
|
||||
|
||||
/* LEDs */
|
||||
pinmux_pin_set(porte, 11, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(porte, 12, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(porte, 29, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(porte, 30, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
/* Buttons */
|
||||
pinmux_pin_set(porta, 4, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(porte, 4, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portb, 5, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portb, 4, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
/* FXOS8700 INT1, INT2 */
|
||||
pinmux_pin_set(portc, 18, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portc, 19, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C
|
||||
/* I2C1 SCL, SDA */
|
||||
pinmux_pin_set(portd, 8, PORT_PCR_MUX(kPORT_MuxAlt2)
|
||||
|
|
|
@ -44,13 +44,6 @@ static int usb_kw24d512_pinmux_init(const struct device *dev)
|
|||
pinmux_pin_set(porta, 2, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||
#endif
|
||||
|
||||
/* SW1 */
|
||||
pinmux_pin_set(portc, 4, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
/* blue LEDs D2, D3 */
|
||||
pinmux_pin_set(portd, 4, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portd, 5, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI
|
||||
/* SPI1 CS0, SCK, SOUT, SIN */
|
||||
pinmux_pin_set(portb, 10, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||
|
@ -59,11 +52,6 @@ static int usb_kw24d512_pinmux_init(const struct device *dev)
|
|||
pinmux_pin_set(portb, 17, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IEEE802154_MCR20A
|
||||
/* Reset, IRQ_B */
|
||||
pinmux_pin_set(portb, 19, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portb, 3, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,5 +6,4 @@ project(tagoio_http_post)
|
|||
|
||||
target_sources(app PRIVATE src/main.c)
|
||||
target_sources(app PRIVATE src/sockets.c)
|
||||
target_sources(app PRIVATE src/pinmux.c)
|
||||
target_sources_ifdef(CONFIG_WIFI app PRIVATE src/wifi.c)
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2020 Gerson Fernando Budke <nandojve@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <init.h>
|
||||
#include <drivers/pinmux.h>
|
||||
|
||||
#if defined(CONFIG_BOARD_FRDM_K64F)
|
||||
#include <fsl_port.h>
|
||||
#endif
|
||||
|
||||
static int tagoio_pinmux_init(const struct device *dev)
|
||||
{
|
||||
ARG_UNUSED(dev);
|
||||
|
||||
#if defined(CONFIG_BOARD_FRDM_K64F)
|
||||
const struct device *portc = DEVICE_DT_GET(DT_NODELABEL(portc));
|
||||
|
||||
__ASSERT_NO_MSG(device_is_ready(portc));
|
||||
|
||||
pinmux_pin_set(portc, 2, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(portc, 3, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
SYS_INIT(tagoio_pinmux_init, POST_KERNEL, CONFIG_PINMUX_INIT_PRIORITY);
|
|
@ -8,7 +8,7 @@
|
|||
#include "test_gpio.h"
|
||||
|
||||
/* Grotesque hack for pinmux boards */
|
||||
#if defined(CONFIG_BOARD_FRDM_K64F) || defined(CONFIG_BOARD_RV32M1_VEGA)
|
||||
#if defined(CONFIG_BOARD_RV32M1_VEGA)
|
||||
#include <drivers/pinmux.h>
|
||||
#include <fsl_port.h>
|
||||
#elif defined(CONFIG_BOARD_UDOO_NEO_FULL_M4)
|
||||
|
@ -33,14 +33,7 @@ static void board_setup(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BOARD_FRDM_K64F)
|
||||
/* TODO figure out how to get this from "GPIO_2" */
|
||||
const char *pmx_name = "portc";
|
||||
const struct device *pmx = device_get_binding(pmx_name);
|
||||
|
||||
pinmux_pin_set(pmx, PIN_OUT, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
pinmux_pin_set(pmx, PIN_IN, PORT_PCR_MUX(kPORT_MuxAsGpio));
|
||||
#elif defined(CONFIG_BOARD_UDOO_NEO_FULL_M4)
|
||||
#if defined(CONFIG_BOARD_UDOO_NEO_FULL_M4)
|
||||
/*
|
||||
* Configure pin mux.
|
||||
* The following code needs to configure the same GPIOs which were
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue