USBDDriver.h
Go to the documentation of this file.
1 /* ---------------------------------------------------------------------------- */
2 /* Atmel Microcontroller Software Support */
3 /* SAM Software Package License */
4 /* ---------------------------------------------------------------------------- */
5 /* Copyright (c) 2015, Atmel Corporation */
6 /* */
7 /* All rights reserved. */
8 /* */
9 /* Redistribution and use in source and binary forms, with or without */
10 /* modification, are permitted provided that the following condition is met: */
11 /* */
12 /* - Redistributions of source code must retain the above copyright notice, */
13 /* this list of conditions and the disclaimer below. */
14 /* */
15 /* Atmel's name may not be used to endorse or promote products derived from */
16 /* this software without specific prior written permission. */
17 /* */
18 /* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */
19 /* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
20 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */
21 /* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */
22 /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
23 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
24 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
25 /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
26 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
27 /* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
28 /* ---------------------------------------------------------------------------- */
29 
46 #ifndef USBDDRIVER_H
47 #define USBDDRIVER_H
48 
53 /*------------------------------------------------------------------------------
54  * Headers
55  *------------------------------------------------------------------------------*/
56 
57 /* These headers were introduced in C99 by working group
58  * ISO/IEC JTC1/SC22/WG14.
59  */
60 #include <stdbool.h>
61 #include <stdint.h>
62 #include <stdio.h>
63 
64 #include <USBRequests.h>
65 #include <USBDescriptors.h>
66 #include <USBLib_Types.h>
67 
68 /*------------------------------------------------------------------------------
69  * Types
70  *------------------------------------------------------------------------------*/
71 
79 typedef struct _USBDDriverDescriptors {
80 
82  const USBDeviceDescriptor *pFsDevice;
84  const USBConfigurationDescriptor *pFsConfiguration;
86  const USBDeviceQualifierDescriptor *pFsQualifier;
88  const USBConfigurationDescriptor *pFsOtherSpeed;
90  const USBDeviceDescriptor *pHsDevice;
92  const USBConfigurationDescriptor *pHsConfiguration;
94  const USBDeviceQualifierDescriptor *pHsQualifier;
96  const USBConfigurationDescriptor *pHsOtherSpeed;
98  const uint8_t **pStrings;
100  uint8_t numStrings;
101 
103 
109 typedef struct _USBDDriver {
110 
114  uint8_t *pInterfaces;
116  uint8_t cfgnum;
121 } USBDDriver;
122 
123 /*------------------------------------------------------------------------------
124  * Exported functions
125  *------------------------------------------------------------------------------*/
126 
127 extern USBDDriver *USBD_GetDriver(void);
128 extern void USBDDriver_Initialize(
129  USBDDriver *pDriver,
130  const USBDDriverDescriptors *pDescriptors,
131  uint8_t *pInterfaces);
132 extern USBConfigurationDescriptor* USBDDriver_GetCfgDescriptors(
133  USBDDriver * pDriver,
134  uint8_t cfgNum);
135 extern void USBDDriver_RequestHandler(
136  USBDDriver *pDriver,
137  const USBGenericRequest *pRequest);
138 extern uint8_t USBDDriver_IsRemoteWakeUpEnabled(const USBDDriver *pDriver);
139 extern uint8_t USBDDriver_returnOTGFeatures(const USBDDriver *pDriver);
140 extern void USBDDriver_clearOTGFeatures(USBDDriver *pDriver);
141 
142 extern void USBDDriverCallbacks_ConfigurationChanged(uint8_t cfgnum);
143 extern void USBDDriverCallbacks_InterfaceSettingChanged(uint8_t interface,
144  uint8_t setting);
145 
148 #endif /*#ifndef USBDDRIVER_H*/
149 
const uint8_t ** pStrings
Definition: USBDDriver.h:98
const USBDeviceQualifierDescriptor * pHsQualifier
Definition: USBDDriver.h:94
const USBDeviceDescriptor * pHsDevice
Definition: USBDDriver.h:90
const USBConfigurationDescriptor * pHsOtherSpeed
Definition: USBDDriver.h:96
const USBConfigurationDescriptor * pHsConfiguration
Definition: USBDDriver.h:92
WEAK void USBDDriverCallbacks_InterfaceSettingChanged(uint8_t interface, uint8_t setting)
WEAK void USBDDriverCallbacks_ConfigurationChanged(uint8_t cfgnum)
uint8_t USBDDriver_IsRemoteWakeUpEnabled(const USBDDriver *pDriver)
Definition: USBDDriver.c:821
struct _USBDDriver USBDDriver
USB device driver structure, holding a list of descriptors identifying the device as well as the driv...
void USBDDriver_RequestHandler(USBDDriver *pDriver, const USBGenericRequest *pRequest)
Definition: USBDDriver.c:609
USBConfigurationDescriptor * USBDDriver_GetCfgDescriptors(USBDDriver *pDriver, uint8_t cfgNum)
Definition: USBDDriver.c:587
uint8_t cfgnum
Definition: USBDDriver.h:116
const USBDDriverDescriptors * pDescriptors
Definition: USBDDriver.h:112
const USBConfigurationDescriptor * pFsOtherSpeed
Definition: USBDDriver.h:88
void USBDDriver_clearOTGFeatures(USBDDriver *pDriver)
Definition: USBDDriver.c:841
const USBDeviceQualifierDescriptor * pFsQualifier
Definition: USBDDriver.h:86
uint8_t otg_features_supported
Definition: USBDDriver.h:120
USBDDriver * USBD_GetDriver(void)
Definition: USBDDriver.c:549
const USBConfigurationDescriptor * pFsConfiguration
Definition: USBDDriver.h:84
const USBDeviceDescriptor * pFsDevice
Definition: USBDDriver.h:82
struct _USBDDriverDescriptors USBDDriverDescriptors
List of all descriptors used by a USB device driver. Each descriptor can be provided in two versions:...
uint8_t USBDDriver_returnOTGFeatures(const USBDDriver *pDriver)
Definition: USBDDriver.c:831
uint8_t * pInterfaces
Definition: USBDDriver.h:114
void USBDDriver_Initialize(USBDDriver *pDriver, const USBDDriverDescriptors *pDescriptors, uint8_t *pInterfaces)
Definition: USBDDriver.c:563
uint8_t isRemoteWakeUpEnabled
Definition: USBDDriver.h:118


inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:17:58