71 enum {NONE, IN, OUT, Q} active{};
84 void push(
Request &&rq)
override;
88 I2C_HandleTypeDef handle{};
Wrapper class for pins in alternate configuration mode.
Definition gpio.h:60
simple Buffer backed queue implementation
Definition queue.h:12
registry that maps classes to HAL handles
Definition registry.h:13
dynamically allocated, but fixed-size buffer template
Definition buffer.h:18
simple solution for keeping track of timeouts
Definition deadline.h:15
generic I2C device wrapper.
Definition i2c.h:21
const uint8_t address
unshifted 7bit I2C device address
Definition i2c.h:24
virtual void callback(const Request &req)=0
callback.
Device(Sink< Request > &bus, uint8_t address)
construct device on bus with given address
Definition i2c.h:26
I2C Peripheral Driver.
Definition i2c.h:65
uint32_t baud
baud-rate
Definition i2c.h:77
AFIO scl
initialized (Open-Drain) pins
Definition i2c.h:76
bool full() override
no need to call this before pushing SLAVE requests
Definition i2c.cpp:113
I2C_TypeDef * i2c
I2C peripheral.
Definition i2c.h:75
uint32_t address
unshifted 7-bit address to respond to as slave
Definition i2c.h:78
bus configuration
Definition i2c.h:74
struct defining an I2C request.
Definition i2c.h:37
Buffer< uint8_t > data
transfer data
Definition i2c.h:39
uint8_t mem
memory address for memory transmissions
Definition i2c.h:61
Device * dev
pointer to the calling I2C::Device instance
Definition i2c.h:38
union I2C::Request::Type opts
transfer options.
generic object sink, i.e.
Definition streams.h:15