TI-RTOS for TivaC  2.14.04.31
USBMSCHFatFs.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  */
107 #ifndef ti_drivers_USBMSCHFATFS__include
108 #define ti_drivers_USBMSCHFATFS__include
109 
110 #ifdef __cplusplus
111 extern "C" {
112 #endif
113 
114 #include <stddef.h>
115 #include <stdint.h>
116 #include <stdbool.h>
117 
129 #define USBMSCHFatFs_CMD_RESERVED 32
130 
143 #define USBMSCHFatFs_STATUS_RESERVED -32
144 
151 #define USBMSCHFatFs_STATUS_SUCCESS 0
152 
159 #define USBMSCHFatFs_STATUS_ERROR -1
160 
168 #define USBMSCHFatFs_STATUS_UNDEFINEDCMD -2
169 
174 
184 typedef struct USBMSCHFatFs_Params {
185  unsigned int servicePriority;
192  void *custom;
195 
200 typedef void (*USBMSCHFatFs_InitFxn) (USBMSCHFatFs_Handle handle);
201 
206 typedef USBMSCHFatFs_Handle (*USBMSCHFatFs_OpenFxn) (USBMSCHFatFs_Handle handle,
207  unsigned char drv,
208  USBMSCHFatFs_Params *params);
209 
214 typedef void (*USBMSCHFatFs_CloseFxn) (USBMSCHFatFs_Handle handle);
215 
220 typedef int (*USBMSCHFatFs_ControlFxn) (USBMSCHFatFs_Handle handle,
221  unsigned int cmd,
222  void *arg);
223 
228 typedef bool (*USBMSCHFatFs_waitForconnectFxn) (USBMSCHFatFs_Handle handle,
229  unsigned int timeout);
230 
236 typedef struct USBMSCHFatFs_FxnTable {
239 
242 
245 
248 
252 
264 typedef struct USBMSCHFatFs_Config {
270 
272  void *object;
273 
275  void const *hwAttrs;
277 
292 extern void USBMSCHFatFs_close(USBMSCHFatFs_Handle handle);
293 
313 extern int USBMSCHFatFs_control(USBMSCHFatFs_Handle handle,
314  unsigned int cmd,
315  void *arg);
316 
325 extern void USBMSCHFatFs_init(void);
326 
349 extern USBMSCHFatFs_Handle USBMSCHFatFs_open(unsigned int index,
350  unsigned char drv,
351  USBMSCHFatFs_Params *params);
352 
363 extern void USBMSCHFatFs_Params_init(USBMSCHFatFs_Params *params);
364 
378 extern bool USBMSCHFatFs_waitForConnect(USBMSCHFatFs_Handle handle,
379  unsigned int timeout);
380 
381 #ifdef __cplusplus
382 }
383 #endif
384 
385 #endif /* ti_drivers_USBMSCHFATFS__include */
USBMSCHFatFs Parameters.
Definition: USBMSCHFatFs.h:184
int USBMSCHFatFs_control(USBMSCHFatFs_Handle handle, unsigned int cmd, void *arg)
Function performs implementation specific features on a given USBMSCHFatFs_Handle.
USBMSCHFatFs_FxnTable const * fxnTablePtr
Definition: USBMSCHFatFs.h:269
struct USBMSCHFatFs_Config * USBMSCHFatFs_Handle
USBMSCHFatFs Handler.
Definition: USBMSCHFatFs.h:173
struct USBMSCHFatFs_FxnTable USBMSCHFatFs_FxnTable
The definition of a USBMSCHFatFs function table that contains the required set of functions to contro...
bool(* USBMSCHFatFs_waitForconnectFxn)(USBMSCHFatFs_Handle handle, unsigned int timeout)
A function pointer to a driver specific implementation of USBMSCHFatFs_waitForConnect().
Definition: USBMSCHFatFs.h:228
size_t serviceTaskStackSize
Definition: USBMSCHFatFs.h:189
void USBMSCHFatFs_Params_init(USBMSCHFatFs_Params *params)
Function to initialize the USBMSCHFatFs_Params structure to its defaults.
void * custom
Definition: USBMSCHFatFs.h:192
USBMSCHFatFs_InitFxn initFxn
Definition: USBMSCHFatFs.h:238
struct USBMSCHFatFs_Params USBMSCHFatFs_Params
USBMSCHFatFs Parameters.
unsigned int servicePriority
Definition: USBMSCHFatFs.h:185
USBMSCHFatFs_ControlFxn controlFxn
Definition: USBMSCHFatFs.h:247
USBMSCHFatFs_CloseFxn closeFxn
Definition: USBMSCHFatFs.h:244
USBMSCHFatFs_Handle(* USBMSCHFatFs_OpenFxn)(USBMSCHFatFs_Handle handle, unsigned char drv, USBMSCHFatFs_Params *params)
A function pointer to a driver specific implementation of USBMSCHFatFs_open().
Definition: USBMSCHFatFs.h:206
void USBMSCHFatFs_init(void)
Function to initialize the USBMSCHFatFs module.
USBMSCHFatFs_OpenFxn openFxn
Definition: USBMSCHFatFs.h:241
void * object
Definition: USBMSCHFatFs.h:272
USBMSCHFatFs Global configuration.
Definition: USBMSCHFatFs.h:264
void * serviceTaskStackPtr
Definition: USBMSCHFatFs.h:187
void(* USBMSCHFatFs_InitFxn)(USBMSCHFatFs_Handle handle)
A function pointer to a driver specific implementation of USBMSCHFatFs_init().
Definition: USBMSCHFatFs.h:200
USBMSCHFatFs_waitForconnectFxn waitForConnectFxn
Definition: USBMSCHFatFs.h:250
bool USBMSCHFatFs_waitForConnect(USBMSCHFatFs_Handle handle, unsigned int timeout)
Function blocks task execution while no USB drive is enumerated. After the USBMSCHFatFs driver has be...
The definition of a USBMSCHFatFs function table that contains the required set of functions to contro...
Definition: USBMSCHFatFs.h:236
void(* USBMSCHFatFs_CloseFxn)(USBMSCHFatFs_Handle handle)
A function pointer to a driver specific implementation of USBMSCHFatFs_close().
Definition: USBMSCHFatFs.h:214
struct USBMSCHFatFs_Config USBMSCHFatFs_Config
USBMSCHFatFs Global configuration.
void const * hwAttrs
Definition: USBMSCHFatFs.h:275
USBMSCHFatFs_Handle USBMSCHFatFs_open(unsigned int index, unsigned char drv, USBMSCHFatFs_Params *params)
This function registers the USBMSCHFatFs driver with BIOS' FatFs module and mounts the FatFs file sys...
int(* USBMSCHFatFs_ControlFxn)(USBMSCHFatFs_Handle handle, unsigned int cmd, void *arg)
A function pointer to a driver specific implementation of USBMSCHFatFs_control(). ...
Definition: USBMSCHFatFs.h:220
void USBMSCHFatFs_close(USBMSCHFatFs_Handle handle)
Function to closes a given USBMSCHFatFs peripheral specified by the USBMSCHFatFs handle. This function unmounts the file system mounted by USBMSCHFatFs_open and unregisters the USBMSCHFatFs driver from BIOS' FatFs module.
Copyright 2015, Texas Instruments Incorporated