Hello !
I need to have ISR by multiple GPIO lines in ACTIVE, SLEEP and POWER DOWN modes.
I would like to detect both edges and try to utilize both GINTx and include pin twice and configure GINT0 for detect rising edge and GINT1 for falling edge ( or vise versa).
Looks like scheme works if one pin is taken from GPIO0 port. But If I add pins from GPIO1 port, only falling edge works.
I have checked all possible combinations and haven't find working combination how-to detect both edges for set of pins from both GPIO ports.
Is any limitations exists ? There are not visible in UM.
I have attached exact modified gint example.
Essential part :
/* Select one input, active low for GINT0 */
#define DEMO_GINT0_POL_MASK_LOW ~(1U << BOARD_SW1_GPIO_PIN)
#define DEMO_GINT0_POL_MASK_HIGH (1U << BOARD_SW1_GPIO_PIN)
#define DEMO_GINT0_ENA_MASK (1U << BOARD_SW1_GPIO_PIN)
/* Select two inputs, active low for GINT1. SW2 & SW3 must be connected to the same port */
#define DEMO_GINT1_POL_MASK_LOW ~((1U << BOARD_SW2_GPIO_PIN) | (1U << BOARD_SW3_GPIO_PIN))
#define DEMO_GINT1_POL_MASK_HIGH ((1U << BOARD_SW2_GPIO_PIN) | (1U << BOARD_SW3_GPIO_PIN))
#define DEMO_GINT1_ENA_MASK ((1U << BOARD_SW2_GPIO_PIN) | (1U << BOARD_SW3_GPIO_PIN))
....
/* Initialize GINT0 & GINT1 */
GINT_Init(GINT0);
GINT_Init(GINT1);
/* Setup GINT0 for edge trigger, "OR" mode */
GINT_SetCtrl(GINT0, kGINT_CombineOr, kGINT_TrigEdge, gint0_callback);
/* Setup GINT1 for edge trigger, "OR" mode */
GINT_SetCtrl(GINT1, kGINT_CombineOr, kGINT_TrigEdge, gint1_callback);
/* Select pins & polarity for GINT0 */
//GINT_ConfigPins(GINT0, DEMO_GINT0_PORT, DEMO_GINT0_POL_MASK_LOW, DEMO_GINT0_ENA_MASK); // GPIO0, pin 5, SW1
//GINT_ConfigPins(GINT0, DEMO_GINT0_PORT, DEMO_GINT0_POL_MASK_HIGH, DEMO_GINT0_ENA_MASK); // GPIO0, pin 5, SW1
GINT_ConfigPins(GINT0, DEMO_GINT1_PORT, DEMO_GINT1_POL_MASK_HIGH, DEMO_GINT1_ENA_MASK); //
//GINT_ConfigPins(GINT0, DEMO_GINT1_PORT, DEMO_GINT1_POL_MASK_LOW, DEMO_GINT1_ENA_MASK);
/* Select pins & polarity for GINT1 */
//GINT_ConfigPins(GINT1, DEMO_GINT0_PORT, DEMO_GINT0_POL_MASK_HIGH, DEMO_GINT0_ENA_MASK); // GPIO0, pin 5, SW1
//GINT_ConfigPins(GINT1, DEMO_GINT0_PORT, DEMO_GINT0_POL_MASK_LOW, DEMO_GINT0_ENA_MASK); // GPIO0, pin 5, SW1
GINT_ConfigPins(GINT1, DEMO_GINT1_PORT, DEMO_GINT1_POL_MASK_LOW, DEMO_GINT1_ENA_MASK); // Port1, pins 9, 18
//GINT_ConfigPins(GINT1, DEMO_GINT1_PORT, DEMO_GINT1_POL_MASK_HIGH, DEMO_GINT1_ENA_MASK); // Port1, pins 9, 18
/* Enable callbacks for GINT0 & GINT1 */
GINT_EnableCallback(GINT0);
GINT_EnableCallback(GINT1);
Could you suggest how-to allocate multiple pins from GPIO1 port for be able to detect rising and falling edges
?
Regards,
Eugene