Microchip® Advanced Software Framework

uhi_msc_doc.h File Reference

USB host driver for Mass Storage Class interface.

Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.

Data Structures

struct  uhi_msc_lun_t
 Logical Unit Number (LUN) structure information. More...
 

Macros

Interface with USB Host Core (UHC)

Definition and functions required by UHC.

#define UHI_MSC
 Global definition which contains standard UHI API for UHC. More...
 

Typedefs

typedef void(* uhi_msc_scsi_callback_t )(bool)
 Callback type used by uhi_msc_scsi() functions. More...
 

Enumerations

enum  lun_status_t {
  LUN_GOOD = 0,
  LUN_FAIL = 1,
  LUN_NOT_PRESENT = 2,
  LUN_BUSY = 3
}
 Status of LUN. More...
 

Functions

Functions Required by UHC
uhc_enum_status_t uhi_msc_install (uhc_device_t *dev)
 Install interface. More...
 
void uhi_msc_enable (uhc_device_t *dev)
 Enable the interface. More...
 
void uhi_msc_uninstall (uhc_device_t *dev)
 Uninstall the interface (if installed). More...
 
UHI for Mass Storage Class

Common APIs used by high level application to use this USB host class.

bool uhi_msc_is_available (void)
 Tests if the interface UHI Mass Storage is available. More...
 
uint8_t uhi_msc_get_lun (void)
 Gives the number of LUN available. More...
 
uhi_msc_lun_tuhi_msc_get_lun_desc (uint8_t lun)
 Gives information about a LUN. More...
 
bool uhi_msc_scsi_test_unit_ready (uint8_t lun, uhi_msc_scsi_callback_t callback)
 Checks and update the status of the LUN. More...
 
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. More...
 
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. More...
 
USB Host Mass Storage Interface for Control Access Module

Layer added on UHI MSC interface to allow the usage of control access module.

The control access module provides a common access at all memories and it is used by the File Systems available in ASF.

uint8_t uhi_msc_mem_get_lun (void)
 Gives the number of available LUN. More...
 
Ctrl_status uhi_msc_mem_test_unit_ready (uint8_t lun)
 Checks and update the status of the LUN. More...
 
Ctrl_status uhi_msc_mem_read_capacity (uint8_t lun, uint32_t *u32_nb_sector)
 Returns the capacity of the LUN. More...
 
uint8_t uhi_msc_mem_read_sector_size (uint8_t lun)
 Returns the sector size of the LUN. More...
 
bool uhi_msc_mem_wr_protect (uint8_t lun)
 Checks if the LUN is write protected. More...
 
bool uhi_msc_mem_removal (void)
 Checks if the device is removed. More...
 
Ctrl_status uhi_msc_mem_read_10_ram (uint32_t addr, void *ram)
 Reads 512 bytes from the current LUN. More...
 
Ctrl_status uhi_msc_mem_write_10_ram (uint32_t addr, const void *ram)
 Writes 512 bytes to the current LUN. More...