How to read interrupt for GPIO1_07

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

How to read interrupt for GPIO1_07

925 Views
den
Contributor I

Hi all.

I'm working with imx8mp CPU.

I want to know which pin makes an interrupt for GPIO1 controller.

I have the following in my device tree file:

&gpio1 {
/* GPIO1_IO07 */
test_input_pin_hog {
gpio-hog;
gpios = <7 GPIO_ACTIVE_HIGH>;
gpio-output;
output-high;
line-name = "test_input_pin";
};
};
 
and gpio1 controller has the following description into the cpu dtsi:
 
gpio1: gpio@30200000 {
compatible = "fsl,imx8mp-gpio", "fsl,imx35-gpio";
reg = <0x30200000 0x10000>;
interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk IMX8MP_CLK_GPIO1_ROOT>;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <2>;
gpio-ranges = <&iomuxc 0 5 30>;
};
 
64 and 65 IRQs for 

Combined interrupt indication for GPIO1 signal 0throughout 15
and
 
Combined interrupt indication for GPIO1 signal16 throughout 31

 

How do I know that I received an interrupt on this pin(GPIO1_7)?
Thanks!
Labels (1)
Tags (1)
0 Kudos
Reply
1 Reply

880 Views
brian14
NXP TechSupport
NXP TechSupport

Hi @den

To read this interruption you will need to configure the pin via software.
To do that you can follow the iMX8MP Reference Manual in section Chapter 8 Chip IO and Pinmux > General Purpose Input/Output (GPIO) > Interrupt Control Unit.

Also, for iMX8MPlus there are no code samples for interrupt applications, but you can be based on the gpio driver for iMXRT SDK there are no big differences between gpio driver for both processors.

You can port a code sample of iMXRT SDK for interrupt control to iMX8M SDK, and make some changes:

1. You will need to change some macros to correctly port to iMX8M SDK.
2. Use the BOARD_RdcInit() and BOARD_InitMemory() instead of BOARD_ConfigMPU() used by iMXRT SDK.

I hope this information will be helpful.

Best regards, Brian.

0 Kudos
Reply