RZT Flexible Software Package Documentation  Release v2.3.0

 
Shared Memory Interface

Detailed Description

Interface for Shared Memory.

Summary

The SHARED_MEMORY interface provides Shared Memory functionality.

Data Structures

struct  shared_memory_callback_args_t
 
struct  shared_memory_status_t
 
struct  shared_memory_cfg_t
 
struct  shared_memory_api_t
 
struct  shared_memory_instance_t
 

Typedefs

typedef void shared_memory_ctrl_t
 

Enumerations

enum  shared_memory_state_t
 

Data Structure Documentation

◆ shared_memory_callback_args_t

struct shared_memory_callback_args_t

SHARED_MEMORY callback parameter definition

Data Fields
void const * p_context Pointer to user-provided context.
shared_memory_state_t state Connection status with the communication partner.

◆ shared_memory_status_t

struct shared_memory_status_t

SHARED_MEMORY status indicators

Data Fields
shared_memory_state_t state State of this driver.

◆ shared_memory_cfg_t

struct shared_memory_cfg_t

SHARED_MEMORY configuration block

Data Fields

uint8_t semaphore_reg
 Identifier recognizable by implementation. More...
 
uint8_t * p_memory
 Start address of shared memory region.
 
uint32_t memory_size
 Size of shared memory area in bytes.
 
void(* p_callback )(shared_memory_callback_args_t *p_args)
 Pointer to callback function. More...
 
void const * p_context
 Pointer to the user-provided context.
 
void const * p_extend
 Extended configuration of hardware dependent. More...
 

Field Documentation

◆ semaphore_reg

uint8_t shared_memory_cfg_t::semaphore_reg

Identifier recognizable by implementation.

Generic configuration

◆ p_callback

void(* shared_memory_cfg_t::p_callback) (shared_memory_callback_args_t *p_args)

Pointer to callback function.

Parameters to control software behavior

◆ p_extend

void const* shared_memory_cfg_t::p_extend

Extended configuration of hardware dependent.

Extended configuration

◆ shared_memory_api_t

struct shared_memory_api_t

Interface definition for inter-core data access via inter-core shared memory

Data Fields

fsp_err_t(* open )(shared_memory_ctrl_t *const p_ctrl, shared_memory_cfg_t const *const p_cfg)
 
fsp_err_t(* read )(shared_memory_ctrl_t *const p_ctrl, uint8_t *const p_dest, uint32_t const offset, uint32_t const bytes)
 
fsp_err_t(* write )(shared_memory_ctrl_t *const p_ctrl, uint8_t *const p_src, uint32_t const offset, uint32_t const bytes)
 
fsp_err_t(* statusGet )(shared_memory_ctrl_t *const p_ctrl, shared_memory_status_t *p_status)
 
fsp_err_t(* callbackSet )(shared_memory_ctrl_t *const p_ctrl, void(*p_callback)(shared_memory_callback_args_t *), void const *const p_context, shared_memory_callback_args_t *const p_callback_memory)
 
fsp_err_t(* close )(shared_memory_ctrl_t *const p_ctrl)
 

Field Documentation

◆ open

fsp_err_t(* shared_memory_api_t::open) (shared_memory_ctrl_t *const p_ctrl, shared_memory_cfg_t const *const p_cfg)

Opens the shared memory driver and initializes the hardware.

Parameters
[in]p_ctrlPointer to control block. Must be declared by user. Elements are set here.
[in]p_cfgPointer to configuration structure.

◆ read

fsp_err_t(* shared_memory_api_t::read) (shared_memory_ctrl_t *const p_ctrl, uint8_t *const p_dest, uint32_t const offset, uint32_t const bytes)

Performs a read operation from inter-core shared memory.

Parameters
[in]p_ctrlPointer to control block set in shared_memory_api_t::open call.
[out]p_destPointer to the location to store read data.
[in]offsetOffset position from the start address of the shared memory to read (bytes).
[in]bytesNumber of bytes to read.

◆ write

fsp_err_t(* shared_memory_api_t::write) (shared_memory_ctrl_t *const p_ctrl, uint8_t *const p_src, uint32_t const offset, uint32_t const bytes)

Performs a write operation to inter-core shared memory.

Parameters
[in]p_ctrlPointer to control block set in shared_memory_api_t::open call.
[in]p_srcPointer to the location to get write data from.
[in]offsetOffset position from the start address of the shared memory to write (bytes).
[in]bytesNumber of bytes to write.

◆ statusGet

fsp_err_t(* shared_memory_api_t::statusGet) (shared_memory_ctrl_t *const p_ctrl, shared_memory_status_t *p_status)

Gets the status of the shared memory.

Parameters
[in]p_ctrlPointer to control block set in shared_memory_api_t::open call.
[out]p_statusPointer to store current status.

◆ callbackSet

fsp_err_t(* shared_memory_api_t::callbackSet) (shared_memory_ctrl_t *const p_ctrl, void(*p_callback)(shared_memory_callback_args_t *), void const *const p_context, shared_memory_callback_args_t *const p_callback_memory)

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

Parameters
[in]p_ctrlPointer to control block set in shared_memory_api_t::open call.
[in]p_callbackCallback function
[in]p_contextPointer to send to callback function
[in]p_callback_memoryPointer to volatile memory where callback structure can be allocated. Callback arguments allocated here are only valid during the callback.

◆ close

fsp_err_t(* shared_memory_api_t::close) (shared_memory_ctrl_t *const p_ctrl)

Closes the driver and releases the device.

Parameters
[in]p_ctrlPointer to control block set in shared_memory_api_t::open call.

◆ shared_memory_instance_t

struct shared_memory_instance_t

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

Data Fields
shared_memory_ctrl_t * p_ctrl Pointer to the control structure for this instance.
shared_memory_cfg_t const * p_cfg Pointer to the configuration structure for this instance.
shared_memory_api_t const * p_api Pointer to the API structure for this instance.

Typedef Documentation

◆ shared_memory_ctrl_t

typedef void shared_memory_ctrl_t

SHARED_MEMORY control block. Allocate an instance specific control block to pass into the SHARED_MEMORY API calls.

Enumeration Type Documentation

◆ shared_memory_state_t

States of SHARED_MEMORY module

Enumerator
SHARED_MEMORY_STATE_NOT_READY 

This driver has been opened. But the opposite driver has not.

SHARED_MEMORY_STATE_READY_TO_WRITE 

This driver can write data.

SHARED_MEMORY_STATE_READY_TO_READ_WRITE 

This driver can write and read data.