2 * FlexRay Communication RPP API header file.
6 * @copyright Copyright (C) 2013, 2015 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"
20 * Enumeration of states for the FlexRay
23 RPP_FR_UNKNOWN, /**< FlexRay is in unknown state, this should not happen */
24 RPP_FR_NOT_INITIALIZED, /**< FlexRay driver was not yet configured and initialized, communication is not running. This is the default state after reset */
25 RPP_FR_DRV_INITIALIZED, /**< FlexRay driver was initialized, communication is not running, Driver is ready for controller initialization */
26 RPP_FR_CTR_INITIALIZED, /**< FlexRay controller was initlized, communicatin is not running, but can be started */
27 RPP_FR_RUNNING, /**< Communication is running */
28 RPP_FR_HALTED, /**< Communication was halted, controller is ready for reconfiguration and restart of the communication */
29 RPP_FR_ABORTED /**< Communication was aborted, controller is ready for reconfiguration and restart of the communication */
32 #define RPP_FR_MAX_STATIC_BUF_CNT 32 /**< Maximum number of the buffers for static segment of the communication cycle */
33 #define RPP_FR_MAX_DYNAMIC_BUF_CNT 32 /**< Maximum number of the buffers for dynamic segment of the communication cycle */
34 #define RPP_FR_MAX_FIFO_BUF_DEPTH 32 /**< Maximal depth of the RX FIFO buffer */
36 /* AUTOSAR-like API */
39 * FlexRay driver initialization.
41 * This function is not thread safe. Do not call it from multiple threads.
43 * This method should be called before any other function from this
46 * The function copies configuration data into drivers internal
47 * structures and initializes the driver.
49 * After a successful driver initialization, the driver is ready for calling:
50 * - rpp_fr_init_controller()
51 * - rpp_fr_get_poc_status()
52 * - rpp_fr_get_wakeup_rx_status()
53 * - rpp_fr_get_timer_irq_status()
55 * @param [in] config_ptr Address of the structure with all FlexRay
56 * configuration parameters.
57 * @param [out] error Address where error flags will be stored. The flags
58 * definitions can be found in fr_tms570.h, with ERR_PARAM prefix.
60 * @return SUCCESS if initialization successful.
61 * FAILURE if module already initialized.
64 int8_t rpp_fr_init_driver(const Fr_ConfigType *config_ptr, uint32_t *error);
67 * FlexRay controller initialization.
69 * The function is thread safe, unless compiled with
72 * This method should be called after rpp_fr_init_driver(), rpp_fr_halt_communication() or
73 * rpp_fr_abort_communication() and before any other function from this module.
75 * Use this sequence to restart communication after halt or abort functions were called:
76 * - rpp_fr_init_controller()
77 * - rpp_fr_start_communication()
78 * - rpp_fr_all_slots() (optionally)
80 * The functions checks configuration parameters and configures FlexRay
81 * controller registers.
83 * After successful controller initialization, the FlexRay driver is ready for calling:
84 * - rpp_fr_get_poc_status()
85 * - rpp_fr_get_wakeup_rx_status()
86 * - rpp_fr_get_timer_irq_status()
87 * - rpp_fr_start_communication()
89 * - rpp_fr_set_wu_channel()
90 * - rpp_fr_get_global_time()
91 * - rpp_fr_get_network_management_vector()
92 * - rpp_fr_get_channel_status()
93 * - rpp_fr_reconfigure_lpdu()
95 * @param [in] ctrl Not used, set always to zero.
96 * @param [out] error Address where error flags will be stored. The flags
97 * definitions can be found in fr_tms570.h, with ERR_PARAM and FR_INIT_ERR
100 * @return SUCCESS if initialization if successful.
101 * FAILURE if module already initialized.
104 int8_t rpp_fr_init_controller(uint8_t ctrl, uint32_t *error);
107 * Start communication
109 * The function is thread safe, unless compiled with
110 * -DRPP_THREADSAFE=0.
112 * This method should be called after rpp_fr_init_controller() and
113 * before any attempt to send or receive messages.
115 * For coldstarter node the function listens and tries to join an
116 * existing network. If it fails, it tries to initiate the new one.
117 * For regular node it only listens on the bus and tries to join to
118 * some existing network.
120 * After successful communication start, the FlexRay is ready for:
121 * - rpp_fr_get_poc_status()
122 * - rpp_fr_get_wakeup_rx_status()
123 * - rpp_fr_get_timer_irq_status()
124 * - rpp_fr_set_wu_channel()
125 * - rpp_fr_get_global_time()
126 * - rpp_fr_get_network_management_vector()
127 * - rpp_fr_get_channel_status()
128 * - rpp_fr_all_slots()
129 * - rpp_fr_halt_communication()
130 * - rpp_fr_abort_communication()
131 * - rpp_fr_transmit_lpdu()
132 * - rpp_fr_cancel_transmit_lpdu()
133 * - rpp_fr_receive_lpdu()
134 * - rpp_fr_check_tx_lpdu_status()
135 * - rpp_fr_disable_lpdu()
136 * - rpp_fr_get_clock_correction()
137 * - rpp_fr_get_sync_frame_list()
138 * - rpp_fr_set_timer()
139 * - rpp_fr_cancel_timer()
140 * - rpp_fr_reconfigure_lpdu()
143 * @param [in] ctrl Not used, set always to zero.
144 * @param [out] error Address where error flags will be stored. The flags
145 * definitions can be found in fr_tms570h, with FR_STARTUP_ERR prefix.
147 * @return SUCCESS if initialization successful.
148 * FAILURE if module already initialized.
151 int8_t rpp_fr_start_communication(uint8_t ctrl, uint32_t *error);
154 * Allow communication on all slots
156 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
158 * The FlexRay node can be configured to communicate only on key
159 * frames after the startup. If this is the case, after calling this
160 * function, communication on all configured slots is allowed.
162 * The function should be called only after rpp_fr_start_communication() has been called.
164 * @param [in] ctrl Not used, set always to zero.
166 * @return SUCCESS if started successfully.
167 * FAILURE if timeout reached.
170 int8_t rpp_fr_all_slots(uint8_t ctrl);
173 * Stop communication after the end of the communication cycle.
175 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
177 * The function should be called only after
178 * rpp_fr_start_communication() has been called.
180 * After the communication is stopped, only those functions are allowed to be called:
181 * - rpp_fr_set_wu_channel()
182 * - rpp_fr_get_global_time()
183 * - rpp_fr_get_network_management_vector()
184 * - rpp_fr_get_channel_status()
185 * - rpp_fr_get_clock_correction()
186 * - rpp_fr_get_sync_frame_list()
187 * - rpp_fr_get_wakeup_rx_status()
188 * - rpp_fr_get_poc_status()
189 * - rpp_fr_init_controller()
191 * To restart the communication, the following sequence has to be called:
192 * - rpp_fr_init_controller()
193 * - rpp_fr_start_communication()
194 * - rpp_fr_all_slots() (optionally)
197 * @param [in] ctrl Not used, set always to zero.
199 * @return SUCCESS if command passed successfully.
200 * FAILURE if command rejected.
203 int8_t rpp_fr_halt_communication(uint8_t ctrl);
206 * Stop communication immediately.
208 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
210 * The function should be called only after
211 * rpp_fr_start_communication() has been called.
213 * After the communication is stopped, only those functions are allowed to be called:
214 * - rpp_fr_set_wu_channel()
215 * - rpp_fr_get_global_time()
216 * - rpp_fr_get_network_management_vector()
217 * - rpp_fr_get_channel_status()
218 * - rpp_fr_get_clock_correction()
219 * - rpp_fr_get_sync_frame_list()
220 * - rpp_fr_get_wakeup_rx_status()
221 * - rpp_fr_get_poc_status()
222 * - rpp_fr_init_controller()
224 * To restart the communication, the following sequence has to be called:
225 * - rpp_fr_init_controller()
226 * - rpp_fr_start_communication()
227 * - rpp_fr_all_slots() (optionally)
229 * @param [in] ctrl Not used, set always to zero.
231 * @return SUCCESS if command passed successfully.
232 * FAILURE if command rejected.
235 int8_t rpp_fr_abort_communication(uint8_t ctrl);
238 * Send wakeup pattern.
240 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
242 * The function should be called after FlexRay controller is initialized
243 * and before the communication start.
245 * @param [in] ctrl Not used, set always to zero.
247 * @return SUCCESS if command passed successfully.
248 * FAILURE if command rejected.
251 int8_t rpp_fr_send_wup(uint8_t ctrl);
254 * Set channel for wakeup pattern sending.
256 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
258 * This allows to change the configuration passed to the
259 * rpp_fr_init_driver().
261 * The function should be called after FlexRay controller is initialized
262 * and before the communication started.
264 * @param [in] ctrl Not used, set always to zero.
265 * @param [in] channel Channel selector, where wakeup pattern will be sent
267 * @return SUCCESS if command passed successfully.
268 * FAILURE if command rejected.
271 int8_t rpp_fr_set_wu_channel(uint8_t ctrl, Fr_ChannelType channel);
274 * Get FlexRay POC state
276 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
278 * The function can be called any time after the driver is
281 * @param [in] ctrl Not used, set always to zero.
282 * @param [out] poc_status_ptr Address where status will be stored.
284 * @return SUCCESS if status retrieved successfully.
285 * FAILURE if something failed.
288 int8_t rpp_fr_get_poc_status(uint8_t ctrl, Fr_POCStatusType *poc_status_ptr);
291 * Send a message on the bus in the specified frame
293 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
295 * The function can be called any time when communication is running
296 * (rpp_fr_start_communication() was called).
298 * If the buffer assigned to the frame is configured for continuous
299 * mode, this functions starts sending the message periodically. The
300 * transmission can be stopped by rpp_fr_cancel_transmit_lpdu(). If
301 * the buffer assigned to the frame is configured for single-shot
302 * mode, the message is sent only once.
304 * @param [in] ctrl Not used, set always to zero.
305 * @param [in] lpdu_idx Index of the frame, where the message will be sent.
306 * @param [in] lsdu Address of the first byte of the message.
307 * @param [in] lsdu_length Number of bytes of the message.
309 * @return SUCCESS if message was transmitted.
310 * FAILURE if something failed.
313 int8_t rpp_fr_transmit_lpdu(uint8_t ctrl, uint16_t lpdu_idx, const uint8_t *lsdu, uint8_t lsdu_length);
316 * Cancel a transmission of the message.
318 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
320 * The function can be called any time when communication is running
321 * (rpp_fr_start_communication() was called).
323 * This is one way to stop transmission for buffers configured for
324 * continuous mode. The other way is to use rpp_fr_disable_lpdu().
326 * @param [in] ctrl Not used, set always to zero.
327 * @param [in] lpdu_idx Index of the frame, where the message transmission will be stopped.
329 * @return SUCCESS if the transmission was stopped.
330 * FAILURE if something failed.
333 int8_t rpp_fr_cancel_transmit_lpdu(uint8_t ctrl, uint16_t lpdu_idx);
336 * Receive a message from the bus from the specified frame.
338 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
340 * The function can be called any time when communication is running
341 * (rpp_fr_start_communication() was called).
343 * If a new message was received in a buffer configured for the static
344 * and dynamic segment or FIFO, this function can retrieve it.
346 * The buffers with lower index (specified in configuration) have higher
347 * priority in retrieving process. This means for example if some buffer is
348 * configured to accept messages from slot 2 on channel A and another buffer
349 * accepts from slot 2 on channel B, the message from the first buffer
350 * will be retrieved first. If there is a FIFO buffer configured to accept
351 * messages from slot 2 in different cyclesets then other buffers, those
352 * messages accepted by the FIFO will be retrieved at the end of the process.
354 * @param [in] ctrl Not used, set always to zero.
355 * @param [in] lpdu_idx Index of the frame where message will be received from.
356 * @param [out] lsdu Address of the first byte of the buffer, where message will be stored.
357 * @param [out] lpdu_status Address where the status will be stored. It can be:
358 * FR_NOT_RECEIVED, FR_RECEIVED, FR_RECEIVED_MORE_DATA_AVAILABLE - for FIFO only.
359 * @param [out] lsdu_length Number of bytes of the message.
361 * @return SUCCESS if message was received.
362 * FAILURE if something failed.
365 int8_t rpp_fr_receive_lpdu(uint8_t ctrl, uint16_t lpdu_idx, uint8_t *lsdu, Fr_RxLPduStatusType *lpdu_status, uint8_t *lsdu_length);
368 * Check TX buffer status
370 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
372 * The function can be called any time when communication is running
373 * (rpp_fr_start_communication() was called).
375 * The status says whether a transmission request (TXR) is pending or
378 * If the buffer is configured for single-shot mode, the (TXR) is
379 * pending until the message is sent. For buffers configured in
380 * continuous mode, the transmission request is always pending.
383 * @param [in] ctrl Not used, set always to zero.
384 * @param [in] lpdu_idx Index of the frame to which the buffer is assigned.
385 * @param [out] lpdu_status Address of the status. It can be FR_TRANSMITTED,
386 * which means the TXR is not pending, or FR_NOT_TRANSMITTED which means that
389 * @return SUCCESS if everything is OK.
390 * FAILURE if something failed.
392 int8_t rpp_fr_check_tx_lpdu_status(uint8_t ctrl, uint16_t lpdu_idx, Fr_TxLPduStatusType *lpdu_status);
398 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
400 * The function can be called any time when after controller was initialized
401 * (rpp_fr_init_controller() was called).
403 * If the node is configured to allow buffer reconfiguration, some of the buffers
404 * can be reconfigured in runtime. Buffers used for synchronization and buffers
405 * assigned to the RX FIFO can not be reconfigured.
407 * It is not possible to change the direction (TX/RX) of the buffer or to change
408 * the mode (single-shot/continuous).
410 * Messages that were planned to be sent or received might not be transmitted or received
411 * if reconfiguration occurs in bad time.
413 * @param [in] ctrl Not used, set always to zero.
414 * @param [in] lpdu_idx Index of the frame, where reconfigured buffer is communicating.
415 * @param [in] frame_id Frame ID, where the buffer will be communicating after the reconfiguration.
416 * @param [in] channel Channel, where the buffer will be communicating. For dynamic segment it should not be AB.
417 * @param [in] cycle_set Cycle set value for cycle filtering. Can be 1, 2, 4, 8, 16, 32, 64.
418 * @param [in] cycle_offset Cycle offset value for cycle filtering. Must be 0 - cycle_set-1
419 * @param [in] payload Maximum payload for the reconfigured buffer in bytes. Must not be higher than the original payload, defined in half-words.
420 * @param [in] header_crc Not used, set to zero. The CRC is calculated automaticaly inside the function.
422 * @return SUCCESS if everything is OK.
423 * FAILURE if something failed.
425 int8_t rpp_fr_reconfigure_lpdu(uint8_t ctrl, uint16_t lpdu_idx, uint16_t frame_id, Fr_ChannelType channel, uint8_t cycle_set, uint8_t cycle_offset, uint8_t payload, uint16_t header_crc);
428 * Disable a FlexRay buffer
430 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
432 * The function can be called any time when communication is running
433 * (rpp_fr_start_communication() was called).
435 * This functions resets the configuration of the selected buffer.
436 * The disabled buffer is not accessible or reconfigurable any more.
438 * @param [in] ctrl Not used, set always to zero.
439 * @param [in] lpdu_idx Index of the frame to which the buffer is assigned.
441 * @return SUCCESS if buffer was disabled.
442 * FAILURE if something failed.
445 int8_t rpp_fr_disable_lpdu(uint8_t ctrl, uint16_t lpdu_idx);
448 * Get FlexRay global time
450 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
452 * The function can be called any time after the controller is initialized.
454 * @param [in] ctrl Not used, set always to zero.
455 * @param [out] cycle Adress where the number of actual cycle will be stored.
456 * @param [out] macroticks Address where offset in the cycle will be stored.
458 * @return SUCCESS if everything is OK.
459 * FAILURE if something failed.
462 int8_t rpp_fr_get_global_time(uint8_t ctrl, uint8_t *cycle, uint16_t *macroticks);
465 * Get Network management vector.
467 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
469 * The function can be called any time after the controller is initialized.
471 * The FlexRay controller updates the vector at the end of every cycle
472 * by doing bit-wise OR on every network management (NM) vectors
473 * received from all nodes.
475 * The NM vector can be sent in a frame by a buffer with the
476 * payloadPreambleIndicatorTr parameter set. Those frames are
477 * automatically processed by all the receiving controllers. But
478 * sending the vector has to be done manually by copying the NM vector
479 * data into the TX buffer (using the rpp_fr_transmit_lpdu() function).
481 * @param [in] ctrl Not used, set always to zero.
482 * @param [out] nm_vector Address where the vector will be stored. The size of the buffer has to be at least gNetworkManagementVectorLength.
484 * @return SUCCESS if everything is OK.
485 * FAILURE if something failed.
487 int8_t rpp_fr_get_network_management_vector(uint8_t ctrl, uint8_t *nm_vector);
490 * Get channel status.
492 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
494 * The function can be called any time after the controller is
497 * The output of the function is bitcoded in this way:
498 * - Bit 0: Channel A/B aggregated channel status vSS!ValidFrame
499 * - Bit 1: Channel A/B aggregated channel status vSS!SyntaxError
500 * - Bit 2: Channel A/B aggregated channel status vSS!ContentError
501 * - Bit 3: Channel A/B aggregated channel status additional communication
502 * - Bit 4: Channel A/B aggregated channel status vSS!Bviolation
503 * - Bit 5: Channel A/B aggregated channel status vSS!TxConflict
504 * - Bit 6: Not used (0)
505 * - Bit 7: Not used (0)
506 * - Bit 8: Channel A/B symbol window status data vSS!ValidMTS
507 * - Bit 9: Channel A/B symbol window status data vSS!SyntaxError
508 * - Bit 10: Channel A/B symbol window status data vSS!Bviolation
509 * - Bit 11: Channel A/B symbol window status data vSS!TxConflict
510 * - Bit 12: Channel A/B NIT status data vSS!SyntaxError
511 * - Bit 13: Channel A/B NIT status data vSS!Bviolation
512 * - Bit 14: Not used (0)
513 * - Bit 15: Not used (0)
515 * @param [in] ctrl Not used, set always to zero.
516 * @param [out] channel_a_status Address where the bitcoded status of the channel A will be stored.
517 * @param [out] channel_b_status Address where the bitcoded status of the channel B will be stored.
519 * @return SUCCESS if everything is OK.
520 * FAILURE if something failed.
523 int8_t rpp_fr_get_channel_status(uint8_t ctrl, uint16_t *channel_a_status, uint16_t *channel_b_status);
526 * Get clock correction.
528 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
530 * The function can be called while the communication is running or
533 * @param [in] ctrl Not used, set always to zero.
534 * @param [out] rate_correction Address where the rate will be stored.
535 * @param [out] offset_correction Address where the offset will be stored.
537 * @return SUCCESS if everything is OK.
538 * FAILURE if something failed.
541 int8_t rpp_fr_get_clock_correction(uint8_t ctrl, int16_t *rate_correction, int32_t *offset_correction);
544 * Gets a list of syncframes received or transmitted on channel A and channel B via the even and odd communication cycle.
546 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
548 * The function can be called while communication is running or was stopped.
550 * @param [in] ctrl Not used, set always to zero.
551 * @param [in] list_size Size of the arrays passed via parameters:
552 * @param [out] channel_a_even_list Address the list of syncframes on channel A within the
553 * even communication cycle is written to. The exact
554 * number of elements written to the list is limited by
555 * parameter Fr_ListSize.
556 * Unused list elements are filled with the value '0' to indicate that no more syncframe has been seen.
557 * @param [out] channel_b_even_list Address the list of syncframes on channel B within the
558 * even communication cycle is written to. The exact
559 * number of elements written to the list is limited by
560 * parameter Fr_ListSize.
561 * @param [out] channel_a_odd_list Address the list of syncframes on channel A within the
562 * odd communication cycle is written to. The exact number
563 * of elements written to the list is limited by parameter
565 * Unused list elements are filled with the value '0' to indicate that no more syncframe has been seen.
566 * @param [out] channel_b_odd_list Address the list of syncframes on channel B within the
568 * @return SUCCESS if everything is OK.
569 * FAILURE if something failed.
572 int8_t rpp_fr_get_sync_frame_list(uint8_t ctrl, uint8_t list_size, uint16_t *channel_a_even_list,
573 uint16_t *channel_b_even_list, uint16_t *channel_a_odd_list, uint16_t *channel_b_odd_list);
576 * Get the status of WUP receiving
578 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
580 * The function can be called any time after controller is initialized.
582 * If the Wake Up Pattern was received on some channel, the flag is set in status address.
583 * Bit 0: Wakeup received on channel A indicator
584 * Bit 1: Wakeup received on channel B indicator
587 * @param [in] ctrl Not used, set always to zero.
588 * @param [out] status Address where the status will be stored.
590 * @return SUCCESS if everything is OK.
591 * FAILURE if something failed.
594 int8_t rpp_fr_get_wakeup_rx_status(uint8_t ctrl, uint8_t *status);
597 * Set the absolute timer and start it.
599 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
601 * The function can be called any time after communication is running.
603 * The FlexRay controller has two absolute timers. Each of them can be
604 * configured to request the interrupt, when the global time reaches
605 * configured cycle set and offset.
607 * Timer interrupt request can be detected by
608 * rpp_fr_get_timer_irq_status(). The timer interrupt request can be
609 * cleared by rpp_fr_clear_timer_irq(). The timer can be canceled by
610 * rpp_fr_cancel_timer().
612 * @param [in] ctrl Not used, set always to zero.
613 * @param [in] timer_idx Index of the timer (0,1).
614 * @param [in] cycle_set Determines the set of cycles that trigger the interrupt (see Table 23-6 in TMS570 datasheet (SPNU499))
615 * @param [in] offset_threshold Offset in the cycle in mactroticks.
617 * @return SUCCESS if everything is OK.
618 * FAILURE if something failed.
621 int8_t rpp_fr_set_timer(uint8_t ctrl, uint8_t timer_idx, uint8_t cycle_set, uint16_t offset_threshold);
624 * Stop the absolute timer, clear IRQ.
626 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
628 * The function can be called any time after communication is running.
630 * The FlexRay controller has two absolute timers. Each of them can be
631 * configured to request the interrupt, when the global time reaches
632 * configured cycle and offset. This function stops the timer and clears
633 * the interrupt request.
635 * Timer interrupt request can be detected by
636 * rpp_fr_get_timer_irq_status(). Timer interrupt request can be
637 * cleared by rpp_fr_clear_timer_irq() Timer can be started by
638 * rpp_fr_set_timer().
640 * @param [in] ctrl Not used, set always to zero.
641 * @param [in] timer_idx Index of the timer (0,1).
643 * @return SUCCESS if everything is OK.
644 * FAILURE if something failed.
647 int8_t rpp_fr_cancel_timer(uint8_t ctrl, uint8_t timer_idx);
650 * Clear the IRQ flag of the absolute timer
652 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
654 * The function can be called any time after communication is running.
656 * The FlexRay controller has two absolute timers. Each of them can be
657 * configured to request the interrupt, when the global time reaches
658 * configured cycle and offset. This function clears the IRQ flag.
660 * Timer interrupt request can be detected by rpp_fr_get_timer_irq_status().
661 * The timer can be started by rpp_fr_set_timer().
662 * The timer can be canceled by rpp_fr_cancel_timer().
664 * @param [in] ctrl Not used, set always to zero.
665 * @param [in] timer_idx Index of the timer (0,1).
667 * @return SUCCESS if everything is OK.
668 * FAILURE if something failed.
671 int8_t rpp_fr_clear_timer_irq(uint8_t ctrl, uint8_t timer_idx);
674 * Get IRQ flag of the absolute timer
676 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
678 * The function can be called any time after communication is running.
680 * The FlexRay controller has two absolute timers. Each of them can be
681 * configured to request the interrupt, when the global time reaches
682 * configured cycle and offset. Using this function the IRQ can be detected.
684 * Timer interrupt request can be cleared by rpp_fr_clear_timer_irq().
685 * The timer can be started by rpp_fr_set_timer().
686 * The timer can be canceled by rpp_fr_cancel_timer().
688 * @param [in] ctrl Not used, set always to zero.
689 * @param [in] timer_idx Index of the timer (0,1).
690 * @param [out] irq_pending Address, where status of the IRQ flag will be stored.
692 * @return SUCCESS if everything is OK.
693 * FAILURE if something failed.
696 int8_t rpp_fr_get_timer_irq_status(uint8_t ctrl, uint8_t timer_idx, boolean_t *irq_pending);
699 * Get information about the driver vendor, module and version.
701 * The function is thread safe
703 * The function can be called any time.
705 * @param [out] version Address, where the information will be stored.
707 * @return always SUCCESS
710 int8_t rpp_fr_get_driver_version(Std_VersionInfoType *version);
713 * Get configuration parameter value from the internal driver structures.
715 * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
717 * The function can be called any time.
719 * @param [in] ctrl Not used, set always to zero.
720 * @param [in] param_idx The index if the parameter. You can find the indexes in Fr_GeneralTypes.h file with FR_CIDX prefix.
721 * @param [out] param_value Address, where the information will be stored.
723 * @return SUCCESS if everything is OK.
724 * FAILURE if something failed.
727 int8_t rpp_fr_read_com_ctrl_config(uint8_t ctrl, uint8_t param_idx, uint32_t *param_value);
729 #endif /* __RPP_FR_H */