C external module using IRQS

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
mroussel
Posts: 7
Joined: Fri Nov 23, 2018 6:08 pm
Location: Montreal, Quebec, Canada

C external module using IRQS

Post by mroussel » Sat May 14, 2022 2:07 am

Hi all,

I need some help, in figuring out if this is supported by micropython

I plan to use a RP2 board with a bare metal micropython

The projet would be split in two ( I would like to use only one RP2 core)

- micropython side (via USB) this would handle all UI and commands, this is the non time critical section, yes, this is supported

- gpio side (not using the PIO of RP2), this side would be very time critical and driven by irqs at high rate
this would be a C external module, yes, this is supported

The question: Can my external c module bind itself(or with some help from micropython) to IRQ's , before you answer, read below

The C external module would do a software I2c slave (decoding GPIO bit level transitions via edge triggered IRQs of SDA and SCK).
It has to be custom slave, I can not use standard hardware I2C peripherals as my application needs to answer to many I2C slave addresses.
(my application will do clock stretching)

The IRQ latency must be minimized (ideally a direct ISR call)
Can the external C module, share/steal the IRQ at the bare metal level?
is this supported , recommended , has it been done , pointer to projects I can look at ?

maybe another approach is better?

regards

Martin

Post Reply