STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
usbd_msc_scsi.h
Go to the documentation of this file.
1 
28 /* Define to prevent recursive inclusion -------------------------------------*/
29 #ifndef __USBD_MSC_SCSI_H
30 #define __USBD_MSC_SCSI_H
31 
32 #ifdef __cplusplus
33  extern "C" {
34 #endif
35 
36 /* Includes ------------------------------------------------------------------*/
37 #include "usbd_def.h"
38 
52 #define SENSE_LIST_DEEPTH 4
53 
54 /* SCSI Commands */
55 #define SCSI_FORMAT_UNIT 0x04
56 #define SCSI_INQUIRY 0x12
57 #define SCSI_MODE_SELECT6 0x15
58 #define SCSI_MODE_SELECT10 0x55
59 #define SCSI_MODE_SENSE6 0x1A
60 #define SCSI_MODE_SENSE10 0x5A
61 #define SCSI_ALLOW_MEDIUM_REMOVAL 0x1E
62 #define SCSI_READ6 0x08
63 #define SCSI_READ10 0x28
64 #define SCSI_READ12 0xA8
65 #define SCSI_READ16 0x88
66 
67 #define SCSI_READ_CAPACITY10 0x25
68 #define SCSI_READ_CAPACITY16 0x9E
69 
70 #define SCSI_REQUEST_SENSE 0x03
71 #define SCSI_START_STOP_UNIT 0x1B
72 #define SCSI_TEST_UNIT_READY 0x00
73 #define SCSI_WRITE6 0x0A
74 #define SCSI_WRITE10 0x2A
75 #define SCSI_WRITE12 0xAA
76 #define SCSI_WRITE16 0x8A
77 
78 #define SCSI_VERIFY10 0x2F
79 #define SCSI_VERIFY12 0xAF
80 #define SCSI_VERIFY16 0x8F
81 
82 #define SCSI_SEND_DIAGNOSTIC 0x1D
83 #define SCSI_READ_FORMAT_CAPACITIES 0x23
84 
85 #define NO_SENSE 0
86 #define RECOVERED_ERROR 1
87 #define NOT_READY 2
88 #define MEDIUM_ERROR 3
89 #define HARDWARE_ERROR 4
90 #define ILLEGAL_REQUEST 5
91 #define UNIT_ATTENTION 6
92 #define DATA_PROTECT 7
93 #define BLANK_CHECK 8
94 #define VENDOR_SPECIFIC 9
95 #define COPY_ABORTED 10
96 #define ABORTED_COMMAND 11
97 #define VOLUME_OVERFLOW 13
98 #define MISCOMPARE 14
99 
100 
101 #define INVALID_CDB 0x20
102 #define INVALID_FIELED_IN_COMMAND 0x24
103 #define PARAMETER_LIST_LENGTH_ERROR 0x1A
104 #define INVALID_FIELD_IN_PARAMETER_LIST 0x26
105 #define ADDRESS_OUT_OF_RANGE 0x21
106 #define MEDIUM_NOT_PRESENT 0x3A
107 #define MEDIUM_HAVE_CHANGED 0x28
108 #define WRITE_PROTECTED 0x27
109 #define UNRECOVERED_READ_ERROR 0x11
110 #define WRITE_FAULT 0x03
111 
112 #define READ_FORMAT_CAPACITY_DATA_LEN 0x0C
113 #define READ_CAPACITY10_DATA_LEN 0x08
114 #define MODE_SENSE10_DATA_LEN 0x08
115 #define MODE_SENSE6_DATA_LEN 0x04
116 #define REQUEST_SENSE_DATA_LEN 0x12
117 #define STANDARD_INQUIRY_DATA_LEN 0x24
118 #define BLKVFY 0x04
119 
120 extern uint8_t Page00_Inquiry_Data[];
121 extern uint8_t Standard_Inquiry_Data[];
122 extern uint8_t Standard_Inquiry_Data2[];
123 extern uint8_t Mode_Sense6_data[];
124 extern uint8_t Mode_Sense10_data[];
125 extern uint8_t Scsi_Sense_Data[];
126 extern uint8_t ReadCapacity10_Data[];
127 extern uint8_t ReadFormatCapacity_Data [];
137 typedef struct _SENSE_ITEM {
138  char Skey;
139  union {
140  struct _ASCs {
141  char ASC;
142  char ASCQ;
143  }b;
144  unsigned int ASC;
145  char *pData;
146  } w;
171  uint8_t lun,
172  uint8_t *cmd);
173 
175  uint8_t lun,
176  uint8_t sKey,
177  uint8_t ASC);
178 
183 #ifdef __cplusplus
184 }
185 #endif
186 
187 #endif /* __USBD_MSC_SCSI_H */
188 
200 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
201 
void SCSI_SenseCode(USBD_HandleTypeDef *pdev, uint8_t lun, uint8_t sKey, uint8_t ASC)
SCSI_SenseCode Load the last error code in the error list.
uint8_t ReadFormatCapacity_Data[]
uint8_t ReadCapacity10_Data[]
uint8_t Page00_Inquiry_Data[]
struct _SENSE_ITEM::@35::_ASCs b
uint8_t Standard_Inquiry_Data2[]
uint8_t Mode_Sense10_data[]
union _SENSE_ITEM::@35 w
int8_t SCSI_ProcessCmd(USBD_HandleTypeDef *pdev, uint8_t lun, uint8_t *cmd)
SCSI_ProcessCmd Process SCSI commands.
unsigned int ASC
struct _SENSE_ITEM USBD_SCSI_SenseTypeDef
uint8_t Scsi_Sense_Data[]
uint8_t Mode_Sense6_data[]
uint8_t Standard_Inquiry_Data[]
General defines for the usb device library.