]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blob - rpp/include/rpp/fr.h
Reformated by uncrustify
[pes-rpp/rpp-lib.git] / rpp / include / rpp / fr.h
1 /**
2  * FlexRay Communication RPP API header file.
3  *
4  * @file fr.h
5  *
6  * @copyright Copyright (C) 2013 Czech Technical University in Prague
7  *
8  * @author Carlos Jenkins <carlos@jenkins.co.cr>
9  * @author Michal Horn <hornmich@fel.cvut.cz>
10  */
11
12
13 #ifndef __RPP_FR_H
14 #define __RPP_FR_H
15
16 #include "drv/Fr_GeneralTypes.h"
17 #include "drv/fr_tms570.h"
18
19 /**
20  * Enumeration of states for the FlexRay
21  */
22 typedef enum {
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 */
30 } rpp_fr_state_t;
31
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 */
35
36 /* AUTOSAR-like API */
37
38 /**
39  * FlexRay driver initialization.
40  *
41  * This method should be called before any other function from this
42  * module.
43  *
44  * The function copies configuration data into drivers internal
45  * structures and initializes the driver.
46  *
47  * After a successful driver initialization, the driver is ready for calling:
48  * - rpp_fr_init_controller()
49  * - rpp_fr_get_poc_status()
50  * - rpp_fr_get_wakeup_rx_status()
51  * - rpp_fr_get_timer_irq_status()
52  *
53  * @param [in] config_ptr Address of the structure with all FlexRay
54  * configuration parameters.
55  * @param [out] error Address where error flags will be stored. The flags
56  * definitions can be found in fr_tms570.h, with ERR_PARAM prefix.
57  *
58  * @return SUCCESS if initialization successful.
59  *         FAILURE if module already initialized.
60  *
61  */
62 int8_t rpp_fr_init_driver(const Fr_ConfigType *config_ptr, uint32_t *error);
63
64 /**
65  * FlexRay controller initialization.
66  *
67  * This method should be called after rpp_fr_init_driver(), rpp_fr_halt_communication() or
68  * rpp_fr_abort_communication() and before any other function from this module.
69  *
70  * Use this sequence to restart communication after halt or abort functions were called:
71  * - rpp_fr_init_controller()
72  * - rpp_fr_start_communication()
73  * - rpp_fr_all_slots() (optionally)
74  *
75  * The functions checks configuration parameters and configures FlexRay
76  * controller registers.
77  *
78  * After successful controller initialization, the FlexRay driver is ready for calling:
79  * - rpp_fr_get_poc_status()
80  * - rpp_fr_get_wakeup_rx_status()
81  * - rpp_fr_get_timer_irq_status()
82  * - rpp_fr_start_communication()
83  * - rpp_fr_send_wup()
84  * - rpp_fr_set_wu_channel()
85  * - rpp_fr_get_global_time()
86  * - rpp_fr_get_network_management_vector()
87  * - rpp_fr_get_channel_status()
88  * - rpp_fr_reconfigure_lpdu()
89  *
90  * @param [in] ctrl Not used, set always to zero.
91  * @param [out] error Address where error flags will be stored. The flags
92  * definitions can be found in fr_tms570.h, with ERR_PARAM and FR_INIT_ERR
93  * prefix.
94  *
95  * @return SUCCESS if initialization if successful.
96  *         FAILURE if module already initialized.
97  */
98
99 int8_t rpp_fr_init_controller(uint8_t ctrl, uint32_t *error);
100
101 /**
102  * Start communication
103  *
104  * This method should be called after rpp_fr_init_controller() and
105  * before any attempt to send or receive messages.
106  *
107  * For coldstarter node the function listens and tries to join an
108  * existing network. If it fails, it tries to initiate the new one.
109  * For regular node it only listens on the bus and tries to join to
110  * some existing network.
111  *
112  * After successful communication start, the FlexRay is ready for:
113  * - rpp_fr_get_poc_status()
114  * - rpp_fr_get_wakeup_rx_status()
115  * - rpp_fr_get_timer_irq_status()
116  * - rpp_fr_set_wu_channel()
117  * - rpp_fr_get_global_time()
118  * - rpp_fr_get_network_management_vector()
119  * - rpp_fr_get_channel_status()
120  * - rpp_fr_all_slots()
121  * - rpp_fr_halt_communication()
122  * - rpp_fr_abort_communication()
123  * - rpp_fr_transmit_lpdu()
124  * - rpp_fr_cancel_transmit_lpdu()
125  * - rpp_fr_receive_lpdu()
126  * - rpp_fr_check_tx_lpdu_status()
127  * - rpp_fr_disable_lpdu()
128  * - rpp_fr_get_clock_correction()
129  * - rpp_fr_get_sync_frame_list()
130  * - rpp_fr_set_timer()
131  * - rpp_fr_cancel_timer()
132  * - rpp_fr_reconfigure_lpdu()
133  *
134  *
135  * @param [in] ctrl Not used, set always to zero.
136  * @param [out] error Address where error flags will be stored. The flags
137  * definitions can be found in fr_tms570h, with FR_STARTUP_ERR prefix.
138  *
139  * @return SUCCESS if initialization successful.
140  *         FAILURE if module already initialized.
141  *
142  */
143 int8_t rpp_fr_start_communication(uint8_t ctrl, uint32_t *error);
144
145 /**
146  * Allow communication on all slots
147  *
148  * The FlexRay node can be configured to communicate only on key
149  * frames after the startup. If this is the case, after calling this
150  * function, communication on all configured slots is allowed.
151  *
152  * The function should be called only after rpp_fr_start_communication() has been called.
153  *
154  * @param [in] ctrl Not used, set always to zero.
155  *
156  * @return SUCCESS if started successfully.
157  *         FAILURE if timeout reached.
158  *
159  */
160 int8_t rpp_fr_all_slots(uint8_t ctrl);
161
162 /**
163  * Stop communication after the end of the communication cycle.
164  *
165  * The function should be called only after
166  * rpp_fr_start_communication() has been called.
167  *
168  * After the communication is stopped, only those functions are allowed to be called:
169  * - rpp_fr_set_wu_channel()
170  * - rpp_fr_get_global_time()
171  * - rpp_fr_get_network_management_vector()
172  * - rpp_fr_get_channel_status()
173  * - rpp_fr_get_clock_correction()
174  * - rpp_fr_get_sync_frame_list()
175  * - rpp_fr_get_wakeup_rx_status()
176  * - rpp_fr_get_poc_status()
177  * - rpp_fr_init_controller()
178  *
179  * To restart the communication, the following sequence has to be called:
180  * - rpp_fr_init_controller()
181  * - rpp_fr_start_communication()
182  * - rpp_fr_all_slots() (optionally)
183  *
184  *
185  * @param [in] ctrl Not used, set always to zero.
186  *
187  * @return SUCCESS if command passed successfully.
188  *         FAILURE if command rejected.
189  *
190  */
191 int8_t rpp_fr_halt_communication(uint8_t ctrl);
192
193 /**
194  * Stop communication immediately.
195  *
196  * The function should be called only after
197  * rpp_fr_start_communication() has been called.
198  *
199  * After the communication is stopped, only those functions are allowed to be called:
200  * - rpp_fr_set_wu_channel()
201  * - rpp_fr_get_global_time()
202  * - rpp_fr_get_network_management_vector()
203  * - rpp_fr_get_channel_status()
204  * - rpp_fr_get_clock_correction()
205  * - rpp_fr_get_sync_frame_list()
206  * - rpp_fr_get_wakeup_rx_status()
207  * - rpp_fr_get_poc_status()
208  * - rpp_fr_init_controller()
209  *
210  * To restart the communication, the following sequence has to be called:
211  * - rpp_fr_init_controller()
212  * - rpp_fr_start_communication()
213  * - rpp_fr_all_slots() (optionally)
214  *
215  * @param [in] ctrl Not used, set always to zero.
216  *
217  * @return SUCCESS if command passed successfully.
218  *         FAILURE if command rejected.
219  *
220  */
221 int8_t rpp_fr_abort_communication(uint8_t ctrl);
222
223 /**
224  * Send wakeup pattern.
225  *
226  * The function should be called after FlexRay controller is initialized
227  * and before the communication start.
228  *
229  * @param [in] ctrl Not used, set always to zero.
230  *
231  * @return SUCCESS if command passed successfully.
232  *         FAILURE if command rejected.
233  *
234  */
235 int8_t rpp_fr_send_wup(uint8_t ctrl);
236
237 /**
238  * Set channel for wakeup pattern sending.
239  *
240  * This allows to change the configuration passed to the
241  * rpp_fr_init_driver().
242  *
243  * The function should be called after FlexRay controller is initialized
244  * and before the communication started.
245  *
246  * @param [in] ctrl Not used, set always to zero.
247  * @param [in] channel Channel selector, where wakeup pattern will be sent
248  *
249  * @return SUCCESS if command passed successfully.
250  *         FAILURE if command rejected.
251  *
252  */
253 int8_t rpp_fr_set_wu_channel(uint8_t ctrl, Fr_ChannelType channel);
254
255 /**
256  * Get FlexRay POC state
257  *
258  * The function can be called any time after the driver is
259  * initialized.
260  *
261  * @param [in] ctrl Not used, set always to zero.
262  * @param [out] poc_status_ptr Address where status will be stored.
263  *
264  * @return SUCCESS if status retrieved successfully.
265  *         FAILURE if something failed.
266  *
267  */
268 int8_t rpp_fr_get_poc_status(uint8_t ctrl, Fr_POCStatusType *poc_status_ptr);
269
270 /**
271  * Send a message on the bus in the specified frame
272  *
273  * The function can be called any time when communication is running
274  * (rpp_fr_start_communication() was called).
275  *
276  * If the buffer assigned to the frame is configured for continuous
277  * mode, this functions starts sending the message periodically. The
278  * transmission can be stopped by rpp_fr_cancel_transmit_lpdu(). If
279  * the buffer assigned to the frame is configured for single-shot
280  * mode, the message is sent only once.
281  *
282  * @param [in] ctrl Not used, set always to zero.
283  * @param [in] lpdu_idx Index of the frame, where the message will be sent.
284  * @param [in] lsdu Address of the first byte of the message.
285  * @param [in] lsdu_length Number of bytes of the message.
286  *
287  * @return SUCCESS if message was transmitted.
288  *         FAILURE if something failed.
289  *
290  */
291 int8_t rpp_fr_transmit_lpdu(uint8_t ctrl, uint16_t lpdu_idx, const uint8_t *lsdu, uint8_t lsdu_length);
292
293 /**
294  * Cancel a transmission of the message.
295  *
296  * The function can be called any time when communication is running
297  * (rpp_fr_start_communication() was called).
298  *
299  * This is one way to stop transmission for buffers configured for
300  * continuous mode. The other way is to use rpp_fr_disable_lpdu().
301  *
302  * @param [in] ctrl Not used, set always to zero.
303  * @param [in] lpdu_idx Index of the frame, where the message transmission will be stopped.
304  *
305  * @return SUCCESS if the transmission was stopped.
306  *         FAILURE if something failed.
307  *
308  */
309 int8_t rpp_fr_cancel_transmit_lpdu(uint8_t ctrl, uint16_t lpdu_idx);
310
311 /**
312  * Receive a message from the bus from the specified frame.
313  *
314  * The function can be called any time when communication is running
315  * (rpp_fr_start_communication() was called).
316  *
317  * If a new message was received in a buffer configured for the static
318  * and dynamic segment or FIFO, this function can retrieve it.
319  *
320  * The buffers with lower index (specified in configuration) have higher
321  * priority in retrieving process. This means for example if some buffer is
322  * configured to accept messages from slot 2 on channel A and another buffer
323  * accepts from slot 2 on channel B, the message from the first buffer
324  * will be retrieved first. If there is a FIFO buffer configured to accept
325  * messages from slot 2 in different cyclesets then other buffers, those
326  * messages accepted by the FIFO will be retrieved at the end of the process.
327  *
328  * @param [in] ctrl Not used, set always to zero.
329  * @param [in] lpdu_idx Index of the frame where message will be received from.
330  * @param [out] lsdu Address of the first byte of the buffer, where message will be stored.
331  * @param [out] lpdu_status Address where the status will be stored. It can be:
332  * FR_NOT_RECEIVED, FR_RECEIVED, FR_RECEIVED_MORE_DATA_AVAILABLE - for FIFO only.
333  * @param [out] lsdu_length Number of bytes of the message.
334  *
335  * @return SUCCESS if message was received.
336  *         FAILURE if something failed.
337  *
338  */
339 int8_t rpp_fr_receive_lpdu(uint8_t ctrl, uint16_t lpdu_idx, uint8_t *lsdu, Fr_RxLPduStatusType *lpdu_status, uint8_t *lsdu_length);
340
341 /**
342  * Check TX buffer status
343  *
344  * The function can be called any time when communication is running
345  * (rpp_fr_start_communication() was called).
346  *
347  * The status says whether a transmission request (TXR) is pending or
348  * not.
349  *
350  * If the buffer is configured for single-shot mode, the (TXR) is
351  * pending until the message is sent. For buffers configured in
352  * continuous mode, the transmission request is always pending.
353  *
354  *
355  * @param [in] ctrl Not used, set always to zero.
356  * @param [in] lpdu_idx Index of the frame to which the buffer is assigned.
357  * @param [out] lpdu_status Address of the status. It can be FR_TRANSMITTED,
358  * which means the TXR is not pending, or FR_NOT_TRANSMITTED which means that
359  * TXR is pending.
360  *
361  * @return SUCCESS if everything is OK.
362  *         FAILURE if something failed.
363  */
364 int8_t rpp_fr_check_tx_lpdu_status(uint8_t ctrl, uint16_t lpdu_idx, Fr_TxLPduStatusType *lpdu_status);
365
366
367 /**
368  * Reconfigure buffer
369  *
370  * The function can be called any time when after controller was initialized
371  * (rpp_fr_init_controller() was called).
372  *
373  * If the node is configured to allow buffer reconfiguration, some of the buffers
374  * can be reconfigured in runtime. Buffers used for synchronization and buffers
375  * assigned to the RX FIFO can not be reconfigured.
376  *
377  * It is not possible to change the direction (TX/RX) of the buffer or to change
378  * the mode (single-shot/continuous).
379  *
380  * Messages that were planned to be sent or received might not be transmitted or received
381  * if reconfiguration occurs in bad time.
382  *
383  * @param [in] ctrl Not used, set always to zero.
384  * @param [in] lpdu_idx Index of the frame, where reconfigured buffer is communicating.
385  * @param [in] frame_id Frame ID, where the buffer will be communicating after the reconfiguration.
386  * @param [in] channel Channel, where the buffer will be communicating. For dynamic segment it should not be AB.
387  * @param [in] cycle_set Cycle set value for cycle filtering. Can be 1, 2, 4, 8, 16, 32, 64.
388  * @param [in] cycle_offset Cycle offset value for cycle filtering. Must be 0 - cycle_set-1
389  * @param [in] payload Maximum payload for the reconfigured buffer in bytes. Must not be higher than the original payload, defined in half-words.
390  * @param [in] header_crc Not used, set to zero. The CRC is calculated automaticaly inside the function.
391  *
392  * @return SUCCESS if everything is OK.
393  *         FAILURE if something failed.
394  */
395 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);
396
397 /**
398  * Disable a FlexRay buffer
399  *
400  * The function can be called any time when communication is running
401  * (rpp_fr_start_communication() was called).
402  *
403  * This functions resets the configuration of the selected buffer.
404  * The disabled buffer is not accessible or reconfigurable any more.
405  *
406  * @param [in] ctrl Not used, set always to zero.
407  * @param [in] lpdu_idx Index of the frame to which the buffer is assigned.
408  *
409  * @return SUCCESS if buffer was disabled.
410  *         FAILURE if something failed.
411  *
412  */
413 int8_t rpp_fr_disable_lpdu(uint8_t ctrl, uint16_t lpdu_idx);
414
415 /**
416  * Get FlexRay global time
417  *
418  * The function can be called any time after the controller is initialized.
419  *
420  * @param [in] ctrl Not used, set always to zero.
421  * @param [out] cycle Adress where the number of actual cycle will be stored.
422  * @param [out] macroticks Address where offset in the cycle will be stored.
423  *
424  * @return SUCCESS if everything is OK.
425  *         FAILURE if something failed.
426  *
427  */
428 int8_t rpp_fr_get_global_time(uint8_t ctrl, uint8_t *cycle, uint16_t *macroticks);
429
430 /**
431  * Get Network management vector.
432  *
433  * The function can be called any time after the controller is initialized.
434  *
435  * The FlexRay controller updates the vector at the end of every cycle
436  * by doing bit-wise OR on every network management (NM) vectors
437  * received from all nodes.
438  *
439  * The NM vector can be sent in a frame by a buffer with the
440  * payloadPreambleIndicatorTr parameter set. Those frames are
441  * automatically processed by all the receiving controllers. But
442  * sending the vector has to be done manually by copying the NM vector
443  * data into the TX buffer (using the rpp_fr_transmit_lpdu() function).
444  *
445  * @param [in] ctrl Not used, set always to zero.
446  * @param [out] nm_vector Address where the vector will be stored. The size of the buffer has to be at least gNetworkManagementVectorLength.
447  *
448  * @return SUCCESS if everything is OK.
449  *         FAILURE if something failed.
450  */
451 int8_t rpp_fr_get_network_management_vector(uint8_t ctrl, uint8_t *nm_vector);
452
453 /**
454  * Get channel status.
455  *
456  * The function can be called any time after the controller is
457  * initialized.
458  *
459  * The output of the function is bitcoded in this way:
460  * - Bit 0: Channel A/B aggregated channel status vSS!ValidFrame
461  * - Bit 1: Channel A/B aggregated channel status vSS!SyntaxError
462  * - Bit 2: Channel A/B aggregated channel status vSS!ContentError
463  * - Bit 3: Channel A/B aggregated channel status additional communication
464  * - Bit 4: Channel A/B aggregated channel status vSS!Bviolation
465  * - Bit 5: Channel A/B aggregated channel status vSS!TxConflict
466  * - Bit 6: Not used (0)
467  * - Bit 7: Not used (0)
468  * - Bit 8: Channel A/B symbol window status data vSS!ValidMTS
469  * - Bit 9: Channel A/B symbol window status data vSS!SyntaxError
470  * - Bit 10: Channel A/B symbol window status data vSS!Bviolation
471  * - Bit 11: Channel A/B symbol window status data vSS!TxConflict
472  * - Bit 12: Channel A/B NIT status data vSS!SyntaxError
473  * - Bit 13: Channel A/B NIT status data vSS!Bviolation
474  * - Bit 14: Not used (0)
475  * - Bit 15: Not used (0)
476  *
477  * @param [in] ctrl Not used, set always to zero.
478  * @param [out] channel_a_status Address where the bitcoded status of the channel A will be stored.
479  * @param [out] channel_b_status Address where the bitcoded status of the channel B will be stored.
480  *
481  * @return SUCCESS if everything is OK.
482  *         FAILURE if something failed.
483  *
484  */
485 int8_t rpp_fr_get_channel_status(uint8_t ctrl, uint16_t *channel_a_status, uint16_t *channel_b_status);
486
487 /**
488  * Get clock correction.
489  *
490  * The function can be called while the communication is running or
491  * was stopped.
492  *
493  * @param [in] ctrl Not used, set always to zero.
494  * @param [out] rate_correction Address where the rate will be stored.
495  * @param [out] offset_correction Address where the offset will be stored.
496  *
497  * @return SUCCESS if everything is OK.
498  *         FAILURE if something failed.
499  *
500  */
501 int8_t rpp_fr_get_clock_correction(uint8_t ctrl, int16_t *rate_correction, int32_t *offset_correction);
502
503 /**
504  * Gets a list of syncframes received or transmitted on channel A and channel B via the even and odd communication cycle.
505  *
506  * The function can be called while communication is running or was stopped.
507  *
508  * @param [in] ctrl Not used, set always to zero.
509  * @param [in] list_size Size of the arrays passed via parameters:
510  * @param [out] channel_a_even_list Address the list of syncframes on channel A within the
511  * even communication cycle is written to. The exact
512  * number of elements written to the list is limited by
513  * parameter Fr_ListSize.
514  * Unused list elements are filled with the value '0' to indicate that no more syncframe has been seen.
515  * @param [out] channel_b_even_list Address the list of syncframes on channel B within the
516  * even communication cycle is written to. The exact
517  * number of elements written to the list is limited by
518  * parameter Fr_ListSize.
519  * @param [out] channel_a_odd_list Address the list of syncframes on channel A within the
520  * odd communication cycle is written to. The exact number
521  * of elements written to the list is limited by parameter
522  * Fr_ListSize.
523  * Unused list elements are filled with the value '0' to indicate that no more syncframe has been seen.
524  * @param [out] channel_b_odd_list Address the list of syncframes on channel B within the
525  *
526  * @return SUCCESS if everything is OK.
527  *         FAILURE if something failed.
528  *
529  */
530 int8_t rpp_fr_get_sync_frame_list(uint8_t ctrl, uint8_t list_size, uint16_t *channel_a_even_list,
531                                                                   uint16_t *channel_b_even_list, uint16_t *channel_a_odd_list, uint16_t *channel_b_odd_list);
532
533 /**
534  * Get the status of WUP receiving
535  *
536  * The function can be called any time after controller is initialized.
537  *
538  * If the Wake Up Pattern was received on some channel, the flag is set in status address.
539  * Bit 0: Wakeup received on channel A indicator
540  * Bit 1: Wakeup received on channel B indicator
541  * Bit 2-7: Unused
542  *
543  * @param [in] ctrl Not used, set always to zero.
544  * @param [out] status Address where the status will be stored.
545  *
546  * @return SUCCESS if everything is OK.
547  *         FAILURE if something failed.
548  *
549  */
550 int8_t rpp_fr_get_wakeup_rx_status(uint8_t ctrl, uint8_t *status);
551
552 /**
553  * Set the absolute timer and start it.
554  *
555  * The function can be called any time after communication is running.
556  *
557  * The FlexRay controller has two absolute timers. Each of them can be
558  * configured to request the interrupt, when the global time reaches
559  * configured cycle set and offset.
560  *
561  * Timer interrupt request can be detected by
562  * rpp_fr_get_timer_irq_status(). The timer interrupt request can be
563  * cleared by rpp_fr_clear_timer_irq(). The timer can be canceled by
564  * rpp_fr_cancel_timer().
565  *
566  * @param [in] ctrl Not used, set always to zero.
567  * @param [in] timer_idx Index of the timer (0,1).
568  * @param [in] cycle_set Determines the set of cycles that trigger the interrupt (see Table 23-6 in TMS570 datasheet (SPNU499))
569  * @param [in] offset_threshold Offset in the cycle in mactroticks.
570  *
571  * @return SUCCESS if everything is OK.
572  *         FAILURE if something failed.
573  *
574  */
575 int8_t rpp_fr_set_timer(uint8_t ctrl, uint8_t timer_idx, uint8_t cycle_set, uint16_t offset_threshold);
576
577 /**
578  * Stop the absolute timer, clear IRQ.
579  *
580  * The function can be called any time after communication is running.
581  *
582  * The FlexRay controller has two absolute timers. Each of them can be
583  * configured to request the interrupt, when the global time reaches
584  * configured cycle and offset. This function stops the timer and clears
585  * the interrupt request.
586  *
587  * Timer interrupt request can be detected by
588  * rpp_fr_get_timer_irq_status(). Timer interrupt request can be
589  * cleared by rpp_fr_clear_timer_irq() Timer can be started by
590  * rpp_fr_set_timer().
591  *
592  * @param [in] ctrl Not used, set always to zero.
593  * @param [in] timer_idx Index of the timer (0,1).
594  *
595  * @return SUCCESS if everything is OK.
596  *         FAILURE if something failed.
597  *
598  */
599 int8_t rpp_fr_cancel_timer(uint8_t ctrl, uint8_t timer_idx);
600
601 /**
602  * Clear the IRQ flag of the absolute timer
603  *
604  * The function can be called any time after communication is running.
605  *
606  * The FlexRay controller has two absolute timers. Each of them can be
607  * configured to request the interrupt, when the global time reaches
608  * configured cycle and offset. This function clears the IRQ flag.
609  *
610  * Timer interrupt request can be detected by rpp_fr_get_timer_irq_status().
611  * The timer can be started by rpp_fr_set_timer().
612  * The timer can be canceled by rpp_fr_cancel_timer().
613  *
614  * @param [in] ctrl Not used, set always to zero.
615  * @param [in] timer_idx Index of the timer (0,1).
616  *
617  * @return SUCCESS if everything is OK.
618  *         FAILURE if something failed.
619  *
620  */
621 int8_t rpp_fr_clear_timer_irq(uint8_t ctrl, uint8_t timer_idx);
622
623 /**
624  * Get IRQ flag of the absolute timer
625  *
626  * The function can be called any time after communication is running.
627  *
628  * The FlexRay controller has two absolute timers. Each of them can be
629  * configured to request the interrupt, when the global time reaches
630  * configured cycle and offset. Using this function the IRQ can be detected.
631  *
632  * Timer interrupt request can be cleared by rpp_fr_clear_timer_irq().
633  * The timer can be started by rpp_fr_set_timer().
634  * The timer can be canceled by rpp_fr_cancel_timer().
635  *
636  * @param [in] ctrl Not used, set always to zero.
637  * @param [in] timer_idx Index of the timer (0,1).
638  * @param [out] irq_pending Address, where status of the IRQ flag will be stored.
639  *
640  * @return SUCCESS if everything is OK.
641  *         FAILURE if something failed.
642  *
643  */
644 int8_t rpp_fr_get_timer_irq_status(uint8_t ctrl, uint8_t timer_idx, boolean_t *irq_pending);
645
646 /**
647  * Get information about the driver vendor, module and version.
648  *
649  * The function can be called any time.
650  *
651  * @param [out] version Address, where the information will be stored.
652  *
653  * @return always SUCCESS
654  *
655  */
656 int8_t rpp_fr_get_driver_version(Std_VersionInfoType *version);
657
658 /**
659  * Get configuration parameter value from the internal driver structures.
660  *
661  * The function can be called any time.
662  *
663  * @param [in] ctrl Not used, set always to zero.
664  * @param [in] param_idx The index if the parameter. You can find the indexes in Fr_GeneralTypes.h file with FR_CIDX prefix.
665  * @param [out] param_value Address, where the information will be stored.
666  *
667  * @return SUCCESS if everything is OK.
668  *         FAILURE if something failed.
669  *
670  */
671 int8_t rpp_fr_read_com_ctrl_config(uint8_t ctrl, uint8_t param_idx, uint32_t *param_value);
672
673 #endif /* __RPP_FR_H */