Atmel Software Framework

uhi_msc.h File Reference

USB host driver for Mass Storage Class interface.

Copyright (C) 2011-2012 Atmel Corporation. All rights reserved.

#include "conf_usb_host.h"
#include "usb_protocol_msc.h"
#include "spc_protocol.h"
#include "sbc_protocol.h"
#include "uhc.h"
#include "uhi.h"

Data Structures

struct  uhi_msc_lun_t
 LUN structure information. More...
 

Macros

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

Functions

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. More...
 
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. More...
 
Functions required by UHC
uhc_enum_status_t uhi_msc_install (uhc_device_t *dev)
 
void uhi_msc_enable (uhc_device_t *dev)
 
void uhi_msc_uninstall (uhc_device_t *dev)
 
Functions to access at LUNs
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 Note: The sector size used to define the data section is the sector size returned by LUN in field. 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 Note: The sector size used to define the data section is the sector size returned by LUN in field. More...
 

Struct to access at Logical Unit Numbers (LUNs)

enum  lun_status_t {
  LUN_GOOD = 0,
  LUN_FAIL = 1,
  LUN_NOT_PRESENT = 2,
  LUN_BUSY = 3
}
 Status of LUN. More...
 
typedef void(* uhi_msc_scsi_callback_t )(bool)
 Callback type used by uhi_msc_scsi() functions. More...