the interrupt channel only 7channels in buttons.c of ncs sdk?

Hi,

i develop my product ny ncs V2.6.0. when i view the code

static int callback_ctrl(uint32_t enable_mask)
{
	int err = 0;

	/* Normally this should be done with irqs disabled to avoid pin callback
	 * being fired before others are still not activated.
	 * Since we defer the handling code to work we can however assume
	 * cancel executed after callbacks maintenance will keep things safe.
	 *
	 * Note that this code MUST be executed from a system workqueue context.
	 *
	 * We are also safe to access state without a lock as long as it is
	 * done only from system workqueue context.
	 */

	for (size_t i = 0; (i < ARRAY_SIZE(row)) && !err; i++) 
	{
		if (enable_mask & BIT(i)) 
		{
			/* Level interrupt is needed to leave deep sleep mode.
			 * Edge interrupt gives only 7 channels. It is not
			 * suitable for larger matrix/number of GPIO buttons.
			 */
			gpio_flags_t flag_irq = (IS_ENABLED(CONFIG_CAF_BUTTONS_POLARITY_INVERSED) ?
						(GPIO_INT_LEVEL_LOW) : (GPIO_INT_LEVEL_HIGH));

			err = gpio_pin_interrupt_configure(gpio_devs[row[i].port],
							   row[i].pin,
							   flag_irq);
		} 
		else 
		{
			err = gpio_pin_interrupt_configure(gpio_devs[row[i].port],
							   row[i].pin,
							   GPIO_INT_DISABLE);
		}
	}
	if (!enable_mask) {
		/* Callbacks are disabled but they could fire in the meantime.
		 * Make sure pending work is canceled.
		 */
		k_work_cancel_delayable(&button_pressed);
	}

	return err;
}

I noticed the annotation, it says “Edge interrupt gives only 7 channels. It is not suitable for larger matrix/number of GPIO buttons.” so why it only 7 channels,and if there is 15 pin need to set interrupt pin in my key  matrix, how can i slove thie problem?

Parents Reply Children
No Data
Related