Microchip® Advanced Software Framework

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Interface with USB Device Core (UDC)

Structures and functions required by UDC.


bool udi_msc_enable (void)


UDC_DESC_STORAGE udi_api_t udi_api_msc
 Global structure which contains standard UDI interface for UDC. More...
UDC_DESC_STORAGE udi_api_t udi_api_msc
 Global structure which contains standard UDI API for UDC. More...

Routines manage SCSI Commands

Number of lun

void udi_msc_disable (void)
bool udi_msc_setup (void)
uint8_t udi_msc_getsetting (void)
static void udi_msc_cbw_invalid (void)
static void udi_msc_csw_invalid (void)
static void udi_msc_cbw_wait (void)
static void udi_msc_cbw_received (udd_ep_status_t status, iram_size_t nb_received, udd_ep_id_t ep)
static bool udi_msc_cbw_validate (uint32_t alloc_len, uint8_t dir_flag)
static void udi_msc_data_send (uint8_t *buffer, uint8_t buf_size)
static void udi_msc_data_sent (udd_ep_status_t status, iram_size_t nb_sent, udd_ep_id_t ep)
static void udi_msc_csw_process (void)
void udi_msc_csw_send (void)
static void udi_msc_csw_sent (udd_ep_status_t status, iram_size_t nb_sent, udd_ep_id_t ep)
static void udi_msc_clear_sense (void)
static void udi_msc_sense_fail (uint8_t sense_key, uint16_t add_sense, uint32_t lba)
static void udi_msc_sense_pass (void)
static void udi_msc_sense_fail_not_present (void)
static void udi_msc_sense_fail_busy_or_change (void)
static void udi_msc_sense_fail_hardware (void)
static void udi_msc_sense_fail_protected (void)
static void udi_msc_sense_fail_cdb_invalid (void)
static void udi_msc_sense_command_invalid (void)
static void udi_msc_spc_requestsense (void)
static void udi_msc_spc_inquiry (void)
static bool udi_msc_spc_testunitready_global (void)
static void udi_msc_spc_testunitready (void)
static void udi_msc_spc_mode_sense (bool b_sense10)
static void udi_msc_spc_prevent_allow_medium_removal (void)
static void udi_msc_sbc_start_stop (void)
static void udi_msc_sbc_read_capacity (void)
static void udi_msc_sbc_trans (bool b_read)
bool udi_msc_process_trans (void)
 Process the background read/write commands. More...
static void udi_msc_trans_ack (udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep)
bool udi_msc_trans_block (bool b_read, uint8_t *block, iram_size_t block_size, void(*callback)(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep))
 Transfers data to/from USB MSC endpoints. More...

static void udi_msc_cbw_invalid ( void  )

References UDI_MSC_EP_OUT.

Referenced by udi_msc_cbw_received().

static bool udi_msc_cbw_validate ( uint32_t  alloc_len,
uint8_t  dir_flag 
static void udi_msc_cbw_wait ( void  )
static void udi_msc_clear_sense ( void  )
static void udi_msc_csw_invalid ( void  )

References UDI_MSC_EP_IN.

Referenced by udi_msc_cbw_received().

void udi_msc_csw_send ( void  )

References udi_msc_csw_sent(), and UDI_MSC_EP_IN.

Referenced by udi_msc_csw_process().

static void udi_msc_csw_sent ( udd_ep_status_t  status,
iram_size_t  nb_sent,
udd_ep_id_t  ep 

References udi_msc_cbw_wait(), and UNUSED.

Referenced by udi_msc_csw_send().

static void udi_msc_data_send ( uint8_t *  buffer,
uint8_t  buf_size 
static void udi_msc_data_sent ( udd_ep_status_t  status,
iram_size_t  nb_sent,
udd_ep_id_t  ep 
void udi_msc_disable ( void  )
bool udi_msc_enable ( void  )
uint8_t udi_msc_getsetting ( void  )
bool udi_msc_process_trans ( void  )
static void udi_msc_sbc_start_stop ( void  )
static void udi_msc_sense_command_invalid ( void  )
static void udi_msc_sense_fail_busy_or_change ( void  )
static void udi_msc_sense_fail_not_present ( void  )
static void udi_msc_sense_fail_protected ( void  )
static void udi_msc_spc_prevent_allow_medium_removal ( void  )
static void udi_msc_spc_requestsense ( void  )
static void udi_msc_spc_testunitready ( void  )
static void udi_msc_trans_ack ( udd_ep_status_t  status,
iram_size_t  n,
udd_ep_id_t  ep 

References status, UDD_EP_TRANSFER_OK, and UNUSED.

Referenced by udi_msc_trans_block().

bool udi_msc_trans_block ( bool  b_read,
uint8_t *  block,
iram_size_t  block_size,
void(*)(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep)  callback 

Transfers data to/from USB MSC endpoints.

b_readMemory to USB, if true
blockBuffer on Internal RAM to send or fill
block_sizeBuffer size to send or fill
callbackFunction to call at the end of transfer. If NULL then the routine exit when transfer is finish.
1 if function was successfully done, otherwise 0.

References callback, NULL, UDI_MSC_EP_IN, UDI_MSC_EP_OUT, and udi_msc_trans_ack().

Referenced by at45dbx_usb_read_10(), at45dbx_usb_write_10(), sd_mmc_spi_read_multiple_sector_callback(), sd_mmc_spi_write_multiple_sector_callback(), sd_mmc_usb_read_10(), sd_mmc_usb_write_10(), and virtual_usb_trans().

Global structure which contains standard UDI interface for UDC.

Global structure which contains standard UDI interface for UDC.

Initial value:
= {
.enable = udi_msc_enable,
.disable = udi_msc_disable,
.setup = udi_msc_setup,
.getsetting = udi_msc_getsetting,
.sof_notify = NULL,
#define NULL
Definition: lwip-1.4.0/src/include/lwip/def.h:47
bool udi_msc_setup(void)
Definition: udi_msc.c:396
uint8_t udi_msc_getsetting(void)
Definition: udi_msc.c:440
void udi_msc_disable(void)
Definition: udi_msc.c:387
bool udi_msc_enable(void)

Global structure which contains standard UDI API for UDC.

Global structure which contains standard UDI interface for UDC.