Hi,
I have a custom board which uses P0.02 and P0.03. They are connected to interrupt signals from external devices.
To configure them as GPIO I set CONFIG_NFCT_PINS_AS_GPIOS=y
Below is my DTS where I use one of the pin:
Fullscreen
1
2
3
4
5
6
7
8
9
&i2c1 {
· · sens1: sens1@44·{
· · · · compatible = "...";
· · · · reg = <0x44>;
· · · · ...
· · · · int-gpios = <&gpio0 3 0>;
· · · · ...
· · };
};
I configure the pin as input like:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
...
if (device_is_ready(irq_pin->port)) {
ret = gpio_pin_configure(irq_pin->port, irq_pin->pin,
(GPIO_INPUT | GPIO_PULL_UP | irq_pin->dt_flags));
ret = gpio_pin_interrupt_configure(irq_pin->port, irq_pin->pin, GPIO_INT_EDGE_FALLING);
if (ret != 0) {
LOG_ERR("Failed to configure interrupt pin %d (%d)", irq_pin->pin, ret);
return ret;
}
/* Prepare GPIO callback for interrupt pin */
gpio_init_callback(&m_irq_cb, irq_handler, BIT(irq_pin->pin));
gpio_add_callback(irq_pin->port, &m_irq_cb);
}
...
But the pin only reads low. I am getting 0V on the CRO.
If I change the pin from P0.03 to some other (I have tried P1.01), I get high-to-low interrupt pulses from the external device.
What could be the issue?
Thanks,
Rohan