modm API documentation for SAMD21-MINI
|
#include <modm/driver/pwm/lp503x.hpp>
Public Typedefs | |
using | RegisterValue_t = FlagsGroup< DeviceConfig0_t, DeviceConfig1_t, Reset_t > |
Public Member Functions | |
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. | |
Public Attributes | |
DeviceConfig1_t | DefaultConfiguration |
Protected Member Functions | |
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 () |
Protected Attributes | |
I2cWriteReadTransaction | transaction |
LP5030/LP5036 30/36-channel, 12-bit PWM LED controller
|
inheritedinline |
Attaches a configuration handler, which is called before a transaction, whenever the configuration has to be changed.
|
inheritedinlineprotected |
true
when transaction is busy.
|
inheritedinline |
true | device responds to address |
false | no device with address found |
|
inheritedinline |
Sets a new address of the slave device.
address | the slave address not yet shifted left (address < 128). |
modm::ResumableResult<bool> modm::lp503x< I2cMaster, Channels >::setBankABrightness | ( | uint8_t | value | ) |
Set brightness for all channels 3n configured in bank mode.
modm::ResumableResult<bool> modm::lp503x< I2cMaster, Channels >::setBankBBrightness | ( | uint8_t | value | ) |
Set brightness for all channels 3n+1 configured in bank mode.
modm::ResumableResult<bool> modm::lp503x< I2cMaster, Channels >::setBankBrightness | ( | uint8_t | value | ) |
Set bank brightness multiplicator. This controls all channels in bank mode.
modm::ResumableResult<bool> modm::lp503x< I2cMaster, Channels >::setBankCBrightness | ( | uint8_t | value | ) |
Set brightness for all channels 3n+2 configured in bank mode.
modm::ResumableResult<bool> modm::lp503x< I2cMaster, Channels >::setBankModeEnabled | ( | LedBankMode_t | bankMode | ) |
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.
modm::ResumableResult<bool> modm::lp503x< I2cMaster, Channels >::setChannelBrightness | ( | uint8_t | channel, |
uint8_t | value | ||
) |
Set brightness value for individual output channel.
This writes to the OutXColor registers.
If the LogScale flag is set these values are scaled logithmically to 12 bit pwm duty-cycles (default).
channel | output channel index |
value | 8-bit brightness value |
modm::ResumableResult<bool> modm::lp503x< I2cMaster, Channels >::setChannelBrightnessValues | ( | uint8_t | startChannel, |
const uint8_t * | values, | ||
uint8_t | numChannels | ||
) |
Set brightness values for multiple output channels in one transaction.
This writes the OutXColor registers.
channel | output channel start index |
numChannels | number of values to write |
value | 8-bit brightness value |
modm::ResumableResult<bool> modm::lp503x< I2cMaster, Channels >::setConfiguration | ( | DeviceConfig1_t | configuration | ) |
Set device configuration AutoIncrement is always set
modm::ResumableResult<bool> modm::lp503x< I2cMaster, Channels >::setLedGroupBrightness | ( | uint8_t | index, |
uint8_t | value | ||
) |
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.
value | 8-bit brightness value |
|
inheritedinlineprotected |
true
when transaction did not return an error. DeviceConfig1_t modm::lp503x< I2cMaster, Channels >::DefaultConfiguration |