My Project
rgb-led-lighting-shield-pal-i2c-psoc.hpp
Go to the documentation of this file.
1 
10 #ifndef RGB_LED_LIGHTING_SHIELD_PAL_I2C_PSOC_HPP_
11 #define RGB_LED_LIGHTING_SHIELD_PAL_I2C_PSOC_HPP_
12 
14 
15 #if (RGB_LED_LIGHTING_SHIELD_FRAMEWORK == RGB_LED_LIGHTING_SHIELD_FRMWK_PSOC6)
16 
19 #include "cy_pdl.h"
20 #include "cyhal.h"
21 #include "cybsp.h"
22 #include "cy_retarget_io.h"
23 #include "string.h"
24 
30 using namespace ledDali;
31 
32 class I2CPALPSoC : virtual public I2CPAL
33 {
34  public:
35  I2CPALPSoC();
36  ~I2CPALPSoC();
37  Error_t init();
38  Error_t deinit();
39  Error_t setClockFreq(uint32_t clockHz);
40  Error_t read(uint16_t addr, uint8_t command, uint16_t *data, uint16_t length);
41  Error_t read(uint16_t addr, uint8_t command, uint16_t *data);
42  Error_t write(uint16_t addr, uint8_t command, uint16_t *data, uint16_t length);
43  Error_t write(uint16_t addr, uint8_t command, uint16_t data);
44  Error_t writeDMX(uint16_t addr, uint8_t command);
45 
46  private:
47  void convertData(uint8_t command, uint16 *buffer, uint16_t length, uint8_t *result);
48  uint16_t _i2cFreq = 100000;
49  cyhal_i2c_t _I2C;
50  cyhal_i2c_cfg_t _I2C_cfg;
51 };
52 
57 #endif
58 #endif
rgbShield::INVALID_CONFIG_ERROR
@ INVALID_CONFIG_ERROR
Definition: rgb-led-lighting-shield-types.hpp:37
I2CPALPSoC::deinit
Error_t deinit()
Deinitialize the I2C bus.
Definition: rgb-led-lighting-shield-pal-i2c-psoc.cpp:77
I2CPALPSoC::I2CPALPSoC
I2CPALPSoC()
Constructor of the IC2-Class for PSoC.
Definition: rgb-led-lighting-shield-pal-i2c-psoc.cpp:20
rgb-led-lighting-shield-conf.hpp
RGB LED LIGHTING SHIELD Library Configuration.
I2CPALPSoC::writeDMX
Error_t writeDMX(uint16_t addr, uint8_t command)
Write to the slave via DMX.
Definition: rgb-led-lighting-shield-pal-i2c-psoc.cpp:284
rgbShield::OK
@ OK
Definition: rgb-led-lighting-shield-types.hpp:28
I2CPALPSoC::init
Error_t init()
Initialization of the I2C bus.
Definition: rgb-led-lighting-shield-pal-i2c-psoc.cpp:44
I2CPALPSoC::setClockFreq
Error_t setClockFreq(uint32_t clockHz)
Set the clock frequency of the I2C bus.
Definition: rgb-led-lighting-shield-pal-i2c-psoc.cpp:96
rgb-led-lighting-shield-pal-i2c-psoc.hpp
RGB LED LIGHTING SHIELD I2C Platform Abstraction Layer PSoC.
I2CPALPSoC::read
Error_t read(uint16_t addr, uint8_t command, uint16_t *data, uint16_t length)
Read several bytes from the slave via I2C.
Definition: rgb-led-lighting-shield-pal-i2c-psoc.cpp:126
I2CPALPSoC
Definition: rgb-led-lighting-shield-pal-i2c-psoc.hpp:32
rgb-led-lighting-shield-pal-i2c.hpp
RGB LED LIGHTING SHIELD I2C Platform Abstraction Layer.
rgbShield::COMM_ERROR
@ COMM_ERROR
Definition: rgb-led-lighting-shield-types.hpp:33
I2CPALPSoC::write
Error_t write(uint16_t addr, uint8_t command, uint16_t *data, uint16_t length)
Write several bytes to the I2C slave.
Definition: rgb-led-lighting-shield-pal-i2c-psoc.cpp:217
rgb-led-lighting-shield-reg.hpp
RGB LED LIGHTING SHIELD Library Registers.
rgbShield::Error_t
Error_t
Error List.
Definition: rgb-led-lighting-shield-types.hpp:26
I2CPALPSoC::~I2CPALPSoC
~I2CPALPSoC()
Destructor of the PSoC I2C-Class.
Definition: rgb-led-lighting-shield-pal-i2c-psoc.cpp:31