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 = 35, 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 (void)
| 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

enum stripe_transient_t

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

  len | Length of the data array
  *data | Pointer 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

  percent | Heating level (0-100%)

void stripeEffectPulse | ( | stripe_color | color | ) |

Enables pulsing with a given color of the stripe.

Parameters

  color | Effect color

void stripeGetDim | ( | int * | dim | ) |

Reads the current stripe dimmer value.

Parameters

  *dim | Pointer to dimmer variable

void stripeGetRGB | ( | int * | red,
|  | int * | green,
|  | int * | blue
| ) |  |

Reads the current stripe color.

Parameters

  *red | Pointer to red variable
  *green | Pointer to green variable
  *blue | Pointer to blue variable

void stripeGetWhite | ( | int * | white | ) |

Reads the current stripe white value (4th channel)

Parameters

  *white | Pointer to white variable

void stripeInit | ( | void |  | ) |

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

  color | Color struct

void stripeSetDim | ( | int | dim | ) |

Updates the dimmer value of the stripe.

Parameters

  dim | Dimmer value

void stripeSetRGB | ( | int | red,
|  | int | green,
|  | int | blue
| ) |  |

Updates the color of the stripe.

Parameters

  red | Red value (max 255)
  green | Green value (max 255)
  blue | Blue value (max 255)

void stripeSetTransient | ( | stripe_transient_t | transient | ) |

Updates the transient time for the stripe (fading)

Parameters

  transient | Transient time in ticks

void stripeSetWhite | ( | int | white | ) |

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

Parameters

  white | White value

void* stripeThread | ( | void * | threadid | ) |

Thread for the stripe control.

Requests data from other threads or HAL

Parameters

  *threadid | Thread ID

void* stripeTimerHandler | ( | void * | threadid | ) |

This is the handler for time based stripe effects.

Parameters

  *threadid | Thread ID

void stripeUpdate | ( | void |  | ) |

Updates the color data and prepares the stripe command.

void stripeUpdateDim | ( | void |  | ) |

Updates the dimmer value of the stripe.