SemiDrive SSDK Appication Program Interface PTG3.0
sdrv_flexray.h
Go to the documentation of this file.
1
9#ifndef SDRV_FLEXRAY_H_
10#define SDRV_FLEXRAY_H_
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#include "sdrv_common.h"
17#include "sdrv_flexray_driver.h"
18#include "sdrv_flexray_general_types.h"
19
20typedef enum {
21 FR_UNINIT = 0U, /* Flexray un-init */
22 FR_INIT /* Flexray init */
24
25typedef Fr_ConfigType sdrv_flexray_config_type;
26typedef Fr_CtrlCfgType sdrv_flexray_ctrl_cfg_type;
27typedef Fr_ChannelType sdrv_flexray_channel_type;
28typedef Fr_POCStatusType sdrv_flexray_poc_status_type;
29typedef Fr_ConfigurationType sdrv_flexray_configuration_type;
31typedef Fr_SlotAssignmentType sdrv_flexray_slot_assignment_type;
32typedef Fr_CCTxBufferConfigType sdrv_flexray_cc_tx_buffer_config_type;
33typedef Fr_RxLPduStatusType sdrv_flexray_rx_lpdu_status_type;
34typedef Fr_TxLPduStatusType sdrv_flexray_tx_lpdu_status_type;
35typedef GlobalInterruptType sdrv_flexray_global_interrupt_type;
36typedef Fr_CCHardwareConfigType sdrv_flexray_cc_hardware_config_type;
37typedef Fr_CCLowLevelConfigSetType
39typedef Fr_CCRxBufferConfigType sdrv_flexray_cc_rx_buffer_config_type;
40typedef Fr_CCFifoConfigType sdrv_flexray_cc_fifo_config_type;
41typedef Fr_CCBufferConfigSetType sdrv_flexray_cc_buffer_config_set_type;
42typedef Fr_CCLpduInfoType sdrv_flexray_cc_lpdu_info_type;
43typedef Fr_CCBufferAddressType sdrv_flexray_cc_buffer_address_type;
44typedef Fr_CCBufferOffset16Type sdrv_flexray_cc_buffer_offset16_type;
45
49typedef struct sdrv_flexray {
50 uint32_t irq;
51 uint32_t abs_timers_num;
55
60 /* Error reported when parameter timer index exceeds number of available timers */
62 /* Error reported when invalid pointer in parameter list */
64 /* Error reported when parameter offset exceeds bounds */
66 /* Error reported when invalid controller base */
68 /* Error reported when invalid channel index */
70 /* Error reported when parameter cycle exceeds 63 */
72 /* Error reported when Fr module was not initialized */
74 /* Error reported when Fr CC is not in the expected POC state */
76 /* Error reported when Payload length parameter has an invalid value */
78 /* Error reported when invalid LPdu index */
80 /* Error reported when invalid FlexRay header CRC */
82 /* Error reported when invalid value passed as parameter Fr_ConfigParamIdx. */
84 /* Error reported when invalid framelist size value. */
86 /* Error reported when requested resource is not configured to be available
87 on the current core */
89};
90
99
108
117
127
136
145
154
163
174 sdrv_flexray_channel_type channel_idx);
175
185 sdrv_flexray_poc_status_type *poc_status_ptr);
186
199 uint8_t abs_timer_idx,
200 uint8_t cycle, uint16_t offset);
201
218 uint16_t lpdu_idx,
219 const uint8_t *lsdu_ptr,
220 uint8_t lsdu_length, sdrv_flexray_slot_assignment_type *slot_assignment_ptr);
221
231 uint16_t lpdu_idx);
232
251 uint16_t lpdu_idx,
252 uint8_t *lsdu_ptr,
253 sdrv_flexray_rx_lpdu_status_type *lpdu_status_ptr, uint8_t *lsdu_length_ptr,
254 sdrv_flexray_slot_assignment_type *slot_assignment_ptr);
255
267 uint16_t lpdu_idx,
268 sdrv_flexray_tx_lpdu_status_type *tx_lpdu_status_ptr,
269 sdrv_flexray_slot_assignment_type *slot_assignment_ptr);
270
282 uint8_t *cycle_ptr,
283 uint16_t *macro_tick_ptr);
284
295 uint8_t *network_vector);
296
307 uint8_t *number_startup_frame_ptr);
308
321 uint16_t *channel_a_status_ptr, uint16_t *channel_b_status_ptr);
322
335 sint16 *rate_correction_ptr, sint32 *offset_correction_ptr);
336
356 uint8_t list_size,
357 uint16_t *channel_a_even_list_ptr,
358 uint16_t *channel_b_even_list_ptr, uint16_t *channel_a_odd_list_ptr,
359 uint16_t *channel_b_odd_list_ptr);
360
372 uint8_t *wakeup_rx_status_ptr);
373
383 uint8_t abs_timer_idx);
384
396 uint8_t config_paramter_idx, uint32_t *config_para_value_ptr);
397
407 uint8_t abs_timer_idx);
408
418 uint8_t abs_timer_idx);
419
429 uint8_t abs_timer_idx);
430
441 sdrv_flexray_t *handle,
442 uint8_t abs_timer_idx,
443 boolean *irq_status_ptr);
444
454 sdrv_flexray_global_interrupt_type interrupt_source);
455
465 sdrv_flexray_global_interrupt_type interrupt_source);
466
467#ifdef __cplusplus
468}
469#endif
470
471#endif /* SDRV_FLEXRAY_H_ */
SemiDrive driver common header file.
@ SDRV_STATUS_GROUP_FLEXRAY
Definition: sdrv_common.h:62
int32_t status_t
Type used for all status and error return values.
Definition: sdrv_common.h:82
#define SDRV_ERROR_STATUS(group, code)
Construct a status code value from a group and code number. All the error statuses are negetive numbe...
Definition: sdrv_common.h:17
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.
Fr_CCRxBufferConfigType sdrv_flexray_cc_rx_buffer_config_type
Definition: sdrv_flexray.h:39
Fr_CCTxBufferConfigType sdrv_flexray_cc_tx_buffer_config_type
Definition: sdrv_flexray.h:32
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.
Fr_ConfigType sdrv_flexray_config_type
Definition: sdrv_flexray.h:25
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.
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.
Fr_CCLpduInfoType sdrv_flexray_cc_lpdu_info_type
Definition: sdrv_flexray.h:42
Fr_SoftwareStatesType sdrv_flexray_software_states_type
Definition: sdrv_flexray.h:30
status_t sdrv_flexray_send_wakeup(sdrv_flexray_t *handle)
Initiates transition to POC:Wakeup.
status_t sdrv_flexray_halt_communication(sdrv_flexray_t *handle)
This API call stops communication.
status_t sdrv_flexray_interrupt_disable(sdrv_flexray_t *handle, sdrv_flexray_global_interrupt_type interrupt_source)
disable flexray interrupt
Fr_CCFifoConfigType sdrv_flexray_cc_fifo_config_type
Definition: sdrv_flexray.h:40
status_t sdrv_flexray_start_communication(sdrv_flexray_t *handle)
Starts the communication.
Fr_CCBufferConfigSetType sdrv_flexray_cc_buffer_config_set_type
Definition: sdrv_flexray.h:41
Fr_ChannelType sdrv_flexray_channel_type
Definition: sdrv_flexray.h:27
Fr_POCStatusType sdrv_flexray_poc_status_type
Definition: sdrv_flexray.h:28
Fr_SoftwareStatesType
Definition: sdrv_flexray.h:20
@ FR_INIT
Definition: sdrv_flexray.h:22
@ FR_UNINIT
Definition: sdrv_flexray.h:21
Fr_CCHardwareConfigType sdrv_flexray_cc_hardware_config_type
Definition: sdrv_flexray.h:36
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.
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.
Fr_CCBufferOffset16Type sdrv_flexray_cc_buffer_offset16_type
Definition: sdrv_flexray.h:44
status_t sdrv_flexray_get_network_vector(sdrv_flexray_t *handle, uint8_t *network_vector)
Read network management vector.
Fr_CCLowLevelConfigSetType sdrv_flexray_cc_low_level_config_set_type
Definition: sdrv_flexray.h:38
status_t sdrv_flexray_allow_coldstart(sdrv_flexray_t *handle)
Invokes the CC CHI command ALLOW_COLDSTART.
Fr_ConfigurationType sdrv_flexray_configuration_type
Definition: sdrv_flexray.h:29
status_t sdrv_flexray_get_poc_status(sdrv_flexray_t *handle, sdrv_flexray_poc_status_type *poc_status_ptr)
Query for the controller status.
status_t sdrv_flexray_get_wakeup_rx_status(sdrv_flexray_t *handle, uint8_t *wakeup_rx_status_ptr)
Gets clock correction values.
status_t sdrv_flexray_enable_absolute_timer_irq(sdrv_flexray_t *handle, uint8_t abs_timer_idx)
Enables absolute timer interrupts.
Fr_CtrlCfgType sdrv_flexray_ctrl_cfg_type
Definition: sdrv_flexray.h:26
status_t sdrv_flexray_interrupt_enable(sdrv_flexray_t *handle, sdrv_flexray_global_interrupt_type interrupt_source)
open flexray interrupt
Fr_CCBufferAddressType sdrv_flexray_cc_buffer_address_type
Definition: sdrv_flexray.h:43
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.
sdrv_flexray_error
flexray status error code.
Definition: sdrv_flexray.h:59
@ SDRV_FLEXRAY_INIT_FAILED
Definition: sdrv_flexray.h:73
@ SDRV_FLEXRAY_INV_CHNL_IDX
Definition: sdrv_flexray.h:69
@ SDRV_FLEXRAY_INV_LPDU_IDX
Definition: sdrv_flexray.h:79
@ SDRV_FLEXRAY_INV_TIMER_IDX
Definition: sdrv_flexray.h:61
@ SDRV_FLEXRAY_INV_POCSTATE
Definition: sdrv_flexray.h:75
@ SDRV_FLEXRAY_INV_CYCLE
Definition: sdrv_flexray.h:71
@ SDRV_FLEXRAY_PARAM_CONFIG
Definition: sdrv_flexray.h:88
@ SDRV_FLEXRAY_INV_BASE_ADDR
Definition: sdrv_flexray.h:67
@ SDRV_FLEXRAY_INV_LENGTH
Definition: sdrv_flexray.h:77
@ SDRV_FLEXRAY_INV_CONFIG_IDX
Definition: sdrv_flexray.h:83
@ SDRV_FLEXRAY_INV_HEADERCRC
Definition: sdrv_flexray.h:81
@ SDRV_FLEXRAY_INV_OFFSET
Definition: sdrv_flexray.h:65
@ SDRV_FLEXRAY_PARAM_POINTER
Definition: sdrv_flexray.h:63
@ SDRV_FLEXRAY_INV_FRAMELIST_SIZE
Definition: sdrv_flexray.h:85
status_t sdrv_flexray_ack_absolute_timer_irq(sdrv_flexray_t *handle, uint8_t abs_timer_idx)
Clears absolute timer interrupt flag.
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.
status_t sdrv_flexray_disable_absolute_timer_irq(sdrv_flexray_t *handle, uint8_t abs_timer_idx)
Disables absolute timer interrupt generation.
GlobalInterruptType sdrv_flexray_global_interrupt_type
Definition: sdrv_flexray.h:35
Fr_RxLPduStatusType sdrv_flexray_rx_lpdu_status_type
Definition: sdrv_flexray.h:33
struct sdrv_flexray sdrv_flexray_t
flexray status error code.
status_t sdrv_flexray_cancel_tx_lpdu(sdrv_flexray_t *handle, uint16_t lpdu_idx)
Reconfigures physical resource.
status_t sdrv_flexray_get_clock_correction(sdrv_flexray_t *handle, sint16 *rate_correction_ptr, sint32 *offset_correction_ptr)
Gets clock correction values.
status_t sdrv_flexray_init(sdrv_flexray_t *handle)
Controller initialization function.
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.
status_t sdrv_flexray_cancel_absolute_timer(sdrv_flexray_t *handle, uint8_t abs_timer_idx)
Stops an absolute timer.
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.
Fr_SlotAssignmentType sdrv_flexray_slot_assignment_type
Definition: sdrv_flexray.h:31
status_t sdrv_flexray_set_wakeup_channel(sdrv_flexray_t *handle, sdrv_flexray_channel_type channel_idx)
Selects which channel sends WUPs.
Fr_TxLPduStatusType sdrv_flexray_tx_lpdu_status_type
Definition: sdrv_flexray.h:34
status_t sdrv_flexray_controller_init(sdrv_flexray_t *handle)
CC configuration.
status_t sdrv_flexray_all_slots(sdrv_flexray_t *handle)
Invokes the CC CHI command ALL_SLOTS.
status_t sdrv_flexray_abort_communication(sdrv_flexray_t *handle)
Abort the communication.
flexray status error code.
Definition: sdrv_flexray.h:49
uint32_t irq
Definition: sdrv_flexray.h:50
const sdrv_flexray_configuration_type * internal_cfg
Definition: sdrv_flexray.h:53
uint32_t abs_timers_num
Definition: sdrv_flexray.h:51
sdrv_flexray_software_states_type status
Definition: sdrv_flexray.h:52