2 * FlexRay Communication RPP API header file.
6 * @copyright Copyright (C) 2013 Czech Technical University in Prague
8 * @author Carlos Jenkins <carlos@jenkins.co.cr>
9 * @author Michal Horn <hornmich@fel.cvut.cz>
16 #include "drv/Fr_GeneralTypes.h"
17 #include "drv/fr_tms570.h"
22 RPP_FR_NOT_INITIALIZED,
23 RPP_FR_DRV_INITIALIZED,
24 RPP_FR_CTR_INITIALIZED,
31 * Store cluster configuration parameters.
33 * This function provides a mechanism to do the user FlexRay configuration.
34 * The function parses the string with parameters and stores them into an
36 * For a complete user configuration also rpp_fr_config_node_params and
37 * rpp_fr_config_static_buffer have to be called to configure local
38 * FlexRay parameters and at least one static buffer.
40 * The string with configuration contains hexadecimal numbers separated by spaces.
41 * Each number stands for one parameter in this order:
45 * gMaxWithoutClockCorrectionFatal
46 * gMaxWithoutClockCorrectionPassive
47 * gNetworkManagementVectorLength
49 * gNumberOfStaticSlots
50 * gOffsetCorrectionStart
51 * gPayloadLengthStatic
55 * gdDynamicSlotIdlePhase
57 * gdMinislotActionPointOffset
62 * gdWakeupSymbolRxIdle
64 * gdWakeupSymbolRxWindow
65 * gdWakeupSymbolTxIdle
69 * "0x2 0xF 0x15E0 0xF 0xF 0xC 0x15A 0x8 0xAE4 0x9 0xF 0x4 0x43 0x1 0x4 0x2 0xAE3 0x0 0x56 0xA 0x12 0x12 0x4C 0xB4 0x3C"
71 * @param [in] params Address of the string with configuration parameters
73 * @return SUCCESS if configuration successful.
74 * FAILURE if parameter parsing fails.
76 int8_t rpp_fr_config_cluster_params(const char* params);
79 * Store node configuration parameters.
81 * This functions provides a mechanism to do the user FlexRay configuration.
82 * The function parses the string with parameters and stores them into an
84 * For complete user configuration also rpp_fr_config_cluster_params and
85 * rpp_fr_config_static_buffer have to be called to configure global
86 * FlexRay parameters and at least one static buffer.
88 * The string with configuration contains hexadecimal numbers separated by spaces.
89 * Each number stands for one parameter in this order:
90 * pAllowHaltDueToClock
91 * pAllowPassiveToActive
92 * pChannels (0 - A, 1 - B, 2 - AB)
93 * pClusterDriftDamping
96 * pExternOffsetCorrection
97 * pExternRateCorrection
98 * pKeySlotUsedForStartup
101 * pMacroInitialOffsetA
102 * pMacroInitialOffsetB
103 * pMicroInitialOffsetA
104 * pMicroInitialOffsetB
107 * pOffsetCorrectionOut
108 * pSamplesPerMicrotick
110 * pWakeupChannel (0 - A, 1 - B)
112 * pdAcceptedStartupRange
115 * pDecodingCorrection
116 * syncFramePayloadMultiplexEnabled
117 * secureBuffers (0 - FR_SB_RECONFIG_ENABLED, 1 - FR_SB_STAT_REC_DISABLED_STAT_TR_DISABLED, 2 - FR_SB_ALL_REC_DISABLED, 3 - FR_SB_ALL_REC_DISABLED_STAT_TR_DISABLED)
120 * "0x0 0x0 0x2 0x1 0x3 0x3 0x0 0x0 0x1 0x1 0x10D 0x6 0x6 0x18 0x18 0x36B00 0xCD 0x151 0x0 0x1 0x0 0x2 0x81 0x36DA2 0x151 0x33 0x0 0x0"
122 * @param [in] params Address of the string with configuration parameters
124 * @return SUCCESS if configuration successful.
125 * FAILURE if parameter parsing fails.
127 int8_t rpp_fr_config_node_params(const char* params);
130 * Add new static buffer configuration into the list of buffers.
132 * This functions provides a mechanism to do the user FlexRay configuration.
133 * The function parses the string with parameters and stores them into an
134 * internal structure.
135 * For complete user configuration also rpp_fr_config_cluster_params and
136 * rpp_fr_config_node_params have to be called to configure global and local
137 * FlexRay parameters.
138 * At least one static buffer must be configured as TX. For sync and coldstart nodes
139 * the first buffer should be configured as TX.
141 * The string with configuration contains hexadecimal numbers or strings separated by spaces.
142 * Each number or string stands for one parameter in this order:
143 * channel (0 - A, 1 - B, 2 - AB)
144 * cycleCounterFiltering
148 * payloadPreambleIndicatorTr
153 * "0x2 0x0 0x1 0x9 0x1 0x0 0x0 0x1"
155 * @param [in] params Address of the string with configuration parameters
157 * @return SUCCESS if configuration successful.
158 * FAILURE if parameter parsing fails.
160 int8_t rpp_fr_config_static_buffer(const char* params);
163 * Add new dynamic buffer configuration into the list of buffers.
165 * This functions provides a mechanism to do the user FlexRay configuration.
166 * The function parses the string with parameters and stores them into an
167 * internal structure.
168 * For complete user configuration also rpp_fr_config_cluster_params,
169 * rpp_fr_config_node_params and rpp_fr_config_static_buffer have to be called
170 * to configure global, local FlexRay parameters and at least one static buffer.
172 * The string with configuration contains hexadecimal numbers or strings separated by spaces.
173 * Each number or string stands for one parameter in this order:
174 * channel (0 - A, 1 - B)
175 * cycleCounterFiltering
183 * "0x0 0x0 0x1 0x9 0x1 0x0 0x1"
185 * @param [in] params Address of the string with configuration parameters
187 * @return SUCCESS if configuration successful.
188 * FAILURE if parameter parsing fails.
190 int8_t rpp_fr_config_dynamic_buffer(const char* params);
193 * Configures new RX FIFO buffer configuration into the list of buffers.
195 * This functions provides a mechanism to do the user FlexRay configuration.
196 * The function parses the string with parameters and stores them into an
197 * internal structure.
198 * For complete user configuration also rpp_fr_config_cluster_params,
199 * rpp_fr_config_node_params and rpp_fr_config_static_buffer have to be called
200 * to configure global, local FlexRay parameters and at least one static buffer.
201 * Only one RX FIFO buffer with specified depth can be configured.
203 * The string with configuration contains hexadecimal numbers or strings separated by spaces.
204 * Each number or string stands for one parameter in this order:
206 * channel (0 - A, 1 - B, 2 - AB)
207 * cycleCounterFiltering
210 * rejectStaticSegment
211 * slotId (zero means no frame will be rejected)
214 * "0x5 0x2 0x0 0x40 0x1 0x0 0x0"
216 * @param [in] params Address of the string with configuration parameters
218 * @return SUCCESS if configuration successful.
219 * FAILURE if parameter parsing fails.
221 int8_t rpp_fr_config_fifo_buffer(const char* params);
223 /* AUTOSAR-like API */
226 * FlexRay driver initialization.
228 * This method should be called before any other function from this
229 * module, except rpp_fr_config_* functions.
231 * The function copies configuration data into drivers internal
232 * structures and initializes the driver.
234 * There are two ways how to configure FlexRay.
235 * 1) Passing address of the config structure as an argument from the application.
236 * 2) Using rpp_fr_config_* functions to create configuration at run-time. Then the argument
237 * for this function has to be NULL and configuration functions have to be called before
240 * After a successful driver initialization, the driver is ready for calling:
241 * - rpp_fr_init_controller()
242 * - rpp_fr_get_poc_status()
243 * - rpp_fr_get_wakeup_rx_status()
244 * - rpp_fr_get_timer_irq_status()
246 * @param [in] Fr_ConfigPtr Address of the structure with all FlexRay
247 * configuration parameters. If it is NULL, then the default structure,
248 * filled by rpp_fr_config functions, is used.
249 * @param [out] error Address where error flags will be stored. The flags
250 * definitions can be found in fr_tms570h, with ERR_PARAM prefix.
252 * @return SUCCESS if initialization successful.
253 * FAILURE if module already initialized.
256 int8_t rpp_fr_init_driver(const Fr_ConfigType* config_ptr, uint32_t* error);
259 * FlexRay controller initialization.
261 * This method should be called after rpp_fr_init_driver() and before any
262 * other function from this module.
264 * The functions checks configuration parameters and configures FlexRay
265 * controller registers.
267 * After successful controller initialization, the FlexRay driver is ready for calling:
268 * - rpp_fr_get_poc_status()
269 * - rpp_fr_get_wakeup_rx_status()
270 * - rpp_fr_get_timer_irq_status()
271 * - rpp_fr_start_communication()
272 * - rpp_fr_send_wup()
273 * - rpp_fr_set_wu_channel()
274 * - rpp_fr_get_global_time()
275 * - rpp_fr_get_network_management_vector()
276 * - rpp_fr_get_channel_status()
278 * @param [in] ctrl Not used, set always to zero.
279 * @param [out] error Address where error flags will be stored. The flags
280 * definitions can be found in fr_tms570h, with ERR_PARAM and FR_INIT_ERR
283 * @return SUCCESS if initialization if successful.
284 * FAILURE if module already initialized.
287 int8_t rpp_fr_init_controller(uint8_t ctrl, uint32_t* error);
290 * FlexRay start communication
292 * This method should be called after rpp_fr_init_controller() and
293 * before any attempt to send or receive messages.
295 * For coldstarter node the function tries to listen and join an
296 * existing network. If it fails, it tries to initiate the new one.
297 * For regular node it only listens on the bus and tries to join to
298 * some existing network.
300 * After successful communication start, the FlexRay is ready for:
301 * - rpp_fr_get_poc_status()
302 * - rpp_fr_get_wakeup_rx_status()
303 * - rpp_fr_get_timer_irq_status()
304 * - rpp_fr_set_wu_channel()
305 * - rpp_fr_get_global_time()
306 * - rpp_fr_get_network_management_vector()
307 * - rpp_fr_get_channel_status()
308 * - rpp_fr_all_slots()
309 * - rpp_fr_halt_communication()
310 * - rpp_fr_abort_communication()
311 * - rpp_fr_transmit_lpdu()
312 * - rpp_fr_cancel_transmit_lpdu()
313 * - rpp_fr_receive_lpdu()
314 * - rpp_fr_check_tx_lpdu_status()
315 * - rpp_fr_disable_lpdu()
316 * - rpp_fr_get_clock_correction()
317 * - rpp_fr_get_sync_frame_list()
318 * - rpp_fr_set_timer()
319 * - rpp_fr_cancel_timer()
321 * @param [in] ctrl Not used, set always to zero.
322 * @param [out] error Address where error flags will be stored. The flags
323 * definitions can be found in fr_tms570h, with FR_STARTUP_ERR prefix.
325 * @return SUCCESS if initialization successful.
326 * FAILURE if module already initialized.
329 int8_t rpp_fr_start_communication(uint8_t ctrl, uint32_t* error);
332 * FlexRay allow communication on all slots
334 * The FlexRay node can be configured to communicate only on key
335 * frames after the startup. If this is the case, after calling this
336 * function, communication on all configured slots is allowed.
338 * The function should be called only after rpp_fr_start_communication() has been called.
340 * @param [in] ctrl Not used, set always to zero.
342 * @return SUCCESS if started successfully.
343 * FAILURE if timeout reached.
346 int8_t rpp_fr_all_slots(uint8_t ctrl);
349 * FlexRay stop communication after the end of the communication cycle.
351 * The function should be called only after
352 * rpp_fr_start_communication() has been called.
354 * After the communication is stopped, only those functions are allowed to be called:
355 * - rpp_fr_set_wu_channel()
356 * - rpp_fr_get_global_time()
357 * - rpp_fr_get_network_management_vector()
358 * - rpp_fr_get_channel_status()
359 * - rpp_fr_get_clock_correction()
360 * - rpp_fr_get_sync_frame_list()
361 * - rpp_fr_get_wakeup_rx_status()
362 * - rpp_fr_get_poc_status()
364 * To establish new communication, it is necessary to reset the
366 * @param [in] ctrl Not used, set always to zero.
368 * @return SUCCESS if command passed successfully.
369 * FAILURE if command rejected.
372 int8_t rpp_fr_halt_communication(uint8_t ctrl);
375 * FlexRay stop communication immediately.
377 * The function should be called only after
378 * rpp_fr_start_communication() has been called.
380 * After the communication is stopped, only those functions are allowed to be called:
381 * - rpp_fr_set_wu_channel()
382 * - rpp_fr_get_global_time()
383 * - rpp_fr_get_network_management_vector()
384 * - rpp_fr_get_channel_status()
385 * - rpp_fr_get_clock_correction()
386 * - rpp_fr_get_sync_frame_list()
387 * - rpp_fr_get_wakeup_rx_status()
388 * - rpp_fr_get_poc_status()
390 * To establish new communication, it is necessary to reset the
393 * @param [in] ctrl Not used, set always to zero.
395 * @return SUCCESS if command passed successfully.
396 * FAILURE if command rejected.
399 int8_t rpp_fr_abort_communication(uint8_t ctrl);
402 * FlexRay send wakeup pattern.
404 * The function should be called after FlexRay controller is initialized
405 * and before the communication start.
407 * @param [in] ctrl Not used, set always to zero.
409 * @return SUCCESS if command passed successfully.
410 * FAILURE if command rejected.
413 int8_t rpp_fr_send_wup(uint8_t ctrl);
416 * FlexRay set channel for wakeup pattern sending.
418 * This allows to change the configuration passed to the
419 * rpp_fr_init_driver().
421 * The function should be called after FlexRay controller is initialized
422 * and before the communication start.
424 * @param [in] ctrl Not used, set always to zero.
426 * @return SUCCESS if command passed successfully.
427 * FAILURE if command rejected.
430 int8_t rpp_fr_set_wu_channel(uint8_t ctrl, Fr_ChannelType channel);
433 * Get FlexRay POC state
435 * The function can be called any time after the driver is
438 * @param [in] ctrl Not used, set always to zero.
439 * @parap [out] poc_status_ptr Address where status will be stored.
441 * @return SUCCESS if status retrieved successfully.
442 * FAILURE if something failed.
445 int8_t rpp_fr_get_poc_status(uint8_t ctrl, Fr_POCStatusType* poc_status_ptr);
448 * Send a message on the bus in the specified frame
450 * The function can be called any time when communication is running
451 * (rpp_fr_start_communication() was called).
453 * If the buffer assigned to the frame is configured for continuous
454 * mode, this functions starts sending the message periodically. The
455 * transmission can be stopped by rpp_fr_cancel_transmit_lpdu(). If
456 * the buffer assigned to the frame is configured for single-shot
457 * mode, the message is sent only once.
459 * @param [in] ctrl Not used, set always to zero.
460 * @param [in] lpdu_idx Index of the frame, where the message will be sent.
461 * @param [in] lsdu Address of the first byte of the message.
462 * @param [in] lsdu_length Number of bytes of the message.
464 * @return SUCCESS if message was transmitted.
465 * FAILURE if something failed.
468 int8_t rpp_fr_transmit_lpdu(uint8_t ctrl, uint16_t lpdu_idx, const uint8_t* lsdu, uint8_t lsdu_length);
471 * Cancel a transmission of the message.
473 * The function can be called any time when communication is running
474 * (rpp_fr_start_communication() was called).
476 * This is one way to stop transmission for buffers configured for
477 * continuous mode. The other way is to use rpp_fr_disable_lpdu().
479 * @param [in] ctrl Not used, set always to zero.
480 * @param [in] lpdu_idx Index of the frame, where the message transmission will be stopped.
482 * @return SUCCESS if the transmission was stopped.
483 * FAILURE if something failed.
486 int8_t rpp_fr_cancel_transmit_lpdu(uint8_t ctrl, uint16_t lpdu_idx);
489 * Receive a message from the bus from the specified frame.
491 * The function can be called any time when communication is running
492 * (rpp_fr_start_communication() was called).
494 * If a new message was received in a buffer configured for the static
495 * or dynamic segment, this function can retrieve it.
497 * @param [in] ctrl Not used, set always to zero.
498 * @param [in] lpdu_idx Index of the frame where message will be received from.
499 * @param [out] lsdu Address of the first byte of the buffer, where message will be stored.
500 * @param [out] lpdu_status Address where the status will be stored. It can be:
501 * FR_NOT_RECEIVED, FR_RECEIVED, FR_RECEIVED_MORE_DATA_AVAILABLE - for FIFO only.
502 * @param [out] lsdu_length Number of bytes of the message.
504 * @return SUCCESS if message was received.
505 * FAILURE if something failed.
508 int8_t rpp_fr_receive_lpdu(uint8_t ctrl, uint16_t lpdu_idx, uint8_t* lsdu, Fr_RxLPduStatusType* lpdu_status, uint8_t* lsdu_length);
511 * Check TX buffer status
513 * The function can be called any time when communication is running
514 * (rpp_fr_start_communication() was called).
516 * The status says whther a transmission request (TXR) is pending or
519 * If the buffer is configured for single-shot mode, the (TXR) is
520 * pending until the message is sent. For buffers configured in
521 * continuous mode, the transmission request is always pending.
524 * @param [in] ctrl Not used, set always to zero.
525 * @param [in] lpdu_idx Index of the frame to which the buffer is assigned.
526 * @param [out] lpdu_status Address of the status. It can be FR_TRANSMITTED,
527 * which means the TXR is not pending, or FR_NOT_TRANSMITTED which means that
530 * @return SUCCESS if everything is OK.
531 * FAILURE if something failed.
533 int8_t rpp_fr_check_tx_lpdu_status(uint8_t ctrl, uint16_t lpdu_idx, Fr_TxLPduStatusType* lpdu_status);
536 * Disable a FlexRay buffer
538 * The function can be called any time when communication is running
539 * (rpp_fr_start_communication() was called).
541 * This functions resets the configuration of the selected buffer.
542 * The disabled buffer is not usable any more.
544 * @param [in] ctrl Not used, set always to zero.
545 * @param [in] lpdu_idx Index of the frame to which the buffer is assigned.
547 * @return SUCCESS if buffer was disabled.
548 * FAILURE if something failed.
551 int8_t rpp_fr_disable_lpdu(uint8_t ctrl, uint16_t lpdu_idx);
554 * Get FlexRay global time
556 * The function can be called any time after the controller is initialized.
558 * @param [in] ctrl Not used, set always to zero.
559 * @param [out] cycle Adress where the number of actual cycle will be stored.
560 * @param [out] macroticks Address where offset in the cycle will be stored.
562 * @return SUCCESS if everything is OK.
563 * FAILURE if something failed.
566 int8_t rpp_fr_get_global_time(uint8_t ctrl, uint8_t* cycle, uint16_t* macroticks);
569 * Get Network management vector.
571 * The function can be called any time after the controller is initialized.
573 * The FlexRay controller updates the vector at the end of every cycle
574 * by doing bit-wise OR on every network managemet (NM) vectors
575 * received from all nodes.
577 * The NM vector can be sent in a frame by a buffer with the
578 * payloadPreambleIndicatorTr parameter set. Those frames are
579 * automatically processed by all the receiving controllers. But
580 * sending the vector has to be done manually by copying the NM vector
581 * data (obtainable by this function) into the TX buffer (using the
582 * rpp_fr_transmit_lpdu() function).
584 * @param [in] ctrl Not used, set always to zero.
585 * @param [out] nm_vector Address where the vector will be stored. The size of the buffer has to be at least gNetworkManagementVectorLength.
587 * @return SUCCESS if everything is OK.
588 * FAILURE if something failed.
590 int8_t rpp_fr_get_network_management_vector(uint8_t ctrl, uint8_t* nm_vector);
593 * Get Channel status.
595 * The function can be called any time after the controller is
598 * The output of the function is bitcoded in this way:
599 * - Bit 0: Channel A/B aggregated channel status vSS!ValidFrame
600 * - Bit 1: Channel A/B aggregated channel status vSS!SyntaxError
601 * - Bit 2: Channel A/B aggregated channel status vSS!ContentError
602 * - Bit 3: Channel A/B aggregated channel status additional communication
603 * - Bit 4: Channel A/B aggregated channel status vSS!Bviolation
604 * - Bit 5: Channel A/B aggregated channel status vSS!TxConflict
605 * - Bit 6: Not used (0)
606 * - Bit 7: Not used (0)
607 * - Bit 8: Channel A/B symbol window status data vSS!ValidMTS
608 * - Bit 9: Channel A/B symbol window status data vSS!SyntaxError
609 * - Bit 10: Channel A/B symbol window status data vSS!Bviolation
610 * - Bit 11: Channel A/B symbol window status data vSS!TxConflict
611 * - Bit 12: Channel A/B NIT status data vSS!SyntaxError
612 * - Bit 13: Channel A/B NIT status data vSS!Bviolation
613 * - Bit 14: Not used (0)
614 * - Bit 15: Not used (0)
616 * @param [in] ctrl Not used, set always to zero.
617 * @param [out] channel_a_status Address where the bitcoded status of the channel A will be stored.
618 * @param [out] channel_b_status Address where the bitcoded status of the channel B will be stored.
620 * @return SUCCESS if everything is OK.
621 * FAILURE if something failed.
624 int8_t rpp_fr_get_channel_status(uint8_t ctrl, uint16_t* channel_a_status, uint16_t* channel_b_status);
627 * Get clock correction.
629 * The function can be called while the communication is running or
632 * @param [in] ctrl Not used, set always to zero.
633 * @param [out] rate_correction Address where the rate will be stored.
634 * @param [out] offset_correction Address where the offset will be stored.
636 * @return SUCCESS if everything is OK.
637 * FAILURE if something failed.
640 int8_t rpp_fr_get_clock_correction(uint8_t ctrl, int16_t* rate_correction, int32_t* offset_correction);
643 * Gets a list of syncframes received or transmitted on channel A and channel B via the even and odd communication cycle.
645 * The function can be called while communication is running or was stopped.
647 * @param [in] ctrl Not used, set always to zero.
648 * @param [in] list_size Size of the arrays passed via parameters:
649 * @param [out] channel_a_even_list Address the list of syncframes on channel A within the
650 * even communication cycle is written to. The exact
651 * number of elements written to the list is limited by
652 * parameter Fr_ListSize.
653 * Unused list elements are filled with the value '0' to indicate that no more syncframe has been seen.
654 * @param [out] channel_b_even_list Address the list of syncframes on channel B within the
655 * even communication cycle is written to. The exact
656 * number of elements written to the list is limited by
657 * parameter Fr_ListSize.
658 * @param [out] channel_a_odd_list Address the list of syncframes on channel A within the
659 * odd communication cycle is written to. The exact number
660 * of elements written to the list is limited by parameter
662 * Unused list elements are filled with the value '0' to indicate that no more syncframe has been seen.
663 * @param [out] channel_b_odd_list Address the list of syncframes on channel B within the
665 * @return SUCCESS if everything is OK.
666 * FAILURE if something failed.
669 int8_t rpp_fr_get_sync_frame_list(uint8_t ctrl, uint8_t list_size, uint16_t* channel_a_even_list,
670 uint16_t* channel_b_even_list, uint16_t* channel_a_odd_list, uint16_t* channel_b_odd_list);
673 * Get the status of WUP receiving
675 * The function can be called any time after controller is initialized.
677 * If the Wake Up Pattern was received on some channel, the flag is set in status address.
678 * Bit 0: Wakeup received on channel A indicator
679 * Bit 1: Wakeup received on channel B indicator
682 * @param [in] ctrl Not used, set always to zero.
683 * @param [out] status Address where the status will be stored.
685 * @return SUCCESS if everything is OK.
686 * FAILURE if something failed.
689 int8_t rpp_fr_get_wakeup_rx_status(uint8_t ctrl, uint8_t* status);
692 * Set an absolute timer and start it.
694 * The function can be called any time after communication is running.
695 * The FlexRay controller has two absolute timers. Each of them can be
696 * configured to request the interrupt, when the global time reaches
697 * configured cycle and offset.
699 * Timer interrupt request can be detected by
700 * rpp_fr_get_timer_irq_status(). The timer interrupt request can be
701 * cleared by rpp_fr_clear_timer_irq(). The timer can be canceled by
702 * rpp_fr_cancel_timer().
704 * @param [in] ctrl Not used, set always to zero.
705 * @param [in] timer_idx Index of the timer (0,1).
706 * @param [in] cycle_threshold Number of the cycle.
707 * @param [in] offset_threshold Offset in the cycle in mactroticks.
709 * @return SUCCESS if everything is OK.
710 * FAILURE if something failed.
713 int8_t rpp_fr_set_timer(uint8_t ctrl, uint8_t timer_idx, uint8_t cycle_threshold, uint16_t offset_threshold);
716 * Stops an absolute timer, clear IRQ.
718 * The function can be called any time after communication is running.
720 * The FlexRay controller has two absolute timers. Each of them can be
721 * configured to request the interrupt, when the global time reaches
722 * configured cycle and offset. This function stops the timer and clears
723 * the interrupt request.
725 * Timer interrupt request can be detected by
726 * rpp_fr_get_timer_irq_status(). Timer interrupt request can be
727 * cleared by rpp_fr_clear_timer_irq() Timer can be started by
728 * rpp_fr_set_timer().
730 * @param [in] ctrl Not used, set always to zero.
731 * @param [in] timer_idx Index of the timer (0,1).
733 * @return SUCCESS if everything is OK.
734 * FAILURE if something failed.
737 int8_t rpp_fr_cancel_timer(uint8_t ctrl, uint8_t timer_idx);
740 * Clear the IRQ flag of the absolute timer
742 * The function can be called any time after communication is running.
744 * The FlexRay controller has two absolute timers. Each of them can be
745 * configured to request the interrupt, when the global time reaches
746 * configured cycle and offset. This function clears the IRQ flag.
748 * Timer interrupt request can be detected by rpp_fr_get_timer_irq_status().
749 * The timer can be started by rpp_fr_set_timer().
750 * The timer can be canceled by rpp_fr_cancel_timer().
752 * @param [in] ctrl Not used, set always to zero.
753 * @param [in] timer_idx Index of the timer (0,1).
755 * @return SUCCESS if everything is OK.
756 * FAILURE if something failed.
759 int8_t rpp_fr_clear_timer_irq(uint8_t ctrl, uint8_t timer_idx);
762 * Get IRQ flag of the absolute timer
764 * The function can be called any time after communication is running.
766 * The FlexRay controller has two absolute timers. Each of them can be
767 * configured to request the interrupt, when the global time reaches
768 * configured cycle and offset. Using this function the IRQ can be detected.
770 * Timer interrupt request can be cleared by rpp_fr_clear_timer_irq().
771 * The timer can be started by rpp_fr_set_timer().
772 * The timer can be canceled by rpp_fr_cancel_timer().
774 * @param [in] ctrl Not used, set always to zero.
775 * @param [in] timer_idx Index of the timer (0,1).
777 * @return SUCCESS if everything is OK.
778 * FAILURE if something failed.
781 int8_t rpp_fr_get_timer_irq_status(uint8_t ctrl, uint8_t timer_idx, boolean_t* irq_pending);
784 * Get information about the driver vendor, module and version.
786 * The function can be called any time.
788 * @param [out] version Address, where the information will be stored.
790 * @return always SUCCESS
793 int8_t rpp_fr_get_driver_version(Std_VersionInfoType* version);
796 * Get configuration parameter value from the internal driver structures.
798 * The function can be called any time.
800 * @param [in] ctrl Not used, set always to zero.
801 * @param [in] param_idx The index if the parameter. You can find the indexes in Fr_GeneralTypes.h file with FR_CIDX prefix.
802 * @param [out] param_value Address, where the information will be stored.
804 * @return SUCCESS if everything is OK.
805 * FAILURE if something failed.
808 int8_t rpp_fr_read_com_ctrl_config(uint8_t ctrl, uint8_t param_idx, uint32_t* param_value);
810 #endif /* __RPP_FR_H */