usbd_storage_template.c
Go to the documentation of this file.
1 
29 /* Includes ------------------------------------------------------------------*/
30 #include "usbd_msc_mem.h"
31 
32 /* Private typedef -----------------------------------------------------------*/
33 /* Private define ------------------------------------------------------------*/
34 /* Private macro -------------------------------------------------------------*/
35 /* Private variables ---------------------------------------------------------*/
36 /* Private function prototypes -----------------------------------------------*/
37 /* Extern function prototypes ------------------------------------------------*/
38 /* Private functions ---------------------------------------------------------*/
39 
40 #define STORAGE_LUN_NBR 1
41 
42 int8_t STORAGE_Init (uint8_t lun);
43 
44 int8_t STORAGE_GetCapacity (uint8_t lun,
45  uint32_t *block_num,
46  uint16_t *block_size);
47 
48 int8_t STORAGE_IsReady (uint8_t lun);
49 
50 int8_t STORAGE_IsWriteProtected (uint8_t lun);
51 
52 int8_t STORAGE_Read (uint8_t lun,
53  uint8_t *buf,
54  uint32_t blk_addr,
55  uint16_t blk_len);
56 
57 int8_t STORAGE_Write (uint8_t lun,
58  uint8_t *buf,
59  uint32_t blk_addr,
60  uint16_t blk_len);
61 
62 int8_t STORAGE_GetMaxLun (void);
63 
64 /* USB Mass storage Standard Inquiry Data */
65 const int8_t STORAGE_Inquirydata[] = {//36
66 
67  /* LUN 0 */
68  0x00,
69  0x80,
70  0x02,
71  0x02,
73  0x00,
74  0x00,
75  0x00,
76  'S', 'T', 'M', ' ', ' ', ' ', ' ', ' ', /* Manufacturer : 8 bytes */
77  'P', 'r', 'o', 'd', 'u', 't', ' ', ' ', /* Product : 16 Bytes */
78  ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
79  '0', '.', '0' ,'1', /* Version : 4 Bytes */
80 };
81 
83 {
92 
93 };
94 
96 /*******************************************************************************
97 * Function Name : Read_Memory
98 * Description : Handle the Read operation from the microSD card.
99 * Input : None.
100 * Output : None.
101 * Return : None.
102 *******************************************************************************/
103 int8_t STORAGE_Init (uint8_t lun)
104 {
105  return (0);
106 }
107 
108 /*******************************************************************************
109 * Function Name : Read_Memory
110 * Description : Handle the Read operation from the STORAGE card.
111 * Input : None.
112 * Output : None.
113 * Return : None.
114 *******************************************************************************/
115 int8_t STORAGE_GetCapacity (uint8_t lun, uint32_t *block_num, uint16_t *block_size)
116 {
117  return (0);
118 }
119 
120 /*******************************************************************************
121 * Function Name : Read_Memory
122 * Description : Handle the Read operation from the STORAGE card.
123 * Input : None.
124 * Output : None.
125 * Return : None.
126 *******************************************************************************/
127 int8_t STORAGE_IsReady (uint8_t lun)
128 {
129  return (0);
130 }
131 
132 /*******************************************************************************
133 * Function Name : Read_Memory
134 * Description : Handle the Read operation from the STORAGE card.
135 * Input : None.
136 * Output : None.
137 * Return : None.
138 *******************************************************************************/
139 int8_t STORAGE_IsWriteProtected (uint8_t lun)
140 {
141  return 0;
142 }
143 
144 /*******************************************************************************
145 * Function Name : Read_Memory
146 * Description : Handle the Read operation from the STORAGE card.
147 * Input : None.
148 * Output : None.
149 * Return : None.
150 *******************************************************************************/
151 int8_t STORAGE_Read (uint8_t lun,
152  uint8_t *buf,
153  uint32_t blk_addr,
154  uint16_t blk_len)
155 {
156  return 0;
157 }
158 /*******************************************************************************
159 * Function Name : Write_Memory
160 * Description : Handle the Write operation to the STORAGE card.
161 * Input : None.
162 * Output : None.
163 * Return : None.
164 *******************************************************************************/
165 int8_t STORAGE_Write (uint8_t lun,
166  uint8_t *buf,
167  uint32_t blk_addr,
168  uint16_t blk_len)
169 {
170  return (0);
171 }
172 /*******************************************************************************
173 * Function Name : Write_Memory
174 * Description : Handle the Write operation to the STORAGE card.
175 * Input : None.
176 * Output : None.
177 * Return : None.
178 *******************************************************************************/
179 int8_t STORAGE_GetMaxLun (void)
180 {
181  return (STORAGE_LUN_NBR - 1);
182 }
183 
184 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
185 
int8_t STORAGE_GetCapacity(uint8_t lun, uint32_t *block_num, uint16_t *block_size)
USBD_STORAGE_cb_TypeDef USBD_MICRO_SDIO_fops
header for the STORAGE DISK file file
#define USBD_STD_INQUIRY_LENGTH
Definition: usbd_msc_mem.h:48
int8_t STORAGE_IsWriteProtected(uint8_t lun)
int8_t STORAGE_IsReady(uint8_t lun)
int8_t STORAGE_Init(uint8_t lun)
int8_t STORAGE_Read(uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t blk_len)
int8_t STORAGE_GetMaxLun(void)
USBD_STORAGE_cb_TypeDef * USBD_STORAGE_fops
int8_t STORAGE_Write(uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t blk_len)
#define STORAGE_LUN_NBR
const int8_t STORAGE_Inquirydata[]


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Apr 15 2021 05:07:50