TI-RTOS for TivaC  2.14.04.31
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  */
52 #ifndef ti_drivers_usbmschfatfs_USBMSCHFatFsTiva__include
53 #define ti_drivers_usbmschfatfs_USBMSCHFatFsTiva__include
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 #include <stdint.h>
61 
62 #include <ti/sysbios/gates/GateMutex.h>
63 
64 #define ti_sysbios_family_arm_m3_Hwi__nolocalnames
65 #include <ti/sysbios/family/arm/m3/Hwi.h>
66 #include <ti/sysbios/knl/Task.h>
67 #include <ti/sysbios/knl/Semaphore.h>
68 #include <ti/sysbios/fatfs/ff.h>
69 #include <ti/sysbios/fatfs/diskio.h>
70 
71 #if defined(TIVAWARE)
72 #include <usblib/host/usbhmsc.h>
73 typedef tUSBHMSCInstance *USBMSCType;
74 #else /* MWARE */
75 typedef unsigned long USBMSCType;
76 #endif
77 
78 /* Memory for the Host Class Driver */
79 #define HCDMEMORYPOOLSIZE 128
80 
81 /* USBMSCHFatFs function table */
83 
102 
106 typedef struct USBMSCHFatFsTiva_HWAttrs {
107  unsigned int intNum;
108  unsigned int intPriority;
110 
116 typedef struct USBMSCHFatFsTiva_Object {
117  uint32_t driveNumber;
119  ti_sysbios_family_arm_m3_Hwi_Struct hwi;
120  Task_Struct taskHCDMain;
121  GateMutex_Struct gateUSBWait;
122  GateMutex_Struct gateUSBLibAccess;
123  Semaphore_Struct semUSBConnected;
124  USBMSCType MSCInstance;
125  uint8_t memPoolHCD[HCDMEMORYPOOLSIZE]; /* MSC memory buffer */
126  FATFS filesystem;
128 
129 /* Do not interfere with the app if they include the family Hwi module */
130 #undef ti_sysbios_family_arm_m3_Hwi__nolocalnames
131 
132 #ifdef __cplusplus
133 }
134 #endif
135 
136 #endif /* ti_drivers_usbmschfatfs_USBMSCHFatFsTiva__include */
Task_Struct taskHCDMain
Definition: USBMSCHFatFsTiva.h:120
USBMSCHFatFsTiva_USBState
USBMSCHFatFsTiva_USBState.
Definition: USBMSCHFatFsTiva.h:87
GateMutex_Struct gateUSBWait
Definition: USBMSCHFatFsTiva.h:121
unsigned long USBMSCType
Definition: USBMSCHFatFsTiva.h:75
struct USBMSCHFatFsTiva_Object USBMSCHFatFsTiva_Object
USBMSCHFatFsTiva Object.
FATFS filesystem
Definition: USBMSCHFatFsTiva.h:126
uint32_t driveNumber
Definition: USBMSCHFatFsTiva.h:117
#define HCDMEMORYPOOLSIZE
Definition: USBMSCHFatFsTiva.h:79
unsigned int intNum
Definition: USBMSCHFatFsTiva.h:107
Definition: USBMSCHFatFsTiva.h:100
GateMutex_Struct gateUSBLibAccess
Definition: USBMSCHFatFsTiva.h:122
Definition: USBMSCHFatFsTiva.h:90
USBMSCHFatFsTiva_USBState volatile state
Definition: USBMSCHFatFsTiva.h:118
struct USBMSCHFatFsTiva_HWAttrs USBMSCHFatFsTiva_HWAttrs
USBMSCHFatFsTiva Hardware attributes.
USBMSCHFatFsTiva Hardware attributes.
Definition: USBMSCHFatFsTiva.h:106
USBMSCHFatFsTiva Object.
Definition: USBMSCHFatFsTiva.h:116
uint8_t memPoolHCD[HCDMEMORYPOOLSIZE]
Definition: USBMSCHFatFsTiva.h:125
struct USBMSCHFatFsTiva_Object * USBMSCHFatFsTiva_Handle
unsigned int intPriority
Definition: USBMSCHFatFsTiva.h:108
The definition of a USBMSCHFatFs function table that contains the required set of functions to contro...
Definition: USBMSCHFatFs.h:236
ti_sysbios_family_arm_m3_Hwi_Struct hwi
Definition: USBMSCHFatFsTiva.h:119
USBMSCHFatFs driver interface.
Definition: USBMSCHFatFsTiva.h:95
const USBMSCHFatFs_FxnTable USBMSCHFatFsTiva_fxnTable
Semaphore_Struct semUSBConnected
Definition: USBMSCHFatFsTiva.h:123
Definition: USBMSCHFatFsTiva.h:88
USBMSCType MSCInstance
Definition: USBMSCHFatFsTiva.h:124
Copyright 2015, Texas Instruments Incorporated