upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Data Structures | Functions | Typedefs
Include dependency graph for p9813.h:

API Description

Go to the source code of this file.

Data Structures

struct  _p9813_context
 

Functions

p9813_context p9813_init (int ledcount, int clk, int data)
 
void p9813_close (p9813_context dev)
 
upm_result_t p9813_set_led (p9813_context dev, uint16_t index, uint8_t r, uint8_t g, uint8_t b)
 
upm_result_t p9813_set_leds (p9813_context dev, uint16_t s_index, uint16_t e_index, uint8_t r, uint8_t g, uint8_t b)
 
upm_result_t p9813_refresh (p9813_context dev)
 

Typedefs

typedef struct _p9813_contextp9813_context
 

Function Documentation

p9813_context p9813_init ( int  ledcount,
int  clk,
int  data 
)

Instantiates a new P9813 Chainable RGB LEDs

Parameters
ledcountNumber of LEDs in the chain
clkClock pin
dataData pin
Returns
an initialized p9813 context on success, NULL on error.

Here is the call graph for this function:

void p9813_close ( p9813_context  dev)

P9813 close function

Parameters
devThe p9813_context to close

Here is the caller graph for this function:

upm_result_t p9813_set_led ( p9813_context  dev,
uint16_t  index,
uint8_t  r,
uint8_t  g,
uint8_t  b 
)

Sets the color for one LED in the buffer

Parameters
devThe p9813_context to use
indexIndex of the LED (0 based)
rRed component (0-255)
gGreen component (0-255)
bBlue component (0-255)
Returns
upm_result_t UPM success/error code

Here is the call graph for this function:

upm_result_t p9813_set_leds ( p9813_context  dev,
uint16_t  s_index,
uint16_t  e_index,
uint8_t  r,
uint8_t  g,
uint8_t  b 
)

Sets the color for multiple LEDs in the buffer

Parameters
devThe p9813_context to use
s_indexThe start Index of the LED range (0 based)
e_indexThe end Index of the LED range (0 based)
rRed component (0-255)
gGreen component (0-255)
bBlue component (0-255)
Returns
upm_result_t UPM success/error code

Here is the caller graph for this function:

upm_result_t p9813_refresh ( p9813_context  dev)

Writes the buffer to the LED controllers thus updating the LEDs

Parameters
devThe p9813_context to use
Returns
upm_result_t UPM success/error code

Typedef Documentation

typedef struct _p9813_context * p9813_context

Device context