-
-
Notifications
You must be signed in to change notification settings - Fork 40
/
gem_led_animation.h
45 lines (36 loc) · 1.07 KB
/
gem_led_animation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Copyright (c) 2021 Alethea Katherine Flowers.
Published under the standard MIT License.
Full text available at: https://opensource.org/licenses/MIT
*/
#pragma once
#include "fix16.h"
#include "gem_dotstar.h"
#include "gem_mode.h"
#include "wntr_ramfunc.h"
#include <stdbool.h>
/* Routines for animating the LEDs on Gemini's front panel. */
#define GEM_MAX_DOTSTAR_COUNT 8
struct GemLEDCfg {
uint32_t hue_offsets[GEM_MAX_DOTSTAR_COUNT];
size_t vertical_pos_index[GEM_MAX_DOTSTAR_COUNT];
size_t lfo_tweak_led;
size_t pitch_a_tweak_led;
size_t pitch_b_tweak_led;
size_t pwm_a_led;
size_t pwm_b_led;
size_t fm_a_led;
size_t fm_b_led;
};
extern struct GemLEDInputs {
fix16_t lfo_amplitude;
fix16_t lfo_gain;
uint16_t lfo_mod_a;
uint16_t lfo_mod_b;
uint16_t pitch_tweak_a;
uint16_t pitch_tweak_b;
bool tweaking;
} gem_led_inputs;
void gem_led_animation_init(const struct GemLEDCfg cfg);
bool gem_led_animation_step(const struct GemDotstarCfg* dotstar) RAMFUNC;
void gem_led_animation_set_mode(enum GemMode mode);