CoffeePi
Coffee machine control for Raspberry Pi
Data Structures | Macros | Enumerations | Functions
stripe.h File Reference

Go to the source code of this file.

Data Structures

struct  stripe_color
 

Macros

#define I2C_ADDRESS_STRIPE   0x69
 
#define STRIPE_CMD_SETR   0x01
 
#define STRIPE_CMD_SETG   0x02
 
#define STRIPE_CMD_SETB   0x03
 
#define STRIPE_CMD_SETW   0x04
 
#define STRIPE_CMD_SETDIM   0x05
 
#define STRIPE_CMD_SET   0x06
 
#define STRIPE_CMD_SET2   0x07
 
#define STRIPE_CMD_RESET   0x09
 
#define STRIPE_CMD_FADEOUT   0x0A
 
#define STRIPE_CMD_FADETO   0x0B
 
#define STRIPE_CMD_FADESTOP   0x0C
 

Enumerations

enum  stripe_transient_t { TRANS_DIRECT = 0, TRANS_FAST = 6, TRANS_MEDIUM = 33, TRANS_SLOW = 200 }
 

Functions

void * stripeThread (void *threadid)
 Thread for the stripe control. More...
 
void * stripeTimerHandler (void *threadid)
 This is the handler for time based stripe effects. More...
 
void stripeInit ()
 Initializes i2c communication to stripe controller. More...
 
int stripeCommand (int len, char *data)
 Sends out command data to the stripe controller via i2c. More...
 
void stripeUpdate (void)
 Updates the color data and prepares the stripe command. More...
 
void stripeUpdateDim (void)
 Updates the dimmer value of the stripe. More...
 
void stripeSetRGB (int red, int green, int blue)
 Updates the color of the stripe. More...
 
void stripeSetColor (stripe_color color)
 Updates the color of the stripe. More...
 
void stripeSetTransient (stripe_transient_t transient)
 Updates the transient time for the stripe (fading) More...
 
void stripeSetDim (int dim)
 Updates the dimmer value of the stripe. More...
 
void stripeSetWhite (int white)
 Updates the white value of the stripe (4th channel) More...
 
void stripeOn (void)
 Turns the stripe on (Sets dimmer to 100%) More...
 
void stripeOff (void)
 Turns the stripe on (Sets dimmer to 0%) More...
 
void stripeGetRGB (int *red, int *green, int *blue)
 Reads the current stripe color. More...
 
void stripeGetDim (int *dim)
 Reads the current stripe dimmer value. More...
 
void stripeGetWhite (int *white)
 Reads the current stripe white value (4th channel) More...
 
void stripeEffectDisable (void)
 Stops current running effects. More...
 
void stripeEffectHeating (int percent)
 Sets the stripe to a correspondending color to the heating status. More...
 
void stripeEffectPulse (stripe_color color)
 Enables pulsing with a given color of the stripe. More...
 

Macro Definition Documentation

#define I2C_ADDRESS_STRIPE   0x69
#define STRIPE_CMD_FADEOUT   0x0A
#define STRIPE_CMD_FADESTOP   0x0C
#define STRIPE_CMD_FADETO   0x0B
#define STRIPE_CMD_RESET   0x09
#define STRIPE_CMD_SET   0x06
#define STRIPE_CMD_SET2   0x07
#define STRIPE_CMD_SETB   0x03
#define STRIPE_CMD_SETDIM   0x05
#define STRIPE_CMD_SETG   0x02
#define STRIPE_CMD_SETR   0x01
#define STRIPE_CMD_SETW   0x04

Enumeration Type Documentation

Enumerator
TRANS_DIRECT 
TRANS_FAST 
TRANS_MEDIUM 
TRANS_SLOW 

Function Documentation

int stripeCommand ( int  len,
char *  data 
)

Sends out command data to the stripe controller via i2c.

Parameters
lenLength of the data array
*dataPointer to data array
Returns
Number of failed bytes, 0 if successful
void stripeEffectDisable ( void  )

Stops current running effects.

void stripeEffectHeating ( int  percent)

Sets the stripe to a correspondending color to the heating status.

Parameters
percentHeating level (0-100%)
void stripeEffectPulse ( stripe_color  color)

Enables pulsing with a given color of the stripe.

Parameters
colorEffect color
void stripeGetDim ( int *  dim)

Reads the current stripe dimmer value.

Parameters
*dimPointer to dimmer variable
void stripeGetRGB ( int *  red,
int *  green,
int *  blue 
)

Reads the current stripe color.

Parameters
*redPointer to red variable
*greenPointer to green variable
*bluePointer to blue variable
void stripeGetWhite ( int *  white)

Reads the current stripe white value (4th channel)

Parameters
*whitePointer to white variable
void stripeInit ( )

Initializes i2c communication to stripe controller.

void stripeOff ( void  )

Turns the stripe on (Sets dimmer to 0%)

void stripeOn ( void  )

Turns the stripe on (Sets dimmer to 100%)

void stripeSetColor ( stripe_color  color)

Updates the color of the stripe.

Parameters
colorColor struct
void stripeSetDim ( int  dim)

Updates the dimmer value of the stripe.

Parameters
dimDimmer value
void stripeSetRGB ( int  red,
int  green,
int  blue 
)

Updates the color of the stripe.

Parameters
redRed value (max 255)
greenGreen value (max 255)
blueBlue value (max 255)
void stripeSetTransient ( stripe_transient_t  transient)

Updates the transient time for the stripe (fading)

Parameters
transientTransient time in ticks
void stripeSetWhite ( int  white)

Updates the white value of the stripe (4th channel)

Parameters
whiteWhite value
void* stripeThread ( void *  threadid)

Thread for the stripe control.

Requests data from other threads or HAL

Parameters
*threadidThread ID
void* stripeTimerHandler ( void *  threadid)

This is the handler for time based stripe effects.

Parameters
*threadidThread ID
void stripeUpdate ( void  )

Updates the color data and prepares the stripe command.

void stripeUpdateDim ( void  )

Updates the dimmer value of the stripe.