31 #ifndef __USB_DISK_H__ 32 #define __USB_DISK_H__ 1 34 #include "usb_device_config.h" 36 #include "usb_device.h" 37 #include "usb_device_class.h" 38 #include "usb_device_msc.h" 39 #include "usb_device_ch9.h" 40 #include "usb_descriptor.h" 41 #include "flash/fsl_flash.h" 42 #include "executable_image.h" 46 #if defined(USB_DEVICE_CONFIG_EHCI) && (USB_DEVICE_CONFIG_EHCI > 0) 47 #define CONTROLLER_ID kUSB_ControllerEhci0 49 #if defined(USB_DEVICE_CONFIG_KHCI) && (USB_DEVICE_CONFIG_KHCI > 0) 50 #define CONTROLLER_ID kUSB_ControllerKhci0 53 #define USB_DEVICE_INTERRUPT_PRIORITY (4) 56 #define LENGTH_OF_EACH_LBA (512) 58 #define TOTAL_LOGICAL_ADDRESS_BLOCKS_NORMAL (48) 61 #define DISK_SIZE_NORMAL (TOTAL_LOGICAL_ADDRESS_BLOCKS_NORMAL * LENGTH_OF_EACH_LBA) 63 #define LOGICAL_UNIT_SUPPORTED (1U) 65 #define USB_DEVICE_MSC_WRITE_BUFF_NUM 2 66 #define USB_DEVICE_MSC_WRITE_BUFF_SIZE 512 67 #define USB_DEVICE_MSC_READ_BUFF_SIZE 512 68 #define MSD_FLASH_BASE IMAGE_START_ADDRESS 71 #define P_FLASH_BASE 0x00000000 72 #define P_FLASH_SIZE (FSL_FEATURE_FLASH_PFLASH_BLOCK_SIZE * FSL_FEATURE_FLASH_PFLASH_BLOCK_COUNT) 73 #define P_BLOCK_NUM FSL_FEATURE_FLASH_PFLASH_BLOCK_COUNT 74 #define P_SECTOR_SIZE FSL_FEATURE_FLASH_PFLASH_BLOCK_SECTOR_SIZE 76 typedef struct _usb_msc_struct
78 usb_device_handle deviceHandle;
79 class_handle_t mscHandle;
80 uint8_t storageDisk[DISK_SIZE_NORMAL];
82 uint8_t read_write_error;
83 uint8_t currentConfiguration;
84 uint8_t currentInterfaceAlternateSetting[USB_MSC_INTERFACE_COUNT];
94 #if defined(__cplusplus) 100 #if defined(__cplusplus) Definition: msc_disk.h:185
Flash driver state information.
Definition: src/drivers/flash/fsl_flash.h:443