#include <rgb-led-lighting-shield-pal-i2c-ino.hpp>
Public Member Functions | |
I2CPALIno (TwoWire *wire) | |
Constructor of the IC2-Class for Arduino. More... | |
~I2CPALIno () | |
Destructor of the Arduino I2C-Class. More... | |
Error_t | init () |
Initialization of the I2C bus. More... | |
Error_t | deinit () |
Deinitialize the I2C bus. More... | |
Error_t | setClockFreq (uint32_t clockHz) |
Set the clock frequency of the I2C bus. More... | |
Error_t | read (uint16_t addr, uint8_t command, uint16_t *data, uint16_t length) |
Read several bytes from the slave via I2C. More... | |
Error_t | read (uint16_t addr, uint8_t command, uint16_t *data) |
Read two byte (an unsigned int16) from the I2C slave. More... | |
Error_t | write (uint16_t addr, uint8_t command, uint16_t *data, uint16_t length) |
Write several bytes to the I2C slave. More... | |
Error_t | write (uint16_t addr, uint8_t command, uint16_t data) |
Write two bytes to the I2C slave. More... | |
Error_t | writeDMX (uint16_t addr, uint8_t command) |
Write to the slave via DMX. More... | |
I2CPALIno::I2CPALIno | ( | TwoWire * | wire | ) |
Constructor of the IC2-Class for Arduino.
This is the default constructor of the I2C-Class for Arduino. It is getting a pointer to the TwoWire-Class.
[in] | wire | Pointer to the TwoWire-Class. |
I2CPALIno::~I2CPALIno | ( | ) |
Destructor of the Arduino I2C-Class.
This is the destructor of the I2C-Class for Arduino.
|
virtual |
Initialization of the I2C bus.
This function is initializing the I2C bus. It takes care that all necessary values are set, so that the I2C bus can work properly.
Implements rgbShield::I2CPAL.
|
virtual |
Deinitialize the I2C bus.
This function is de-initializing the I2C bus. The bus has to be initialized again for further usage.
Implements rgbShield::I2CPAL.
|
virtual |
Set the clock frequency of the I2C bus.
This function is setting the clock frequency of the I2C bus, if the default value(100 kHz) should be changed.
[in] | clockHz | Clock frequency in Hz |
Implements rgbShield::I2CPAL.
|
virtual |
Read several bytes from the slave via I2C.
This functions is used to read from a slave on the I2C bus. It needs the address of the slave, the required command (see rgb-led-lighting-shield-reg.hpp), a pointer to the data buffer, where the received data is stored and the length of the data buffer that should be sent.
[in] | addr | Address of the slave device. |
[in] | command | Command to read out the board. |
[in,out] | data | Pointer to a buffer where the received data is stored. |
[in] | length | Number of bytes to read. |
Implements rgbShield::I2CPAL.
|
virtual |
Read two byte (an unsigned int16) from the I2C slave.
This function is used to read two byte from the I2C slave. It requires the address of the slave, the command of what should be read (see rgb-led-lighting-shield-reg.hpp) and a pointer to an uint16 variable where the received data is stored.
[in] | addr | Address of the slave device. |
[in] | command | Command to read out the board. |
[in,out] | data | Pointer to an uint16 variable to store the received data. |
Implements rgbShield::I2CPAL.
|
virtual |
Write several bytes to the I2C slave.
This functions is used to write several bytes to an I2C slave. It needs the address of the I2C slave, the write command (see rgb-led-lighting-shield-reg.hpp), the pointer to data buffer which should be sent and the length of the data buffer.
[in] | addr | Address of the I2C slave device. |
[in] | command | Command to write to the board. |
[in] | data | Pointer to the data buffer that should be written to the slave. |
[in] | length | Number of bytes that should be written. |
Implements rgbShield::I2CPAL.
|
virtual |
Write two bytes to the I2C slave.
This function is used to write two bytes (an unsigned int16) to the slave device. It needs the address of the slave device, the write command (see rgb-led-lighting-shield-reg.hpp) and the data that should be sent.
[in] | addr | Address of the I2C slave device. |
[in] | command | Command to write to the board. |
[in] | data | Data which should be written to the slave. |
Implements rgbShield::I2CPAL.
|
virtual |
Write to the slave via DMX.
This function is used to write to the slave device via the DMX-Standard. It needs the address of the slave and the command (see rgb-led-lighting-shield-reg.hpp) of what should be written to the slave.
[in] | addr | Address of the slave device |
[in] | command | Write command |
Implements rgbShield::I2CPAL.