usbddfu-rt.h
Go to the documentation of this file.
1 //*****************************************************************************
2 //
3 // usbddfu-rt.h - Definitions used by runtime DFU class devices.
4 //
5 // Copyright (c) 2010-2017 Texas Instruments Incorporated. All rights reserved.
6 // Software License Agreement
7 //
8 // Texas Instruments (TI) is supplying this software for use solely and
9 // exclusively on TI's microcontroller products. The software is owned by
10 // TI and/or its suppliers, and is protected under applicable copyright
11 // laws. You may not combine this software with "viral" open-source
12 // software in order to form a larger program.
13 //
14 // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
15 // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
16 // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17 // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
18 // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
19 // DAMAGES, FOR ANY REASON WHATSOEVER.
20 //
21 //*****************************************************************************
22 
23 #ifndef __USBDDFURT_H__
24 #define __USBDDFURT_H__
25 
26 //*****************************************************************************
27 //
28 // If building with a C++ compiler, make all of the definitions in this header
29 // have a C binding.
30 //
31 //*****************************************************************************
32 #ifdef __cplusplus
33 extern "C"
34 {
35 #endif
36 
37 //*****************************************************************************
38 //
41 //
42 //*****************************************************************************
43 
44 //*****************************************************************************
45 //
46 // This is the size of the g_pui8DFUInterface array in bytes.
47 //
48 //*****************************************************************************
49 #define DFUINTERFACE_SIZE (9)
50 
51 //*****************************************************************************
52 //
53 // This is the size of the g_pui8DFUFunctionalDesc array in bytes.
54 //
55 //*****************************************************************************
56 #define DFUFUNCTIONALDESC_SIZE (9)
57 
58 //*****************************************************************************
59 //
67 //
68 //*****************************************************************************
69 #define COMPOSITE_DDFU_SIZE (DFUINTERFACE_SIZE + DFUFUNCTIONALDESC_SIZE)
70 
71 //*****************************************************************************
72 //
82 //
83 //*****************************************************************************
84 #define USBD_DFU_EVENT_DETACH (USBD_DFU_EVENT_BASE + 0)
85 
86 //*****************************************************************************
87 //
88 // PRIVATE
89 //
90 // This structure defines the private instance data and state variables for
91 // DFU devices. The memory for this structure is included in the
92 // sPrivateData field in the tUSBDDFUDevice structure passed in the
93 // USBDDFUCompositeInit() function.
94 //
95 //*****************************************************************************
96 typedef struct
97 {
98  //
99  // Base address for the USB controller.
100  //
101  uint32_t ui32USBBase;
102 
103  //
104  // The device info to interact with the lower level DCD code.
105  //
107 
108  //
109  // The DFU class interface number, this is modified in composite devices.
110  //
111  uint8_t ui8Interface;
112 
113  //
114  // The connection status of the device.
115  //
117 }
119 
120 //*****************************************************************************
121 //
130 //
131 //*****************************************************************************
132 typedef struct
133 {
134  //
137  //
139 
140  //
143  //
144  void * const pvCBData;
145 
146  //
150  //
152 }
154 
155 //*****************************************************************************
156 //
157 // API Function Prototypes
158 //
159 //*****************************************************************************
160 extern void *USBDDFUCompositeInit(uint32_t ui32Index,
161  tUSBDDFUDevice *psDFUDevice,
162  tCompositeEntry *psCompEntry);
163 extern void USBDDFUCompositeTerm(void *pvDFUInstance);
164 extern void USBDDFUUpdateBegin(void);
165 
166 //*****************************************************************************
167 //
168 // Close the Doxygen group.
170 //
171 //*****************************************************************************
172 
173 //*****************************************************************************
174 //
175 // Mark the end of the C bindings section for C++ compilers.
176 //
177 //*****************************************************************************
178 #ifdef __cplusplus
179 }
180 #endif
181 
182 #endif // __USBDDFURT_H__
bool bConnected
Definition: usbddfu-rt.h:116
Definition: usbddfu-rt.h:96
const tUSBCallback pfnCallback
Definition: usbddfu-rt.h:138
Definition: usbdevice.h:135
void *const pvCBData
Definition: usbddfu-rt.h:144
uint8_t ui8Interface
Definition: usbddfu-rt.h:111
tDeviceInfo sDevInfo
Definition: usbddfu-rt.h:106
tDFUInstance sPrivateData
Definition: usbddfu-rt.h:151
Definition: usbdevice.h:66
uint32_t(* tUSBCallback)(void *pvCBData, uint32_t ui32Event, uint32_t ui32MsgParam, void *pvMsgData)
Definition: usblib.h:1220
void USBDDFUCompositeTerm(void *pvDFUInstance)
Definition: usbddfu-rt.c:551
void * USBDDFUCompositeInit(uint32_t ui32Index, tUSBDDFUDevice *psDFUDevice, tCompositeEntry *psCompEntry)
Definition: usbddfu-rt.c:483
uint32_t ui32USBBase
Definition: usbddfu-rt.h:101
Definition: usbddfu-rt.h:132
void USBDDFUUpdateBegin(void)
Definition: usbddfu-rt.c:589
Copyright 2018, Texas Instruments Incorporated