YAHAL
Yet Another Hardware Abstraction Library
Loading...
Searching...
No Matches
boostxl_eduMKII_base.h
1// This file defines a generic interface to
2// the functionality of a BOOSTXL-EDU MKII board.
3
4#ifndef _BOOSTXL_EDUMKII_BASE_H_
5#define _BOOSTXL_EDUMKII_BASE_H_
6
7#include "gpio_interface.h"
8#include "spi_interface.h"
9#include "i2c_interface.h"
10#include "adc_interface.h"
11
13
15 : need_buttons(false),
16 need_led_rgb(false),
17 need_buzzer(false),
18 need_gator(false),
19 need_servo(false),
20 need_lcd(false),
21 need_i2c(false),
22 need_joystick(false),
23 need_microphone(false),
24 need_accelerometer(false),
25
26 _button1(nullptr),
27 _button2(nullptr),
28 _led_red(nullptr),
29 _led_green(nullptr),
30 _led_blue(nullptr),
31 _buzzer(nullptr),
32 _gator(nullptr),
33 _servo(nullptr),
34 _lcd_spi(nullptr),
35 _lcd_cs(nullptr),
36 _lcd_rst(nullptr),
37 _lcd_dc(nullptr),
38 _sensor_i2c(nullptr),
39 _opt3001_int(nullptr),
40 _tmp006_int(nullptr),
41 _joy_x(nullptr),
42 _joy_y(nullptr),
43 _joy_button(nullptr),
44 _mic(nullptr),
45 _acc_x(nullptr),
46 _acc_y(nullptr),
47 _acc_z(nullptr)
48 {
49 }
50
51 bool need_buttons;
52 bool need_led_rgb;
53 bool need_buzzer;
54 bool need_gator;
55 bool need_servo;
56 bool need_lcd;
57 bool need_i2c;
58 bool need_joystick;
59 bool need_microphone;
60 bool need_accelerometer;
61
62 gpio_interface & button1();
63 gpio_interface & button2();
64 gpio_interface & led_red();
65 gpio_interface & led_green();
66 gpio_interface & led_blue();
67 gpio_interface & buzzer();
68 gpio_interface & gator();
69 gpio_interface & servo();
70 spi_interface & lcd_spi();
71 gpio_interface & lcd_cs();
72 gpio_interface & lcd_rst();
73 gpio_interface & lcd_dc();
74 i2c_interface & sensor_i2c();
75 gpio_interface & opt3001_int();
76 gpio_interface & tmp006_int();
77 adc_channel & joy_x();
78 adc_channel & joy_y();
79 gpio_interface & joy_button();
80 adc_channel & mic();
81 adc_channel & acc_x();
82 adc_channel & acc_y();
83 adc_channel & acc_z();
84
85protected:
86 gpio_interface * _button1;
87 gpio_interface * _button2;
88 gpio_interface * _led_red;
89 gpio_interface * _led_green;
90 gpio_interface * _led_blue;
91 gpio_interface * _buzzer;
92 gpio_interface * _gator;
93 gpio_interface * _servo;
94 spi_interface * _lcd_spi;
95 gpio_interface * _lcd_cs;
96 gpio_interface * _lcd_rst;
97 gpio_interface * _lcd_dc;
98 i2c_interface * _sensor_i2c;
99 gpio_interface * _opt3001_int;
100 gpio_interface * _tmp006_int;
101 adc_channel * _joy_x;
102 adc_channel * _joy_y;
103 gpio_interface * _joy_button;
104 adc_channel * _mic;
105 adc_channel * _acc_x;
106 adc_channel * _acc_y;
107 adc_channel * _acc_z;
108};
109
110#endif // _BOOSTXL_EDUMKII_BASE_H_