RA Flexible Software Package Documentation  Release v5.3.0

 
Virtual EEPROM Interface

Detailed Description

Interface for Virtual EEPROM access.

Summary

The Virtual EEPROM Port configures a fail-safe key value store designed for microcontrollers on top of a lower level storage device.

Data Structures

struct  rm_vee_callback_args_t
 
struct  rm_vee_cfg_t
 
struct  rm_vee_api_t
 
struct  rm_vee_instance_t
 

Typedefs

typedef void rm_vee_ctrl_t
 

Enumerations

enum  rm_vee_state_t
 

Data Structure Documentation

◆ rm_vee_callback_args_t

struct rm_vee_callback_args_t

User configuration structure, used in open function

Data Fields
rm_vee_state_t state State of the Virtual EEPROM.
void const * p_context Placeholder for user data. Set in rm_vee_api_t::open function in::rm_vee_cfg_t.

◆ rm_vee_cfg_t

struct rm_vee_cfg_t

User configuration structure, used in open function

Data Fields

uint32_t start_addr
 Start address to be used for Virtual EEPROM memory.
 
uint32_t num_segments
 Number of segments to divide the volume into.
 
uint32_t total_size
 Total size of the volume.
 
uint32_t ref_data_size
 Size of the reference data stored at the end of the segment.
 
uint32_t record_max_id
 Maximum record ID that can be used.
 
uint16_t * rec_offset
 Pointer to buffer used for record offset caching.
 
void(* p_callback )(rm_vee_callback_args_t *p_args)
 Callback provided when a Virtual EEPROM event occurs.
 
void const * p_context
 Placeholder for user data.
 
void const * p_extend
 Pointer to hardware dependent configuration.
 

◆ rm_vee_api_t

struct rm_vee_api_t

Virtual EEPROM interface API.

Data Fields

fsp_err_t(* open )(rm_vee_ctrl_t *const p_ctrl, rm_vee_cfg_t const *const p_cfg)
 
fsp_err_t(* recordWrite )(rm_vee_ctrl_t *const p_ctrl, uint32_t const rec_id, uint8_t const *const p_rec_data, uint32_t num_bytes)
 
fsp_err_t(* recordPtrGet )(rm_vee_ctrl_t *const p_ctrl, uint32_t rec_id, uint8_t **const pp_rec_data, uint32_t *const p_num_bytes)
 
fsp_err_t(* refDataWrite )(rm_vee_ctrl_t *const p_ctrl, uint8_t const *const p_ref_data)
 
fsp_err_t(* refDataPtrGet )(rm_vee_ctrl_t *const p_ctrl, uint8_t **const pp_ref_data)
 
fsp_err_t(* statusGet )(rm_vee_ctrl_t *const p_ctrl, rm_vee_status_t *const p_status)
 
fsp_err_t(* refresh )(rm_vee_ctrl_t *const p_ctrl)
 
fsp_err_t(* format )(rm_vee_ctrl_t *const p_ctrl, uint8_t const *const p_ref_data)
 
fsp_err_t(* callbackSet )(rm_vee_ctrl_t *const p_ctrl, void(*p_callback)(rm_vee_callback_args_t *), void const *const p_context, rm_vee_callback_args_t *const p_callback_memory)
 
fsp_err_t(* close )(rm_vee_ctrl_t *const p_ctrl)
 

Field Documentation

◆ open

fsp_err_t(* rm_vee_api_t::open) (rm_vee_ctrl_t *const p_ctrl, rm_vee_cfg_t const *const p_cfg)

Initializes the driver’s internal structures and opens the Flash driver.

Parameters
[in]p_ctrlPointer to control block. Must be declared by user. Elements set here.
[in]p_cfgPointer to configuration structure. All elements of this structure must be set by user.

◆ recordWrite

fsp_err_t(* rm_vee_api_t::recordWrite) (rm_vee_ctrl_t *const p_ctrl, uint32_t const rec_id, uint8_t const *const p_rec_data, uint32_t num_bytes)

Writes a record to data flash.

Parameters
[in]p_ctrlPointer to control block.
[in]rec_idID of record to write.
[in]p_rec_dataPointer to record data to write.
[in]num_bytesLength of data to write.

◆ recordPtrGet

fsp_err_t(* rm_vee_api_t::recordPtrGet) (rm_vee_ctrl_t *const p_ctrl, uint32_t rec_id, uint8_t **const pp_rec_data, uint32_t *const p_num_bytes)

This function gets the pointer to the most recent version of a record specified by ID.

Parameters
[in]p_ctrlPointer to control block.
[in]rec_idID of record to locate.
[in]pp_rec_dataPointer to set to the most recent version of the record.
[in]p_num_bytesVariable to load with record length.

◆ refDataWrite

fsp_err_t(* rm_vee_api_t::refDataWrite) (rm_vee_ctrl_t *const p_ctrl, uint8_t const *const p_ref_data)

Writes new Reference data to the reference update area.

Parameters
[in]p_ctrlPointer to control block.
[in]p_ref_dataPointer to data to write to the reference data update area.

◆ refDataPtrGet

fsp_err_t(* rm_vee_api_t::refDataPtrGet) (rm_vee_ctrl_t *const p_ctrl, uint8_t **const pp_ref_data)

Gets a pointer to the most recent reference data.

Parameters
[in]p_ctrlPointer to control block.
[in]pp_ref_dataPointer to set to the most recent valid reference data.

◆ statusGet

fsp_err_t(* rm_vee_api_t::statusGet) (rm_vee_ctrl_t *const p_ctrl, rm_vee_status_t *const p_status)

Get the current status of the VEE driver.

Parameters
[in]p_ctrlPointer to control block.
[in]p_statusPointer to store the current status of the VEE driver.

◆ refresh

fsp_err_t(* rm_vee_api_t::refresh) (rm_vee_ctrl_t *const p_ctrl)

Manually start a refresh operation.

Parameters
[in]p_ctrlPointer to control block.

◆ format

fsp_err_t(* rm_vee_api_t::format) (rm_vee_ctrl_t *const p_ctrl, uint8_t const *const p_ref_data)

Format the Virtual EEPROM.

Parameters
[in]p_ctrlPointer to control block.
[in]p_ref_dataOptional pointer to reference data to write during format.

◆ callbackSet

fsp_err_t(* rm_vee_api_t::callbackSet) (rm_vee_ctrl_t *const p_ctrl, void(*p_callback)(rm_vee_callback_args_t *), void const *const p_context, rm_vee_callback_args_t *const p_callback_memory)

Specify callback function and optional context pointer and working memory pointer.

Parameters
[in]p_ctrlControl block set in rm_vee_api_t::open call.
[in]p_callbackCallback function to register
[in]p_contextPointer to send to callback function
[in]p_working_memoryPointer to volatile memory where callback structure can be allocated. Callback arguments allocated here are only valid during the callback.

◆ close

fsp_err_t(* rm_vee_api_t::close) (rm_vee_ctrl_t *const p_ctrl)

Closes the module and lower level storage device.

Parameters
[in]p_ctrlControl block set in rm_vee_api_t::open call.

◆ rm_vee_instance_t

struct rm_vee_instance_t

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

Data Fields
rm_vee_ctrl_t * p_ctrl Pointer to the control structure for this instance.
rm_vee_cfg_t const * p_cfg Pointer to the configuration structure for this instance.
rm_vee_api_t const * p_api Pointer to the API structure for this instance.

Typedef Documentation

◆ rm_vee_ctrl_t

typedef void rm_vee_ctrl_t

Virtual EEPROM API control block. Allocate an instance specific control block to pass into the VEE API calls.

Enumeration Type Documentation

◆ rm_vee_state_t

Enumerator
RM_VEE_STATE_READY 

Ready.

RM_VEE_STATE_BUSY 

Operation in progress.

RM_VEE_STATE_REFRESH 

Refresh operation in progress.

RM_VEE_STATE_OVERFLOW 

The amount of data written exceeds the space available.

RM_VEE_STATE_HARDWARE_FAIL 

Lower level hardware failure.