Open Eekle opened 1 week ago
I'm thinking we can have two constructors here, one with the interrupt, one without. Then users can choose how they want to use it. Make the irq an option.
I'm thinking we can have two constructors here, one with the interrupt, one without. Then users can choose how they want to use it. Make the irq an option.
Would this be best achieved as an additional type parameter on the Tsc
struct?
Yeah we can add the interrupt handler as an option and then follow the paradigm of the peripheral mode (Async vs Blocking) and have a constructor for each implementation. The Async takes the interrupts, the blocking doesn't. Then maybe we can combine the non-interrupt start function with the polling function and move that to the Blocking impl and the start_it to the Async impl. Most of the bus implementations already follow the pattern for reference.
@kkoppul2 Updated with async/blocking split.
I have just removed the _it
functions altogether, since the async wait works with the normal start
func. I hope that's not problematic?
First punt at contributing peripheral code, I hope it's close to where it needs to be.
Based off what I read in
rng.rs
, on the advice of @kkoppul2Some questions I have:
start_it
andpoll_for_acquisition
methods