mikroSDK Reference Manual
tusb.h
1
/*
2
* The MIT License (MIT)
3
*
4
* Copyright (c) 2019 Ha Thach (tinyusb.org)
5
*
6
* Permission is hereby granted, free of charge, to any person obtaining a copy
7
* of this software and associated documentation files (the "Software"), to deal
8
* in the Software without restriction, including without limitation the rights
9
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
* copies of the Software, and to permit persons to whom the Software is
11
* furnished to do so, subject to the following conditions:
12
*
13
* The above copyright notice and this permission notice shall be included in
14
* all copies or substantial portions of the Software.
15
*
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
* THE SOFTWARE.
23
*
24
* This file is part of the TinyUSB stack.
25
*/
26
27
#ifndef _TUSB_H_
28
#define _TUSB_H_
29
30
#ifdef __cplusplus
31
extern
"C"
{
32
#endif
33
34
//--------------------------------------------------------------------+
35
// INCLUDE
36
//--------------------------------------------------------------------+
37
#include "common/tusb_common.h"
38
#include "osal/osal.h"
39
#include "common/tusb_fifo.h"
40
41
#include "class/hid/hid.h"
42
43
// BEGIN Added by MikroElektronika
44
#ifdef __PROJECT_MIKROSDK_MIKROE__
45
#include "usb_hw.h"
46
#include "
usb_isr_routines.h
"
47
#endif
48
// END of addition
49
50
//------------- TypeC -------------//
51
#if CFG_TUC_ENABLED
52
#include "typec/usbc.h"
53
#endif
54
55
//------------- HOST -------------//
56
#if CFG_TUH_ENABLED
57
#include "host/usbh.h"
58
59
#if CFG_TUH_HID
60
#include "class/hid/hid_host.h"
61
#endif
62
63
#if CFG_TUH_MSC
64
#include "class/msc/msc_host.h"
65
#endif
66
67
#if CFG_TUH_CDC
68
#include "class/cdc/cdc_host.h"
69
#endif
70
71
#if CFG_TUH_VENDOR
72
#include "class/vendor/vendor_host.h"
73
#endif
74
75
#endif
76
77
//------------- DEVICE -------------//
78
#if CFG_TUD_ENABLED
79
#include "device/usbd.h"
80
81
#if CFG_TUD_HID
82
#include "class/hid/hid_device.h"
83
#endif
84
85
#if CFG_TUD_CDC
86
#include "class/cdc/cdc_device.h"
87
#endif
88
89
#if CFG_TUD_MSC
90
#include "class/msc/msc_device.h"
91
#endif
92
93
#if CFG_TUD_AUDIO
94
#include "class/audio/audio_device.h"
95
#endif
96
97
#if CFG_TUD_VIDEO
98
#include "class/video/video_device.h"
99
#endif
100
101
#if CFG_TUD_MIDI
102
#include "class/midi/midi_device.h"
103
#endif
104
105
#if CFG_TUD_VENDOR
106
#include "class/vendor/vendor_device.h"
107
#endif
108
109
#if CFG_TUD_USBTMC
110
#include "class/usbtmc/usbtmc_device.h"
111
#endif
112
113
#if CFG_TUD_DFU_RUNTIME
114
#include "class/dfu/dfu_rt_device.h"
115
#endif
116
117
#if CFG_TUD_DFU
118
#include "class/dfu/dfu_device.h"
119
#endif
120
121
#if CFG_TUD_ECM_RNDIS || CFG_TUD_NCM
122
#include "class/net/net_device.h"
123
#endif
124
125
#if CFG_TUD_BTH
126
#include "class/bth/bth_device.h"
127
#endif
128
#endif
129
130
131
//--------------------------------------------------------------------+
132
// APPLICATION API
133
//--------------------------------------------------------------------+
134
135
// Initialize device/host stack
136
// Note: when using with RTOS, this should be called after scheduler/kernel is started.
137
// Otherwise it could cause kernel issue since USB IRQ handler does use RTOS queue API.
138
bool
tusb_init(
void
);
139
140
// Check if stack is initialized
141
bool
tusb_inited(
void
);
142
143
// TODO
144
// bool tusb_teardown(void);
145
146
#ifdef __cplusplus
147
}
148
#endif
149
150
#endif
/* _TUSB_H_ */
usb_isr_routines.h
Default MikroE USB ISR.