upload
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

midi_function_types.h 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. * @file
  20. * @brief Function signature definitions
  21. */
  22. #ifndef MIDI_FUNCTION_TYPES_H
  23. #define MIDI_FUNCTION_TYPES_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #include <inttypes.h>
  28. #include <stdbool.h>
  29. //forward declaration
  30. typedef struct _midi_device MidiDevice;
  31. typedef void (* midi_one_byte_func_t)(MidiDevice * device, uint8_t byte);
  32. typedef void (* midi_two_byte_func_t)(MidiDevice * device, uint8_t byte0, uint8_t byte1);
  33. typedef void (* midi_three_byte_func_t)(MidiDevice * device, uint8_t byte0, uint8_t byte1, uint8_t byte2);
  34. //all bytes after count bytes should be ignored
  35. typedef void (* midi_var_byte_func_t)(MidiDevice * device, uint16_t count, uint8_t byte0, uint8_t byte1, uint8_t byte2);
  36. //the start byte tells you how far into the sysex message you are, the data_length tells you how many bytes data is
  37. typedef void (* midi_sysex_func_t)(MidiDevice * device, uint16_t start_byte, uint8_t data_length, uint8_t *data);
  38. #ifdef __cplusplus
  39. }
  40. #endif
  41. #endif