-
Notifications
You must be signed in to change notification settings - Fork 0
/
input.h
executable file
·52 lines (42 loc) · 1.08 KB
/
input.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
46
47
48
49
50
51
52
#include "fixedpoint.h"
#ifndef __INPUT_H
#define __INPUT_H
#define N_POTS 10
enum pots_t {POT_OSC_FREQ,
POT_LFO_DEPTH, POT_LFO_FREQ, POT_RELEASE,
POT_FILTER_FREQ, POT_FILTER_RES, POT_FILTER_SWEEP,
POT_DELAY_WET, POT_DELAY_TIME, POT_DELAY_FB};
typedef struct pot_data_s { // this must be exactly N_POTS
uint16_t osc_frequency;
uint16_t lfo_depth;
uint16_t lfo_frequency;
uint16_t release_time;
uint16_t filter_cutoff;
uint16_t filter_resonance;
uint16_t filter_sweep;
uint16_t delay_wet;
uint16_t delay_time;
uint16_t delay_feedback;
} pot_data_t;
typedef struct sreg_data_s {
uint8_t encoder_data;
uint8_t button_data;
} sreg_data_t;
typedef struct pot_route_s {
uint8_t adc_channel;
uint8_t mux_setting;
} pot_route_t;
class Input {
private:
void _setupAdc ();
uint16_t _readAdc (int channel);
sreg_data_t _readShiftRegister ();
public:
waveform_t osc_waveform;
pot_data_t pot_data;
uint8_t button_state;
Input ();
void update ();
void printPots ();
};
#endif