espressif_tinyusb/src/tusb.h

111 lines
2.8 KiB
C
Raw Normal View History

/*
* The MIT License (MIT)
*
2019-05-14 06:48:05 +02:00
* 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.
*/
2014-03-05 15:37:53 +01:00
#ifndef _TUSB_H_
#define _TUSB_H_
#ifdef __cplusplus
extern "C" {
#endif
//--------------------------------------------------------------------+
// INCLUDE
//--------------------------------------------------------------------+
2018-03-12 16:45:35 +01:00
#include "common/tusb_common.h"
2014-03-05 15:37:53 +01:00
#include "osal/osal.h"
2018-11-02 11:26:35 +01:00
#include "common/tusb_fifo.h"
2014-03-05 15:37:53 +01:00
//------------- HOST -------------//
#if TUSB_OPT_HOST_ENABLED
2014-03-05 15:37:53 +01:00
#include "host/usbh.h"
#if HOST_CLASS_HID
2018-03-06 11:26:34 +01:00
#include "class/hid/hid_host.h"
2014-03-05 15:37:53 +01:00
#endif
#if CFG_TUH_MSC
2018-03-06 11:26:34 +01:00
#include "class/msc/msc_host.h"
2014-03-05 15:37:53 +01:00
#endif
#if CFG_TUH_CDC
2018-03-06 11:26:34 +01:00
#include "class/cdc/cdc_host.h"
2014-03-05 15:37:53 +01:00
#endif
#if CFG_TUH_VENDOR
#include "class/vendor/vendor_host.h"
2014-03-05 15:37:53 +01:00
#endif
#endif
//------------- DEVICE -------------//
2018-07-23 10:25:45 +02:00
#if TUSB_OPT_DEVICE_ENABLED
2014-03-05 15:37:53 +01:00
#include "device/usbd.h"
#if CFG_TUD_HID
2018-03-06 11:26:34 +01:00
#include "class/hid/hid_device.h"
2014-03-05 15:37:53 +01:00
#endif
2018-04-12 08:23:52 +02:00
#if CFG_TUD_CDC
2018-03-06 11:26:34 +01:00
#include "class/cdc/cdc_device.h"
2014-03-05 15:37:53 +01:00
#endif
2018-04-12 08:23:52 +02:00
#if CFG_TUD_MSC
2018-03-06 11:26:34 +01:00
#include "class/msc/msc_device.h"
2014-03-05 15:37:53 +01:00
#endif
#if CFG_TUD_MIDI
#include "class/midi/midi_device.h"
#endif
#if CFG_TUD_VENDOR
#include "class/vendor/vendor_device.h"
#endif
2014-03-05 15:37:53 +01:00
#endif
//--------------------------------------------------------------------+
// APPLICATION API
//--------------------------------------------------------------------+
2014-03-25 07:00:37 +01:00
/** \ingroup group_application_api
* @{ */
// Initialize device/host stack
bool tusb_init(void);
2014-03-05 15:37:53 +01:00
// Check if stack is initialized
bool tusb_inited(void);
// TODO
// bool tusb_teardown(void);
/** @} */
2014-03-05 15:37:53 +01:00
#ifdef __cplusplus
}
#endif
#endif /* _TUSB_H_ */