GPIO Interrupt error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GPIO Interrupt error

439 Views
prady7
Contributor I

Hi Community, 

Am working on imx7 dual board. Am having problem with configuring GPIO falling edge interrupt. Could someone help me with this problem?
Am using this for FreeRTOS
Here is my configuration. 
1. pins.c - in this file, I have configured GPIO 63 in alt 5 mode. 

gpio_config_t gpio_Unknown1 = {
"SODIMM 63", /* name */
&IOMUXC_SW_MUX_CTL_PAD_ENET1_RGMII_RD2, /* muxReg */
5, /* muxConfig */
&IOMUXC_SW_PAD_CTL_PAD_ENET1_RGMII_RD2, /* padReg */
IOMUXC_SW_PAD_CTL_PAD_ENET1_RGMII_RD2_PS(2) | /* padConfig */
IOMUXC_SW_PAD_CTL_PAD_ENET1_RGMII_RD2_PE_MASK |
IOMUXC_SW_PAD_CTL_PAD_ENET1_RGMII_RD2_HYS_MASK,
GPIO7, /* base */
2


2. in board.h - I have added these lines - GPIO_Unknown1 is my config for port 63

#define BOARD_GPIO_UNKNOWN1_RDC_PDAP rdcPdapGpio7
#define BOARD_GPIO_UNKNOWN1_CONFIG (&gpio_Unknown1)
#define BOARD_GPIO_UNKNOWN1_IRQ GPIO7_INT15_0_IRQn
#define BOARD_GPIO_UNKNOWN1_HANDLER GPIO7_INT15_0_Handler

3. and in main.c am trying to toggle other port. 

int readpin63;
readpin63 = GPIO_ReadPinInput(gpio_Unknown1.base, gpio_Unknown1.pin);

if (readpin63)
{
GPIO_WritePinOutput(gpio_Unknown2.base, gpio_Unknown2.pin, 1);
vTaskDelay(blinkingInterval);
GPIO_WritePinOutput(gpio_Unknown2.base, gpio_Unknown2.pin, 0);
vTaskDelay(blinkingInterval);

Am I missing something or the way am doing is wrong? 

Labels (2)
0 Kudos
1 Reply

425 Views
igorpadykov
NXP Employee
NXP Employee

Hi Prady

 

for gpio interrupt example one can look at  ../demo_apps/blinking_imx_demo/gpio_ctrl.c

Pay attention to function NVIC_EnableIRQ(BOARD_GPIO_KEY_IRQ_NUM),
BOARD_GPIO_KEY_IRQ_NUM can be found in board.h.

 

Best regards
igor

0 Kudos