forked from Builty/TonexOneController
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusb_comms.h
More file actions
75 lines (59 loc) · 1.76 KB
/
usb_comms.h
File metadata and controls
75 lines (59 loc) · 1.76 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
Copyright (C) 2024 Greg Smith
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef _USB_COMMS_H
#define _USB_COMMS_H
#ifdef __cplusplus
extern "C" {
#endif
#define IK_MULTIMEDIA_USB_VENDOR 0x1963
#define TONEX_ONE_PRODUCT_ID 0x00D1
#define TONEX_PRODUCT_ID 0x0068
// Amp Modeller types
enum AmpModellers
{
AMP_MODELLER_NONE,
AMP_MODELLER_TONEX_ONE,
AMP_MODELLER_TONEX, // full size pedal with 3 footswitches
};
enum USB_Commands
{
USB_COMMAND_SET_PRESET,
USB_COMMAND_MODIFY_PARAMETER,
USB_COMMAND_LOAD_PRESET_TO_SLOT_A,
USB_COMMAND_LOAD_PRESET_TO_SLOT_B
};
typedef struct
{
usb_host_client_handle_t client_hdl;
uint8_t dev_addr;
usb_device_handle_t dev_hdl;
uint32_t actions;
} class_driver_t;
typedef struct
{
uint8_t Command;
uint32_t Payload;
float PayloadFloat;
} tUSBMessage;
void init_usb_comms(void);
// thread safe public API
void usb_set_preset(uint32_t preset);
void usb_modify_parameter(uint16_t index, float value);
void usb_load_preset_to_slot_a(uint32_t preset);
void usb_load_preset_to_slot_b(uint32_t preset);
uint8_t usb_get_max_presets_for_connected_modeller(void);
uint8_t usb_get_first_preset_index_for_connected_modeller(void);
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif