File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change 4
4
#include " utility/Adafruit_MAX31865/Adafruit_MAX31865.h"
5
5
#include " utility/Arduino_MKRTHERM/src/MKRTHERM.h"
6
6
#include " utility/ArduinoRS485/src/ArduinoRS485.h"
7
+ #include " utility/QEI/QEI.h"
8
+ #include " utility/ioexpander/TCA6424A.h"
7
9
8
10
#include " mbed.h"
9
11
@@ -138,24 +140,40 @@ extern AnalogOutClass analog_out;
138
140
Use QEI library for mbed since it implements index pin
139
141
*/
140
142
143
+ static QEI _enc_0 (PJ_8, PH_12, PH_11, 0 );
144
+ static QEI _enc_1 (PC_13, PK_1, PJ_10, 0 );
145
+
141
146
class EncoderClass {
142
147
public:
148
+ QEI& operator [](int index) {
149
+ switch (index) {
150
+ case 0 :
151
+ return enc_0;
152
+ case 1 :
153
+ return enc_1;
154
+ }
155
+ }
143
156
private:
157
+ QEI& enc_0 = _enc_0;
158
+ QEI& enc_1 = _enc_1;
144
159
};
145
160
146
161
extern EncoderClass encoders;
147
162
148
163
/*
149
- TODO: writeme
150
164
using gpio expander class https://www.i2cdevlib.com/devices/tca6424a#source
151
165
Ask Giampaolo for proper porting
152
166
Expander interrupt is PI_5
153
167
prog_latch_retry (AKA TERM ? ) is PH_14
168
+
169
+ TODO: check if Wire and address are correct
154
170
*/
155
171
156
- class ProgrammableDIOClass {
172
+ class ProgrammableDIOClass : public TCA6424A {
157
173
public:
174
+ mbed::DigitalOut prog_latch_retry = mbed::DigitalOut(PH_14);
158
175
private:
176
+
159
177
};
160
178
161
179
extern ProgrammableDIOClass programmable_digital_io;
You can’t perform that action at this time.
0 commit comments