LP50XX Driver
V1.0
Library for interaction with the LP5009 and LP5012 LED driver
|
|
Go to the documentation of this file.
17 #define DEFAULT_ADDRESS 0x14
18 #define BROADCAST_ADDRESS 0x0C
57 #define DEVICE_CONFIG0 0x00 // Chip_EN
58 #define DEVICE_CONFIG1 0x01 // Configurations for Log_scale, Power_save, Auto_inc, PWM_dithering, Max_current_option and LED_Global_off
59 #define LED_CONFIG0 0x02 // Contains the BANK configurations
60 #define BANK_BRIGHTNESS 0x03 // Contains the BANK brightness level
61 #define BANK_A_COLOR 0x04 // Contains the BANK A color value
62 #define BANK_B_COLOR 0x05 // Contains the BANK B color value
63 #define BANK_C_COLOR 0x06 // Contains the BANK C color value
64 #define LED0_BRIGHTNESS 0x07 // Contains the brightness level for LED 0
65 #define LED1_BRIGHTNESS 0x08 // Contains the brightness level for LED 1
66 #define LED2_BRIGHTNESS 0x09 // Contains the brightness level for LED 2
67 #define LED3_BRIGHTNESS 0x0A // Contains the brightness level for LED 3 (only on the LP5012)
68 #define OUT0_COLOR 0x0B // Contains the color value for output 0
69 #define OUT1_COLOR 0x0C // Contains the color value for output 1
70 #define OUT2_COLOR 0x0D // Contains the color value for output 2
71 #define OUT3_COLOR 0x0E // Contains the color value for output 3
72 #define OUT4_COLOR 0x0F // Contains the color value for output 4
73 #define OUT5_COLOR 0x10 // Contains the color value for output 5
74 #define OUT6_COLOR 0x11 // Contains the color value for output 6
75 #define OUT7_COLOR 0x12 // Contains the color value for output 7
76 #define OUT8_COLOR 0x13 // Contains the color value for output 8
77 #define OUT9_COLOR 0x14 // Contains the color value for output 9 (only on the LP5012)
78 #define OUT10_COLOR 0x15 // Contains the color value for output 10 (only on the LP5012)
79 #define OUT11_COLOR 0x16 // Contains the color value for output 11 (only on the LP5012)
80 #define RESET_REGISTERS 0x17 // Resets all the registers to their default values
142 uint8_t _i2c_address;
144 uint8_t _enable_pin = 0xFF;
@ MAX_CURRENT_25mA
Definition: LP50XX.h:39
@ RGB
Definition: LP50XX.h:21
LP50XX_Configuration
Definition: LP50XX.h:36
void SetBankColorB(uint8_t value, EAddressType addressType=EAddressType::Normal)
Sets BANK color B related to Output 1,4,7,10.
Definition: LP50XX.cpp:302
@ Broadcast
Definition: LP50XX.h:53
@ PWM_DITHERING_ON
Definition: LP50XX.h:42
@ BRG
Definition: LP50XX.h:26
#define DEFAULT_ADDRESS
Definition: LP50XX.h:17
@ POWER_SAVE_OFF
Definition: LP50XX.h:45
@ LED_2
Definition: LP50XX.h:32
@ LED_1
Definition: LP50XX.h:31
void SetPWMDithering(uint8_t dithering)
Sets the PWM dithering of the device.
Definition: LP50XX.cpp:183
void SetGlobalLedOff(uint8_t value)
Turns all LED outputs ON or OFF.
Definition: LP50XX.cpp:219
void SetBankBrightness(uint8_t brightness, EAddressType addressType=EAddressType::Normal)
Sets the brightness level of the whole BANK.
Definition: LP50XX.cpp:282
void SetOutputColor(uint8_t output, uint8_t value, EAddressType addressType=EAddressType::Normal)
Sets the color level of a single output.
Definition: LP50XX.cpp:386
@ POWER_SAVE_ON
Definition: LP50XX.h:46
@ BGR
Definition: LP50XX.h:23
void SetBankColor(uint8_t red, uint8_t green, uint8_t blue, EAddressType addressType=EAddressType::Normal)
Sets the BANK color according to the set LED configuration SetLEDConfiguration.
Definition: LP50XX.cpp:324
void SetPowerSaving(uint8_t powerSave)
Sets the power saving mode of the device.
Definition: LP50XX.cpp:147
#define BROADCAST_ADDRESS
Definition: LP50XX.h:18
EAddressType
Definition: LP50XX.h:51
@ GBR
Definition: LP50XX.h:25
void ResetRegisters(EAddressType addressType=EAddressType::Normal)
Resets the registers to their original values.
Definition: LP50XX.cpp:105
void Configure(uint8_t configuration, EAddressType addressType=EAddressType::Normal)
Configures the device according to the configuration param.
Definition: LP50XX.cpp:120
@ MAX_CURRENT_35mA
Definition: LP50XX.h:40
void SetMaxCurrentOption(uint8_t option)
Sets the max current option of the device.
Definition: LP50XX.cpp:201
void Begin(uint8_t i2c_address=DEFAULT_ADDRESS)
Initializes the I2C bus and the LP5009 or LP5012.
Definition: LP50XX.cpp:66
Class to communicate with the LP5009 or LP5012.
Definition: LP50XX.h:85
@ LED_GLOBAL_OFF
Definition: LP50XX.h:38
@ LED_3
Definition: LP50XX.h:33
void WriteRegister(uint8_t reg, uint8_t value, EAddressType addressType=EAddressType::Normal)
Writes a value to a specified register.
Definition: LP50XX.cpp:450
@ PWM_DITHERING_OFF
Definition: LP50XX.h:41
void SetI2CAddress(uint8_t address)
Sets the I2C address.
Definition: LP50XX.cpp:257
void SetAutoIncrement(uint8_t autoInc)
Sets the auto increment mode of the device.
Definition: LP50XX.cpp:165
void SetBankColorC(uint8_t value, EAddressType addressType=EAddressType::Normal)
Sets BANK color C related to Output 2,5,8,11.
Definition: LP50XX.cpp:312
@ Normal
Definition: LP50XX.h:52
void SetScaling(uint8_t scaling)
Sets the PWM scaling used by the device.
Definition: LP50XX.cpp:129
@ LOG_SCALE_ON
Definition: LP50XX.h:48
LED_Configuration
Definition: LP50XX.h:20
@ GRB
Definition: LP50XX.h:22
void ReadRegister(uint8_t reg, uint8_t *value)
Reads a value from a specified register.
Definition: LP50XX.cpp:460
void Reset()
Resets the device by using the enable pin if available and resetting the registers.
Definition: LP50XX.cpp:85
@ LED_0
Definition: LP50XX.h:30
@ AUTO_INC_OFF
Definition: LP50XX.h:43
void SetBankControl(uint8_t leds, EAddressType addressType=EAddressType::Normal)
Enables or Disables BANK control for specific LEDs.
Definition: LP50XX.cpp:272
void SetLEDBrightness(uint8_t led, uint8_t brighness, EAddressType addressType=EAddressType::Normal)
Sets the brightness level of a single LED (3 outputs)
Definition: LP50XX.cpp:375
@ AUTO_INC_ON
Definition: LP50XX.h:44
@ LOG_SCALE_OFF
Definition: LP50XX.h:47
LP50XX(void)
This function instantiates the class object.
Definition: LP50XX.cpp:19
LP50XX_LEDS
Definition: LP50XX.h:29
void SetLEDColor(uint8_t led, uint8_t red, uint8_t green, uint8_t blue, EAddressType addressType=EAddressType::Normal)
Sets the LED color according to the set LED configuration SetLEDConfiguration.
Definition: LP50XX.cpp:399
void SetLEDConfiguration(LED_Configuration ledConfiguration)
Sets the LED configuration acording the LED_Configuration enum.
Definition: LP50XX.cpp:248
void SetBankColorA(uint8_t value, EAddressType addressType=EAddressType::Normal)
Sets BANK color A related to Output 0,3,6,9.
Definition: LP50XX.cpp:292
@ LED_GLOBAL_ON
Definition: LP50XX.h:37
void SetEnablePin(uint8_t enablePin)
Sets the enable pin of the device. This pin is used to enable the device in Begin.
Definition: LP50XX.cpp:238
@ RBG
Definition: LP50XX.h:24