Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - GPIO Interrupts with RPi4 BSP: (6 Items)
   
GPIO Interrupts with RPi4 BSP  
I've been working with a BeagleBone Black running QNX7.1 and it works quite well, but now that the RPi4 BSP has been 
released by QNX I'd like to make some comparisons.  I've rebuilt the BSP and do see the GPIO code in the support folder.
  I was hoping someone might have a small C program demonstrating how to setup interrupts for GPIO change of states for 
the BCM2711?  I've gotten this to work on the TI chip, and I'd really like to see if I could get these working on the 
Pi4.  I'm sure the gpio.c provided in the src/hardware/support directory is the right place to start, but if anyone had 
pointers for enabling interrupts and handling these, that would be super helpful.

David
Re: GPIO Interrupts with RPi4 BSP  
Here  you go.
It's a much simplified version of a full GPIO resource manager that I wrote.
You can ignore the Screen calls, they are there because I used this code to test injecting keyboard events to Screen.

--Elad
Attachment: Text rpi_gpio_intr.c 6.77 KB
Re: GPIO Interrupts with RPi4 BSP  
Thank you!!!  I’ll try this out for sure - I really appreciate it.  Is there screen support for the RPi?  I didn’t see
 any mention of it in the BSP release?  I don’t actually need it (don’t use a display with the BBB, so it doesn’t 
really matter for this comparison), but it would be great to have it if it works, of course!

-David

> On Mar 22, 2021, at 1:13 PM, Elad Lahav <community-noreply@qnx.com> wrote:
> 
> Here  you go.
> It's a much simplified version of a full GPIO resource manager that I wrote.
> You can ignore the Screen calls, they are there because I used this code to test injecting keyboard events to Screen.
> 
> --Elad
> 
> 
> 
> _______________________________________________
> 
> OSTech
> http://community.qnx.com/sf/go/post121340
> To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com
> <rpi_gpio_intr.c>

Attachment: Text smime.p7s 1.57 KB
Re: GPIO Interrupts with RPi4 BSP  
There is no GPU driver for now, and therefore no Screen support.
I do have a working SDL library using the frame buffer, and have been able to run Super Mario and Prince of Persia on 
the RPi under QNX ;-)

--Elad
Re: GPIO Interrupts with RPi4 BSP  
Forgot to mention one more thing. I have recently discovered that the GPIO interrupt on the RPi can be very bouncy 
(discovered by working on Tetris with my son). Depending on your needs you may need to debounce.

--Elad
Re: GPIO Interrupts with RPi4 BSP  
Works perfectly!  Already had my SPDT switch debounced through my favorite (and still mind bending NAND gates) so output
 was nice and clean!  Huge help, thanks so much.  Now I’ll try to connect the MCP23017 DIO expander using the interrupt
 line and see how the I2C works.  Am I correct that the RPi has only one SPI bus accessible under QNX or should I have 
access to both (I think there are two?!)?

Thanks again,
David

> On Mar 22, 2021, at 1:45 PM, Elad Lahav <community-noreply@qnx.com> wrote:
> 
> Forgot to mention one more thing. I have recently discovered that the GPIO interrupt on the RPi can be very bouncy 
(discovered by working on Tetris with my son). Depending on your needs you may need to debounce.
> 
> --Elad
> 
> 
> 
> _______________________________________________
> 
> OSTech
> http://community.qnx.com/sf/go/post121343
> To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com

Attachment: Text smime.p7s 1.57 KB