Abstract
Microcontrollers commonly use Special Function Registers (SFRs) to configure, control, and monitor operations ranging from IO devices to clock speeds and timers. These registers are exposed as addressable memory where words can be carved into fields of varying bit lengths and access rules.
groov is a library that allows definition of registers as compositions of fields and access rules. Reads and writes to fields are “optimized” (combined) at compile time to reduce the number of operations. When writing a subset of the fields to a register, groov can preserve the values of the remaining fields by performing a read-modify-write.
Many device functions are modeled as registers and not all of them are local to the processor’s memory bus. Remote devices can communicate via I2C, SPI, CAN, or some other interface with non-trivial latency. These remote registers present challenges with asynchronicity, error handling, and cancelation. groov is built on Intel’s baremetal senders and recievers library to provide a robust asynchronous solution.
This talk will present groov as an elegant and efficient solution for handling field access in local and remote registers. We will talk about designing a composable library, using Sender intrinsics to build more complex Sender aware libraries, and ensuring abstractions do not adversely affect code generation. While this talk will be presenting the open-source groov library, the design and implementation details will be applicable to those interested in asynchronous library design.
Join us as we explore groov’s library design and the power of employing senders and receivers.