upm  0.5.1
Sensor/Actuator repository for libmraa (v0.9.1)
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups Pages
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
MY9221 Class Reference

Public Member Functions

 MY9221 (uint8_t dataPin, uint8_t clockPin, int instances=1)
 
 ~MY9221 ()
 
void setAutoRefresh (bool enable)
 
void setLED (int led, bool on)
 
void setLowIntensityValue (int intensity)
 
void setHighIntensityValue (int intensity)
 
void setAll ()
 
void clearAll ()
 
void refresh ()
 

Static Public Attributes

static const int LEDS_PER_INSTANCE = 12
 

Protected Member Functions

virtual void lockData ()
 
virtual void send16bitBlock (uint16_t data)
 

Protected Attributes

bool m_autoRefresh
 
uint16_t m_lowIntensity
 
uint16_t m_highIntensity
 
unsigned int m_instances
 
uint16_t * m_bitStates
 
uint16_t m_commandWord
 
mraa::Gpio m_gpioClk
 
mraa::Gpio m_gpioData
 

Constructor & Destructor Documentation

MY9221 ( uint8_t  dataPin,
uint8_t  clockPin,
int  instances = 1 
)

Instantiates an MY9221 object

Parameters
dataPinData pin
clockPinClock pin
instancesNumber of daisy-chained my9221s, default 1

Here is the call graph for this function:

~MY9221 ( )

MY9221 destructor

Here is the call graph for this function:

Member Function Documentation

void setAutoRefresh ( bool  enable)
inline

Enable or disable auto refresh. When auto refresh is enabled, update the LED display as soon as the internal state changes. When false, the display(s) will not be updated until the refresh() method is called.

Parameters
enabletrue to enable auto refresh, false otherwise

Here is the caller graph for this function:

void setLED ( int  led,
bool  on 
)

Set an LED to a specific on (high intensity) or off (low intensity) value.

Parameters
ledThe LED whose state you wish to change
ontrue to turn on the LED, false to turn the LED off

Here is the call graph for this function:

void setLowIntensityValue ( int  intensity)

Set the greyscale intensity of an LED in the OFF state. The intensity is a value from 0 (fully off) to 255 (fully on). This will take effect on any future LED set or clear operations.

Parameters
intensitya value from 0 (fully off) to 255 (fully on)

Here is the caller graph for this function:

void setHighIntensityValue ( int  intensity)

Set the greyscale intensity of an LED in the ON state. The intensity is a value from 0 (fully off) to 255 (fully on). This will take effect on any future LED set or clear operations.

Parameters
intensitya value from 0 (fully off) to 255 (fully on)

Here is the caller graph for this function:

void setAll ( )

Set all of the LEDS to the ON (high intensity value) state.

Here is the call graph for this function:

void clearAll ( )

Set all of the LEDS to the OFF (low intensity value) state.

Here is the call graph for this function:

Here is the caller graph for this function:

void refresh ( )

Set the LED states to match the internal stored states. This is useful when auto refresh (setAutoRefresh()) is false to update the display.

Here is the caller graph for this function:

Inheritance diagram for MY9221:
Inheritance graph
[legend]

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