2 * @brief Error Signaling Module Driver Header File
\r
6 * This file contains:
\r
10 * which are relevant for the Esm driver.
\r
13 /* (c) Texas Instruments 2010, All rights reserved. */
\r
18 #include "sys_common.h"
\r
20 /* USER CODE BEGIN (0) */
\r
24 /* ESM General Definitions */
\r
27 * @brief Alias name for ESM group 1
\r
29 * This is an alias name for the ESM group 1.
\r
31 * @note This value should be used for API argument @a group
\r
33 #define esmGROUP1 0U
\r
36 * @brief Alias name for ESM group 2
\r
38 * This is an alias name for the ESM group 2.
\r
40 * @note This value should be used for API argument @a group
\r
42 #define esmGROUP2 1U
\r
45 * @brief Alias name for ESM group 3
\r
47 * This is an alias name for the ESM group 3.
\r
49 * @note This value should be used for API argument @a group
\r
51 #define esmGROUP3 2U
\r
53 /** @def esmCHANNEL0
\r
54 * @brief Alias name for ESM group x channel 0
\r
56 * This is an alias name for the ESM group x channel 0.
\r
58 * @note This value should be used for API argument @a channel
\r
60 #define esmCHANNEL0 0x0000000000000001ULL
\r
62 /** @def esmCHANNEL1
\r
63 * @brief Alias name for ESM group x channel 1
\r
65 * This is an alias name for the ESM group x channel 1.
\r
67 * @note This value should be used for API argument @a channel
\r
69 #define esmCHANNEL1 0x0000000000000002ULL
\r
71 /** @def esmCHANNEL2
\r
72 * @brief Alias name for ESM group x channel 2
\r
74 * This is an alias name for the ESM group x channel 2.
\r
76 * @note This value should be used for API argument @a channel
\r
78 #define esmCHANNEL2 0x0000000000000004ULL
\r
80 /** @def esmCHANNEL3
\r
81 * @brief Alias name for ESM group x channel 3
\r
83 * This is an alias name for the ESM group x channel 3.
\r
85 * @note This value should be used for API argument @a channel
\r
87 #define esmCHANNEL3 0x0000000000000008ULL
\r
89 /** @def esmCHANNEL4
\r
90 * @brief Alias name for ESM group x channel 4
\r
92 * This is an alias name for the ESM group x channel 4.
\r
94 * @note This value should be used for API argument @a channel
\r
96 #define esmCHANNEL4 0x0000000000000010ULL
\r
98 /** @def esmCHANNEL5
\r
99 * @brief Alias name for ESM group x channel 5
\r
101 * This is an alias name for the ESM group x channel 5.
\r
103 * @note This value should be used for API argument @a channel
\r
105 #define esmCHANNEL5 0x0000000000000020ULL
\r
107 /** @def esmCHANNEL6
\r
108 * @brief Alias name for ESM group x channel 6
\r
110 * This is an alias name for the ESM group x channel 6.
\r
112 * @note This value should be used for API argument @a channel
\r
114 #define esmCHANNEL6 0x0000000000000040ULL
\r
116 /** @def esmCHANNEL7
\r
117 * @brief Alias name for ESM group x channel 7
\r
119 * This is an alias name for the ESM group x channel 7.
\r
121 * @note This value should be used for API argument @a channel
\r
123 #define esmCHANNEL7 0x0000000000000080ULL
\r
125 /** @def esmCHANNEL8
\r
126 * @brief Alias name for ESM group x channel 8
\r
128 * This is an alias name for the ESM group x channel 8.
\r
130 * @note This value should be used for API argument @a channel
\r
132 #define esmCHANNEL8 0x0000000000000100ULL
\r
134 /** @def esmCHANNEL9
\r
135 * @brief Alias name for ESM group x channel 9
\r
137 * This is an alias name for the ESM group x channel 9.
\r
139 * @note This value should be used for API argument @a channel
\r
141 #define esmCHANNEL9 0x0000000000000200ULL
\r
143 /** @def esmCHANNEL10
\r
144 * @brief Alias name for ESM group x channel 10
\r
146 * This is an alias name for the ESM group x channel 10.
\r
148 * @note This value should be used for API argument @a channel
\r
150 #define esmCHANNEL10 0x0000000000000400ULL
\r
152 /** @def esmCHANNEL11
\r
153 * @brief Alias name for ESM group x channel 11
\r
155 * This is an alias name for the ESM group x channel 11.
\r
157 * @note This value should be used for API argument @a channel
\r
159 #define esmCHANNEL11 0x0000000000000800ULL
\r
161 /** @def esmCHANNEL12
\r
162 * @brief Alias name for ESM group x channel 12
\r
164 * This is an alias name for the ESM group x channel 12.
\r
166 * @note This value should be used for API argument @a channel
\r
168 #define esmCHANNEL12 0x0000000000001000ULL
\r
170 /** @def esmCHANNEL13
\r
171 * @brief Alias name for ESM group x channel 13
\r
173 * This is an alias name for the ESM group x channel 13.
\r
175 * @note This value should be used for API argument @a channel
\r
177 #define esmCHANNEL13 0x0000000000002000ULL
\r
179 /** @def esmCHANNEL14
\r
180 * @brief Alias name for ESM group x channel 14
\r
182 * This is an alias name for the ESM group x channel 14.
\r
184 * @note This value should be used for API argument @a channel
\r
186 #define esmCHANNEL14 0x0000000000004000ULL
\r
188 /** @def esmCHANNEL15
\r
189 * @brief Alias name for ESM group x channel 15
\r
191 * This is an alias name for the ESM group x channel 15.
\r
193 * @note This value should be used for API argument @a channel
\r
195 #define esmCHANNEL15 0x0000000000008000ULL
\r
197 /** @def esmCHANNEL16
\r
198 * @brief Alias name for ESM group x channel 16
\r
200 * This is an alias name for the ESM group x channel 16.
\r
202 * @note This value should be used for API argument @a channel
\r
204 #define esmCHANNEL16 0x0000000000010000ULL
\r
206 /** @def esmCHANNEL17
\r
207 * @brief Alias name for ESM group x channel 17
\r
209 * This is an alias name for the ESM group x channel 17.
\r
211 * @note This value should be used for API argument @a channel
\r
213 #define esmCHANNEL17 0x0000000000020000ULL
\r
215 /** @def esmCHANNEL18
\r
216 * @brief Alias name for ESM group x channel 18
\r
218 * This is an alias name for the ESM group x channel 18.
\r
220 * @note This value should be used for API argument @a channel
\r
222 #define esmCHANNEL18 0x0000000000040000ULL
\r
224 /** @def esmCHANNEL19
\r
225 * @brief Alias name for ESM group x channel 19
\r
227 * This is an alias name for the ESM group x channel 19.
\r
229 * @note This value should be used for API argument @a channel
\r
231 #define esmCHANNEL19 0x0000000000080000ULL
\r
233 /** @def esmCHANNEL20
\r
234 * @brief Alias name for ESM group x channel 20
\r
236 * This is an alias name for the ESM group x channel 20.
\r
238 * @note This value should be used for API argument @a channel
\r
240 #define esmCHANNEL20 0x0000000000100000ULL
\r
242 /** @def esmCHANNEL21
\r
243 * @brief Alias name for ESM group x channel 21
\r
245 * This is an alias name for the ESM group x channel 21.
\r
247 * @note This value should be used for API argument @a channel
\r
249 #define esmCHANNEL21 0x0000000000200000ULL
\r
251 /** @def esmCHANNEL22
\r
252 * @brief Alias name for ESM group x channel 22
\r
254 * This is an alias name for the ESM group x channel 22.
\r
256 * @note This value should be used for API argument @a channel
\r
258 #define esmCHANNEL22 0x0000000000400000ULL
\r
260 /** @def esmCHANNEL23
\r
261 * @brief Alias name for ESM group x channel 23
\r
263 * This is an alias name for the ESM group x channel 23.
\r
265 * @note This value should be used for API argument @a channel
\r
267 #define esmCHANNEL23 0x0000000000800000ULL
\r
269 /** @def esmCHANNEL24
\r
270 * @brief Alias name for ESM group x channel 24
\r
272 * This is an alias name for the ESM group x channel 24.
\r
274 * @note This value should be used for API argument @a channel
\r
276 #define esmCHANNEL24 0x0000000001000000ULL
\r
278 /** @def esmCHANNEL25
\r
279 * @brief Alias name for ESM group x channel 25
\r
281 * This is an alias name for the ESM group x channel 25.
\r
283 * @note This value should be used for API argument @a channel
\r
285 #define esmCHANNEL25 0x0000000002000000ULL
\r
287 /** @def esmCHANNEL26
\r
288 * @brief Alias name for ESM group x channel 26
\r
290 * This is an alias name for the ESM group x channel 26.
\r
292 * @note This value should be used for API argument @a channel
\r
294 #define esmCHANNEL26 0x0000000004000000ULL
\r
296 /** @def esmCHANNEL27
\r
297 * @brief Alias name for ESM group x channel 27
\r
299 * This is an alias name for the ESM group x channel 27.
\r
301 * @note This value should be used for API argument @a channel
\r
303 #define esmCHANNEL27 0x0000000008000000ULL
\r
305 /** @def esmCHANNEL28
\r
306 * @brief Alias name for ESM group x channel 28
\r
308 * This is an alias name for the ESM group x channel 28.
\r
310 * @note This value should be used for API argument @a channel
\r
312 #define esmCHANNEL28 0x0000000010000000ULL
\r
314 /** @def esmCHANNEL29
\r
315 * @brief Alias name for ESM group x channel 29
\r
317 * This is an alias name for the ESM group x channel 29.
\r
319 * @note This value should be used for API argument @a channel
\r
321 #define esmCHANNEL29 0x0000000020000000ULL
\r
323 /** @def esmCHANNEL30
\r
324 * @brief Alias name for ESM group x channel 30
\r
326 * This is an alias name for the ESM group x channel 30.
\r
328 * @note This value should be used for API argument @a channel
\r
330 #define esmCHANNEL30 0x0000000040000000ULL
\r
332 /** @def esmCHANNEL31
\r
333 * @brief Alias name for ESM group x channel 31
\r
335 * This is an alias name for the ESM group x channel 31.
\r
337 * @note This value should be used for API argument @a channel
\r
339 #define esmCHANNEL31 0x0000000080000000ULL
\r
341 /** @def esmCHANNEL32
\r
342 * @brief Alias name for ESM group x channel 32
\r
344 * This is an alias name for the ESM group x channel 32.
\r
346 * @note This value should be used for API argument @a channel
\r
348 #define esmCHANNEL32 0x0000000100000000ULL
\r
350 /** @def esmCHANNEL33
\r
351 * @brief Alias name for ESM group x channel 33
\r
353 * This is an alias name for the ESM group x channel 33.
\r
355 * @note This value should be used for API argument @a channel
\r
357 #define esmCHANNEL33 0x0000000200000000ULL
\r
359 /** @def esmCHANNEL34
\r
360 * @brief Alias name for ESM group x channel 34
\r
362 * This is an alias name for the ESM group x channel 34.
\r
364 * @note This value should be used for API argument @a channel
\r
366 #define esmCHANNEL34 0x0000000400000000ULL
\r
368 /** @def esmCHANNEL35
\r
369 * @brief Alias name for ESM group x channel 35
\r
371 * This is an alias name for the ESM group x channel 35.
\r
373 * @note This value should be used for API argument @a channel
\r
375 #define esmCHANNEL35 0x0000000800000000ULL
\r
377 /** @def esmCHANNEL36
\r
378 * @brief Alias name for ESM group x channel 36
\r
380 * This is an alias name for the ESM group x channel 36.
\r
382 * @note This value should be used for API argument @a channel
\r
384 #define esmCHANNEL36 0x0000001000000000ULL
\r
386 /** @def esmCHANNEL37
\r
387 * @brief Alias name for ESM group x channel 37
\r
389 * This is an alias name for the ESM group x channel 37.
\r
391 * @note This value should be used for API argument @a channel
\r
393 #define esmCHANNEL37 0x0000002000000000ULL
\r
395 /** @def esmCHANNEL38
\r
396 * @brief Alias name for ESM group x channel 38
\r
398 * This is an alias name for the ESM group x channel 38.
\r
400 * @note This value should be used for API argument @a channel
\r
402 #define esmCHANNEL38 0x0000004000000000ULL
\r
404 /** @def esmCHANNEL39
\r
405 * @brief Alias name for ESM group x channel 39
\r
407 * This is an alias name for the ESM group x channel 39.
\r
409 * @note This value should be used for API argument @a channel
\r
411 #define esmCHANNEL39 0x0000008000000000ULL
\r
413 /** @def esmCHANNEL40
\r
414 * @brief Alias name for ESM group x channel 40
\r
416 * This is an alias name for the ESM group x channel 40.
\r
418 * @note This value should be used for API argument @a channel
\r
420 #define esmCHANNEL40 0x0000010000000000ULL
\r
422 /** @def esmCHANNEL41
\r
423 * @brief Alias name for ESM group x channel 41
\r
425 * This is an alias name for the ESM group x channel 41.
\r
427 * @note This value should be used for API argument @a channel
\r
429 #define esmCHANNEL41 0x0000020000000000ULL
\r
431 /** @def esmCHANNEL42
\r
432 * @brief Alias name for ESM group x channel 42
\r
434 * This is an alias name for the ESM group x channel 42.
\r
436 * @note This value should be used for API argument @a channel
\r
438 #define esmCHANNEL42 0x0000040000000000ULL
\r
440 /** @def esmCHANNEL43
\r
441 * @brief Alias name for ESM group x channel 43
\r
443 * This is an alias name for the ESM group x channel 43.
\r
445 * @note This value should be used for API argument @a channel
\r
447 #define esmCHANNEL43 0x0000080000000000ULL
\r
449 /** @def esmCHANNEL44
\r
450 * @brief Alias name for ESM group x channel 44
\r
452 * This is an alias name for the ESM group x channel 44.
\r
454 * @note This value should be used for API argument @a channel
\r
456 #define esmCHANNEL44 0x0000100000000000ULL
\r
458 /** @def esmCHANNEL45
\r
459 * @brief Alias name for ESM group x channel 45
\r
461 * This is an alias name for the ESM group x channel 45.
\r
463 * @note This value should be used for API argument @a channel
\r
465 #define esmCHANNEL45 0x0000200000000000ULL
\r
467 /** @def esmCHANNEL46
\r
468 * @brief Alias name for ESM group x channel 46
\r
470 * This is an alias name for the ESM group x channel 46.
\r
472 * @note This value should be used for API argument @a channel
\r
474 #define esmCHANNEL46 0x0000400000000000ULL
\r
476 /** @def esmCHANNEL47
\r
477 * @brief Alias name for ESM group x channel 47
\r
479 * This is an alias name for the ESM group x channel 47.
\r
481 * @note This value should be used for API argument @a channel
\r
483 #define esmCHANNEL47 0x0000800000000000ULL
\r
485 /** @def esmCHANNEL48
\r
486 * @brief Alias name for ESM group x channel 48
\r
488 * This is an alias name for the ESM group x channel 48.
\r
490 * @note This value should be used for API argument @a channel
\r
492 #define esmCHANNEL48 0x0001000000000000ULL
\r
494 /** @def esmCHANNEL49
\r
495 * @brief Alias name for ESM group x channel 49
\r
497 * This is an alias name for the ESM group x channel 49.
\r
499 * @note This value should be used for API argument @a channel
\r
501 #define esmCHANNEL49 0x0002000000000000ULL
\r
503 /** @def esmCHANNEL50
\r
504 * @brief Alias name for ESM group x channel 50
\r
506 * This is an alias name for the ESM group x channel 50.
\r
508 * @note This value should be used for API argument @a channel
\r
510 #define esmCHANNEL50 0x0004000000000000ULL
\r
512 /** @def esmCHANNEL51
\r
513 * @brief Alias name for ESM group x channel 51
\r
515 * This is an alias name for the ESM group x channel 51.
\r
517 * @note This value should be used for API argument @a channel
\r
519 #define esmCHANNEL51 0x0008000000000000ULL
\r
521 /** @def esmCHANNEL52
\r
522 * @brief Alias name for ESM group x channel 52
\r
524 * This is an alias name for the ESM group x channel 52.
\r
526 * @note This value should be used for API argument @a channel
\r
528 #define esmCHANNEL52 0x0010000000000000ULL
\r
530 /** @def esmCHANNEL53
\r
531 * @brief Alias name for ESM group x channel 53
\r
533 * This is an alias name for the ESM group x channel 53.
\r
535 * @note This value should be used for API argument @a channel
\r
537 #define esmCHANNEL53 0x0020000000000000ULL
\r
539 /** @def esmCHANNEL54
\r
540 * @brief Alias name for ESM group x channel 54
\r
542 * This is an alias name for the ESM group x channel 54.
\r
544 * @note This value should be used for API argument @a channel
\r
546 #define esmCHANNEL54 0x0040000000000000ULL
\r
548 /** @def esmCHANNEL55
\r
549 * @brief Alias name for ESM group x channel 55
\r
551 * This is an alias name for the ESM group x channel 55.
\r
553 * @note This value should be used for API argument @a channel
\r
555 #define esmCHANNEL55 0x0080000000000000ULL
\r
557 /** @def esmCHANNEL56
\r
558 * @brief Alias name for ESM group x channel 56
\r
560 * This is an alias name for the ESM group x channel 56.
\r
562 * @note This value should be used for API argument @a channel
\r
564 #define esmCHANNEL56 0x0100000000000000ULL
\r
566 /** @def esmCHANNEL57
\r
567 * @brief Alias name for ESM group x channel 57
\r
569 * This is an alias name for the ESM group x channel 57.
\r
571 * @note This value should be used for API argument @a channel
\r
573 #define esmCHANNEL57 0x0200000000000000ULL
\r
575 /** @def esmCHANNEL58
\r
576 * @brief Alias name for ESM group x channel 58
\r
578 * This is an alias name for the ESM group x channel 58.
\r
580 * @note This value should be used for API argument @a channel
\r
582 #define esmCHANNEL58 0x0400000000000000ULL
\r
584 /** @def esmCHANNEL59
\r
585 * @brief Alias name for ESM group x channel 59
\r
587 * This is an alias name for the ESM group x channel 59.
\r
589 * @note This value should be used for API argument @a channel
\r
591 #define esmCHANNEL59 0x0800000000000000ULL
\r
593 /** @def esmCHANNEL60
\r
594 * @brief Alias name for ESM group x channel 60
\r
596 * This is an alias name for the ESM group x channel 60.
\r
598 * @note This value should be used for API argument @a channel
\r
600 #define esmCHANNEL60 0x1000000000000000ULL
\r
602 /** @def esmCHANNEL61
\r
603 * @brief Alias name for ESM group x channel 61
\r
605 * This is an alias name for the ESM group x channel 61.
\r
607 * @note This value should be used for API argument @a channel
\r
609 #define esmCHANNEL61 0x2000000000000000ULL
\r
611 /** @def esmCHANNEL62
\r
612 * @brief Alias name for ESM group x channel 62
\r
614 * This is an alias name for the ESM group x channel 62.
\r
616 * @note This value should be used for API argument @a channel
\r
618 #define esmCHANNEL62 0x4000000000000000ULL
\r
620 /** @def esmCHANNEL63
\r
621 * @brief Alias name for ESM group x channel 63
\r
623 * This is an alias name for the ESM group x channel 63.
\r
625 * @note This value should be used for API argument @a channel
\r
627 #define esmCHANNEL63 0x8000000000000000ULL
\r
632 /* USER CODE BEGIN (1) */
\r
633 /* USER CODE END */
\r
636 /* Esm Register Frame Definition */
\r
637 /** @struct esmBase
\r
638 * @brief Esm Register Frame Definition
\r
640 * This type is used to access the Esm Registers.
\r
642 /** @typedef esmBASE_t
\r
643 * @brief Esm Register Frame Type Definition
\r
645 * This type is used to access the Esm Registers.
\r
647 typedef volatile struct esmBase
\r
649 uint32_t EPENASET1; /* 0x0000 */
\r
650 uint32_t EPENACLR1; /* 0x0004 */
\r
651 uint32_t INTENASET1; /* 0x0008 */
\r
652 uint32_t INTENACLR1; /* 0x000C */
\r
653 uint32_t INTLVLSET1; /* 0x0010 */
\r
654 uint32_t INTLVLCLR1; /* 0x0014 */
\r
655 uint32_t ESTATUS1[3U]; /* 0x0018, 0x001C, 0x0020 */
\r
656 uint32_t EPSTATUS; /* 0x0024 */
\r
657 uint32_t INTOFFH; /* 0x0028 */
\r
658 uint32_t INTOFFL; /* 0x002C */
\r
659 uint32_t LTC; /* 0x0030 */
\r
660 uint32_t LTCPRELOAD; /* 0x0034 */
\r
661 uint32_t KEY; /* 0x0038 */
\r
662 uint32_t ESTATUS2EMU; /* 0x003C */
\r
663 uint32_t EPENASET4; /* 0x0040 */
\r
664 uint32_t EPENACLR4; /* 0x0044 */
\r
665 uint32_t INTENASET4; /* 0x0048 */
\r
666 uint32_t INTENACLR4; /* 0x004C */
\r
667 uint32_t INTLVLSET4; /* 0x0050 */
\r
668 uint32_t INTLVLCLR4; /* 0x0054 */
\r
669 uint32_t ESTATUS4[3U]; /* 0x0058, 0x005C, 0x0060 */
\r
670 uint32_t ESTATUS5EMU; /* 0x0064 */
\r
674 * @brief Esm Register Frame Pointer
\r
676 * This pointer is used by the Esm driver to access the Esm registers.
\r
678 #define esmREG ((esmBASE_t *)0xFFFFF500U)
\r
680 /* USER CODE BEGIN (2) */
\r
681 /* USER CODE END */
\r
684 /* Esm Interface Functions */
\r
685 void esmInit(void);
\r
686 uint32_t esmError(void);
\r
687 void esmEnableError(uint64_t channels);
\r
688 void esmDisableError(uint64_t channels);
\r
689 void esmTriggerErrorPinReset(void);
\r
690 void esmActivateNormalOperation(void);
\r
691 void esmEnableInterrupt(uint64_t channels);
\r
692 void esmDisableInterrupt(uint64_t channels);
\r
693 void esmSetInterruptLevel(uint64_t channels, uint64_t flags);
\r
694 void esmClearStatus(uint32_t group, uint64_t channels);
\r
695 void esmClearStatusBuffer(uint64_t channels);
\r
696 void esmSetCounterPreloadValue(uint32_t value);
\r
698 uint64_t esmGetStatus(uint32_t group, uint64_t channels);
\r
699 uint64_t esmGetStatusBuffer(uint64_t channels);
\r
702 /** @fn void esmGroup1Notification(uint32_t channel)
\r
703 * @brief Interrupt callback
\r
704 * @param[in] channel - Group 1 channel
\r
706 * This is a callback that is provided by the application and is called apon
\r
707 * an interrupt. The parameter passed to the callback is group 1 channel caused the interrupt.
\r
709 void esmGroup1Notification(uint32_t channel);
\r
712 /** @fn void esmGroup2Notification(uint32_t channel)
\r
713 * @brief Interrupt callback
\r
714 * @param[in] channel - Group 2 channel
\r
716 * This is a callback that is provided by the application and is called apon
\r
717 * an interrupt. The parameter passed to the callback is group 2 channel caused the interrupt.
\r
719 void esmGroup2Notification(uint32_t channel);
\r
722 /* USER CODE BEGIN (3) */
\r
723 /* USER CODE END */
\r