22 #ifndef APA102_HAL_PLATFORM
32 #define APA102_HAL_PLATFORM avr0
35 #ifndef APA102_NUMBER_OF_LEDS
45 #define APA102_NUMBER_OF_LEDS 1
48 #ifndef APA102_FRAME_SIZE
58 #define APA102_FRAME_SIZE 4
61 #ifndef APA102_START_FLAG
69 #define APA102_START_FLAG 0xE0
72 #ifndef APA102_SOF_VALUE
80 #define APA102_SOF_VALUE 0x00
83 #ifndef APA102_EOF_VALUE
91 #define APA102_EOF_VALUE 0xFF
94 #ifndef APA102_MIN_INTENSITY
102 #define APA102_MIN_INTENSITY 0x01
105 #ifndef APA102_MAX_INTENSITY
113 #define APA102_MAX_INTENSITY 0x1F
116 #ifndef APA102_POWER_SAVING_AVAILABLE
127 #define APA102_POWER_SAVING_AVAILABLE
130 #ifndef APA102_ENABLE_FLAG
138 #define APA102_ENABLE_FLAG 0xE0
141 #ifndef APA102_SLEEP_FLAG
149 #define APA102_SLEEP_FLAG 0xA0
156 #include _STR(../../../hal/APA102_HAL_PLATFORM/spi/spi.h)
183 #define APA102_SOF() { apa102_xof(APA102_Transmission_SOF); }
192 #define APA102_EOF() { apa102_xof(APA102_Transmission_EOF); }
void apa102_leds_off(void)
Disable all LEDs by sending sleep commands (if supported) and turning off the SPI peripheral.
Definition apa102.c:154
#define APA102_SOF_VALUE
Defines the start-of-frame marker value for LED data transmission.
Definition apa102.h:80
#define APA102_EOF_VALUE
Defines the end-of-frame marker value for LED data transmission.
Definition apa102.h:91
void apa102_xof(APA102_Transmission type)
Transmit a specified value repeatedly over SPI to form a data frame.
Definition apa102.c:63
void apa102_init(void)
Initialize the LED control interface and hardware.
Definition apa102.c:42
void apa102_led_off(void)
Send an LED data frame to a single LED to turn it off.
Definition apa102.c:135
APA102_Transmission_t
Enumerates possible LED frame types for APA102 LED strips.
Definition apa102.h:166
@ APA102_Transmission_SOF
Definition apa102.h:167
@ APA102_Transmission_EOF
Definition apa102.h:168
enum APA102_Transmission_t APA102_Transmission
Alias for enum APA102_Transmission_t representing possible APA102 transmission types.
Definition apa102.h:174
void apa102_leds(const GFX_RGBA_Color *color)
Send an LED data frame to all LEDs with specified color and intensity.
Definition apa102.c:108
void apa102_led(const GFX_RGBA_Color *color)
Send an LED data frame with specified color and intensity.
Definition apa102.c:87
Header file defining basic structures for color and intensity data.
struct GFX_RGBA_Color_t GFX_RGBA_Color
Definition color.h:59
Helper macros for stringification in C preprocessor.