]> rtime.felk.cvut.cz Git - rpp-test-sw.git/blob - rpp/lib/rpp/include/sys/ti_drv_esm.h
Yet another place to fix
[rpp-test-sw.git] / rpp / lib / rpp / include / sys / ti_drv_esm.h
1 /** @file esm.h
2 *   @brief Error Signaling Module Driver Header File
3 *   @date 15.Mar.2012
4 *   @version 03.01.00
5 *
6 *   This file contains:
7 *   - Definitions
8 *   - Types
9 *   .
10 *   which are relevant for the Esm driver.
11 */
12
13 /* (c) Texas Instruments 2010, All rights reserved. */
14
15 #ifndef __ESM_H__
16 #define __ESM_H__
17
18 #include "base.h"
19
20 /* USER CODE BEGIN (0) */
21 /* USER CODE END */
22
23
24 /* ESM General Definitions */
25
26 /** @def esmGROUP1
27 *   @brief Alias name for ESM group 1
28 *
29 *   This is an alias name for the ESM group 1.
30 *
31 *   @note This value should be used for API argument @a group
32 */
33 #define esmGROUP1 0U
34
35 /** @def esmGROUP2
36 *   @brief Alias name for ESM group 2
37 *
38 *   This is an alias name for the ESM group 2.
39 *
40 *   @note This value should be used for API argument @a group
41 */
42 #define esmGROUP2 1U
43
44 /** @def esmGROUP3
45 *   @brief Alias name for ESM group 3
46 *
47 *   This is an alias name for the ESM group 3.
48 *
49 *   @note This value should be used for API argument @a group
50 */
51 #define esmGROUP3 2U
52
53 /** @def esmCHANNEL0
54 *   @brief Alias name for ESM group x channel 0
55 *
56 *   This is an alias name for the ESM group x channel 0.
57 *
58 *   @note This value should be used for API argument @a channel
59 */
60 #define esmCHANNEL0 0x0000000000000001ULL
61
62 /** @def esmCHANNEL1
63 *   @brief Alias name for ESM group x channel 1
64 *
65 *   This is an alias name for the ESM group x channel 1.
66 *
67 *   @note This value should be used for API argument @a channel
68 */
69 #define esmCHANNEL1 0x0000000000000002ULL
70
71 /** @def esmCHANNEL2
72 *   @brief Alias name for ESM group x channel 2
73 *
74 *   This is an alias name for the ESM group x channel 2.
75 *
76 *   @note This value should be used for API argument @a channel
77 */
78 #define esmCHANNEL2 0x0000000000000004ULL
79
80 /** @def esmCHANNEL3
81 *   @brief Alias name for ESM group x channel 3
82 *
83 *   This is an alias name for the ESM group x channel 3.
84 *
85 *   @note This value should be used for API argument @a channel
86 */
87 #define esmCHANNEL3 0x0000000000000008ULL
88
89 /** @def esmCHANNEL4
90 *   @brief Alias name for ESM group x channel 4
91 *
92 *   This is an alias name for the ESM group x channel 4.
93 *
94 *   @note This value should be used for API argument @a channel
95 */
96 #define esmCHANNEL4 0x0000000000000010ULL
97
98 /** @def esmCHANNEL5
99 *   @brief Alias name for ESM group x channel 5
100 *
101 *   This is an alias name for the ESM group x channel 5.
102 *
103 *   @note This value should be used for API argument @a channel
104 */
105 #define esmCHANNEL5 0x0000000000000020ULL
106
107 /** @def esmCHANNEL6
108 *   @brief Alias name for ESM group x channel 6
109 *
110 *   This is an alias name for the ESM group x channel 6.
111 *
112 *   @note This value should be used for API argument @a channel
113 */
114 #define esmCHANNEL6 0x0000000000000040ULL
115
116 /** @def esmCHANNEL7
117 *   @brief Alias name for ESM group x channel 7
118 *
119 *   This is an alias name for the ESM group x channel 7.
120 *
121 *   @note This value should be used for API argument @a channel
122 */
123 #define esmCHANNEL7 0x0000000000000080ULL
124
125 /** @def esmCHANNEL8
126 *   @brief Alias name for ESM group x channel 8
127 *
128 *   This is an alias name for the ESM group x channel 8.
129 *
130 *   @note This value should be used for API argument @a channel
131 */
132 #define esmCHANNEL8 0x0000000000000100ULL
133
134 /** @def esmCHANNEL9
135 *   @brief Alias name for ESM group x channel 9
136 *
137 *   This is an alias name for the ESM group x channel 9.
138 *
139 *   @note This value should be used for API argument @a channel
140 */
141 #define esmCHANNEL9 0x0000000000000200ULL
142
143 /** @def esmCHANNEL10
144 *   @brief Alias name for ESM group x channel 10
145 *
146 *   This is an alias name for the ESM group x channel 10.
147 *
148 *   @note This value should be used for API argument @a channel
149 */
150 #define esmCHANNEL10 0x0000000000000400ULL
151
152 /** @def esmCHANNEL11
153 *   @brief Alias name for ESM group x channel 11
154 *
155 *   This is an alias name for the ESM group x channel 11.
156 *
157 *   @note This value should be used for API argument @a channel
158 */
159 #define esmCHANNEL11 0x0000000000000800ULL
160
161 /** @def esmCHANNEL12
162 *   @brief Alias name for ESM group x channel 12
163 *
164 *   This is an alias name for the ESM group x channel 12.
165 *
166 *   @note This value should be used for API argument @a channel
167 */
168 #define esmCHANNEL12 0x0000000000001000ULL
169
170 /** @def esmCHANNEL13
171 *   @brief Alias name for ESM group x channel 13
172 *
173 *   This is an alias name for the ESM group x channel 13.
174 *
175 *   @note This value should be used for API argument @a channel
176 */
177 #define esmCHANNEL13 0x0000000000002000ULL
178
179 /** @def esmCHANNEL14
180 *   @brief Alias name for ESM group x channel 14
181 *
182 *   This is an alias name for the ESM group x channel 14.
183 *
184 *   @note This value should be used for API argument @a channel
185 */
186 #define esmCHANNEL14 0x0000000000004000ULL
187
188 /** @def esmCHANNEL15
189 *   @brief Alias name for ESM group x channel 15
190 *
191 *   This is an alias name for the ESM group x channel 15.
192 *
193 *   @note This value should be used for API argument @a channel
194 */
195 #define esmCHANNEL15 0x0000000000008000ULL
196
197 /** @def esmCHANNEL16
198 *   @brief Alias name for ESM group x channel 16
199 *
200 *   This is an alias name for the ESM group x channel 16.
201 *
202 *   @note This value should be used for API argument @a channel
203 */
204 #define esmCHANNEL16 0x0000000000010000ULL
205
206 /** @def esmCHANNEL17
207 *   @brief Alias name for ESM group x channel 17
208 *
209 *   This is an alias name for the ESM group x channel 17.
210 *
211 *   @note This value should be used for API argument @a channel
212 */
213 #define esmCHANNEL17 0x0000000000020000ULL
214
215 /** @def esmCHANNEL18
216 *   @brief Alias name for ESM group x channel 18
217 *
218 *   This is an alias name for the ESM group x channel 18.
219 *
220 *   @note This value should be used for API argument @a channel
221 */
222 #define esmCHANNEL18 0x0000000000040000ULL
223
224 /** @def esmCHANNEL19
225 *   @brief Alias name for ESM group x channel 19
226 *
227 *   This is an alias name for the ESM group x channel 19.
228 *
229 *   @note This value should be used for API argument @a channel
230 */
231 #define esmCHANNEL19 0x0000000000080000ULL
232
233 /** @def esmCHANNEL20
234 *   @brief Alias name for ESM group x channel 20
235 *
236 *   This is an alias name for the ESM group x channel 20.
237 *
238 *   @note This value should be used for API argument @a channel
239 */
240 #define esmCHANNEL20 0x0000000000100000ULL
241
242 /** @def esmCHANNEL21
243 *   @brief Alias name for ESM group x channel 21
244 *
245 *   This is an alias name for the ESM group x channel 21.
246 *
247 *   @note This value should be used for API argument @a channel
248 */
249 #define esmCHANNEL21 0x0000000000200000ULL
250
251 /** @def esmCHANNEL22
252 *   @brief Alias name for ESM group x channel 22
253 *
254 *   This is an alias name for the ESM group x channel 22.
255 *
256 *   @note This value should be used for API argument @a channel
257 */
258 #define esmCHANNEL22 0x0000000000400000ULL
259
260 /** @def esmCHANNEL23
261 *   @brief Alias name for ESM group x channel 23
262 *
263 *   This is an alias name for the ESM group x channel 23.
264 *
265 *   @note This value should be used for API argument @a channel
266 */
267 #define esmCHANNEL23 0x0000000000800000ULL
268
269 /** @def esmCHANNEL24
270 *   @brief Alias name for ESM group x channel 24
271 *
272 *   This is an alias name for the ESM group x channel 24.
273 *
274 *   @note This value should be used for API argument @a channel
275 */
276 #define esmCHANNEL24 0x0000000001000000ULL
277
278 /** @def esmCHANNEL25
279 *   @brief Alias name for ESM group x channel 25
280 *
281 *   This is an alias name for the ESM group x channel 25.
282 *
283 *   @note This value should be used for API argument @a channel
284 */
285 #define esmCHANNEL25 0x0000000002000000ULL
286
287 /** @def esmCHANNEL26
288 *   @brief Alias name for ESM group x channel 26
289 *
290 *   This is an alias name for the ESM group x channel 26.
291 *
292 *   @note This value should be used for API argument @a channel
293 */
294 #define esmCHANNEL26 0x0000000004000000ULL
295
296 /** @def esmCHANNEL27
297 *   @brief Alias name for ESM group x channel 27
298 *
299 *   This is an alias name for the ESM group x channel 27.
300 *
301 *   @note This value should be used for API argument @a channel
302 */
303 #define esmCHANNEL27 0x0000000008000000ULL
304
305 /** @def esmCHANNEL28
306 *   @brief Alias name for ESM group x channel 28
307 *
308 *   This is an alias name for the ESM group x channel 28.
309 *
310 *   @note This value should be used for API argument @a channel
311 */
312 #define esmCHANNEL28 0x0000000010000000ULL
313
314 /** @def esmCHANNEL29
315 *   @brief Alias name for ESM group x channel 29
316 *
317 *   This is an alias name for the ESM group x channel 29.
318 *
319 *   @note This value should be used for API argument @a channel
320 */
321 #define esmCHANNEL29 0x0000000020000000ULL
322
323 /** @def esmCHANNEL30
324 *   @brief Alias name for ESM group x channel 30
325 *
326 *   This is an alias name for the ESM group x channel 30.
327 *
328 *   @note This value should be used for API argument @a channel
329 */
330 #define esmCHANNEL30 0x0000000040000000ULL
331
332 /** @def esmCHANNEL31
333 *   @brief Alias name for ESM group x channel 31
334 *
335 *   This is an alias name for the ESM group x channel 31.
336 *
337 *   @note This value should be used for API argument @a channel
338 */
339 #define esmCHANNEL31 0x0000000080000000ULL
340
341 /** @def esmCHANNEL32
342 *   @brief Alias name for ESM group x channel 32
343 *
344 *   This is an alias name for the ESM group x channel 32.
345 *
346 *   @note This value should be used for API argument @a channel
347 */
348 #define esmCHANNEL32 0x0000000100000000ULL
349
350 /** @def esmCHANNEL33
351 *   @brief Alias name for ESM group x channel 33
352 *
353 *   This is an alias name for the ESM group x channel 33.
354 *
355 *   @note This value should be used for API argument @a channel
356 */
357 #define esmCHANNEL33 0x0000000200000000ULL
358
359 /** @def esmCHANNEL34
360 *   @brief Alias name for ESM group x channel 34
361 *
362 *   This is an alias name for the ESM group x channel 34.
363 *
364 *   @note This value should be used for API argument @a channel
365 */
366 #define esmCHANNEL34 0x0000000400000000ULL
367
368 /** @def esmCHANNEL35
369 *   @brief Alias name for ESM group x channel 35
370 *
371 *   This is an alias name for the ESM group x channel 35.
372 *
373 *   @note This value should be used for API argument @a channel
374 */
375 #define esmCHANNEL35 0x0000000800000000ULL
376
377 /** @def esmCHANNEL36
378 *   @brief Alias name for ESM group x channel 36
379 *
380 *   This is an alias name for the ESM group x channel 36.
381 *
382 *   @note This value should be used for API argument @a channel
383 */
384 #define esmCHANNEL36 0x0000001000000000ULL
385
386 /** @def esmCHANNEL37
387 *   @brief Alias name for ESM group x channel 37
388 *
389 *   This is an alias name for the ESM group x channel 37.
390 *
391 *   @note This value should be used for API argument @a channel
392 */
393 #define esmCHANNEL37 0x0000002000000000ULL
394
395 /** @def esmCHANNEL38
396 *   @brief Alias name for ESM group x channel 38
397 *
398 *   This is an alias name for the ESM group x channel 38.
399 *
400 *   @note This value should be used for API argument @a channel
401 */
402 #define esmCHANNEL38 0x0000004000000000ULL
403
404 /** @def esmCHANNEL39
405 *   @brief Alias name for ESM group x channel 39
406 *
407 *   This is an alias name for the ESM group x channel 39.
408 *
409 *   @note This value should be used for API argument @a channel
410 */
411 #define esmCHANNEL39 0x0000008000000000ULL
412
413 /** @def esmCHANNEL40
414 *   @brief Alias name for ESM group x channel 40
415 *
416 *   This is an alias name for the ESM group x channel 40.
417 *
418 *   @note This value should be used for API argument @a channel
419 */
420 #define esmCHANNEL40 0x0000010000000000ULL
421
422 /** @def esmCHANNEL41
423 *   @brief Alias name for ESM group x channel 41
424 *
425 *   This is an alias name for the ESM group x channel 41.
426 *
427 *   @note This value should be used for API argument @a channel
428 */
429 #define esmCHANNEL41 0x0000020000000000ULL
430
431 /** @def esmCHANNEL42
432 *   @brief Alias name for ESM group x channel 42
433 *
434 *   This is an alias name for the ESM group x channel 42.
435 *
436 *   @note This value should be used for API argument @a channel
437 */
438 #define esmCHANNEL42 0x0000040000000000ULL
439
440 /** @def esmCHANNEL43
441 *   @brief Alias name for ESM group x channel 43
442 *
443 *   This is an alias name for the ESM group x channel 43.
444 *
445 *   @note This value should be used for API argument @a channel
446 */
447 #define esmCHANNEL43 0x0000080000000000ULL
448
449 /** @def esmCHANNEL44
450 *   @brief Alias name for ESM group x channel 44
451 *
452 *   This is an alias name for the ESM group x channel 44.
453 *
454 *   @note This value should be used for API argument @a channel
455 */
456 #define esmCHANNEL44 0x0000100000000000ULL
457
458 /** @def esmCHANNEL45
459 *   @brief Alias name for ESM group x channel 45
460 *
461 *   This is an alias name for the ESM group x channel 45.
462 *
463 *   @note This value should be used for API argument @a channel
464 */
465 #define esmCHANNEL45 0x0000200000000000ULL
466
467 /** @def esmCHANNEL46
468 *   @brief Alias name for ESM group x channel 46
469 *
470 *   This is an alias name for the ESM group x channel 46.
471 *
472 *   @note This value should be used for API argument @a channel
473 */
474 #define esmCHANNEL46 0x0000400000000000ULL
475
476 /** @def esmCHANNEL47
477 *   @brief Alias name for ESM group x channel 47
478 *
479 *   This is an alias name for the ESM group x channel 47.
480 *
481 *   @note This value should be used for API argument @a channel
482 */
483 #define esmCHANNEL47 0x0000800000000000ULL
484
485 /** @def esmCHANNEL48
486 *   @brief Alias name for ESM group x channel 48
487 *
488 *   This is an alias name for the ESM group x channel 48.
489 *
490 *   @note This value should be used for API argument @a channel
491 */
492 #define esmCHANNEL48 0x0001000000000000ULL
493
494 /** @def esmCHANNEL49
495 *   @brief Alias name for ESM group x channel 49
496 *
497 *   This is an alias name for the ESM group x channel 49.
498 *
499 *   @note This value should be used for API argument @a channel
500 */
501 #define esmCHANNEL49 0x0002000000000000ULL
502
503 /** @def esmCHANNEL50
504 *   @brief Alias name for ESM group x channel 50
505 *
506 *   This is an alias name for the ESM group x channel 50.
507 *
508 *   @note This value should be used for API argument @a channel
509 */
510 #define esmCHANNEL50 0x0004000000000000ULL
511
512 /** @def esmCHANNEL51
513 *   @brief Alias name for ESM group x channel 51
514 *
515 *   This is an alias name for the ESM group x channel 51.
516 *
517 *   @note This value should be used for API argument @a channel
518 */
519 #define esmCHANNEL51 0x0008000000000000ULL
520
521 /** @def esmCHANNEL52
522 *   @brief Alias name for ESM group x channel 52
523 *
524 *   This is an alias name for the ESM group x channel 52.
525 *
526 *   @note This value should be used for API argument @a channel
527 */
528 #define esmCHANNEL52 0x0010000000000000ULL
529
530 /** @def esmCHANNEL53
531 *   @brief Alias name for ESM group x channel 53
532 *
533 *   This is an alias name for the ESM group x channel 53.
534 *
535 *   @note This value should be used for API argument @a channel
536 */
537 #define esmCHANNEL53 0x0020000000000000ULL
538
539 /** @def esmCHANNEL54
540 *   @brief Alias name for ESM group x channel 54
541 *
542 *   This is an alias name for the ESM group x channel 54.
543 *
544 *   @note This value should be used for API argument @a channel
545 */
546 #define esmCHANNEL54 0x0040000000000000ULL
547
548 /** @def esmCHANNEL55
549 *   @brief Alias name for ESM group x channel 55
550 *
551 *   This is an alias name for the ESM group x channel 55.
552 *
553 *   @note This value should be used for API argument @a channel
554 */
555 #define esmCHANNEL55 0x0080000000000000ULL
556
557 /** @def esmCHANNEL56
558 *   @brief Alias name for ESM group x channel 56
559 *
560 *   This is an alias name for the ESM group x channel 56.
561 *
562 *   @note This value should be used for API argument @a channel
563 */
564 #define esmCHANNEL56 0x0100000000000000ULL
565
566 /** @def esmCHANNEL57
567 *   @brief Alias name for ESM group x channel 57
568 *
569 *   This is an alias name for the ESM group x channel 57.
570 *
571 *   @note This value should be used for API argument @a channel
572 */
573 #define esmCHANNEL57 0x0200000000000000ULL
574
575 /** @def esmCHANNEL58
576 *   @brief Alias name for ESM group x channel 58
577 *
578 *   This is an alias name for the ESM group x channel 58.
579 *
580 *   @note This value should be used for API argument @a channel
581 */
582 #define esmCHANNEL58 0x0400000000000000ULL
583
584 /** @def esmCHANNEL59
585 *   @brief Alias name for ESM group x channel 59
586 *
587 *   This is an alias name for the ESM group x channel 59.
588 *
589 *   @note This value should be used for API argument @a channel
590 */
591 #define esmCHANNEL59 0x0800000000000000ULL
592
593 /** @def esmCHANNEL60
594 *   @brief Alias name for ESM group x channel 60
595 *
596 *   This is an alias name for the ESM group x channel 60.
597 *
598 *   @note This value should be used for API argument @a channel
599 */
600 #define esmCHANNEL60 0x1000000000000000ULL
601
602 /** @def esmCHANNEL61
603 *   @brief Alias name for ESM group x channel 61
604 *
605 *   This is an alias name for the ESM group x channel 61.
606 *
607 *   @note This value should be used for API argument @a channel
608 */
609 #define esmCHANNEL61 0x2000000000000000ULL
610
611 /** @def esmCHANNEL62
612 *   @brief Alias name for ESM group x channel 62
613 *
614 *   This is an alias name for the ESM group x channel 62.
615 *
616 *   @note This value should be used for API argument @a channel
617 */
618 #define esmCHANNEL62 0x4000000000000000ULL
619
620 /** @def esmCHANNEL63
621 *   @brief Alias name for ESM group x channel 63
622 *
623 *   This is an alias name for the ESM group x channel 63.
624 *
625 *   @note This value should be used for API argument @a channel
626 */
627 #define esmCHANNEL63 0x8000000000000000ULL
628
629
630
631
632 /* USER CODE BEGIN (1) */
633 /* USER CODE END */
634
635
636 /* Esm Register Frame Definition */
637 /** @struct esmBase
638 *   @brief Esm Register Frame Definition
639 *
640 *   This type is used to access the Esm Registers.
641 */
642 /** @typedef esmBASE_t
643 *   @brief Esm Register Frame Type Definition
644 *
645 *   This type is used to access the Esm Registers.
646 */
647 typedef volatile struct esmBase
648 {
649     uint32_t EPENASET1;              /* 0x0000                 */
650     uint32_t EPENACLR1;              /* 0x0004                 */
651     uint32_t INTENASET1;             /* 0x0008                 */
652     uint32_t INTENACLR1;             /* 0x000C                 */
653     uint32_t INTLVLSET1;             /* 0x0010                 */
654     uint32_t INTLVLCLR1;             /* 0x0014                 */
655     uint32_t ESTATUS1[3U];           /* 0x0018, 0x001C, 0x0020 */
656     uint32_t EPSTATUS;               /* 0x0024                 */
657     uint32_t INTOFFH;                /* 0x0028                 */
658     uint32_t INTOFFL;                /* 0x002C                 */
659     uint32_t LTC;                    /* 0x0030                 */
660     uint32_t LTCPRELOAD;             /* 0x0034                 */
661     uint32_t KEY;                    /* 0x0038                 */
662     uint32_t ESTATUS2EMU;            /* 0x003C                 */
663     uint32_t EPENASET4;              /* 0x0040                 */
664     uint32_t EPENACLR4;              /* 0x0044                 */
665     uint32_t INTENASET4;             /* 0x0048                 */
666     uint32_t INTENACLR4;             /* 0x004C                 */
667     uint32_t INTLVLSET4;             /* 0x0050                 */
668     uint32_t INTLVLCLR4;             /* 0x0054                 */
669     uint32_t ESTATUS4[3U];           /* 0x0058, 0x005C, 0x0060 */
670     uint32_t ESTATUS5EMU;            /* 0x0064                 */
671 } esmBASE_t;
672
673 /** @def esmREG
674 *   @brief Esm Register Frame Pointer
675 *
676 *   This pointer is used by the Esm driver to access the Esm registers.
677 */
678 #define esmREG ((esmBASE_t *)0xFFFFF500U)
679
680 /* USER CODE BEGIN (2) */
681 /* USER CODE END */
682
683
684 /* Esm Interface Functions */
685 void     esmInit(void);
686 uint32_t esmError(void);
687 void     esmEnableError(uint64_t channels);
688 void     esmDisableError(uint64_t channels);
689 void     esmTriggerErrorPinReset(void);
690 void     esmActivateNormalOperation(void);
691 void     esmEnableInterrupt(uint64_t channels);
692 void     esmDisableInterrupt(uint64_t channels);
693 void     esmSetInterruptLevel(uint64_t channels, uint64_t flags);
694 void     esmClearStatus(uint32_t group, uint64_t channels);
695 void     esmClearStatusBuffer(uint64_t channels);
696 void     esmSetCounterPreloadValue(uint32_t value);
697
698 uint64_t esmGetStatus(uint32_t group, uint64_t channels);
699 uint64_t esmGetStatusBuffer(uint64_t channels);
700
701
702 /** @fn void esmGroup1Notification(uint32_t channel)
703 *   @brief Interrupt callback
704 *   @param[in] channel - Group 1 channel
705 *
706 * This is a callback that is provided by the application and is called apon
707 * an interrupt. The parameter passed to the callback is group 1 channel caused the interrupt.
708 */
709 void esmGroup1Notification(uint32_t channel);
710
711
712 /** @fn void esmGroup2Notification(uint32_t channel)
713 *   @brief Interrupt callback
714 *   @param[in] channel - Group 2 channel
715 *
716 * This is a callback that is provided by the application and is called apon
717 * an interrupt. The parameter passed to the callback is group 2 channel caused the interrupt.
718 */
719 void esmGroup2Notification(uint32_t channel);
720
721
722 /* USER CODE BEGIN (3) */
723 /* USER CODE END */
724
725
726 #endif