TI-RTOS Drivers  tidrivers_full_2_20_00_08
USBMSCHFatFsTiva.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
55 #ifndef ti_drivers_usbmschfatfs_USBMSCHFatFsTiva__include
56 #define ti_drivers_usbmschfatfs_USBMSCHFatFsTiva__include
57 
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61 
62 #include <stdint.h>
64 
65 #include <ti/sysbios/gates/GateMutex.h>
66 
67 #define ti_sysbios_family_arm_m3_Hwi__nolocalnames
68 #include <ti/sysbios/family/arm/m3/Hwi.h>
69 #include <ti/sysbios/knl/Task.h>
70 #include <ti/sysbios/knl/Semaphore.h>
71 #include <ti/mw/fatfs/ff.h>
72 #include <ti/mw/fatfs/diskio.h>
73 
74 #if defined(TIVAWARE)
75 #include <usblib/host/usbhmsc.h>
76 typedef tUSBHMSCInstance *USBMSCType;
77 #else /* MWARE */
78 typedef unsigned long USBMSCType;
79 #endif
80 
91 /* Add USBMSCHFatFsTiva_STATUS_* macros here */
92 
105 /* Add USBMSCHFatFsTiva_CMD_* macros here */
106 
109 /* Memory for the Host Class Driver */
110 #define HCDMEMORYPOOLSIZE 128
111 
112 /* USBMSCHFatFs function table */
114 
133 
147 typedef struct USBMSCHFatFsTiva_HWAttrs {
148  unsigned int intNum;
149  unsigned int intPriority;
151 
157 typedef struct USBMSCHFatFsTiva_Object {
158  uint32_t driveNumber;
160  ti_sysbios_family_arm_m3_Hwi_Struct hwi;
161  Task_Struct taskHCDMain;
162  GateMutex_Struct gateUSBWait;
163  GateMutex_Struct gateUSBLibAccess;
164  Semaphore_Struct semUSBConnected;
165  USBMSCType MSCInstance;
166  uint8_t memPoolHCD[HCDMEMORYPOOLSIZE]; /* MSC memory buffer */
169 
170 /* Do not interfere with the app if they include the family Hwi module */
171 #undef ti_sysbios_family_arm_m3_Hwi__nolocalnames
172 
173 #ifdef __cplusplus
174 }
175 #endif
176 
177 #endif /* ti_drivers_usbmschfatfs_USBMSCHFatFsTiva__include */
Task_Struct taskHCDMain
Definition: USBMSCHFatFsTiva.h:161
USBMSCHFatFsTiva_USBState
USBMSCHFatFsTiva_USBState.
Definition: USBMSCHFatFsTiva.h:118
GateMutex_Struct gateUSBWait
Definition: USBMSCHFatFsTiva.h:162
unsigned long USBMSCType
Definition: USBMSCHFatFsTiva.h:78
struct USBMSCHFatFsTiva_Object USBMSCHFatFsTiva_Object
USBMSCHFatFsTiva Object.
FATFS filesystem
Definition: USBMSCHFatFsTiva.h:167
uint32_t driveNumber
Definition: USBMSCHFatFsTiva.h:158
#define HCDMEMORYPOOLSIZE
Definition: USBMSCHFatFsTiva.h:110
Definition: ff.h:78
unsigned int intNum
Definition: USBMSCHFatFsTiva.h:148
Definition: USBMSCHFatFsTiva.h:131
GateMutex_Struct gateUSBLibAccess
Definition: USBMSCHFatFsTiva.h:163
Definition: USBMSCHFatFsTiva.h:121
USBMSCHFatFsTiva_USBState volatile state
Definition: USBMSCHFatFsTiva.h:159
struct USBMSCHFatFsTiva_HWAttrs USBMSCHFatFsTiva_HWAttrs
USBMSCHFatFsTiva Hardware attributes.
USBMSCHFatFsTiva Hardware attributes.
Definition: USBMSCHFatFsTiva.h:147
USBMSCHFatFsTiva Object.
Definition: USBMSCHFatFsTiva.h:157
uint8_t memPoolHCD[HCDMEMORYPOOLSIZE]
Definition: USBMSCHFatFsTiva.h:166
struct USBMSCHFatFsTiva_Object * USBMSCHFatFsTiva_Handle
unsigned int intPriority
Definition: USBMSCHFatFsTiva.h:149
The definition of a USBMSCHFatFs function table that contains the required set of functions to contro...
Definition: USBMSCHFatFs.h:262
ti_sysbios_family_arm_m3_Hwi_Struct hwi
Definition: USBMSCHFatFsTiva.h:160
USBMSCHFatFs driver interface.
Definition: USBMSCHFatFsTiva.h:126
const USBMSCHFatFs_FxnTable USBMSCHFatFsTiva_fxnTable
Semaphore_Struct semUSBConnected
Definition: USBMSCHFatFsTiva.h:164
Definition: USBMSCHFatFsTiva.h:119
USBMSCType MSCInstance
Definition: USBMSCHFatFsTiva.h:165
Copyright 2016, Texas Instruments Incorporated