summaryrefslogtreecommitdiff
path: root/src/usbh_driver_ac_midi_private.h
blob: b92ee9744fe9a77d5d2f2c3140f110f1d200dc7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * This file is part of the libusbhost library
 * hosted at http://github.com/libusbhost/libusbhost
 *
 * Copyright (C) 2016 Amir Hammad <amir.hammad@hotmail.com>
 *
 *
 * 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 <http://www.gnu.org/licenses/>.
 *
 */

#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 <stdint.h>


#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