modm API documentation
modm::is31fl3733< I2cMaster > Class Template Reference

#include <modm/driver/display/is31fl3733.hpp>

Inheritance diagram for modm::is31fl3733< I2cMaster >:
modm::I2cDevice< I2cMaster, 4 > modm::NestedResumable< 10+1 >

Classes

struct  LedData
 

Public Typedefs

using LedBinaryData = uint16_t[SizeX]
 

Public Types

enum  Addr : uint8_t { GND = 0b00, SCL = 0b01, SDA = 0b10, VCC = 0b11 }
 
enum  Register : uint16_t {
  LED_ON_OFF = 0x8000, LED_OPEN = 0x8018, LED_SHORT = 0x8030, PWM = 0x8100,
  AUTO_BREATH_MODE = 0x8200, CONFIGURATION = 0x8300, GLOBAL_CURRENT_CONTROL = 0x8301, ABM_1 = 0x8302,
  ABM_2 = 0x8306, ABM_3 = 0x830A, TIME_UPDATE = 0x830E, SW_PULL_UP = 0x830F,
  CS_PULL_DOWN = 0x8310, RESET = 0x8311, COMMAND = 0xFD, COMMAND_WRITE_LOCK = 0xFE,
  INTERRUPT_MASK = 0xF0, INTERRUPT_STATUS = 0xF1
}
 
enum  Resistor : uint8_t {
  None = 0, kOhm_0_5 = 1, kOhm_1 = 2, kOhm_2 = 3,
  kOhm_4 = 4, kOhm_8 = 5, kOhm_16 = 6, kOhm_32 = 7
}
 

Public Member Functions

 Is31fl3733 (uint8_t address=addr ())
 
bool enable (uint8_t x, uint8_t y)
 
void enableAll ()
 
bool disable (uint8_t x, uint8_t y)
 
void disableAll ()
 
bool setPwm (uint8_t x, uint8_t y, uint8_t pwm)
 
void setAllPwm (uint8_t pwm)
 
LedBinaryData & ledsOpen ()
 
LedBinaryData & ledsShort ()
 
modm::ResumableResult< bool > reset ()
 
modm::ResumableResult< bool > setGlobalCurrent (uint8_t current)
 
modm::ResumableResult< bool > clearSoftwareShutdown ()
 
modm::ResumableResult< bool > setSwPullUp (Resistor value)
 
modm::ResumableResult< bool > setCsPullDown (Resistor value)
 
modm::ResumableResult< bool > triggerOpenShortDetection ()
 
modm::ResumableResult< bool > readOpenShort ()
 
modm::ResumableResult< bool > writeOnOff ()
 
modm::ResumableResult< bool > writePwm ()
 
modm::ResumableResult< bool > writeRegister (Register reg, uint8_t value, uint8_t offset=0)
 
modm::ResumableResult< bool > readRegister (Register reg, uint8_t *const value, uint8_t offset=0)
 
void attachConfigurationHandler (I2c::ConfigurationHandler handler)
 
modm::ResumableResult< bool > ping ()
 
void setAddress (uint8_t address)
 

Static Public Member Functions

static constexpr uint8_t addr (Addr addr2=Addr::GND, Addr addr1=Addr::GND)
 Available I2C addresses.
 

Static Public Attributes

static constexpr uint8_t SizeX {12}
 
static constexpr uint8_t SizeY {16}
 

Protected Member Functions

modm::ResumableResult< bool > setPage (Register reg)
 
modm::ResumableResult< ReturnType > resumable function (...)
 
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 seperate 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 ()
 Force all resumable functions to stop running at the current nesting level.
 
bool wasTransactionSuccessful ()
 

Static Protected Member Functions

static constexpr bool hasPage (Register reg)
 
static constexpr uint8_t getPage (Register reg)
 

Protected Attributes

struct modm::Is31fl3733::LedData modm_packed
 
uint16_t led_open [SizeX]
 
uint16_t led_short [SizeX]
 
LedData data
 
uint8_t current_page {0xff}
 
uint8_t buffer [2]
 
I2cWriteReadTransaction transaction
 

Static Protected Attributes

static constexpr uint8_t LED_ON_OFF_size = 0x18
 
static constexpr uint8_t LED_OPEN_size = LED_ON_OFF_size
 
static constexpr uint8_t LED_SHORT_size = LED_ON_OFF_size
 
static constexpr uint8_t PWM_size = 0xC0
 
static constexpr uint8_t AUTO_BREATH_MODE_size = PWM_size
 

Detailed Description

template<class I2cMaster>
class modm::is31fl3733< I2cMaster >

Author
Niklas Hauser

Member Function Documentation

void modm::I2cDevice< I2cMaster, 10 , I2cWriteReadTransaction >::attachConfigurationHandler ( I2c::ConfigurationHandler  handler)
inheritedinline

Attaches a configuration handler, which is called before a transaction, whenever the configuration has to be changed.

modm::ResumableResult< ReturnType > resumable modm::NestedResumable< 1 >::function (   ...)
inherited

Run the resumable function.

You need to implement this method in you subclass yourself.

Returns
>NestingError if still running, <=NestingError if it has finished.
int8_t modm::NestedResumable< 1 >::getResumableDepth ( ) const
inheritedinline
Returns
the nesting depth in the current resumable function, or -1 if called outside any resumable function
bool modm::NestedResumable< 1 >::isResumableRunning ( ) const
inheritedinline
Returns
true if a resumable function is running at the current nesting level, else false
bool modm::I2cDevice< I2cMaster, 10 , I2cWriteReadTransaction >::isTransactionRunning ( )
inheritedinlineprotected
Returns
true when transaction is busy.
modm::ResumableResult<bool> modm::I2cDevice< I2cMaster, 10 , I2cWriteReadTransaction >::ping ( )
inheritedinline
Return Values
truedevice responds to address
falseno device with address found
void modm::I2cDevice< I2cMaster, 10 , I2cWriteReadTransaction >::setAddress ( uint8_t  address)
inheritedinline

Sets a new address of the slave device.

Parameters
addressthe slave address not yet shifted left (address < 128).
bool modm::I2cDevice< I2cMaster, 10 , I2cWriteReadTransaction >::wasTransactionSuccessful ( )
inheritedinlineprotected
Returns
true when transaction did not return an error.

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