DHCOM_HAL
Hardware-abstraction library (HAL) for multiple targets, including DHCOM modules
|
Class representing a slave device of a I2C bus. This is a convenience class, which simplifies operations with I2C slave devices. It automates the selection of I2C slave in case when several slaves are operating on the same bus. More...
#include <I2CSlave.h>
Public Member Functions | |
I2CSlave (I2CBus *bus, uint16_t address) | |
Create an I2CSlave object and remember its properties (address and the bus). | |
STATUS | read (uint8_t *buffer, uint32_t count) const |
Reads a block of bytes from the I2C slave device. | |
uint8_t | read (STATUS *status=NULL) const |
Read one byte from the I2C slave device. | |
STATUS | write (const uint8_t *buffer, uint32_t count) |
Write a block of bytes to the I2C slave device. | |
STATUS | write (uint8_t byte) |
Write one byte to the I2C slave device. | |
Class representing a slave device of a I2C bus. This is a convenience class, which simplifies operations with I2C slave devices. It automates the selection of I2C slave in case when several slaves are operating on the same bus.
Reads a block of bytes from the I2C slave device.
buffer | - a pointer to the buffer to receive the incoming data. |
count | - number of bytes to receive. |
Read one byte from the I2C slave device.
status | - if NULL - no status is returned, otherwise status is assigned from same set of values as for I2CBus::selectSlave() and I2CBus::read(). |
Write a block of bytes to the I2C slave device.
buffer | - a pointer to the buffer from which to send the data; |
count | - number of bytes to send. |
Write one byte to the I2C slave device.
byte | - the value to send. |