]> rtime.felk.cvut.cz Git - frescor/fna.git/blob - src_frescan/frescan_id.h
net
[frescor/fna.git] / src_frescan / frescan_id.h
1 /*!
2  * @file frescan_id.h
3  *
4  * @brief functions to manage the fields of the FRESCAN Identifier
5  *
6  * @version 0.01
7  *
8  * @date 27-Feb-2008
9  *
10  * @author
11  *      Daniel Sangorrin
12  *
13  * @comments
14  *
15  * This file contains the functions needed to manage the fields of a
16  * FRESCAN identifier. That is, how the 29 CAN ID bits of each frame are
17  * allocated in the FRESCAN protocol. If this configuration was to
18  * be changed (for example, the bits per field or the position  of the
19  * fields inside the ID), then only these functions need to be modified
20  *
21  * @license
22  *
23  * See MaRTE OS license
24  *
25  */
26
27 #ifndef _MARTE_FRESCAN_ID_H_
28 #define _MARTE_FRESCAN_ID_H_
29
30 #include <stdint.h>  // uint32_t
31
32 /**
33  *        8          4      4     4          8               1     bytes
34  * +----------------------------------------------------------------+
35  * |     prio     | dest | src | chan |     frag_id     | frag_flag |
36  * +----------------------------------------------------------------+
37  *
38  */
39
40 #define FRESCAN_FIELD_PRIO      0
41 #define FRESCAN_FIELD_DEST      1
42 #define FRESCAN_FIELD_SRC       2
43 #define FRESCAN_FIELD_CHAN      3
44 #define FRESCAN_FIELD_FRAG_ID   4
45 #define FRESCAN_FIELD_FRAG_FLAG 5
46
47 extern void frescan_id_set_field(uint32_t *id, uint32_t field, uint32_t value);
48
49 extern uint32_t frescan_id_get_field(uint32_t id, uint32_t field);
50
51 #endif // _MARTE_FRESCAN_ID_H_