My Project
I2CPALIno Class Reference

#include <rgb-led-lighting-shield-pal-i2c-ino.hpp>

Inheritance diagram for I2CPALIno:
Collaboration diagram for I2CPALIno:

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...
 

Constructor & Destructor Documentation

◆ I2CPALIno()

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.

Parameters
[in]wirePointer to the TwoWire-Class.

◆ ~I2CPALIno()

I2CPALIno::~I2CPALIno ( )

Destructor of the Arduino I2C-Class.

This is the destructor of the I2C-Class for Arduino.

Member Function Documentation

◆ init()

Error_t I2CPALIno::init ( )
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.

Returns
Error_t

Implements rgbShield::I2CPAL.

◆ deinit()

Error_t I2CPALIno::deinit ( )
virtual

Deinitialize the I2C bus.

This function is de-initializing the I2C bus. The bus has to be initialized again for further usage.

Returns
Error_t

Implements rgbShield::I2CPAL.

◆ setClockFreq()

Error_t I2CPALIno::setClockFreq ( uint32_t  clockHz)
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.

Parameters
[in]clockHzClock frequency in Hz
Returns
Error_t

Implements rgbShield::I2CPAL.

◆ read() [1/2]

Error_t I2CPALIno::read ( uint16_t  addr,
uint8_t  command,
uint16_t *  data,
uint16_t  length 
)
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.

Parameters
[in]addrAddress of the slave device.
[in]commandCommand to read out the board.
[in,out]dataPointer to a buffer where the received data is stored.
[in]lengthNumber of bytes to read.
Returns
Error_t

Implements rgbShield::I2CPAL.

◆ read() [2/2]

Error_t I2CPALIno::read ( uint16_t  addr,
uint8_t  command,
uint16_t *  data 
)
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.

Parameters
[in]addrAddress of the slave device.
[in]commandCommand to read out the board.
[in,out]dataPointer to an uint16 variable to store the received data.
Returns
Error_t

Implements rgbShield::I2CPAL.

◆ write() [1/2]

Error_t I2CPALIno::write ( uint16_t  addr,
uint8_t  command,
uint16_t *  data,
uint16_t  length 
)
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.

Parameters
[in]addrAddress of the I2C slave device.
[in]commandCommand to write to the board.
[in]dataPointer to the data buffer that should be written to the slave.
[in]lengthNumber of bytes that should be written.
Returns
Error_t

Implements rgbShield::I2CPAL.

◆ write() [2/2]

Error_t I2CPALIno::write ( uint16_t  addr,
uint8_t  command,
uint16_t  data 
)
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.

Parameters
[in]addrAddress of the I2C slave device.
[in]commandCommand to write to the board.
[in]dataData which should be written to the slave.
Returns
Error_t

Implements rgbShield::I2CPAL.

◆ writeDMX()

Error_t I2CPALIno::writeDMX ( uint16_t  addr,
uint8_t  command 
)
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.

Parameters
[in]addrAddress of the slave device
[in]commandWrite command
Returns
Error_t

Implements rgbShield::I2CPAL.


The documentation for this class was generated from the following files: