Browse Source

Add comments for USB MIDI 32 bit format data format

main
PaulStoffregen 4 years ago
parent
commit
8a8b9914f9
3 changed files with 20 additions and 0 deletions
  1. +7
    -0
      teensy3/usb_midi.c
  2. +7
    -0
      teensy4/usb_midi.c
  3. +6
    -0
      usb_midi/usb_api.cpp

+ 7
- 0
teensy3/usb_midi.c View File

#endif #endif




// This 32 bit input format is documented in the "Universal Serial Bus Device Class
// Definition for MIDI Devices" specification, version 1.0, Nov 1, 1999. It can be
// downloaded from www.usb.org. https://www.usb.org/sites/default/files/midi10.pdf
// If the USB-IF reorganizes their website and this link no longer works, Google
// search the name to find it. This data format is shown on page 16 in Figure #8.
// Byte 0 (shown on the left hand side of Figure #8) is the least significant byte
// of this 32 bit input.
void usb_midi_write_packed(uint32_t n) void usb_midi_write_packed(uint32_t n)
{ {
uint32_t index, wait_count=0; uint32_t index, wait_count=0;

+ 7
- 0
teensy4/usb_midi.c View File

#define TX_TIMEOUT_MSEC 40 #define TX_TIMEOUT_MSEC 40




// This 32 bit input format is documented in the "Universal Serial Bus Device Class
// Definition for MIDI Devices" specification, version 1.0, Nov 1, 1999. It can be
// downloaded from www.usb.org. https://www.usb.org/sites/default/files/midi10.pdf
// If the USB-IF reorganizes their website and this link no longer works, Google
// search the name to find it. This data format is shown on page 16 in Figure #8.
// Byte 0 (shown on the left hand side of Figure #8) is the least significant byte
// of this 32 bit input.
void usb_midi_write_packed(uint32_t n) void usb_midi_write_packed(uint32_t n)
{ {
printf("usb_midi_write_packed\n"); printf("usb_midi_write_packed\n");

+ 6
- 0
usb_midi/usb_api.cpp View File

} }
} }


// This 4 byte input format is documented in the "Universal Serial Bus Device Class
// Definition for MIDI Devices" specification, version 1.0, Nov 1, 1999. It can be
// downloaded from www.usb.org. https://www.usb.org/sites/default/files/midi10.pdf
// If the USB-IF reorganizes their website and this link no longer works, Google
// search the name to find it. This data format is shown on page 16 in Figure #8.
// Byte 0 (shown on the left hand side of Figure #8) is b0, Byte 1 is b1, etc.
void usb_midi_class::send_raw(uint8_t b0, uint8_t b1, uint8_t b2, uint8_t b3) void usb_midi_class::send_raw(uint8_t b0, uint8_t b1, uint8_t b2, uint8_t b3)
{ {
uint8_t intr_state, timeout; uint8_t intr_state, timeout;

Loading…
Cancel
Save