@@ -64,6 +64,37 @@ class Serial_ : public Stream
64
64
};
65
65
extern Serial_ SerialUSB;
66
66
67
+
68
+ // Gurbrinder: Midi Interface
69
+ // ================================================================================
70
+ // ================================================================================
71
+ // MIDI USB class
72
+
73
+ typedef struct
74
+ {
75
+ uint8_t header;
76
+ uint8_t byte1;
77
+ uint8_t byte2;
78
+ uint8_t byte3;
79
+ }midiEventPacket_t;
80
+
81
+ class MIDI_
82
+ {
83
+ private:
84
+ RingBuffer *_midi_rx_buffer;
85
+ public:
86
+ void begin ();
87
+
88
+ virtual uint32_t available (void );
89
+ virtual void accept (void );
90
+ virtual midiEventPacket_t read (void );
91
+ virtual void flush (void );
92
+ virtual void sendMIDI (midiEventPacket_t event);
93
+ virtual size_t write (const uint8_t *buffer, size_t size);
94
+ operator bool ();
95
+ };
96
+ extern MIDI_ MidiUSB;
97
+
67
98
// ================================================================================
68
99
// ================================================================================
69
100
// Mouse
@@ -196,6 +227,15 @@ int CDC_GetOtherInterface(uint8_t* interfaceNum);
196
227
int CDC_GetDescriptor (int i);
197
228
bool CDC_Setup (Setup& setup);
198
229
230
+ // ================================================================================
231
+ // ================================================================================
232
+ // MIDI 'Driver'
233
+
234
+ int MIDI_GetInterface (uint8_t * interfaceNum);
235
+ int MIDI_GetOtherInterface (uint8_t * interfaceNum);
236
+ int MIDI_GetDescriptor (int i);
237
+ bool MIDI_Setup (Setup& setup);
238
+
199
239
// ================================================================================
200
240
// ================================================================================
201
241
0 commit comments