From 2963113e8ee24e3c002cc4856af8508e05ee6e72 Mon Sep 17 00:00:00 2001 From: Amir Hammad Date: Mon, 20 Jun 2016 22:34:32 +0200 Subject: Merged usb midi code into current libusbmaster + merge fixes Signed-off-by: Amir Hammad --- src/usbh_driver_ac_midi_private.h | 52 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/usbh_driver_ac_midi_private.h (limited to 'src/usbh_driver_ac_midi_private.h') diff --git a/src/usbh_driver_ac_midi_private.h b/src/usbh_driver_ac_midi_private.h new file mode 100644 index 0000000..b92ee97 --- /dev/null +++ b/src/usbh_driver_ac_midi_private.h @@ -0,0 +1,52 @@ +/* + * This file is part of the libusbhost library + * hosted at http://github.com/libusbhost/libusbhost + * + * Copyright (C) 2016 Amir Hammad + * + * + * libusbhost is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library. If not, see . + * + */ + +#ifndef USBH_DRIVER_AC_MIDI_PRIVATE_ +#define USBH_DRIVER_AC_MIDI_PRIVATE_ + +#include "driver/usbh_device_driver.h" +#include "usbh_driver_ac_midi.h" + +#include + + +#define MIDI_INITIAL_DELAY (100000) + +struct _midi_device { + usbh_device_t *usbh_device; + uint8_t buffer[USBH_AC_MIDI_BUFFER]; + uint16_t endpoint_in_maxpacketsize; + uint16_t endpoint_out_maxpacketsize; + uint8_t endpoint_in_address; + uint8_t endpoint_out_address; + uint8_t state; + uint8_t endpoint_in_toggle; + uint8_t endpoint_out_toggle; + uint8_t device_id; + bool sending; + midi_write_callback_t write_callback_user; + usbh_packet_t write_packet; + // Timestamp at sending config command + uint32_t time_us_config; +}; +typedef struct _midi_device midi_device_t; +#endif -- cgit