OLE Developer Guide  Latest Git
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
SPI Pixel Controller

Detailed Description

Control RGB Pixels using SPI.

This only supports the LPD8806 chip for now. We're happy to accept pull requests adding support for different pixel types.

Files

file  spi_rgb.h
 Control RGB Pixels using SPI.
 

Data Structures

struct  SPIRGBConfiguration
 SPI RGB Module configuration. More...
 

Enumerations

enum  RGB_Color { RED = 0, GREEN = 1, BLUE = 2 }
 RGB color values.
 

Functions

void SPIRGB_Init (const SPIRGBConfiguration *config)
 Initialize the SPI RGB module. More...
 
void SPIRGB_BeginUpdate ()
 Begin a frame update. More...
 
void SPIRGB_SetPixel (uint16_t index, RGB_Color color, uint8_t value)
 Set the value of a pixel. More...
 
void SPIRGB_CompleteUpdate ()
 Complete a frame update. More...
 
void SPIRGB_Tasks ()
 Perform the periodic SPI RGB tasks. More...
 

Function Documentation

void SPIRGB_BeginUpdate ( )

Begin a frame update.

This pauses the SPI sending task.

void SPIRGB_CompleteUpdate ( )

Complete a frame update.

This unpauses the SPI sending task. The frame will be sent on the next call to SPIRGB_Tasks().

void SPIRGB_Init ( const SPIRGBConfiguration config)

Initialize the SPI RGB module.

Parameters
configThe configuration to use.
void SPIRGB_SetPixel ( uint16_t  index,
RGB_Color  color,
uint8_t  value 
)

Set the value of a pixel.

Parameters
indexThe pixel offset
colorThe pixel color
valueThe new value for the pixel
void SPIRGB_Tasks ( )

Perform the periodic SPI RGB tasks.

This should be called in the main event loop.