9 #include <satcat5/cfg_i2c.h>
12 #ifndef SATCAT5_I2C_MAXCMD
13 #define SATCAT5_I2C_MAXCMD 16
51 u8 regbytes, u32 regaddr, u8 nread,
54 u8 regbytes, u32 regaddr, u8 nwrite,
const u8* data,
61 u32 regaddr,
unsigned nread,
const u8* rdata)
override;
64 inline unsigned cb_wridx()
const
65 {
return satcat5::util::modulo_add_uns(m_cb_rdidx + m_cb_count, SATCAT5_I2C_MAXCMD);}
Callback interface for cfg::I2cGeneric events.
Polymorphic API for a generic I2C interface.
Device driver for PCA9548A / TCA9548A I2C switches.
bool write(const satcat5::util::I2cAddr &devaddr, u8 regbytes, u32 regaddr, u8 nwrite, const u8 *data, satcat5::cfg::I2cEventListener *callback=0) override
Add a write operation to the queue.
bool select_mask(u8 mask)
Select a channel or channel(s).
bool busy() override
Is the I2C controller currently busy?
bool select_channel(unsigned n)
Shortcut for selecting a specific channel.
bool read(const satcat5::util::I2cAddr &devaddr, u8 regbytes, u32 regaddr, u8 nread, satcat5::cfg::I2cEventListener *callback=0) override
Add a read operation to the queue.
Tca9548(satcat5::cfg::I2cGeneric *i2c, const satcat5::util::I2cAddr &devaddr)
Constructor links to the specified I2C bus.
Conversion function for I2C device addresses.
Miscellaneous mathematical utility functions.