You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The parameters are: the struct name, size of the wrapped value, and list of fields and position of those fields (e.g. NONE is one bit long, and it's the lsb).
We could also add another input for a default value (and remove all the DEFAULTconsts).
Generally grouping the registers together sounds very nice. I think we can go further down and provide abstractions for the main components of the serial console. For example, if we take the interrupts, there are 3 main operations (which have separate defines):
enabling interrupts -> corresponds to IER defines
adding/deleting an interrupt -> corresponds to the IIR defines
-trigering the interrupt
A non significant overhead in the serial console comes from handling interrupts. If we can "modularize" working with an interrupt, we get "for free" the separation you are proposing because we can then define the bit shifts in the context of the newly created interface. Does that make sense?
I'm not sure I understand correctly your proposal, can you maybe show an example of the interface you're referrng to? I thnk you're proposing to not expose the bit masks, but instead to provide methods like "set_bit_x".
Activity
andreeaflorescu commentedon Feb 4, 2021
Generally grouping the registers together sounds very nice. I think we can go further down and provide abstractions for the main components of the serial console. For example, if we take the interrupts, there are 3 main operations (which have separate defines):
-trigering the interrupt
A non significant overhead in the serial console comes from handling interrupts. If we can "modularize" working with an interrupt, we get "for free" the separation you are proposing because we can then define the bit shifts in the context of the newly created interface. Does that make sense?
FedericoPonzi commentedon Feb 8, 2021
I'm not sure I understand correctly your proposal, can you maybe show an example of the interface you're referrng to? I thnk you're proposing to not expose the bit masks, but instead to provide methods like "set_bit_x".