55 I2C(I2C_TypeDef*
i2c,
const miosix::GpioPin& scl,
56 const miosix::GpioPin& sda);
77 void* buffer,
const size_t nBytes);
92 const void* buffer,
const size_t nBytes);
108 const uint8_t registerAddress, uint8_t& registerContent);
124 const uint8_t registerAddress, uint16_t& registerContent);
140 const uint8_t registerAddress, uint32_t& registerContent);
156 const uint8_t registerAddress, uint32_t& registerContent);
172 const uint8_t registerAddress,
const uint8_t registerContent);
188 const uint8_t registerAddress,
const uint16_t registerContent);
204 const uint8_t registerAddress,
const uint32_t registerContent);
220 const uint8_t registerAddress,
const uint32_t registerContent);
237 const uint8_t registerAddress,
void* buffer,
const size_t nBytes);
281 const miosix::GpioPin& sda);
302 void* buffer,
const size_t nBytes);
317 const void* buffer,
const size_t nBytes);
333 const uint8_t registerAddress, uint8_t& registerContent);
349 const uint8_t registerAddress, uint16_t& registerContent);
365 const uint8_t registerAddress, uint32_t& registerContent);
381 const uint8_t registerAddress, uint32_t& registerContent);
397 const uint8_t registerAddress,
const uint8_t registerContent);
413 const uint8_t registerAddress,
const uint16_t registerContent);
429 const uint8_t registerAddress,
const uint32_t registerContent);
445 const uint8_t registerAddress,
const uint32_t registerContent);
462 const uint8_t registerAddress,
void* buffer,
const size_t nBytes);
491 miosix::FastMutex mutex;
Low level driver for I2C peripherals.
High level driver for the I2C peripherals.
bool readFromRegister(const I2CDriver::I2CSlaveConfig &slaveConfig, const uint8_t registerAddress, void *buffer, const size_t nBytes)
Non blocking operation to read n-bytes from register from a slave.
bool writeRegister32(const I2CDriver::I2CSlaveConfig &slaveConfig, const uint8_t registerAddress, const uint32_t registerContent)
Non blocking operation to write a 32-bit register from a slave.
bool read(const I2CDriver::I2CSlaveConfig &slaveConfig, void *buffer, const size_t nBytes)
Non blocking read operation to read nBytes.
bool probe(const I2CDriver::I2CSlaveConfig &slaveConfig)
Non blocking operation to check if a slave is available.
bool writeRegister(const I2CDriver::I2CSlaveConfig &slaveConfig, const uint8_t registerAddress, const uint8_t registerContent)
Non blocking operation to write an 8-bit register from a slave.
I2C & operator=(I2C &&)=delete
I2C & operator=(const I2C &)=delete
bool readRegister32(const I2CDriver::I2CSlaveConfig &slaveConfig, const uint8_t registerAddress, uint32_t ®isterContent)
Non blocking operation to read a 32-bit register from a slave.
uint16_t getLastError()
Returns the last errors happened in the communication.
bool writeRegister24(const I2CDriver::I2CSlaveConfig &slaveConfig, const uint8_t registerAddress, const uint32_t registerContent)
Non blocking operation to write a 24-bit register from a slave.
bool write(const I2CDriver::I2CSlaveConfig &slaveConfig, const void *buffer, const size_t nBytes)
Non blocking write operation to write nBytes.
I2CDriver i2c
Instance of I2C low-level driver.
I2C(I2C_TypeDef *i2c, const miosix::GpioPin &scl, const miosix::GpioPin &sda)
Constructor for the I2C high-level driver.
bool writeRegister16(const I2CDriver::I2CSlaveConfig &slaveConfig, const uint8_t registerAddress, const uint16_t registerContent)
Non blocking operation to write a 16-bit register from a slave.
bool readRegister16(const I2CDriver::I2CSlaveConfig &slaveConfig, const uint8_t registerAddress, uint16_t ®isterContent)
Non blocking operation to read a 16-bit register from a slave.
bool readRegister24(const I2CDriver::I2CSlaveConfig &slaveConfig, const uint8_t registerAddress, uint32_t ®isterContent)
Non blocking operation to read a 24-bit register from a slave.
bool readRegister(const I2CDriver::I2CSlaveConfig &slaveConfig, const uint8_t registerAddress, uint8_t ®isterContent)
Non blocking operation to read an 8-bit register from a slave.
Thread safe version of the I2C high-level driver.
SyncedI2C(const SyncedI2C &)=delete
bool probe(const I2CDriver::I2CSlaveConfig &slaveConfig)
Check if a slave is available.
SyncedI2C & operator=(SyncedI2C &&)=delete
bool writeRegister16(const I2CDriver::I2CSlaveConfig &slaveConfig, const uint8_t registerAddress, const uint16_t registerContent)
Write a 16-bit register from the device.
bool readRegister24(const I2CDriver::I2CSlaveConfig &slaveConfig, const uint8_t registerAddress, uint32_t ®isterContent)
Read a 24-bit register from the device.
bool write(const I2CDriver::I2CSlaveConfig &slaveConfig, const void *buffer, const size_t nBytes)
Write operation to write nBytes.
bool writeRegister32(const I2CDriver::I2CSlaveConfig &slaveConfig, const uint8_t registerAddress, const uint32_t registerContent)
Write a 32-bit register from the device.
uint16_t getLastError()
Returns the last errors happened in the communication.
bool writeRegister24(const I2CDriver::I2CSlaveConfig &slaveConfig, const uint8_t registerAddress, const uint32_t registerContent)
Write a 24-bit register from the device.
SyncedI2C & operator=(const SyncedI2C &)=delete
bool readRegister16(const I2CDriver::I2CSlaveConfig &slaveConfig, const uint8_t registerAddress, uint16_t ®isterContent)
Read a 16-bit register from the device.
bool read(const I2CDriver::I2CSlaveConfig &slaveConfig, void *buffer, const size_t nBytes)
Read operation to read nBytes.
SyncedI2C(I2C_TypeDef *i2c, const miosix::GpioPin &scl, const miosix::GpioPin &sda)
Constructor for the synced I2C high-level driver.
bool readRegister(const I2CDriver::I2CSlaveConfig &slaveConfig, const uint8_t registerAddress, uint8_t ®isterContent)
Read an 8-bit register from the device.
bool writeRegister(const I2CDriver::I2CSlaveConfig &slaveConfig, const uint8_t registerAddress, const uint8_t registerContent)
Write an 8-bit register from the device.
bool readRegister32(const I2CDriver::I2CSlaveConfig &slaveConfig, const uint8_t registerAddress, uint32_t ®isterContent)
Read a 32-bit register from the device.
SyncedI2C(SyncedI2C &&)=delete
bool readFromRegister(const I2CDriver::I2CSlaveConfig &slaveConfig, const uint8_t registerAddress, void *buffer, const size_t nBytes)
Read n-bytes from register from a slave.
This file includes all the types the logdecoder script will decode.
Configuration struct for a slave device. This will be used for configuring the bus in order to commun...