My Project
I2CPALPSoC Class Reference

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

Inheritance diagram for I2CPALPSoC:
Collaboration diagram for I2CPALPSoC:

Public Member Functions

 I2CPALPSoC ()
 Constructor of the IC2-Class for PSoC. More...
 
 ~I2CPALPSoC ()
 Destructor of the PSoC 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

◆ I2CPALPSoC()

I2CPALPSoC::I2CPALPSoC ( )

Constructor of the IC2-Class for PSoC.

This is the default constructor of the I2C-Class for PSoC.

◆ ~I2CPALPSoC()

I2CPALPSoC::~I2CPALPSoC ( )

Destructor of the PSoC I2C-Class.

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

Member Function Documentation

◆ init()

Error_t I2CPALPSoC::init ( )

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

◆ deinit()

Error_t I2CPALPSoC::deinit ( )

Deinitialize the I2C bus.

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

Returns
Error_t

◆ setClockFreq()

Error_t I2CPALPSoC::setClockFreq ( uint32_t  clockHz)

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

◆ read() [1/2]

Error_t I2CPALPSoC::read ( uint16_t  addr,
uint8_t  command,
uint16_t *  data,
uint16_t  length 
)

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

◆ read() [2/2]

Error_t I2CPALPSoC::read ( uint16_t  addr,
uint8_t  command,
uint16_t *  data 
)

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

◆ write() [1/2]

Error_t I2CPALPSoC::write ( uint16_t  addr,
uint8_t  command,
uint16_t *  data,
uint16_t  length 
)

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

◆ write() [2/2]

Error_t I2CPALPSoC::write ( uint16_t  addr,
uint8_t  command,
uint16_t  data 
)

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

◆ writeDMX()

Error_t I2CPALPSoC::writeDMX ( uint16_t  addr,
uint8_t  command 
)

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

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