Middleware that implements a block media interface on the media of your choice. This module implements the Block Media Interface.
Overview
Features
This module is for using Block media with user-selected media.
Configuration
Block Media User has no output config settings.
The user is required to create the config settings etc. in the application.
The figure below is an example of the config definition when the user media in USB PMSC is RAM.
{
.
open = RM_BLOCK_MEDIA_RAM_Open,
.mediaInit = RM_BLOCK_MEDIA_RAM_MediaInit,
.read = RM_BLOCK_MEDIA_RAM_Read,
.write = RM_BLOCK_MEDIA_RAM_Write,
.erase = RM_BLOCK_MEDIA_RAM_Erase,
.infoGet = RM_BLOCK_MEDIA_RAM_InfoGet,
.statusGet = RM_BLOCK_MEDIA_RAM_StatusGet,
.close = RM_BLOCK_MEDIA_RAM_Close,
};
{.
p_extend = NULL, .p_callback = r_usb_pmsc_block_media_event_callback, .p_context = NULL, };
{.
p_api = &g_rm_block_media_on_user_media, .p_ctrl = NULL, .p_cfg = &g_rm_block_media0_cfg, };
- Note
- If you use block_media_user, you need to create a function that matches the media you are using.
In the above example, this is the function with RM_BLOCK_MEDIA_.
Register the created function in rm_block_media_api_t.
The registered rm_block_media_api_t is registered in p_api, which is a member of rm_block_media_instance_t.
Clock Configuration
This module has no required clock configurations.
Pin Configuration
This module does not use I/O pins.
Examples
Basic Example
Please refer to USB Peripheral Mass Storage Class (r_usb_pmsc) for the PMSC application given as an example.