RA Flexible Software Package Documentation  Release v5.3.0

 
Data Collector Interface

Detailed Description

Interface for RAI Data Collector.

Summary

The rai data collector interface provides functionality to collect data from differnet channels using snapshot mode, data feed mode or mixed mode.

Data Structures

struct  rai_data_collector_error_callback_args_t
 
struct  rai_data_collector_frame_buffer_t
 
struct  rai_data_collector_callback_args_t
 
struct  rai_data_collector_snapshot_cfg_t
 
struct  rai_data_collector_data_feed_cfg_t
 
struct  rai_data_collector_cfg_t
 
struct  rai_data_collector_api_t
 
struct  rai_data_collector_instance_t
 

Typedefs

typedef void rai_data_collector_ctrl_t
 

Enumerations

enum  rai_data_collector_data_type_t
 
enum  rai_data_collector_error_event_t
 

Data Structure Documentation

◆ rai_data_collector_error_callback_args_t

struct rai_data_collector_error_callback_args_t

Error callback function parameter

Data Fields
uint8_t instance_id Instance ID.
rai_data_collector_error_event_t event Error event.

◆ rai_data_collector_frame_buffer_t

struct rai_data_collector_frame_buffer_t

Frame buffer structure

Data Fields
void * p_buf Pointer to data buffer.
rai_data_collector_data_type_t data_type Data samples in the buffer.

◆ rai_data_collector_callback_args_t

struct rai_data_collector_callback_args_t

Data ready callback function parameter

Data Fields
uint8_t frames Number of frame buffers.
uint8_t instance_id Instance id.
uint32_t frame_buf_len Frame buffers shall have the same amount of data sample.
rai_data_collector_frame_buffer_t
const *
p_frame_buf Array of frame buffers.
void const * p_context Pointer to the user-provided context.

◆ rai_data_collector_snapshot_cfg_t

struct rai_data_collector_snapshot_cfg_t

Snapshot mode configuration

Data Fields
uint8_t channels Total snapshot mode channels.
uint16_t transfer_len DTC transfer length.
timer_instance_t const * p_timer Pointer to timer instance.
transfer_instance_t const * p_transfer Pointer to DTC instance.

◆ rai_data_collector_data_feed_cfg_t

struct rai_data_collector_data_feed_cfg_t

Data feed mode configuration

Data Fields
uint8_t channels Total data feed mode channels.

◆ rai_data_collector_cfg_t

struct rai_data_collector_cfg_t

RAI Data Collector general configuration

Data Fields

uint32_t channels: 8
 Total number of channels.
 
uint32_t instance_id: 8
 Instance id.
 
uint32_t virt_channels: 8
 Virtual channels.
 
uint32_t reserved: 8
 Reserved.
 
uint32_t channel_ready_mask
 Bitmask of configured channels.
 
uint32_t required_frame_len
 Length of each frame buffer.
 
rai_data_collector_snapshot_cfg_t const * p_snapshot_cfg
 Pointer to snapshot mode configuration structure.
 
rai_data_collector_data_feed_cfg_t const * p_data_feed_cfg
 Pointer to data feed mode configuration structure.
 
void * p_extend
 Pointer to extended configuration structure.
 
void(* p_callback )(rai_data_collector_callback_args_t const *p_args)
 Pointer to the callback function when data is collected.
 
void(* p_error_callback )(rai_data_collector_error_callback_args_t const *p_args)
 Pointer to the callback function when there is an error.
 
void const * p_context
 Pointer to the user-provided context.
 

◆ rai_data_collector_api_t

struct rai_data_collector_api_t

RAI Data Collector interface API.

Data Fields

fsp_err_t(* open )(rai_data_collector_ctrl_t *const p_ctrl, rai_data_collector_cfg_t const *const p_cfg)
 
fsp_err_t(* snapshotChannelRegister )(rai_data_collector_ctrl_t *const p_ctrl, uint8_t channel, void const *p_src)
 
fsp_err_t(* bufferRelease )(rai_data_collector_ctrl_t *const p_ctrl)
 
fsp_err_t(* bufferReset )(rai_data_collector_ctrl_t *const p_ctrl)
 
fsp_err_t(* snapshotStart )(rai_data_collector_ctrl_t *const p_ctrl)
 
fsp_err_t(* snapshotStop )(rai_data_collector_ctrl_t *const p_ctrl)
 
fsp_err_t(* channelBufferGet )(rai_data_collector_ctrl_t *const p_ctrl, uint8_t channel, void **pp_buf)
 
fsp_err_t(* channelWrite )(rai_data_collector_ctrl_t *const p_ctrl, uint8_t channel, const void *p_buf, uint32_t len)
 
fsp_err_t(* close )(rai_data_collector_ctrl_t *const p_ctrl)
 

Field Documentation

◆ open

fsp_err_t(* rai_data_collector_api_t::open) (rai_data_collector_ctrl_t *const p_ctrl, rai_data_collector_cfg_t const *const p_cfg)

Initialize Data Collector module instance.

Note
To reopen after calling this function, call rai_data_collector_api_t::close first.
Parameters
[in]p_ctrlPointer to control handle structure
[in]p_cfgPointer to configuration structure

◆ snapshotChannelRegister

fsp_err_t(* rai_data_collector_api_t::snapshotChannelRegister) (rai_data_collector_ctrl_t *const p_ctrl, uint8_t channel, void const *p_src)

Config transfer source address for snapshot mode channel

Parameters
[in]p_ctrlPointer to control handle structure
[in]p_srcPointer to transfer source address

◆ bufferRelease

fsp_err_t(* rai_data_collector_api_t::bufferRelease) (rai_data_collector_ctrl_t *const p_ctrl)

Release frame buffers by upper modules

Parameters
[in]p_ctrlPointer to control handle structure
[in]channelWhich snapshot mode channel
[in]p_srcChanenl source buffer address

◆ bufferReset

fsp_err_t(* rai_data_collector_api_t::bufferReset) (rai_data_collector_ctrl_t *const p_ctrl)

Reset internal buffers

Parameters
[in]p_ctrlPointer to control handle structure

◆ snapshotStart

fsp_err_t(* rai_data_collector_api_t::snapshotStart) (rai_data_collector_ctrl_t *const p_ctrl)

Starts snapshot mode.

Parameters
[in]p_ctrlPointer to control handle structure

◆ snapshotStop

fsp_err_t(* rai_data_collector_api_t::snapshotStop) (rai_data_collector_ctrl_t *const p_ctrl)

Stops snapshot mode.

Parameters
[in]p_ctrlPointer to control handle structure

◆ channelBufferGet

fsp_err_t(* rai_data_collector_api_t::channelBufferGet) (rai_data_collector_ctrl_t *const p_ctrl, uint8_t channel, void **pp_buf)

Get the PING or PONG buffer address for data transfer. For data feed mode only.

Parameters
[in]p_ctrlPointer to control handle structure
[in]channelWhich data feed mode channel
[out]pp_bufReturned buffer address

◆ channelWrite

fsp_err_t(* rai_data_collector_api_t::channelWrite) (rai_data_collector_ctrl_t *const p_ctrl, uint8_t channel, const void *p_buf, uint32_t len)

Write data to frame buffer using CPU copy. For data feed mode only.

Parameters
[in]p_ctrlPointer to control handle structure
[in]channelWhich data feed mode channel
[in]p_bufData buffer
[in]lenLength of data buffer in data samples

◆ close

fsp_err_t(* rai_data_collector_api_t::close) (rai_data_collector_ctrl_t *const p_ctrl)

Close the specified Data Collector module instance.

Parameters
[in]p_ctrlPointer to control handle structure

◆ rai_data_collector_instance_t

struct rai_data_collector_instance_t

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

Data Fields
rai_data_collector_ctrl_t * p_ctrl Pointer to the control structure for this instance.
rai_data_collector_cfg_t const * p_cfg Pointer to the configuration structure for this instance.
rai_data_collector_api_t const * p_api Pointer to the API structure for this instance.

Typedef Documentation

◆ rai_data_collector_ctrl_t

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

Enumeration Type Documentation

◆ rai_data_collector_data_type_t

Data types

Enumerator
RAI_DATA_COLLECTOR_DATA_TYPE_INT8_T 

Signed 8-bit.

RAI_DATA_COLLECTOR_DATA_TYPE_UINT8_T 

Unsigned 8-bit.

RAI_DATA_COLLECTOR_DATA_TYPE_INT16_T 

Signed 16-bit.

RAI_DATA_COLLECTOR_DATA_TYPE_UINT16_T 

Unsigned 16-bit.

RAI_DATA_COLLECTOR_DATA_TYPE_INT32_T 

Signed 32-bit.

RAI_DATA_COLLECTOR_DATA_TYPE_UINT32_T 

Unsigned 32-bit.

RAI_DATA_COLLECTOR_DATA_TYPE_FLOAT 

Float.

RAI_DATA_COLLECTOR_DATA_TYPE_DOUBLE 

Double.

◆ rai_data_collector_error_event_t

Data Collector module error events