RA Flexible Software Package Documentation  Release v6.0.0

 
FreeRTOS+FAT Port Interface

Detailed Description

Interface for FreeRTOS+FAT port.

Summary

The FreeRTOS+FAT port provides notifications for insertion and removal of removable media and provides initialization functions required by FreeRTOS+FAT.

Data Structures

struct  rm_freertos_plus_fat_callback_args_t
 
struct  rm_freertos_plus_fat_device_t
 
struct  rm_freertos_plus_fat_info_t
 
struct  rm_freertos_plus_fat_cfg_t
 
struct  rm_freertos_plus_fat_disk_cfg_t
 
struct  rm_freertos_plus_fat_api_t
 
struct  rm_freertos_plus_fat_instance_t
 

Typedefs

typedef void rm_freertos_plus_fat_ctrl_t
 

Enumerations

enum  rm_freertos_plus_fat_event_t
 
enum  rm_freertos_plus_fat_type_t
 

Data Structure Documentation

◆ rm_freertos_plus_fat_callback_args_t

struct rm_freertos_plus_fat_callback_args_t

Callback function parameter data

Data Fields
rm_freertos_plus_fat_event_t event The event can be used to identify what caused the callback.
void * p_context Placeholder for user data.

◆ rm_freertos_plus_fat_device_t

struct rm_freertos_plus_fat_device_t

Information obtained from the media device.

Data Fields
uint32_t sector_count Sector count.
uint32_t sector_size_bytes Sector size in bytes.

◆ rm_freertos_plus_fat_info_t

struct rm_freertos_plus_fat_info_t

Basic information about a FAT volume.

Data Fields
uint32_t sector_size Sector size.
uint32_t sectors_per_cluster Sectors per cluster.
uint32_t total_sectors Total number of sectors.
uint32_t free_sectors Current free sectors.
uint8_t * p_volume_label Volume label.
rm_freertos_plus_fat_type_t type FAT type for this disk.
uint8_t partition_number Partition number for this disk.

◆ rm_freertos_plus_fat_cfg_t

struct rm_freertos_plus_fat_cfg_t

FreeRTOS+FAT configuration structure.

Data Fields

void(* p_callback )(rm_freertos_plus_fat_callback_args_t *p_args)
 Pointer to callback function.
 
void * p_context
 User defined context passed into callback function.
 
fsp_err_t(* p_busy_callback )(void *p_busy_context)
 
void * p_busy_context
 User defined context passed into busy callback function.
 
void const * p_extend
 Extension parameter for hardware specific settings.
 

Field Documentation

◆ p_busy_callback

fsp_err_t(* rm_freertos_plus_fat_cfg_t::p_busy_callback) (void *p_busy_context)

The busy callback function is called when the device is busy with a write or erase operation. It can be used to pend the current thread while waiting for the operation to complete and to manage timeouts if required. Set to NULL if pending the thread is not required and the thread will block waiting for the device busy status to clear. If this function returns an error (anything except FSP_SUCCESS), the upper layer function returns FF_ERR_IOMAN_DRIVER_FATAL_ERROR.

◆ rm_freertos_plus_fat_disk_cfg_t

struct rm_freertos_plus_fat_disk_cfg_t

Initializing a FAT disk.

Data Fields
rm_freertos_plus_fat_device_t device Device sector data.
uint32_t cache_size_bytes Chache memory size.
uint8_t * p_cache Pointer to cache memory.
uint8_t partition_number Partition number for this disk.

◆ rm_freertos_plus_fat_api_t

struct rm_freertos_plus_fat_api_t

FreeRTOS+FAT functions implemented at the HAL layer will follow this API.

Data Fields

fsp_err_t(* open )(rm_freertos_plus_fat_ctrl_t *const p_ctrl, rm_freertos_plus_fat_cfg_t const *const p_cfg)
 
fsp_err_t(* mediaInit )(rm_freertos_plus_fat_ctrl_t *const p_ctrl, rm_freertos_plus_fat_device_t *const p_device)
 
fsp_err_t(* diskInit )(rm_freertos_plus_fat_ctrl_t *const p_ctrl, rm_freertos_plus_fat_disk_cfg_t const *const p_disk_cfg, FF_Disk_t *const p_disk)
 
fsp_err_t(* diskDeinit )(rm_freertos_plus_fat_ctrl_t *const p_ctrl, FF_Disk_t *const p_disk)
 
fsp_err_t(* infoGet )(rm_freertos_plus_fat_ctrl_t *const p_ctrl, FF_Disk_t *const p_disk, rm_freertos_plus_fat_info_t *const p_info)
 
fsp_err_t(* close )(rm_freertos_plus_fat_ctrl_t *const p_ctrl)
 

Field Documentation

◆ open

fsp_err_t(* rm_freertos_plus_fat_api_t::open) (rm_freertos_plus_fat_ctrl_t *const p_ctrl, rm_freertos_plus_fat_cfg_t const *const p_cfg)

Open media device.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_cfgPointer to configuration structure.

◆ mediaInit

fsp_err_t(* rm_freertos_plus_fat_api_t::mediaInit) (rm_freertos_plus_fat_ctrl_t *const p_ctrl, rm_freertos_plus_fat_device_t *const p_device)

Initializes a media device. If the device is removable, it must be plugged in prior to calling this API. This function blocks until media initialization is complete.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_devicePointer to store device information.

◆ diskInit

fsp_err_t(* rm_freertos_plus_fat_api_t::diskInit) (rm_freertos_plus_fat_ctrl_t *const p_ctrl, rm_freertos_plus_fat_disk_cfg_t const *const p_disk_cfg, FF_Disk_t *const p_disk)

Initializes a FreeRTOS+FAT FF_Disk_t structure.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_disk_cfgPointer to disk configurations
[out]p_diskPointer to store FreeRTOS+FAT disk structure.

◆ diskDeinit

fsp_err_t(* rm_freertos_plus_fat_api_t::diskDeinit) (rm_freertos_plus_fat_ctrl_t *const p_ctrl, FF_Disk_t *const p_disk)

Deinitializes a FreeRTOS+FAT FF_Disk_t structure.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_disk_cfgPointer to disk configurations
[out]p_diskPointer to store FreeRTOS+FAT disk structure.

◆ infoGet

fsp_err_t(* rm_freertos_plus_fat_api_t::infoGet) (rm_freertos_plus_fat_ctrl_t *const p_ctrl, FF_Disk_t *const p_disk, rm_freertos_plus_fat_info_t *const p_info)

Returns information about the media device.

Parameters
[in]p_ctrlPointer to control structure.
[out]p_infoPointer to information structure. All elements of this structure will be set by the function.

◆ close

fsp_err_t(* rm_freertos_plus_fat_api_t::close) (rm_freertos_plus_fat_ctrl_t *const p_ctrl)

Close media device.

Parameters
[in]p_ctrlPointer to control structure.

◆ rm_freertos_plus_fat_instance_t

struct rm_freertos_plus_fat_instance_t

This structure encompasses everything that is needed to use an instance of this interface.

Data Fields
rm_freertos_plus_fat_ctrl_t * p_ctrl Pointer to the control structure for this instance.
rm_freertos_plus_fat_cfg_t
const *const
p_cfg Pointer to the configuration structure for this instance.
rm_freertos_plus_fat_api_t const * p_api Pointer to the API structure for this instance.

Typedef Documentation

◆ rm_freertos_plus_fat_ctrl_t

FreeRTOS+FAT control structure

Enumeration Type Documentation

◆ rm_freertos_plus_fat_event_t

Events that can trigger a callback function

Enumerator
RM_FREERTOS_PLUS_FAT_EVENT_MEDIA_REMOVED 

Media removed event.

RM_FREERTOS_PLUS_FAT_EVENT_MEDIA_INSERTED 

Media inserted event.

RM_FREERTOS_PLUS_FAT_EVENT_MEDIA_SUSPEND 

Media suspended event.

RM_FREERTOS_PLUS_FAT_EVENT_MEDIA_RESUME 

Media resumed event.

◆ rm_freertos_plus_fat_type_t

FAT filesystem types.

Enumerator
RM_FREERTOS_PLUS_FAT_TYPE_FAT32 

FAT32 disk.

RM_FREERTOS_PLUS_FAT_TYPE_FAT16 

FAT16 disk.

RM_FREERTOS_PLUS_FAT_TYPE_FAT12 

FAT12 disk.