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

Functions | Variables
USB Host Mass Storage Driver Exported Functions
NUC472/NUC442 Device Driver » USB Host Mass Storage Driver » USB Host Mass Storage Driver Exported Structures
Collaboration diagram for USB Host Mass Storage Driver Exported Functions:

## Functions
int32_t | USBH_MassInit (void)
| Initialize USB Host Mass Storage driver. More...
int32_t | USBH_MassGetDiskList (mass_disk_t *dlist[], int max)
| Obtain the list of currently connected USB Mass Storage disk. More...
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. More...
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. More...

## Variables
USB_DEV_T * | mass_disk_t::pusb_dev
uint16_t | mass_disk_t::vendor_id
uint16_t | mass_disk_t::product_id
uint32_t | mass_disk_t::sector_size
uint32_t | mass_disk_t::sector_number

## Detailed Description

USB Mass Storage disk

## Function Documentation

## ◆ USBH_MassGetDiskList()

int32_t USBH_MassGetDiskList | ( | mass_disk_t * | dlist[],
|  | int | max
| ) |  |

Obtain the list of currently connected USB Mass Storage disk.

Parameters

  [out] | dlist | An array of disk pointer.
  [in] | max | Maximum avalable entries of dlist.

Returns
  Number of disk found.

Return values

  0 | No disk found
  Otherwise | Number of disk

Definition at line 587 of file UmasDriver.c.

## ◆ USBH_MassInit()

int32_t USBH_MassInit | ( | void |  | ) |

Initialize USB Host Mass Storage driver.

Returns
  Success or not.

Return values

  0 | Success
  Otherwise | Failed

Definition at line 564 of file UmasDriver.c.

Here is the call graph for this function:

## ◆ 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.

Parameters

  [in] | disk | The disk pointer.
  [in] | sectorN | The logical sector number to be read.
  [in] | scnt | Number of continuous sectors to be read.
  [out] | buff | Data buffer used to hold data read from device.

Returns
  Success or not.

Return values

  0 | Success
  -1 | Failed

Definition at line 468 of file Umas_FATFS.c.

## ◆ 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.

Parameters

  [in] | disk | The disk pointer.
  [in] | sectorN | The logical sector number to be written.
  [in] | scnt | Number of continuous sectors to be written.
  [in] | buff | Data to be written to device.

Returns
  Success or not.

Return values

  0 | Success
  -1 | Failed

Definition at line 498 of file Umas_FATFS.c.

## Variable Documentation

## ◆ product_id

uint16_t mass_disk_t::product_id

Product ID in device descriptor

Definition at line 37 of file usbh_umas.h.

## ◆ pusb_dev

USB_DEV_T* mass_disk_t::pusb_dev

This USB device.

Definition at line 35 of file usbh_umas.h.

## ◆ sector_number

uint32_t mass_disk_t::sector_number

Total number of sectors

Definition at line 39 of file usbh_umas.h.

## ◆ sector_size

uint32_t mass_disk_t::sector_size

Bytes per sector

Definition at line 38 of file usbh_umas.h.

## ◆ vendor_id

uint16_t mass_disk_t::vendor_id

Vendor ID in device descriptor

Definition at line 36 of file usbh_umas.h.