Get/clear functions for PIO FIFO debug register #450

Open
opened 2021-05-26 09:36:03 -05:00 by jonathangjertsen · 1 comment
jonathangjertsen commented 2021-05-26 09:36:03 -05:00 (Migrated from github.com)

AFAICT the only way to get at the contents of the PIO FIFO debug register is to access the fdebug field on the PIO struct and do the appropriate bit manipulations. It would be nice with a more convenient helper function.

One possible API is

static inline pio_fifo_debug_flags_t pio_sm_get_debug_flags(PIO pio, uint sm, bool clear) { ... }

where pio_fifo_debug_flags_t is a struct with one bool for each flag, and the clear parameter selects whether or not to clear the flags afterwards.

AFAICT the only way to get at the contents of the PIO FIFO debug register is to access the `fdebug` field on the PIO struct and do the appropriate bit manipulations. It would be nice with a more convenient helper function. One possible API is ```C static inline pio_fifo_debug_flags_t pio_sm_get_debug_flags(PIO pio, uint sm, bool clear) { ... } ``` where `pio_fifo_debug_flags_t` is a struct with one bool for each flag, and the `clear` parameter selects whether or not to clear the flags afterwards.
lurch commented 2021-05-26 09:54:23 -05:00 (Migrated from github.com)

You might only want to clear one flag (and leave the others set) rather than clearing all flags? Might make sense to have e.g.

static inline pio_fifo_debug_flags_t pio_sm_get_fifo_debug_flags(PIO pio, uint sm) { ... }
static inline void pio_sm_clear_fifo_debug_flags(PIO pio, uint sm, pio_fifo_debug_flags_t clear) { ... }

🤷‍♂️
(disclaimer: I've never actually done any PIO debugging!)

You might only want to clear one flag (and leave the others set) rather than clearing all flags? Might make sense to have e.g. ```c static inline pio_fifo_debug_flags_t pio_sm_get_fifo_debug_flags(PIO pio, uint sm) { ... } static inline void pio_sm_clear_fifo_debug_flags(PIO pio, uint sm, pio_fifo_debug_flags_t clear) { ... } ``` :man_shrugging: (disclaimer: I've never actually done any PIO debugging!)
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk#450
No description provided.