So is there a simple way of attaching and ISR to a GPIO from user code?

I can see how to do it in rp2040_gpio.c in the board files but I’m hoping not 
to have to change the board files.

Regards,
Mark
_____________________________
Blog: blog.thepcsite.co.uk
Twitter: @nevynuk





> On 12 Aug 2023, at 20:08, Brennan Ashton <bash...@brennanashton.com> wrote:
> 
> I would not recommend doing that. You _could_ but it will break for non
> flat builds and you are explicitly violating the the OS application
> interface boundary. You may also break assumptions of the OS and make it
> unstable by changing important registers in interrupt controller.
> 
> So nothing is stopping you, but you should also not expect the OS to
> function correctly.
> 
> --Brennan
> 
> On Sat, Aug 12, 2023, 11:54 AM Mark Stevens <m...@thepcsite.co.uk> wrote:
> 
>> Is there anyway of using the Pico SDK from within NuttX?
>> 
>> What I am trying to do is attach a generic ISR to some GPIO pins.  I’m not
>> a great fan of having to modify the OS source in order to set up simple
>> things like ISRs to handle button presses.  I’d like to be able to do this
>> from the user application rather than the board files which from what I
>> have read seems to be the way to do it.
>> 
>> My requirement is:
>> 
>> Configure a GPIO to be input, interrupt driven and pull ups enabled
>> Attach and interrupt to the GPIO (this could be one of all input GPIOs if
>> I get a parameter telling me which button or one per GPIO)
>> Driven from the user application
>> 
>> From what I have read in the source (and I may be wrong) I seem to have to
>> modify the board files and use a signal handler for the interrupts.
>> 
>> I’d rather not modify the board files.
>> 
>> Now I know you can achieve what I want in a few calls to the Pico SDK and
>> I was wondering if calling the SDK is possible.
>> 
>> Has anyone doe this?
>> 
>> Alternatively, has anyone configured NuttX to do this from user space?
>> 
>> Regards,
>> Mark
>> _____________________________
>> Blog: blog.thepcsite.co.uk
>> Twitter: @nevynuk
>> 
>> 
>> 
>> 
>> 
>> 

Reply via email to