| NUC472_NUC442_BSP V3.03.003 The Board Support Package for NUC472/NUC442

usbh_umas.h
Go to the documentation of this file.
1/**************************************************************************/
12#ifndef _USBH_UMAS_H_
13#define _USBH_UMAS_H_
14
15#ifdef __cplusplus
16 extern "C"
17{
18#endif
19
20
33 typedef struct
34{
35 USB_DEV_T *pusb_dev;
36 uint16_t vendor_id;
37 uint16_t product_id;
38 uint32_t sector_size;
39 uint32_t sector_number;
40} mass_disk_t; /* end of group NUC472_442_USBH_MASS_EXPORTED_STRUCTURES */
43
44
46
47/*----------------------------
48 * APIs for FATFS
49 *----------------------------*/
50 extern int usbh_umas_disk_status(void);
51 extern DRESULT usbh_umas_ioctl(int cmd, void *buff);
52 extern DRESULT usbh_umas_read(uint8_t *buff, uint32_t sector_no, int number_of_sector);
53 extern DRESULT usbh_umas_write(uint8_t *buff, uint32_t sector_no, int number_of_sector);
54
56
57
58
63 extern int32_t USBH_MassInit(void);
64 extern int32_t USBH_MassGetDiskList(mass_disk_t * dlist[], int max);
65 extern int32_t USBH_MassRawRead(mass_disk_t *disk, uint32_t sectorN, int32_t scnt, uint8_t *buff);
66 extern int32_t USBH_MassRawWrite(mass_disk_t *disk, uint32_t sectorN, int32_t scnt, uint8_t *buff);
67 /* end of group NUC472_442_USBH_MASS_EXPORTED_FUNCTIONS */
69 /* end of group NUC472_442_USBH_MASS_Driver */
71 /* end of group NUC472_442_Device_Driver */
73
74
75#ifdef __cplusplus
76}
77#endif
78
79#endif
80
81/*** (C) COPYRIGHT 2014 Nuvoton Technology Corp. ***/
82
83
USB_DEV_T
HIDDEN_SYMBOLS struct usb_device USB_DEV_T
USBH_MassGetDiskList
int32_t USBH_MassGetDiskList(mass_disk_t *dlist[], int max)
Obtain the list of currently connected USB Mass Storage disk.
Definition: UmasDriver.c:587
USBH_MassRawRead
int32_t USBH_MassRawRead(mass_disk_t *disk, uint32_t sectorN, int32_t scnt, uint8_t *buff)
Read raw data from connected USB Mass Storage disk.
Definition: Umas_FATFS.c:468
mass_disk_t::vendor_id
uint16_t vendor_id
Definition: usbh_umas.h:36
mass_disk_t::sector_size
uint32_t sector_size
Definition: usbh_umas.h:38
mass_disk_t::pusb_dev
USB_DEV_T * pusb_dev
Definition: usbh_umas.h:35
mass_disk_t::product_id
uint16_t product_id
Definition: usbh_umas.h:37
USBH_MassRawWrite
int32_t USBH_MassRawWrite(mass_disk_t *disk, uint32_t sectorN, int32_t scnt, uint8_t *buff)
Write raw data to connected USB Mass Storage disk.
Definition: Umas_FATFS.c:498
USBH_MassInit
int32_t USBH_MassInit(void)
Initialize USB Host Mass Storage driver.
Definition: UmasDriver.c:564
mass_disk_t::sector_number
uint32_t sector_number
Definition: usbh_umas.h:39
mass_disk_t
Definition: usbh_umas.h:34