| 
									
										
										
										
											2021-04-05 16:32:58 -04:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2020-01-14 23:30:39 -05:00
										 |  |  |  * The MIT License (MIT) | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Copyright (c) 2019 Ha Thach (tinyusb.org) | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Permission is hereby granted, free of charge, to any person obtaining a copy | 
					
						
							|  |  |  |  * of this software and associated documentation files (the "Software"), to deal | 
					
						
							|  |  |  |  * in the Software without restriction, including without limitation the rights | 
					
						
							|  |  |  |  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | 
					
						
							|  |  |  |  * copies of the Software, and to permit persons to whom the Software is | 
					
						
							|  |  |  |  * furnished to do so, subject to the following conditions: | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * The above copyright notice and this permission notice shall be included in | 
					
						
							|  |  |  |  * all copies or substantial portions of the Software. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | 
					
						
							|  |  |  |  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 
					
						
							|  |  |  |  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | 
					
						
							|  |  |  |  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | 
					
						
							|  |  |  |  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | 
					
						
							|  |  |  |  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | 
					
						
							|  |  |  |  * THE SOFTWARE. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This file is part of the TinyUSB stack. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef _TUSB_H_
 | 
					
						
							|  |  |  | #define _TUSB_H_
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifdef __cplusplus
 | 
					
						
							|  |  |  |  extern "C" { | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | //--------------------------------------------------------------------+
 | 
					
						
							|  |  |  | // INCLUDE
 | 
					
						
							|  |  |  | //--------------------------------------------------------------------+
 | 
					
						
							|  |  |  | #include "common/tusb_common.h"
 | 
					
						
							|  |  |  | #include "osal/osal.h"
 | 
					
						
							|  |  |  | #include "common/tusb_fifo.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-19 00:43:31 +07:00
										 |  |  | #include "class/hid/hid.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-14 23:30:39 -05:00
										 |  |  | //------------- HOST -------------//
 | 
					
						
							| 
									
										
										
										
											2022-02-23 21:49:11 +07:00
										 |  |  | #if CFG_TUH_ENABLED
 | 
					
						
							| 
									
										
										
										
											2020-01-14 23:30:39 -05:00
										 |  |  |   #include "host/usbh.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-12 20:04:19 +07:00
										 |  |  |   #if CFG_TUH_HID
 | 
					
						
							| 
									
										
										
										
											2020-01-14 23:30:39 -05:00
										 |  |  |     #include "class/hid/hid_host.h"
 | 
					
						
							|  |  |  |   #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   #if CFG_TUH_MSC
 | 
					
						
							|  |  |  |     #include "class/msc/msc_host.h"
 | 
					
						
							|  |  |  |   #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   #if CFG_TUH_CDC
 | 
					
						
							|  |  |  |     #include "class/cdc/cdc_host.h"
 | 
					
						
							|  |  |  |   #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   #if CFG_TUH_VENDOR
 | 
					
						
							|  |  |  |     #include "class/vendor/vendor_host.h"
 | 
					
						
							|  |  |  |   #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | //------------- DEVICE -------------//
 | 
					
						
							| 
									
										
										
										
											2022-02-23 21:46:40 +07:00
										 |  |  | #if CFG_TUD_ENABLED
 | 
					
						
							| 
									
										
										
										
											2020-01-14 23:30:39 -05:00
										 |  |  |   #include "device/usbd.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   #if CFG_TUD_HID
 | 
					
						
							|  |  |  |     #include "class/hid/hid_device.h"
 | 
					
						
							|  |  |  |   #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   #if CFG_TUD_CDC
 | 
					
						
							|  |  |  |     #include "class/cdc/cdc_device.h"
 | 
					
						
							|  |  |  |   #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   #if CFG_TUD_MSC
 | 
					
						
							|  |  |  |     #include "class/msc/msc_device.h"
 | 
					
						
							|  |  |  |   #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-05 16:32:37 +07:00
										 |  |  |   #if CFG_TUD_AUDIO
 | 
					
						
							|  |  |  |     #include "class/audio/audio_device.h"
 | 
					
						
							|  |  |  |   #endif
 | 
					
						
							| 
									
										
										
										
											2020-05-22 12:09:34 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-17 18:51:33 +09:00
										 |  |  |   #if CFG_TUD_VIDEO
 | 
					
						
							|  |  |  |     #include "class/video/video_device.h"
 | 
					
						
							|  |  |  |   #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-14 23:30:39 -05:00
										 |  |  |   #if CFG_TUD_MIDI
 | 
					
						
							|  |  |  |     #include "class/midi/midi_device.h"
 | 
					
						
							|  |  |  |   #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   #if CFG_TUD_VENDOR
 | 
					
						
							|  |  |  |     #include "class/vendor/vendor_device.h"
 | 
					
						
							|  |  |  |   #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   #if CFG_TUD_USBTMC
 | 
					
						
							|  |  |  |     #include "class/usbtmc/usbtmc_device.h"
 | 
					
						
							|  |  |  |   #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-11 12:05:22 +07:00
										 |  |  |   #if CFG_TUD_DFU_RUNTIME
 | 
					
						
							| 
									
										
										
										
											2020-01-14 23:30:39 -05:00
										 |  |  |     #include "class/dfu/dfu_rt_device.h"
 | 
					
						
							|  |  |  |   #endif
 | 
					
						
							| 
									
										
										
										
											2020-03-02 21:15:01 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-15 20:52:58 +07:00
										 |  |  |   #if CFG_TUD_DFU
 | 
					
						
							| 
									
										
										
										
											2021-04-22 14:56:52 -04:00
										 |  |  |     #include "class/dfu/dfu_device.h"
 | 
					
						
							| 
									
										
										
										
											2021-04-05 16:32:58 -04:00
										 |  |  |   #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-05 12:32:07 +07:00
										 |  |  |   #if CFG_TUD_ECM_RNDIS || CFG_TUD_NCM
 | 
					
						
							| 
									
										
										
										
											2020-03-02 21:15:01 -06:00
										 |  |  |     #include "class/net/net_device.h"
 | 
					
						
							|  |  |  |   #endif
 | 
					
						
							| 
									
										
										
										
											2020-05-13 17:04:10 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |   #if CFG_TUD_BTH
 | 
					
						
							|  |  |  |     #include "class/bth/bth_device.h"
 | 
					
						
							|  |  |  |   #endif
 | 
					
						
							| 
									
										
										
										
											2020-01-14 23:30:39 -05:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | //--------------------------------------------------------------------+
 | 
					
						
							|  |  |  | // APPLICATION API
 | 
					
						
							|  |  |  | //--------------------------------------------------------------------+
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Initialize device/host stack
 | 
					
						
							| 
									
										
										
										
											2020-07-23 09:20:45 +07:00
										 |  |  | // Note: when using with RTOS, this should be called after scheduler/kernel is started.
 | 
					
						
							|  |  |  | // Otherwise it could cause kernel issue since USB IRQ handler does use RTOS queue API.
 | 
					
						
							| 
									
										
										
										
											2020-01-14 23:30:39 -05:00
										 |  |  | bool tusb_init(void); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Check if stack is initialized
 | 
					
						
							|  |  |  | bool tusb_inited(void); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // TODO
 | 
					
						
							|  |  |  | // bool tusb_teardown(void);
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifdef __cplusplus
 | 
					
						
							|  |  |  |  } | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif /* _TUSB_H_ */
 |