Go to the source code of this file.
 | 
| apa102_context  | apa102_init (int ledcount, int bus, int cs) | 
|   | 
| void  | apa102_close (apa102_context dev) | 
|   | 
| upm_result_t  | apa102_set_led (apa102_context dev, uint16_t index, uint8_t brightness, uint8_t r, uint8_t g, uint8_t b) | 
|   | 
| upm_result_t  | apa102_set_led_brightness (apa102_context dev, uint16_t index, uint8_t brightness) | 
|   | 
| upm_result_t  | apa102_set_leds (apa102_context dev, uint16_t s_index, uint16_t e_index, uint8_t brightness, uint8_t r, uint8_t g, uint8_t b) | 
|   | 
| upm_result_t  | apa102_set_leds_brightness (apa102_context dev, uint16_t s_index, uint16_t e_index, uint8_t brightness) | 
|   | 
| upm_result_t  | apa102_refresh (apa102_context dev) | 
|   | 
Instantiates a new APA102 LED Strip
- Parameters
 - 
  
    | ledcount | Number of LEDs on the strip  | 
    | bus | SPI bus to use  | 
    | cs | Pin to use for chip select. -1 if not used.  | 
  
   
- Returns
 - an initialized apa102 context on success, NULL on error. 
 
 
 
APA102 close function
- Parameters
 - 
  
    | dev | The apa102_context to close  | 
  
   
 
 
      
        
          | upm_result_t apa102_set_led  | 
          ( | 
          apa102_context  | 
          dev,  | 
        
        
           | 
           | 
          uint16_t  | 
          index,  | 
        
        
           | 
           | 
          uint8_t  | 
          brightness,  | 
        
        
           | 
           | 
          uint8_t  | 
          r,  | 
        
        
           | 
           | 
          uint8_t  | 
          g,  | 
        
        
           | 
           | 
          uint8_t  | 
          b  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Sets the color and brightness for one LED in the buffer
- Parameters
 - 
  
    | dev | The apa102_context to use  | 
    | index | Index of the LED (0 based)  | 
    | brightness | Brightness value (0-31)  | 
    | r | Red component (0-255)  | 
    | g | Green component (0-255)  | 
    | b | Blue component (0-255)  | 
  
   
- Returns
 - upm_result_t UPM success/error code 
 
 
 
      
        
          | upm_result_t apa102_set_led_brightness  | 
          ( | 
          apa102_context  | 
          dev,  | 
        
        
           | 
           | 
          uint16_t  | 
          index,  | 
        
        
           | 
           | 
          uint8_t  | 
          brightness  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Sets the brightness for one LED in the buffer
- Parameters
 - 
  
    | dev | The apa102_context to use  | 
    | index | Index of the LED (0 based)  | 
    | brightness | Brightness value (0-31)  | 
  
   
- Returns
 - upm_result_t UPM success/error code 
 
 
 
      
        
          | upm_result_t apa102_set_leds  | 
          ( | 
          apa102_context  | 
          dev,  | 
        
        
           | 
           | 
          uint16_t  | 
          s_index,  | 
        
        
           | 
           | 
          uint16_t  | 
          e_index,  | 
        
        
           | 
           | 
          uint8_t  | 
          brightness,  | 
        
        
           | 
           | 
          uint8_t  | 
          r,  | 
        
        
           | 
           | 
          uint8_t  | 
          g,  | 
        
        
           | 
           | 
          uint8_t  | 
          b  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Sets the color and brightness for multiple LEDs in the buffer
- Parameters
 - 
  
    | dev | The apa102_context to use  | 
    | s_index | The start Index of the LED range (0 based)  | 
    | e_index | The end Index of the LED range (0 based)  | 
    | brightness | Brightness value (0-31)  | 
    | r | Red component (0-255)  | 
    | g | Green component (0-255)  | 
    | b | Blue component (0-255)  | 
  
   
- Returns
 - upm_result_t UPM success/error code 
 
 
 
      
        
          | upm_result_t apa102_set_leds_brightness  | 
          ( | 
          apa102_context  | 
          dev,  | 
        
        
           | 
           | 
          uint16_t  | 
          s_index,  | 
        
        
           | 
           | 
          uint16_t  | 
          e_index,  | 
        
        
           | 
           | 
          uint8_t  | 
          brightness  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Sets the brightness for multiple LEDs in the buffer
- Parameters
 - 
  
    | dev | The apa102_context to use  | 
    | s_index | The start Index of the LED range (0 based)  | 
    | e_index | The end Index of the LED range (0 based)  | 
    | brightness | Brightness value (0-31)  | 
  
   
- Returns
 - upm_result_t UPM success/error code 
 
 
 
Writes the buffer to the SPI bus thus updating the LED Strip
- Parameters
 - 
  
    | dev | The apa102_context to use  | 
  
   
- Returns
 - upm_result_t UPM success/error code