Learn MoreFAQsTutorials

7 posts / 0 new
Last post
koukou
Offline
Last seen:3 days 12 hours ago
加入:2019-10-14 10:42
interrupt

is there a function like GPIO_EnableIRQ to disable or hide the interrupt !!

Device:
PM_Dialog
Offline
Last seen:3 hours 33 min ago
Staff
加入:2018-02-08 11:03
Hi There,

Hi There,

Do you mean to disable the global interrupts?

Thanks, PM_Dialog

koukou
Offline
Last seen:3 days 12 hours ago
加入:2019-10-14 10:42

I have a problem is that the interruption is triggered several times as long as the push button pressed while I want the interruption to be triggered only once even if the button has been pressed

koukou
Offline
Last seen:3 days 12 hours ago
加入:2019-10-14 10:42

我用GPIO中断:

GPIO_RegisterCallback(GPIO0_IRQn,callback_function);
GPIO_EnableIRQ(GPIO_BUTTON_1_PORT, GPIO_BUTTON_1_PIN, GPIO0_IRQn, true ,false, 250);
GPIO_ResetIRQ (GPIO0_IRQn);

PM_Dialog
Offline
Last seen:3 hours 33 min ago
Staff
加入:2018-02-08 11:03
Hi There,

Hi There,

Could you please try to explain what you are trying to accomplish?

Thanks, PM_Dialog

koukou
Offline
Last seen:3 days 12 hours ago
加入:2019-10-14 10:42

i have a matrix keyboard and i want to read their buttons. I followed the algorithm of the keyboard: the lines are outputs initialized in the high state and the columns are inputs with pulldown resistances, when an interruption occurs on a column I put 1 logic on the first line and 0 logic on the other lines, if I find 1 logic on the column then I know which button is pressed and so on. when I remain pressed on one of the buttons of the 1st line everything is working well and the interrupt is triggered only once but when I remain pressed on one of the buttons of one of the other lines the intrusion remains triggered several times

/ /初始化OUTPUT Up
setSelectedKeypadMatrixRowsUp(_ROW_1 | _ROW_2 | _ROW_3 | _ROW_4);

GPIO_EnableIRQ(GPIO_KEYPAD_C1_PORT, GPIO_KEYPAD_C1_PIN, GPIO0_IRQn, false ,true, 250);
GPIO_RegisterCallback(GPIO0_IRQn,C1_KeypadInterruptHandler);

__STATIC_INLINE void C1_KeypadInterruptHandler (void)
{

setSelectedKeypadMatrixRowsUp(_ROW_1);

if(_COL_1)
{
arch_printf("Keypad 1\n\r");
goto reset;
}

setSelectedKeypadMatrixRowsUp(_ROW_2);

if(_COL_1)
{
arch_printf("Keypad 4\n\r");
goto reset;
}

setSelectedKeypadMatrixRowsUp(_ROW_3);

if(_COL_1)
{
arch_printf("Keypad 7\n\r");
goto reset;
}

setSelectedKeypadMatrixRowsUp(_ROW_4);

if(_COL_1)
{
arch_printf("Keypad *\n\r");
goto reset;
}


reset :

setSelectedKeypadMatrixRowsUp(_ROW_1 | _ROW_2 | _ROW_3 | _ROW_4);

}

__STATIC_INLINE void setSelectedKeypadMatrixRowsUp(int aMask)
{
if(aMask & _ROW_1)
_ROW_1_HIGH;
else
_ROW_1_LOW;

if(aMask & _ROW_2)
_ROW_2_HIGH;
else
_ROW_2_LOW;

if(aMask & _ROW_3)
_ROW_3_HIGH;
else
_ROW_3_LOW;

if(aMask & _ROW_4)
_ROW_4_HIGH;
else
_ROW_4_LOW;
}

PM_Dialog
Offline
Last seen:3 hours 33 min ago
Staff
加入:2018-02-08 11:03
Hi There,

Hi There,

Sorry for my delayed response – probably we missed your last comments. You could use the IRQ APIs from the gpio.h driver.

Thanks, PM_Dialog