]> git.donarmstrong.com Git - qmk_firmware.git/blob - tmk_core/protocol/midi/midi_function_types.h
Extended the hint of the programmer to link to the relevant README part instead of...
[qmk_firmware.git] / tmk_core / protocol / midi / midi_function_types.h
1 //midi for embedded chips,
2 //Copyright 2010 Alex Norman
3 //
4 //This file is part of avr-midi.
5 //
6 //avr-midi is free software: you can redistribute it and/or modify
7 //it under the terms of the GNU General Public License as published by
8 //the Free Software Foundation, either version 3 of the License, or
9 //(at your option) any later version.
10 //
11 //avr-midi is distributed in the hope that it will be useful,
12 //but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 //GNU General Public License for more details.
15 //
16 //You should have received a copy of the GNU General Public License
17 //along with avr-midi.  If not, see <http://www.gnu.org/licenses/>.
18
19 /**
20  * @file
21  * @brief Function signature definitions
22  */
23
24 #ifndef MIDI_FUNCTION_TYPES_H
25 #define MIDI_FUNCTION_TYPES_H
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif 
30
31 #include <inttypes.h>
32 #include <stdbool.h>
33
34 //forward declaration
35 typedef struct _midi_device MidiDevice;
36
37 typedef void (* midi_one_byte_func_t)(MidiDevice * device, uint8_t byte);
38 typedef void (* midi_two_byte_func_t)(MidiDevice * device, uint8_t byte0, uint8_t byte1);
39 typedef void (* midi_three_byte_func_t)(MidiDevice * device, uint8_t byte0, uint8_t byte1, uint8_t byte2);
40 //all bytes after count bytes should be ignored
41 typedef void (* midi_var_byte_func_t)(MidiDevice * device, uint16_t count, uint8_t byte0, uint8_t byte1, uint8_t byte2);
42
43 //the start byte tells you how far into the sysex message you are, the data_length tells you how many bytes data is
44 typedef void (* midi_sysex_func_t)(MidiDevice * device, uint16_t start_byte, uint8_t data_length, uint8_t *data);
45
46 #ifdef __cplusplus
47 }
48 #endif 
49
50 #endif