Debian Codegraph @

src/driver-marsgaming/marsgaming-leds.h

raw symbols SCIP
1 #pragma once
2 #include "stdint.h"
3 #include "libratbag.h"
4
5 #define MARSGAMING_LED_BREATHING_OFF 0
6
7 /*
8 * Colors in Mars Gaming are encoded as the inverse of the value.
9 * That is, a value of 0x00 means fully bright, while 0xFF
10 * means completely dark.
11 */
12 struct marsgaming_led_color {
13 uint8_t red;
14 uint8_t green;
15 uint8_t blue;
16 };
17
18 struct marsgaming_led {
19 struct marsgaming_led_color color;
20 uint8_t brightness;
21 uint8_t breathing_speed;
22 } __attribute__((packed));
23
24 _Static_assert(sizeof(struct marsgaming_led) == 5, "Marsgaming led is not 5 bytes");
25
26 struct ratbag_color
27 marsgaming_led_color_to_ratbag(struct marsgaming_led_color color);