mirror of
https://github.com/STMicroelectronics/stm32-mw-usb-device.git
synced 2026-02-08 20:18:07 -05:00
Release v2.10.0
This commit is contained in:
@@ -86,87 +86,103 @@ USBD_StorageTypeDef USBD_MSC_Template_fops =
|
||||
STORAGE_Inquirydata,
|
||||
|
||||
};
|
||||
/*******************************************************************************
|
||||
* Function Name : Read_Memory
|
||||
* Description : Handle the Read operation from the microSD card.
|
||||
* Input : None.
|
||||
* Output : None.
|
||||
* Return : None.
|
||||
*******************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief Initializes the storage unit (medium)
|
||||
* @param lun: Logical unit number
|
||||
* @retval Status (0 : OK / -1 : Error)
|
||||
*/
|
||||
int8_t STORAGE_Init(uint8_t lun)
|
||||
{
|
||||
UNUSED(lun);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : Read_Memory
|
||||
* Description : Handle the Read operation from the STORAGE card.
|
||||
* Input : None.
|
||||
* Output : None.
|
||||
* Return : None.
|
||||
*******************************************************************************/
|
||||
/**
|
||||
* @brief Returns the medium capacity.
|
||||
* @param lun: Logical unit number
|
||||
* @param block_num: Number of total block number
|
||||
* @param block_size: Block size
|
||||
* @retval Status (0: OK / -1: Error)
|
||||
*/
|
||||
int8_t STORAGE_GetCapacity(uint8_t lun, uint32_t *block_num, uint16_t *block_size)
|
||||
{
|
||||
UNUSED(lun);
|
||||
|
||||
*block_num = STORAGE_BLK_NBR;
|
||||
*block_size = STORAGE_BLK_SIZ;
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : Read_Memory
|
||||
* Description : Handle the Read operation from the STORAGE card.
|
||||
* Input : None.
|
||||
* Output : None.
|
||||
* Return : None.
|
||||
*******************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief Checks whether the medium is ready.
|
||||
* @param lun: Logical unit number
|
||||
* @retval Status (0: OK / -1: Error)
|
||||
*/
|
||||
int8_t STORAGE_IsReady(uint8_t lun)
|
||||
{
|
||||
UNUSED(lun);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : Read_Memory
|
||||
* Description : Handle the Read operation from the STORAGE card.
|
||||
* Input : None.
|
||||
* Output : None.
|
||||
* Return : None.
|
||||
*******************************************************************************/
|
||||
/**
|
||||
* @brief Checks whether the medium is write protected.
|
||||
* @param lun: Logical unit number
|
||||
* @retval Status (0: write enabled / -1: otherwise)
|
||||
*/
|
||||
int8_t STORAGE_IsWriteProtected(uint8_t lun)
|
||||
{
|
||||
UNUSED(lun);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : Read_Memory
|
||||
* Description : Handle the Read operation from the STORAGE card.
|
||||
* Input : None.
|
||||
* Output : None.
|
||||
* Return : None.
|
||||
*******************************************************************************/
|
||||
/**
|
||||
* @brief Reads data from the medium.
|
||||
* @param lun: Logical unit number
|
||||
* @param buf: data buffer
|
||||
* @param blk_addr: Logical block address
|
||||
* @param blk_len: Blocks number
|
||||
* @retval Status (0: OK / -1: Error)
|
||||
*/
|
||||
int8_t STORAGE_Read(uint8_t lun, uint8_t *buf,
|
||||
uint32_t blk_addr, uint16_t blk_len)
|
||||
{
|
||||
UNUSED(lun);
|
||||
UNUSED(buf);
|
||||
UNUSED(blk_addr);
|
||||
UNUSED(blk_len);
|
||||
|
||||
return 0;
|
||||
}
|
||||
/*******************************************************************************
|
||||
* Function Name : Write_Memory
|
||||
* Description : Handle the Write operation to the STORAGE card.
|
||||
* Input : None.
|
||||
* Output : None.
|
||||
* Return : None.
|
||||
*******************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief Writes data into the medium.
|
||||
* @param lun: Logical unit number
|
||||
* @param buf: data buffer
|
||||
* @param blk_addr: Logical block address
|
||||
* @param blk_len: Blocks number
|
||||
* @retval Status (0 : OK / -1 : Error)
|
||||
*/
|
||||
int8_t STORAGE_Write(uint8_t lun, uint8_t *buf,
|
||||
uint32_t blk_addr, uint16_t blk_len)
|
||||
{
|
||||
UNUSED(lun);
|
||||
UNUSED(buf);
|
||||
UNUSED(blk_addr);
|
||||
UNUSED(blk_len);
|
||||
|
||||
return (0);
|
||||
}
|
||||
/*******************************************************************************
|
||||
* Function Name : Write_Memory
|
||||
* Description : Handle the Write operation to the STORAGE card.
|
||||
* Input : None.
|
||||
* Output : None.
|
||||
* Return : None.
|
||||
*******************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief Returns the Max Supported LUNs.
|
||||
* @param None
|
||||
* @retval Lun(s) number
|
||||
*/
|
||||
int8_t STORAGE_GetMaxLun(void)
|
||||
{
|
||||
return (STORAGE_LUN_NBR - 1);
|
||||
|
||||
Reference in New Issue
Block a user