forked from awonak/libModulove
-
Notifications
You must be signed in to change notification settings - Fork 0
/
arythmatik.h
48 lines (37 loc) · 1.26 KB
/
arythmatik.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
#ifndef ARYTHMATIK_H
#define ARYTHMATIK_H
#include <Arduino.h>
// Oled setting
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <EEPROM.h>
#include <Wire.h>
#include "arythmatik_peripherials.h"
#include "digital_input.h"
#include "digital_output.h"
#include "encoder.h"
namespace modulove {
/// @brief Hardware abstraction wrapper for A-RYTH-MATIK module.
class Arythmatik {
public:
/// @brief Constructor
Arythmatik() :
display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1) {}
/// @brief Deconstructor
~Arythmatik() {}
/// @brief Initializes the Arduino, and A-RYTH-MATIK hardware.
void Init();
/// @brief Read the state of the CLK and RST inputs.
void ProcessInputs();
Adafruit_SSD1306 display; ///< OLED display object.
Encoder encoder; ///< Rotary encoder switch object.
DigitalOutput outputs[arythmatik::OUTPUT_COUNT]; ///< An array containing each Output object.
DigitalInput clk; ///< CLK Digital Input object.
DigitalInput rst; ///< RST Digital Input object.
private:
void InitDisplay();
void InitInputs();
void InitOutputs();
};
} // namespace modulove
#endif