Hi,
On the RT1011 chip, I want to multiplex configure the GPIO_ AD0 as a normal GPIO port to output the high or low electrical Level. Could you please provide me an example or some reference documents.
Thanks.
Solved! Go to Solution.
Hello @TOM888,
You could choose the GPIO functionality like follows:
MCUXpresso IDE ConfigTools (MCUXpresso ConfigTools)
Note: You could modify some pin's characteristics in Routing Details
MCUXpresso IDE (Code)
You could change or choose the functionality of each one of the GPIO_AD0 pins changing the IOMUXC and GPIO registers. In the following example, we show you how to write the GPIO_AD0_9 to GPIO1: GPIOMUX_IO23 as Output:
pin_mux.c
/* GPIO configuration of ADC12_4 on GPIO_AD_09 (pin 48) */
gpio_pin_config_t ADC12_4_config = {
.direction = kGPIO_DigitalOutput,
.outputLogic = 0U,
.interruptMode = kGPIO_NoIntmode
};
/* Initialize GPIO functionality on GPIO_AD_09 (pin 48) */
GPIO_PinInit(GPIO1, 23U, &ADC12_4_config);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_09_GPIOMUX_IO23, 0U);
IOMUXC_GPR->GPR26 = ((IOMUXC_GPR->GPR26 & (~(BOARD_INITPINS_IOMUXC_GPR_GPR26_GPIO_SEL_MASK))) | IOMUXC_GPR_GPR26_GPIO_SEL(0x00U));
pin_mux.h
#define BOARD_INITPINS_IOMUXC_GPR_GPR26_GPIO_SEL_MASK 0x800000U /*!< Select GPIO1 or GPIO2: affected bits mask */
/* GPIO_AD_09 (number 48), ADC12_4/JTAG_TDO/J55[6]/J26[4] */
/* Routed pin properties */
#define BOARD_INITPINS_ADC12_4_PERIPHERAL GPIO1 /*!< Peripheral name */
#define BOARD_INITPINS_ADC12_4_SIGNAL gpiomux_io /*!< Signal name */
#define BOARD_INITPINS_ADC12_4_CHANNEL 23U /*!< Signal channel */
Let us know if this helps you.
Best regards, Raul.
Hi, Raul,
Thanks for the detailed explanation, this topic has been resolved.
Best regards!
Hello @TOM888,
You could choose the GPIO functionality like follows:
MCUXpresso IDE ConfigTools (MCUXpresso ConfigTools)
Note: You could modify some pin's characteristics in Routing Details
MCUXpresso IDE (Code)
You could change or choose the functionality of each one of the GPIO_AD0 pins changing the IOMUXC and GPIO registers. In the following example, we show you how to write the GPIO_AD0_9 to GPIO1: GPIOMUX_IO23 as Output:
pin_mux.c
/* GPIO configuration of ADC12_4 on GPIO_AD_09 (pin 48) */
gpio_pin_config_t ADC12_4_config = {
.direction = kGPIO_DigitalOutput,
.outputLogic = 0U,
.interruptMode = kGPIO_NoIntmode
};
/* Initialize GPIO functionality on GPIO_AD_09 (pin 48) */
GPIO_PinInit(GPIO1, 23U, &ADC12_4_config);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_09_GPIOMUX_IO23, 0U);
IOMUXC_GPR->GPR26 = ((IOMUXC_GPR->GPR26 & (~(BOARD_INITPINS_IOMUXC_GPR_GPR26_GPIO_SEL_MASK))) | IOMUXC_GPR_GPR26_GPIO_SEL(0x00U));
pin_mux.h
#define BOARD_INITPINS_IOMUXC_GPR_GPR26_GPIO_SEL_MASK 0x800000U /*!< Select GPIO1 or GPIO2: affected bits mask */
/* GPIO_AD_09 (number 48), ADC12_4/JTAG_TDO/J55[6]/J26[4] */
/* Routed pin properties */
#define BOARD_INITPINS_ADC12_4_PERIPHERAL GPIO1 /*!< Peripheral name */
#define BOARD_INITPINS_ADC12_4_SIGNAL gpiomux_io /*!< Signal name */
#define BOARD_INITPINS_ADC12_4_CHANNEL 23U /*!< Signal channel */
Let us know if this helps you.
Best regards, Raul.