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