This might not be an answer you want, but I wrote code runs on Raspberry Pi 
Pico that doesn't use OS.

  * Example code takes a GPIO input using IRQ handler: 
<https://github.com/demotomohiro/picosdk4nim/blob/main/examples/gpioInIRQ.nim>
  * Example code to copy string using DMA: 
<https://github.com/demotomohiro/picosdk4nim/blob/main/examples/dma.nim>



PicoSDK4Nim wraps Raspberry Pi Pico SDK and these example code calls C 
functions in the SDK.

I have never tried to directly access memory mapped hardware registers on Pico. 
But I think Nim can do so because Nim has [Volatile 
pragma](https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-volatile-pragma)
 and probably can do the same things as C functions in this header file: 
<https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2_common/hardware_base/include/hardware/address_mapped.h>

And Nim has [Assembler 
statement](https://nim-lang.org/docs/manual.html#statements-and-expressions-assembler-statement)
 in case you need to use CPU instructions C compiler doesn't emit.

Raspberry Pi Pico has good documentations:

  * <https://www.raspberrypi.com/documentation/microcontrollers/>
  * <https://www.raspberrypi.com/documentation/pico-sdk/>
  * <https://github.com/raspberrypi/pico-sdk>
  * <https://github.com/raspberrypi/pico-examples>


Reply via email to