Microchip® Advanced Software Framework

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

Structures and functions required by UDC.

Functions

bool udi_msc_enable (void)
 

Variables

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  )
static

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
static void udi_msc_cbw_wait ( void  )
static
static void udi_msc_clear_sense ( void  )
static
static void udi_msc_csw_invalid ( void  )
static

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 
)
static

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
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_disable ( void  )

References UDI_MSC_DISABLE_EXT.

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
static void udi_msc_sense_command_invalid ( void  )
static
static void udi_msc_sense_fail_busy_or_change ( void  )
static
static void udi_msc_sense_fail_not_present ( void  )
static
static void udi_msc_sense_fail_protected ( void  )
static
static void udi_msc_spc_prevent_allow_medium_removal ( void  )
static
static void udi_msc_spc_requestsense ( void  )
static
static void udi_msc_spc_testunitready ( void  )
static
static void udi_msc_trans_ack ( udd_ep_status_t  status,
iram_size_t  n,
udd_ep_id_t  ep 
)
static

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.

Parameters
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.
Returns
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_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,
}
bool udi_msc_setup(void)
Definition: udi_msc.c:396
uint8_t udi_msc_getsetting(void)
Definition: udi_msc.c:440
#define NULL
Definition: src/include/lwip/def.h:47
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.