SemiDrive SSDK Appication Program Interface PTG3.0
Data Structures | Functions
sdrv_flexray.h File Reference
#include "sdrv_common.h"
#include "sdrv_flexray_driver.h"
#include "sdrv_flexray_general_types.h"

Go to the source code of this file.

Data Structures

struct  sdrv_flexray
 

Functions

status_t sdrv_flexray_init (sdrv_flexray_t *handle)
 
status_t sdrv_flexray_controller_init (sdrv_flexray_t *handle)
 
status_t sdrv_flexray_start_communication (sdrv_flexray_t *handle)
 
status_t sdrv_flexray_allow_coldstart (sdrv_flexray_t *handle)
 
status_t sdrv_flexray_all_slots (sdrv_flexray_t *handle)
 
status_t sdrv_flexray_halt_communication (sdrv_flexray_t *handle)
 
status_t sdrv_flexray_abort_communication (sdrv_flexray_t *handle)
 
status_t sdrv_flexray_send_wakeup (sdrv_flexray_t *handle)
 
status_t sdrv_flexray_set_wakeup_channel (sdrv_flexray_t *handle, sdrv_flexray_channel_type channel_idx)
 
status_t sdrv_flexray_get_poc_status (sdrv_flexray_t *handle, sdrv_flexray_poc_status_type *poc_status_ptr)
 
status_t sdrv_flexray_set_absolute_timer (sdrv_flexray_t *handle, uint8_t abs_timer_idx, uint8_t cycle, uint16_t offset)
 
status_t sdrv_flexray_transmit_tx_lpdu (sdrv_flexray_t *handle, uint16_t lpdu_idx, const uint8_t *lsdu_ptr, uint8_t lsdu_length, sdrv_flexray_slot_assignment_type *slot_assignment_ptr)
 
status_t sdrv_flexray_cancel_tx_lpdu (sdrv_flexray_t *handle, uint16_t lpdu_idx)
 
status_t sdrv_flexray_receive_rx_lpdu (sdrv_flexray_t *handle, uint16_t lpdu_idx, uint8_t *lsdu_ptr, sdrv_flexray_rx_lpdu_status_type *lpdu_status_ptr, uint8_t *lsdu_length_ptr, sdrv_flexray_slot_assignment_type *slot_assignment_ptr)
 
status_t sdrv_flexray_check_tx_lpdu_status (sdrv_flexray_t *handle, uint16_t lpdu_idx, sdrv_flexray_tx_lpdu_status_type *tx_lpdu_status_ptr, sdrv_flexray_slot_assignment_type *slot_assignment_ptr)
 
status_t sdrv_flexray_get_global_time (sdrv_flexray_t *handle, uint8_t *cycle_ptr, uint16_t *macro_tick_ptr)
 
status_t sdrv_flexray_get_network_vector (sdrv_flexray_t *handle, uint8_t *network_vector)
 
status_t sdrv_flexray_get_number_startup_frames (sdrv_flexray_t *handle, uint8_t *number_startup_frame_ptr)
 
status_t sdrv_flexray_get_channel_status (sdrv_flexray_t *handle, uint16_t *channel_a_status_ptr, uint16_t *channel_b_status_ptr)
 
status_t sdrv_flexray_get_clock_correction (sdrv_flexray_t *handle, sint16 *rate_correction_ptr, sint32 *offset_correction_ptr)
 
status_t sdrv_flexray_get_sync_frame_list (sdrv_flexray_t *handle, uint8_t list_size, uint16_t *channel_a_even_list_ptr, uint16_t *channel_b_even_list_ptr, uint16_t *channel_a_odd_list_ptr, uint16_t *channel_b_odd_list_ptr)
 
status_t sdrv_flexray_get_wakeup_rx_status (sdrv_flexray_t *handle, uint8_t *wakeup_rx_status_ptr)
 
status_t sdrv_flexray_cancel_absolute_timer (sdrv_flexray_t *handle, uint8_t abs_timer_idx)
 
status_t sdrv_flexray_read_cc_config (sdrv_flexray_t *handle, uint8_t config_paramter_idx, uint32_t *config_para_value_ptr)
 
status_t sdrv_flexray_enable_absolute_timer_irq (sdrv_flexray_t *handle, uint8_t abs_timer_idx)
 
status_t sdrv_flexray_ack_absolute_timer_irq (sdrv_flexray_t *handle, uint8_t abs_timer_idx)
 
status_t sdrv_flexray_disable_absolute_timer_irq (sdrv_flexray_t *handle, uint8_t abs_timer_idx)
 
status_t sdrv_flexray_get_absolute_timer_irq_status (sdrv_flexray_t *handle, uint8_t abs_timer_idx, boolean *irq_status_ptr)
 
status_t sdrv_flexray_interrupt_enable (sdrv_flexray_t *handle, sdrv_flexray_global_interrupt_type interrupt_source)
 
status_t sdrv_flexray_interrupt_disable (sdrv_flexray_t *handle, sdrv_flexray_global_interrupt_type interrupt_source)
 

Detailed Description

Typedef Documentation

◆ sdrv_flexray_cc_buffer_address_type

typedef Fr_CCBufferAddressType sdrv_flexray_cc_buffer_address_type

◆ sdrv_flexray_cc_buffer_config_set_type

typedef Fr_CCBufferConfigSetType sdrv_flexray_cc_buffer_config_set_type

◆ sdrv_flexray_cc_buffer_offset16_type

typedef Fr_CCBufferOffset16Type sdrv_flexray_cc_buffer_offset16_type

◆ sdrv_flexray_cc_fifo_config_type

typedef Fr_CCFifoConfigType sdrv_flexray_cc_fifo_config_type

◆ sdrv_flexray_cc_hardware_config_type

typedef Fr_CCHardwareConfigType sdrv_flexray_cc_hardware_config_type

◆ sdrv_flexray_cc_low_level_config_set_type

typedef Fr_CCLowLevelConfigSetType sdrv_flexray_cc_low_level_config_set_type

◆ sdrv_flexray_cc_lpdu_info_type

typedef Fr_CCLpduInfoType sdrv_flexray_cc_lpdu_info_type

◆ sdrv_flexray_cc_rx_buffer_config_type

typedef Fr_CCRxBufferConfigType sdrv_flexray_cc_rx_buffer_config_type

◆ sdrv_flexray_cc_tx_buffer_config_type

typedef Fr_CCTxBufferConfigType sdrv_flexray_cc_tx_buffer_config_type

◆ sdrv_flexray_channel_type

typedef Fr_ChannelType sdrv_flexray_channel_type

◆ sdrv_flexray_config_type

typedef Fr_ConfigType sdrv_flexray_config_type

◆ sdrv_flexray_configuration_type

typedef Fr_ConfigurationType sdrv_flexray_configuration_type

◆ sdrv_flexray_ctrl_cfg_type

typedef Fr_CtrlCfgType sdrv_flexray_ctrl_cfg_type

◆ sdrv_flexray_global_interrupt_type

typedef GlobalInterruptType sdrv_flexray_global_interrupt_type

◆ sdrv_flexray_poc_status_type

typedef Fr_POCStatusType sdrv_flexray_poc_status_type

◆ sdrv_flexray_rx_lpdu_status_type

typedef Fr_RxLPduStatusType sdrv_flexray_rx_lpdu_status_type

◆ sdrv_flexray_slot_assignment_type

typedef Fr_SlotAssignmentType sdrv_flexray_slot_assignment_type

◆ sdrv_flexray_software_states_type

◆ sdrv_flexray_t

typedef struct sdrv_flexray sdrv_flexray_t

flexray status error code.

◆ sdrv_flexray_tx_lpdu_status_type

typedef Fr_TxLPduStatusType sdrv_flexray_tx_lpdu_status_type

Enumeration Type Documentation

◆ Fr_SoftwareStatesType

Enumerator
FR_UNINIT 
FR_INIT 

◆ sdrv_flexray_error

flexray status error code.

Enumerator
SDRV_FLEXRAY_INV_TIMER_IDX 
SDRV_FLEXRAY_PARAM_POINTER 
SDRV_FLEXRAY_INV_OFFSET 
SDRV_FLEXRAY_INV_BASE_ADDR 
SDRV_FLEXRAY_INV_CHNL_IDX 
SDRV_FLEXRAY_INV_CYCLE 
SDRV_FLEXRAY_INIT_FAILED 
SDRV_FLEXRAY_INV_POCSTATE 
SDRV_FLEXRAY_INV_LENGTH 
SDRV_FLEXRAY_INV_LPDU_IDX 
SDRV_FLEXRAY_INV_HEADERCRC 
SDRV_FLEXRAY_INV_CONFIG_IDX 
SDRV_FLEXRAY_INV_FRAMELIST_SIZE 
SDRV_FLEXRAY_PARAM_CONFIG 

Function Documentation

◆ sdrv_flexray_abort_communication()

status_t sdrv_flexray_abort_communication ( sdrv_flexray_t handle)

Abort the communication.

@function_name sdrv_flexray_abort_communication

Parameters
[in]sdrvflexray handle
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_ack_absolute_timer_irq()

status_t sdrv_flexray_ack_absolute_timer_irq ( sdrv_flexray_t handle,
uint8_t  abs_timer_idx 
)

Clears absolute timer interrupt flag.

@function_name sdrv_flexray_ack_absolute_timer_irq

Parameters
[in]sdrvflexray handle
[in]abs_timer_idxIndex of absolute timer within the context of the flexray CC
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_all_slots()

status_t sdrv_flexray_all_slots ( sdrv_flexray_t handle)

Invokes the CC CHI command ALL_SLOTS.

@function_name sdrv_flexray_all_slots

Parameters
[in]sdrvflexray handle
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_allow_coldstart()

status_t sdrv_flexray_allow_coldstart ( sdrv_flexray_t handle)

Invokes the CC CHI command ALLOW_COLDSTART.

@function_name sdrv_flexray_allow_coldstart

Parameters
[in]sdrvflexray handle
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_cancel_absolute_timer()

status_t sdrv_flexray_cancel_absolute_timer ( sdrv_flexray_t handle,
uint8_t  abs_timer_idx 
)

Stops an absolute timer.

@function_name sdrv_flexray_cancel_absolute_timer

Parameters
[in]sdrvflexray handle
[in]abs_timer_idxIndex of absolute timer within the context of the flexray CC
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_cancel_tx_lpdu()

status_t sdrv_flexray_cancel_tx_lpdu ( sdrv_flexray_t handle,
uint16_t  lpdu_idx 
)

Reconfigures physical resource.

@function_name sdrv_flexray_cancel_tx_lpdu

Parameters
[in]sdrvflexray handle
[in]lpdu_idxThis index is used to uniquely identify a flexray frame
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_check_tx_lpdu_status()

status_t sdrv_flexray_check_tx_lpdu_status ( sdrv_flexray_t handle,
uint16_t  lpdu_idx,
sdrv_flexray_tx_lpdu_status_type tx_lpdu_status_ptr,
sdrv_flexray_slot_assignment_type slot_assignment_ptr 
)

Checks if data have been transmitted.

@function_name sdrv_flexray_check_tx_lpdu_status

Parameters
[in]sdrvflexray handle
[in]lpdu_idxThis index is used to uniquely identify a flexray frame
[out]tx_lpdu_status_ptrPointer used to store the transmit status of the LSdu
[out]slot_assignment_ptrPointer used to store cycle, slot ID, and channel of the frame identified by lpdu_idx
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_controller_init()

status_t sdrv_flexray_controller_init ( sdrv_flexray_t handle)

CC configuration.

@function_name sdrv_flexray_controller_init

Parameters
[in]sdrvflexray handle
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_disable_absolute_timer_irq()

status_t sdrv_flexray_disable_absolute_timer_irq ( sdrv_flexray_t handle,
uint8_t  abs_timer_idx 
)

Disables absolute timer interrupt generation.

@function_name sdrv_flexray_disable_absolute_timer_irq

Parameters
[in]ctrl_idx- Index of flexray CC within the context of the flexray Driver
[in]abs_timer_idx- Index of absolute timer within the context of the flexray CC
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_enable_absolute_timer_irq()

status_t sdrv_flexray_enable_absolute_timer_irq ( sdrv_flexray_t handle,
uint8_t  abs_timer_idx 
)

Enables absolute timer interrupts.

@function_name sdrv_flexray_enable_absolute_timer_irq

Parameters
[in]ctrl_idxIndex of flexray CC within the context of the flexray Driver
[in]abs_timer_idxIndex of absolute timer within the context of the flexray C
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_get_absolute_timer_irq_status()

status_t sdrv_flexray_get_absolute_timer_irq_status ( sdrv_flexray_t handle,
uint8_t  abs_timer_idx,
boolean *  irq_status_ptr 
)

Checks if the absolute timer flag is set.

@function_name sdrv_flexray_get_absolute_timer_irq_status

Parameters
[in]ctrl_idx- Index of flexray CC within the context of the flexray Driver
[in]abs_timer_idx- Index of absolute timer within the context of the flexray CC
[out]irq_status_ptr- Address the output value is stored to
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_get_channel_status()

status_t sdrv_flexray_get_channel_status ( sdrv_flexray_t handle,
uint16_t *  channel_a_status_ptr,
uint16_t *  channel_b_status_ptr 
)

Read channel status.

@function_name sdrv_flexray_get_channel_status

Parameters
[in]ctrl_idx- Index of flexray CC within the context of the flexray Driver
[out]channel_a_status_ptr- Address where the bitcoded channel A status information shall be stored.
[out]channel_b_status_ptr- Address where the bitcoded channel B status information shall be stored.
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_get_clock_correction()

status_t sdrv_flexray_get_clock_correction ( sdrv_flexray_t handle,
sint16 *  rate_correction_ptr,
sint32 *  offset_correction_ptr 
)

Gets clock correction values.

@function_name sdrv_flexray_get_clock_correction

Parameters
[in]ctrl_idx- Index of flexray CC within the context of the flexray Driver
[out]rate_correction_ptr- Address where the current rate correction value shall be stored.
[out]offset_correction_ptr- Address where the current offset correction value shall be stored.
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_get_global_time()

status_t sdrv_flexray_get_global_time ( sdrv_flexray_t handle,
uint8_t *  cycle_ptr,
uint16_t *  macro_tick_ptr 
)

Function gets flexray cluster global time.

@function_name sdrv_flexray_get_global_time

Parameters
[in]sdrvflexray handle
[out]cycle_ptrAddress where the current flexray communication cycle value shall be stored
[out]macro_tick_ptrAddress where the current macrotick value shall be stored
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_get_network_vector()

status_t sdrv_flexray_get_network_vector ( sdrv_flexray_t handle,
uint8_t *  network_vector 
)

Read network management vector.

@function_name sdrv_flexray_get_network_vector

Parameters
[in]ctrl_idx- Index of flexray CC within the context of the flexray Driver
[out]network_vector- Address where the NmVector of the last communication cycle shall be stored
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_get_number_startup_frames()

status_t sdrv_flexray_get_number_startup_frames ( sdrv_flexray_t handle,
uint8_t *  number_startup_frame_ptr 
)

Gets the current number of startup frames seen on the cluster.

@function_name sdrv_flexray_get_number_startup_frames

Parameters
[in]sdrvflexray handle
[in]number_startup_frame_ptrAddress where the number of startup frames seen within the last even or odd cycle pair shall be stored.
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_get_poc_status()

status_t sdrv_flexray_get_poc_status ( sdrv_flexray_t handle,
sdrv_flexray_poc_status_type poc_status_ptr 
)

Query for the controller status.

@function_name sdrv_flexray_get_poc_status

Parameters
[in]sdrvflexray handle
[out]poc_status_ptrAddress the output value is stored to
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_get_sync_frame_list()

status_t sdrv_flexray_get_sync_frame_list ( sdrv_flexray_t handle,
uint8_t  list_size,
uint16_t *  channel_a_even_list_ptr,
uint16_t *  channel_b_even_list_ptr,
uint16_t *  channel_a_odd_list_ptr,
uint16_t *  channel_b_odd_list_ptr 
)

Gets clock correction values.

@function_name sdrv_flexray_get_sync_frame_list

Parameters
[in]handle- sdrv flexray handler
[in]list_size- Size of the arrays passed via parameters: channel_a_even_list_ptr, channel_b_even_list_ptr, channel_a_odd_list_ptr channel_b_odd_list_ptr.
[out]channel_a_even_list_ptr- Address the list of syncframes on channel A within the even communication cycle is written to.
[out]channel_b_even_list_ptr- Address the list of syncframes on channel B within the even communication cycle is written to.
[out]channel_a_odd_list_ptr- Address the list of syncframes on channel A within the odd communication cycle is written to.
[out]channel_b_odd_list_ptr- Address the list of syncframes on channel B within the odd communication cycle is written to.
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_get_wakeup_rx_status()

status_t sdrv_flexray_get_wakeup_rx_status ( sdrv_flexray_t handle,
uint8_t *  wakeup_rx_status_ptr 
)

Gets clock correction values.

@function_name sdrv_flexray_get_wakeup_rx_status

Parameters
[in]handle- sdrv flexray handler
[out]wakeup_rx_status_ptr- Address where bitcoded wakeup reception status shall be stored.
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_halt_communication()

status_t sdrv_flexray_halt_communication ( sdrv_flexray_t handle)

This API call stops communication.

@function_name sdrv_flexray_halt_communication

Parameters
[in]sdrvflexray handle
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_init()

status_t sdrv_flexray_init ( sdrv_flexray_t handle)

Controller initialization function.

@function_name sdrv_flexray_init

Parameters
[in]sdrvflexray handle
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_interrupt_disable()

status_t sdrv_flexray_interrupt_disable ( sdrv_flexray_t handle,
sdrv_flexray_global_interrupt_type  interrupt_source 
)

disable flexray interrupt

@function_name sdrv_flexray_interrupt_disable

Parameters
[in]ctrl_idx- Index of FlexRay CC within the context of the FlexRay Driver
[in]interrupt_source- interrupt source
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_interrupt_enable()

status_t sdrv_flexray_interrupt_enable ( sdrv_flexray_t handle,
sdrv_flexray_global_interrupt_type  interrupt_source 
)

open flexray interrupt

@function_name sdrv_flexray_interrupt_enable

Parameters
[in]ctrl_idx- Index of FlexRay CC within the context of the FlexRay Driver
[in]interrupt_source- interrupt source
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_read_cc_config()

status_t sdrv_flexray_read_cc_config ( sdrv_flexray_t handle,
uint8_t  config_paramter_idx,
uint32_t *  config_para_value_ptr 
)

Reconfigures physical resource.

@function_name sdrv_flexray_read_cc_config

Parameters
[in]sdrvflexray handle
[in]config_paramter_idxIndex that identifies the configuration parameter to read. See macros FR_CIDX_<config_parameter_name>.
[out]config_para_value_ptrAddress the output value is stored to.
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_receive_rx_lpdu()

status_t sdrv_flexray_receive_rx_lpdu ( sdrv_flexray_t handle,
uint16_t  lpdu_idx,
uint8_t *  lsdu_ptr,
sdrv_flexray_rx_lpdu_status_type lpdu_status_ptr,
uint8_t *  lsdu_length_ptr,
sdrv_flexray_slot_assignment_type slot_assignment_ptr 
)

Receives data.

@function_name sdrv_flexray_receive_RxLPdu

Parameters
[in]sdrvflexray handle
[in]lpdu_idxThis index is used to uniquely identify a flexray frame
[out]lsdu_ptrPointer to a buffer where the LSdu
[out]lpdu_status_ptrPointer to the memory location where the status of the LPdu shall be stored
[out]lsdu_length_ptrPointer to the memory location where the length of the LSdu (in bytes) shall be stored
[out]slot_assignment_ptrThis reference points to the memory location where the actual cycle, slot ID, and channel of the frame identified by lpdu_idx shall be stored. A NULL indicates that the information is not required by the caller.
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_send_wakeup()

status_t sdrv_flexray_send_wakeup ( sdrv_flexray_t handle)

Initiates transition to POC:Wakeup.

@function_name sdrv_flexray_send_wakeup

Parameters
[in]ctrl_idx- Index of flexray CC within the context of the flexray Driver
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_set_absolute_timer()

status_t sdrv_flexray_set_absolute_timer ( sdrv_flexray_t handle,
uint8_t  abs_timer_idx,
uint8_t  cycle,
uint16_t  offset 
)

Sets the absolute flexray timer.

@function_name sdrv_flexray_set_absolute_timer

Parameters
[in]sdrvflexray handle
[in]abs_timer_idxIndex of absolute timer within the context of the flexray CC
[in]cycleAbsolute cycle the timer shall elapse in
[in]offsetOffset within cycle cycle in units of macrotick the timer shall elapse at
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_set_wakeup_channel()

status_t sdrv_flexray_set_wakeup_channel ( sdrv_flexray_t handle,
sdrv_flexray_channel_type  channel_idx 
)

Selects which channel sends WUPs.

@function_name sdrv_flexray_set_wakeup_channel

Parameters
[in]sdrvflexray handle
[in]channel_idxIndex of flexray channel within the context of the flexray CC ctrl_idx
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_start_communication()

status_t sdrv_flexray_start_communication ( sdrv_flexray_t handle)

Starts the communication.

@function_name sdrv_flexray_start_communication

Parameters
[in]sdrvflexray handle
Returns
SDRV_STATUS_OK or error code.

◆ sdrv_flexray_transmit_tx_lpdu()

status_t sdrv_flexray_transmit_tx_lpdu ( sdrv_flexray_t handle,
uint16_t  lpdu_idx,
const uint8_t *  lsdu_ptr,
uint8_t  lsdu_length,
sdrv_flexray_slot_assignment_type slot_assignment_ptr 
)

Update selected message buffer with new data.

@function_name sdrv_flexray_transmit_tx_lpdu

Parameters
[in]sdrvflexray handle
[in]lpdu_idxThe index is used to uniquely identify a flexray frame
[in]lsdu_ptrPointer to a buffer where the assembled LSdu to be transmitted within this LPdu is stored at
[in]lsdu_lengthDetermines the length of the data (in Bytes) to be transmitted
[out]slot_assignment_ptrThis reference points to the memory location where the actual cycle, slot ID, and channel of the frame identified by lpdu_idx shall be stored. A NULL indicates that the information is not required by the caller.
Returns
SDRV_STATUS_OK or error code.