usbhmsc.h
Go to the documentation of this file.
1 //*****************************************************************************
2 //
3 // usbhmsc.h - Definitions for the USB MSC host driver.
4 //
5 // Copyright (c) 2008-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 __USBHMSC_H__
24 #define __USBHMSC_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 
45 
46 //*****************************************************************************
47 //
48 // These defines are the the events that will be passed in the \e ui32Event
49 // parameter of the callback from the driver.
50 //
51 //*****************************************************************************
52 #define MSC_EVENT_OPEN 1
53 #define MSC_EVENT_CLOSE 2
54 
55 //*****************************************************************************
56 //
57 // The prototype for the USB MSC host driver callback function.
58 //
59 //*****************************************************************************
60 typedef void (*tUSBHMSCCallback)(tUSBHMSCInstance *psMSCInstance,
61  uint32_t ui32Event,
62  void *pvEventData);
63 
64 //*****************************************************************************
65 //
66 // Prototypes for the USB MSC host driver APIs.
67 //
68 //*****************************************************************************
69 extern tUSBHMSCInstance * USBHMSCDriveOpen(uint32_t ui32Drive,
70  tUSBHMSCCallback pfnCallback);
71 extern void USBHMSCDriveClose(tUSBHMSCInstance *psMSCInstance);
72 extern int32_t USBHMSCDriveReady(tUSBHMSCInstance *psMSCInstance);
73 extern int32_t USBHMSCBlockRead(tUSBHMSCInstance *psMSCInstance,
74  uint32_t ui32LBA, uint8_t *pui8Data,
75  uint32_t ui32NumBlocks);
76 extern int32_t USBHMSCBlockWrite(tUSBHMSCInstance *psMSCInstance,
77  uint32_t ui32LBA, uint8_t *pui8Data,
78  uint32_t ui32NumBlocks);
79 extern uint32_t USBHMSCLPMSleep(tUSBHMSCInstance *psMSCInstance);
80 extern uint32_t USBHMSCLPMStatus(tUSBHMSCInstance *psMSCInstance);
81 
82 //*****************************************************************************
83 //
85 //
86 //*****************************************************************************
87 
88 //*****************************************************************************
89 //
90 // Mark the end of the C bindings section for C++ compilers.
91 //
92 //*****************************************************************************
93 #ifdef __cplusplus
94 }
95 #endif
96 
97 #endif // __USBHMSC_H__
tUSBHMSCInstance * USBHMSCDriveOpen(uint32_t ui32Drive, tUSBHMSCCallback pfnCallback)
Definition: usbhmsc.c:530
void(* tUSBHMSCCallback)(tUSBHMSCInstance *psMSCInstance, uint32_t ui32Event, void *pvEventData)
Definition: usbhmsc.h:60
int32_t USBHMSCBlockRead(tUSBHMSCInstance *psMSCInstance, uint32_t ui32LBA, uint8_t *pui8Data, uint32_t ui32NumBlocks)
Definition: usbhmsc.c:600
int32_t USBHMSCDriveReady(tUSBHMSCInstance *psMSCInstance)
Definition: usbhmsc.c:371
void USBHMSCDriveClose(tUSBHMSCInstance *psMSCInstance)
Definition: usbhmsc.c:566
struct tUSBHMSCInstance tUSBHMSCInstance
Definition: usbhmsc.h:44
uint32_t USBHMSCLPMStatus(tUSBHMSCInstance *psMSCInstance)
Definition: usbhmsc.c:741
uint32_t USBHMSCLPMSleep(tUSBHMSCInstance *psMSCInstance)
Definition: usbhmsc.c:713
int32_t USBHMSCBlockWrite(tUSBHMSCInstance *psMSCInstance, uint32_t ui32LBA, uint8_t *pui8Data, uint32_t ui32NumBlocks)
Definition: usbhmsc.c:656
Copyright 2018, Texas Instruments Incorporated