Logo
MSP430USBDevelopersPackage_5_20_06_03
UsbMsc.h
1 /* --COPYRIGHT--,BSD
2  * Copyright (c) 2016, 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  * --/COPYRIGHT--*/
32 /*
33  * ======== UsbMsc.h ========
34  */
35 #include <stdint.h>
36 
37 #ifndef _USB_MSC_H_
38 #define _USB_MSC_H_
39 
40 #include "UsbMscScsi.h"
41 
42 #ifdef __cplusplus
43 extern "C"
44 {
45 #endif
46 
47 
48 /*----------------------------------------------------------------------------
49  * The following function names and macro names are deprecated. These were
50  * updated to new names to follow OneMCU naming convention.
51  +---------------------------------------------------------------------------*/
52 #ifndef DEPRECATED
53 #define kUSBMSC_idle USBMSC_IDLE
54 #define kUSBMSC_readInProgress USBMSC_READ_IN_PROGRESS
55 #define kUSBMSC_writeInProgress USBMSC_WRITE_IN_PROGRESS
56 #define kUSBMSC_cmdBeingProcessed USBMSC_COMMAND_BEING_PROCESSED
57 #define kUSBMSC_okToSleep USBMSC_OK_TO_SLEEP
58 #define kUSBMSC_processBuffer USBMSC_PROCESS_BUFFER
59 
60 #define USBMSC_bufferProcessed USBMSC_processBuffer
61 #define USBMSC_updateMediaInfo USBMSC_updateMediaInformation
62 #define USBMSC_registerBufInfo USBMSC_registerBufferInformation
63 #define USBMSC_poll USBMSC_pollCommand
64 #endif
65 
66 
67 
68 /*Return values of getState() and USBMSC_pollCommand() API */
69 #define USBMSC_IDLE 0
70 #define USBMSC_READ_IN_PROGRESS 1
71 #define USBMSC_WRITE_IN_PROGRESS 2
72 #define USBMSC_COMMAND_BEING_PROCESSED 3
73 #define USBMSC_OK_TO_SLEEP 4
74 #define USBMSC_PROCESS_BUFFER 5
75 
76 
77 /*----------------------------------------------------------------------------+
78  | Function Prototypes |
79  +----------------------------------------------------------------------------*/
80 
81 //*****************************************************************************
82 //
85 //
86 //******************************************************************************
87 
88 //*****************************************************************************
89 //
109 //
110 //*****************************************************************************
111 uint8_t USBMSC_pollCommand(void);
112 
113 /* MSC functions */
114 int16_t MSCToHostFromBuffer ();
115 int16_t MSCFromHostToBuffer ();
116 //*****************************************************************************
117 //
130 //
131 //*****************************************************************************
132 uint8_t USBMSC_processBuffer(void);
133 uint8_t USBMSC_getState ();
134 //*****************************************************************************
135 //
157 //
158 //*****************************************************************************
159 uint8_t USBMSC_updateMediaInformation (uint8_t lun, struct USBMSC_mediaInfoStr *info);
160 
161 //******************************************************************************
162 //
163 // Close the Doxygen group.
165 //
166 //******************************************************************************
167 //*****************************************************************************
168 //
171 //
172 //******************************************************************************
173 
174 //*****************************************************************************
175 //
188 //
189 //*****************************************************************************
190 uint8_t USBMSC_handleBufferEvent(void);
191 
192 //******************************************************************************
193 //
194 // Close the Doxygen group.
196 //
197 //******************************************************************************
198 
199 //*****************************************************************************
200 //
203 //
204 //******************************************************************************
205 //*****************************************************************************
206 //
242 //
243 //*****************************************************************************
244 uint8_t USBMSC_registerBufferInformation ( uint8_t lun, uint8_t* RWbuf_x, uint8_t* RWbuf_y, uint16_t size);
245 
246 //******************************************************************************
247 //
248 // Close the Doxygen group.
250 //
251 //******************************************************************************
252 #ifdef __cplusplus
253 }
254 #endif
255 #endif //_USB_MSC_H_
uint8_t USBMSC_processBuffer(void)
Definition: UsbMscScsi.h:224
uint8_t USBMSC_updateMediaInformation(uint8_t lun, struct USBMSC_mediaInfoStr *info)
uint8_t USBMSC_handleBufferEvent(void)
uint8_t USBMSC_pollCommand(void)
uint8_t USBMSC_registerBufferInformation(uint8_t lun, uint8_t *RWbuf_x, uint8_t *RWbuf_y, uint16_t size)