I have a question:
When I enable 2 pins as inputs for keyboards interrupts, the KBI0_IRQHandler does not respond. But it is curious because I am able to trigger the KBI0_IRQHandler by one pin or another but when I set the both pin, the KBI0_IRQHandler is never triggered...
Another question: Is it possible to change the edge detection (from falling to rising or from rising to falling) at the very interruption?
Thanks a lot again.
This piece of code does not work.
kbiConfig.mode = kKBI_EdgesDetect;
kbiConfig.pinsEnabled = (uint32_t) (0b00010000 | 0b01000000) ;
kbiConfig.pinsEdge = (uint32_t) (0b00010000 | 0b01000000) ; // Rising edge.
But this,
kbiConfig.mode = kKBI_EdgesDetect;
kbiConfig.pinsEnabled = (uint32_t) ( 0b01000000) ;
kbiConfig.pinsEdge = (uint32_t) ( 0b01000000) ; // Rising edge.
or this
kbiConfig.mode = kKBI_EdgesDetect;
kbiConfig.pinsEnabled = (uint32_t) (0b00010000 ) ;
kbiConfig.pinsEdge = (uint32_t) (0b00010000 ) ; // Rising edge.
does trigger the keyboard 0 interruption... but why?
Hi @carlesls.,
You can check if the KBI is being configure correctly in the Peripherals+ tab.
Also, the KBI only manage one interrupt flag, if two interrupt happens at the same time in the same KBI this can cause only one of them to trigger, this same flag should be cleared every interruption, if this is not done the code will constantly enter the IRQHandler.
I made some test on a FRDM-KE02Z with the configuration you share, and all work as expected.
Is there any other configuration on your project that could affect the KBI peripheral?
Is it possible to use the GPIO and the KBI0 at the same time in the same physical pin?
Thanks a lot.
Hi @carlesls,
The pin uses the last configuration, in this case if you configure the KBI0 and then set the same pins as GPIO the pins will only act as GPIO.
Also, for the KBI interruption there is no difference on the edges, you can only detect edges or edges and levels.