1 //midi for embedded chips,
2 //Copyright 2010 Alex Norman
4 //This file is part of avr-midi.
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.
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.
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/>.
21 * @brief Function signature definitions
24 #ifndef MIDI_FUNCTION_TYPES_H
25 #define MIDI_FUNCTION_TYPES_H
35 typedef struct _midi_device MidiDevice;
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);
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);