|
enum | Register : uint8_t {
DeviceConfig0 = 0x00,
DeviceConfig1 = 0x01,
LedConfig0 = 0x02,
LedConfig1 = 0x03,
BankBrightness = 0x04,
BankAColor = 0x05,
BankBColor = 0x06,
BankCColor = 0x07,
Led0Brightness = 0x08,
Out0Color = 0x14,
Reset = 0x38
} |
|
enum | DeviceConfig0 : uint8_t { ChipEnable = (1 << 6)
} |
|
enum | DeviceConfig1 : uint8_t {
LedGlobalOff = (1 << 0),
HighCurrent = (1 << 1),
PwmDithering = (1 << 2),
AutoIncrement = (1 << 3),
PowerSave = (1 << 4),
LogScale = (1 << 5)
} |
|
enum | LedBankMode : uint16_t {
Led0 = (1 << 0),
Led1 = (1 << 1),
Led2 = (1 << 2),
Led3 = (1 << 3),
Led4 = (1 << 4),
Led5 = (1 << 5),
Led6 = (1 << 6),
Led7 = (1 << 7),
Led8 = (1 << 8),
Led9 = (1 << 9),
Led10 = (1 << 10),
Led11 = (1 << 11)
} |
|
enum | Reset : uint8_t { ResetDevice = 0xff
} |
|
|
| MODM_FLAGS8 (DeviceConfig0) |
|
| MODM_FLAGS8 (DeviceConfig1) |
|
| MODM_FLAGS16 (LedBankMode) |
|
| MODM_FLAGS8 (Reset) |
|
| Lp503x (uint8_t i2cAddress) |
|
modm::ResumableResult< bool > | initialize () |
| Initialize device, call before using any other function.
|
|
modm::ResumableResult< bool > | enable () |
| Enable device.
|
|
modm::ResumableResult< bool > | disable () |
| Disable device.
|
|
modm::ResumableResult< bool > | setConfiguration (DeviceConfig1_t configuration) |
|
modm::ResumableResult< bool > | setChannelBrightness (uint8_t channel, uint8_t value) |
|
modm::ResumableResult< bool > | setChannelBrightnessValues (uint8_t startChannel, const uint8_t *values, uint8_t numChannels) |
|
modm::ResumableResult< bool > | setLedGroupBrightness (uint8_t index, uint8_t value) |
|
modm::ResumableResult< bool > | setBankModeEnabled (LedBankMode_t bankMode) |
|
modm::ResumableResult< bool > | setBankBrightness (uint8_t value) |
|
modm::ResumableResult< bool > | setBankABrightness (uint8_t value) |
|
modm::ResumableResult< bool > | setBankBBrightness (uint8_t value) |
|
modm::ResumableResult< bool > | setBankCBrightness (uint8_t value) |
|
void | attachConfigurationHandler (I2c::ConfigurationHandler handler) |
|
modm::ResumableResult< bool > | ping () |
|
modm::ResumableResult< bool > | read (uint8_t *buffer, std::size_t size) |
| Starts a write transaction and waits until finished.
|
|
void | setAddress (uint8_t address) |
|
modm::ResumableResult< bool > | write (const uint8_t *buffer, std::size_t size) |
| Starts a write transaction and waits until finished.
|
|
modm::ResumableResult< bool > | writeRead (const uint8_t *writeBuffer, std::size_t writeSize, uint8_t *readBuffer, std::size_t readSize) |
| Starts a write-read transaction and waits until finished.
|
|
|
int8_t | getResumableDepth () const |
|
bool | isResumableRunning () const |
|
bool | isTransactionRunning () |
|
modm::ResumableResult< bool > | runTransaction () |
| Starts our own transaction and waits until finished.
|
|
bool | startRead (uint8_t *buffer, std::size_t size) |
| Configures the transaction with a read operation and starts it.
|
|
bool | startTransaction () |
| Starts the transaction with our own transaction object.
|
|
bool | startTransaction (modm::I2cTransaction *transaction) |
| Starts the transaction with a separate transaction object.
|
|
bool | startWrite (const uint8_t *buffer, std::size_t size) |
| Configures the transaction with a write operation and starts it.
|
|
bool | startWriteRead (const uint8_t *writeBuffer, std::size_t writeSize, uint8_t *readBuffer, std::size_t readSize) |
| Configures the transaction with a write/read operation and starts it.
|
|
void | stopResumable () |
|
bool | wasTransactionSuccessful () |
|
template<typename I2cMaster, size_t Channels>
class modm::lp503x< I2cMaster, Channels >
LP5030/LP5036 30/36-channel, 12-bit PWM LED controller
- Template Parameters
-
- Author
- Christopher Durand
template<typename I2cMaster , size_t Channels>
Enable bank mode for a led group. This allows to simultaniously dim multiple RGB leds by accessing the global bank registers.
If bank mode is enabled for a led group (3n, 3n+1, 3n+2) its brightnesses are controlled by the global BankAColor, BankBColor, BankCColor registers and the BankBrightness register. The inidividual channel settings are ignored then.
template<typename I2cMaster , size_t Channels>
Set brightness multiplicator for output channel group (3n, 3n+1, 3n+2). Intended for dimming RGB Leds.
When this feature is not required, this function can be ignored. The default of 0xFF corresponds to full on. Then the resulting LED brightness only depends on the individual channel settings.
This setting has no effect when the LED group is configured in bank mode. Then the value from the BankBrightness register is used.
Default value is 0xFF.
- Parameters
-
value | 8-bit brightness value |