SAMV71 Xplained Ultra Software Package 1.5

uhi_msc.c File Reference

USB host Mass Storage Class interface. More...

#include "conf_usb_host.h"
#include "USBHDriver.h"
#include "USBH.h"
#include "uhi_msc.h"
#include <string.h>

Go to the source code of this file.

Data Structures

struct  uhi_msc_dev_t
 USB MSC device information. More...

Defines

#define UHI_MSC_NOTIFY_NEW_LUN_EXT
#define UHI_MSC_SCSI_TIMEOUT   20000
 Timeout on SCSI commands.

Typedefs

typedef void(* uhi_msc_scsi_sense_callback_t )(void)
 Callback type used by SCSI sense command.

Functions

Routines to initialize the MSC devices

SCSI commands

SCSI protocol sub routines

Interface used by UHC module

USBH_enum_status_t uhi_msc_install (USBH_device_t *dev)
void uhi_msc_enable (USBH_device_t *dev)
void uhi_msc_uninstall (USBH_device_t *dev)
External SCSI commands

bool uhi_msc_is_available (void)
 Tests if the interface UHI Mass Storage is available The UHI Mass Storage can be busy during the enumeration of a USB Device MSC.
uint8_t uhi_msc_get_lun (void)
 Gives the number of LUN available Note: A LUN can be available, but with a status LUN_NOT_PRESENT. It is the case for a card reader without card.
uhi_msc_lun_tuhi_msc_get_lun_desc (uint8_t lun)
 Gives information about a LUN.
bool uhi_msc_scsi_test_unit_ready (uint8_t lun, uhi_msc_scsi_callback_t callback)
 Checks and update the status of the LUN.
bool uhi_msc_scsi_read_10 (uint8_t lun, uint32_t addr, uint8_t *ram, uint8_t nb_sector, uhi_msc_scsi_callback_t callback)
 Reads a LUN data section to RAM buffer Note: The sector size used to define the data section is the sector size returned by LUN in field.
bool uhi_msc_scsi_write_10 (uint8_t lun, uint32_t addr, const uint8_t *ram, uint8_t nb_sector, uhi_msc_scsi_callback_t callback)
 Writes a RAM buffer in a LUN data section Note: The sector size used to define the data section is the sector size returned by LUN in field.

Internal defines and variables to manage MSC unit



#define uhi_msc_dev_sel   (&uhi_msc_dev)
 Current USB MSC device selected by the UHI MSC.



#define uhi_msc_lun_num_sel   uhi_msc_cbw.bCBWLUN

Detailed Description

USB host Mass Storage Class interface.

Definition in file uhi_msc.c.


Variable Documentation

AUDHeaderDescriptor1 header

Header descriptor (with one slave interface).

Header descriptor.

CDC header functional descriptor.

Definition at line 111 of file uhi_msc.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines