Altera SoCAL  16.0
The Altera SoC Abstraction Layer (SoCAL) API Reference Manual
 All Data Structures Variables Typedefs Groups
alt_tmr.h
1 /***********************************************************************************
2 * *
3 * Copyright 2013-2015 Altera Corporation. All Rights Reserved. *
4 * *
5 * Redistribution and use in source and binary forms, with or without *
6 * modification, are permitted provided that the following conditions are met: *
7 * *
8 * 1. Redistributions of source code must retain the above copyright notice, *
9 * this list of conditions and the following disclaimer. *
10 * *
11 * 2. Redistributions in binary form must reproduce the above copyright notice, *
12 * this list of conditions and the following disclaimer in the documentation *
13 * and/or other materials provided with the distribution. *
14 * *
15 * 3. Neither the name of the copyright holder nor the names of its contributors *
16 * may be used to endorse or promote products derived from this software without *
17 * specific prior written permission. *
18 * *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" *
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE *
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE *
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE *
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF *
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS *
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN *
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) *
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
29 * POSSIBILITY OF SUCH DAMAGE. *
30 * *
31 ***********************************************************************************/
32 
35 #ifndef __ALT_SOCAL_TMR_H__
36 #define __ALT_SOCAL_TMR_H__
37 
38 #ifndef __ASSEMBLY__
39 #ifdef __cplusplus
40 #include <cstdint>
41 extern "C"
42 {
43 #else /* __cplusplus */
44 #include <stdint.h>
45 #endif /* __cplusplus */
46 #endif /* __ASSEMBLY__ */
47 
82 #define ALT_TMR_TMR1LDCOUNT_TMR1LDCOUNT_LSB 0
83 
84 #define ALT_TMR_TMR1LDCOUNT_TMR1LDCOUNT_MSB 31
85 
86 #define ALT_TMR_TMR1LDCOUNT_TMR1LDCOUNT_WIDTH 32
87 
88 #define ALT_TMR_TMR1LDCOUNT_TMR1LDCOUNT_SET_MSK 0xffffffff
89 
90 #define ALT_TMR_TMR1LDCOUNT_TMR1LDCOUNT_CLR_MSK 0x00000000
91 
92 #define ALT_TMR_TMR1LDCOUNT_TMR1LDCOUNT_RESET 0x0
93 
94 #define ALT_TMR_TMR1LDCOUNT_TMR1LDCOUNT_GET(value) (((value) & 0xffffffff) >> 0)
95 
96 #define ALT_TMR_TMR1LDCOUNT_TMR1LDCOUNT_SET(value) (((value) << 0) & 0xffffffff)
97 
98 #ifndef __ASSEMBLY__
99 
110 {
111  uint32_t timer1loadcount : 32;
112 };
113 
116 #endif /* __ASSEMBLY__ */
117 
119 #define ALT_TMR_TMR1LDCOUNT_RESET 0x00000000
120 
121 #define ALT_TMR_TMR1LDCOUNT_OFST 0x0
122 
123 #define ALT_TMR_TMR1LDCOUNT_ADDR(base) ALT_CAST(void *, (ALT_CAST(char *, (base)) + ALT_TMR_TMR1LDCOUNT_OFST))
124 
158 #define ALT_TMR_TMR1CURVAL_TMR1CURVAL_LSB 0
159 
160 #define ALT_TMR_TMR1CURVAL_TMR1CURVAL_MSB 31
161 
162 #define ALT_TMR_TMR1CURVAL_TMR1CURVAL_WIDTH 32
163 
164 #define ALT_TMR_TMR1CURVAL_TMR1CURVAL_SET_MSK 0xffffffff
165 
166 #define ALT_TMR_TMR1CURVAL_TMR1CURVAL_CLR_MSK 0x00000000
167 
168 #define ALT_TMR_TMR1CURVAL_TMR1CURVAL_RESET 0x0
169 
170 #define ALT_TMR_TMR1CURVAL_TMR1CURVAL_GET(value) (((value) & 0xffffffff) >> 0)
171 
172 #define ALT_TMR_TMR1CURVAL_TMR1CURVAL_SET(value) (((value) << 0) & 0xffffffff)
173 
174 #ifndef __ASSEMBLY__
175 
186 {
187  const uint32_t timer1currentval : 32;
188 };
189 
192 #endif /* __ASSEMBLY__ */
193 
195 #define ALT_TMR_TMR1CURVAL_RESET 0x00000000
196 
197 #define ALT_TMR_TMR1CURVAL_OFST 0x4
198 
199 #define ALT_TMR_TMR1CURVAL_ADDR(base) ALT_CAST(void *, (ALT_CAST(char *, (base)) + ALT_TMR_TMR1CURVAL_OFST))
200 
254 #define ALT_TMR_TMR1CTLREG_TMR1_EN_E_DISD 0x0
255 
260 #define ALT_TMR_TMR1CTLREG_TMR1_EN_E_END 0x1
261 
263 #define ALT_TMR_TMR1CTLREG_TMR1_EN_LSB 0
264 
265 #define ALT_TMR_TMR1CTLREG_TMR1_EN_MSB 0
266 
267 #define ALT_TMR_TMR1CTLREG_TMR1_EN_WIDTH 1
268 
269 #define ALT_TMR_TMR1CTLREG_TMR1_EN_SET_MSK 0x00000001
270 
271 #define ALT_TMR_TMR1CTLREG_TMR1_EN_CLR_MSK 0xfffffffe
272 
273 #define ALT_TMR_TMR1CTLREG_TMR1_EN_RESET 0x0
274 
275 #define ALT_TMR_TMR1CTLREG_TMR1_EN_GET(value) (((value) & 0x00000001) >> 0)
276 
277 #define ALT_TMR_TMR1CTLREG_TMR1_EN_SET(value) (((value) << 0) & 0x00000001)
278 
307 #define ALT_TMR_TMR1CTLREG_TMR1_MOD_E_FREERUN 0x0
308 
313 #define ALT_TMR_TMR1CTLREG_TMR1_MOD_E_USEDEF 0x1
314 
316 #define ALT_TMR_TMR1CTLREG_TMR1_MOD_LSB 1
317 
318 #define ALT_TMR_TMR1CTLREG_TMR1_MOD_MSB 1
319 
320 #define ALT_TMR_TMR1CTLREG_TMR1_MOD_WIDTH 1
321 
322 #define ALT_TMR_TMR1CTLREG_TMR1_MOD_SET_MSK 0x00000002
323 
324 #define ALT_TMR_TMR1CTLREG_TMR1_MOD_CLR_MSK 0xfffffffd
325 
326 #define ALT_TMR_TMR1CTLREG_TMR1_MOD_RESET 0x0
327 
328 #define ALT_TMR_TMR1CTLREG_TMR1_MOD_GET(value) (((value) & 0x00000002) >> 1)
329 
330 #define ALT_TMR_TMR1CTLREG_TMR1_MOD_SET(value) (((value) << 1) & 0x00000002)
331 
356 #define ALT_TMR_TMR1CTLREG_TMR1_INT_MSK_E_NOTMSKED 0x0
357 
362 #define ALT_TMR_TMR1CTLREG_TMR1_INT_MSK_E_MSKED 0x1
363 
365 #define ALT_TMR_TMR1CTLREG_TMR1_INT_MSK_LSB 2
366 
367 #define ALT_TMR_TMR1CTLREG_TMR1_INT_MSK_MSB 2
368 
369 #define ALT_TMR_TMR1CTLREG_TMR1_INT_MSK_WIDTH 1
370 
371 #define ALT_TMR_TMR1CTLREG_TMR1_INT_MSK_SET_MSK 0x00000004
372 
373 #define ALT_TMR_TMR1CTLREG_TMR1_INT_MSK_CLR_MSK 0xfffffffb
374 
375 #define ALT_TMR_TMR1CTLREG_TMR1_INT_MSK_RESET 0x0
376 
377 #define ALT_TMR_TMR1CTLREG_TMR1_INT_MSK_GET(value) (((value) & 0x00000004) >> 2)
378 
379 #define ALT_TMR_TMR1CTLREG_TMR1_INT_MSK_SET(value) (((value) << 2) & 0x00000004)
380 
381 #ifndef __ASSEMBLY__
382 
393 {
394  uint32_t timer1_enable : 1;
395  uint32_t timer1_mode : 1;
396  uint32_t timer1_interrupt_mask : 1;
397  uint32_t : 29;
398 };
399 
402 #endif /* __ASSEMBLY__ */
403 
405 #define ALT_TMR_TMR1CTLREG_RESET 0x00000000
406 
407 #define ALT_TMR_TMR1CTLREG_OFST 0x8
408 
409 #define ALT_TMR_TMR1CTLREG_ADDR(base) ALT_CAST(void *, (ALT_CAST(char *, (base)) + ALT_TMR_TMR1CTLREG_OFST))
410 
441 #define ALT_TMR_TMR1EOI_TMR1EOI_LSB 0
442 
443 #define ALT_TMR_TMR1EOI_TMR1EOI_MSB 0
444 
445 #define ALT_TMR_TMR1EOI_TMR1EOI_WIDTH 1
446 
447 #define ALT_TMR_TMR1EOI_TMR1EOI_SET_MSK 0x00000001
448 
449 #define ALT_TMR_TMR1EOI_TMR1EOI_CLR_MSK 0xfffffffe
450 
451 #define ALT_TMR_TMR1EOI_TMR1EOI_RESET 0x0
452 
453 #define ALT_TMR_TMR1EOI_TMR1EOI_GET(value) (((value) & 0x00000001) >> 0)
454 
455 #define ALT_TMR_TMR1EOI_TMR1EOI_SET(value) (((value) << 0) & 0x00000001)
456 
457 #ifndef __ASSEMBLY__
458 
469 {
470  const uint32_t timer1eoi : 1;
471  uint32_t : 31;
472 };
473 
475 typedef volatile struct ALT_TMR_TMR1EOI_s ALT_TMR_TMR1EOI_t;
476 #endif /* __ASSEMBLY__ */
477 
479 #define ALT_TMR_TMR1EOI_RESET 0x00000000
480 
481 #define ALT_TMR_TMR1EOI_OFST 0xc
482 
483 #define ALT_TMR_TMR1EOI_ADDR(base) ALT_CAST(void *, (ALT_CAST(char *, (base)) + ALT_TMR_TMR1EOI_OFST))
484 
524 #define ALT_TMR_TMR1INTSTAT_TMR1INTSTAT_E_INACT 0x0
525 
530 #define ALT_TMR_TMR1INTSTAT_TMR1INTSTAT_E_ACT 0x1
531 
533 #define ALT_TMR_TMR1INTSTAT_TMR1INTSTAT_LSB 0
534 
535 #define ALT_TMR_TMR1INTSTAT_TMR1INTSTAT_MSB 0
536 
537 #define ALT_TMR_TMR1INTSTAT_TMR1INTSTAT_WIDTH 1
538 
539 #define ALT_TMR_TMR1INTSTAT_TMR1INTSTAT_SET_MSK 0x00000001
540 
541 #define ALT_TMR_TMR1INTSTAT_TMR1INTSTAT_CLR_MSK 0xfffffffe
542 
543 #define ALT_TMR_TMR1INTSTAT_TMR1INTSTAT_RESET 0x0
544 
545 #define ALT_TMR_TMR1INTSTAT_TMR1INTSTAT_GET(value) (((value) & 0x00000001) >> 0)
546 
547 #define ALT_TMR_TMR1INTSTAT_TMR1INTSTAT_SET(value) (((value) << 0) & 0x00000001)
548 
549 #ifndef __ASSEMBLY__
550 
561 {
562  const uint32_t timer1intstat : 1;
563  uint32_t : 31;
564 };
565 
568 #endif /* __ASSEMBLY__ */
569 
571 #define ALT_TMR_TMR1INTSTAT_RESET 0x00000000
572 
573 #define ALT_TMR_TMR1INTSTAT_OFST 0x10
574 
575 #define ALT_TMR_TMR1INTSTAT_ADDR(base) ALT_CAST(void *, (ALT_CAST(char *, (base)) + ALT_TMR_TMR1INTSTAT_OFST))
576 
636 #define ALT_TMR_TMRSINTSTAT_TMRSINTSTAT_E_INACT 0x0
637 
642 #define ALT_TMR_TMRSINTSTAT_TMRSINTSTAT_E_ACT 0x1
643 
645 #define ALT_TMR_TMRSINTSTAT_TMRSINTSTAT_LSB 0
646 
647 #define ALT_TMR_TMRSINTSTAT_TMRSINTSTAT_MSB 0
648 
649 #define ALT_TMR_TMRSINTSTAT_TMRSINTSTAT_WIDTH 1
650 
651 #define ALT_TMR_TMRSINTSTAT_TMRSINTSTAT_SET_MSK 0x00000001
652 
653 #define ALT_TMR_TMRSINTSTAT_TMRSINTSTAT_CLR_MSK 0xfffffffe
654 
655 #define ALT_TMR_TMRSINTSTAT_TMRSINTSTAT_RESET 0x0
656 
657 #define ALT_TMR_TMRSINTSTAT_TMRSINTSTAT_GET(value) (((value) & 0x00000001) >> 0)
658 
659 #define ALT_TMR_TMRSINTSTAT_TMRSINTSTAT_SET(value) (((value) << 0) & 0x00000001)
660 
661 #ifndef __ASSEMBLY__
662 
673 {
674  const uint32_t timersintstat : 1;
675  uint32_t : 31;
676 };
677 
680 #endif /* __ASSEMBLY__ */
681 
683 #define ALT_TMR_TMRSINTSTAT_RESET 0x00000000
684 
685 #define ALT_TMR_TMRSINTSTAT_OFST 0xa0
686 
687 #define ALT_TMR_TMRSINTSTAT_ADDR(base) ALT_CAST(void *, (ALT_CAST(char *, (base)) + ALT_TMR_TMRSINTSTAT_OFST))
688 
719 #define ALT_TMR_TMRSEOI_TMRSEOI_LSB 0
720 
721 #define ALT_TMR_TMRSEOI_TMRSEOI_MSB 0
722 
723 #define ALT_TMR_TMRSEOI_TMRSEOI_WIDTH 1
724 
725 #define ALT_TMR_TMRSEOI_TMRSEOI_SET_MSK 0x00000001
726 
727 #define ALT_TMR_TMRSEOI_TMRSEOI_CLR_MSK 0xfffffffe
728 
729 #define ALT_TMR_TMRSEOI_TMRSEOI_RESET 0x0
730 
731 #define ALT_TMR_TMRSEOI_TMRSEOI_GET(value) (((value) & 0x00000001) >> 0)
732 
733 #define ALT_TMR_TMRSEOI_TMRSEOI_SET(value) (((value) << 0) & 0x00000001)
734 
735 #ifndef __ASSEMBLY__
736 
747 {
748  const uint32_t timerseoi : 1;
749  uint32_t : 31;
750 };
751 
753 typedef volatile struct ALT_TMR_TMRSEOI_s ALT_TMR_TMRSEOI_t;
754 #endif /* __ASSEMBLY__ */
755 
757 #define ALT_TMR_TMRSEOI_RESET 0x00000000
758 
759 #define ALT_TMR_TMRSEOI_OFST 0xa4
760 
761 #define ALT_TMR_TMRSEOI_ADDR(base) ALT_CAST(void *, (ALT_CAST(char *, (base)) + ALT_TMR_TMRSEOI_OFST))
762 
808 #define ALT_TMR_TMRSRAWINTSTAT_TMRSRAWINTSTAT_E_INACT 0x0
809 
814 #define ALT_TMR_TMRSRAWINTSTAT_TMRSRAWINTSTAT_E_ACT 0x1
815 
817 #define ALT_TMR_TMRSRAWINTSTAT_TMRSRAWINTSTAT_LSB 0
818 
819 #define ALT_TMR_TMRSRAWINTSTAT_TMRSRAWINTSTAT_MSB 0
820 
821 #define ALT_TMR_TMRSRAWINTSTAT_TMRSRAWINTSTAT_WIDTH 1
822 
823 #define ALT_TMR_TMRSRAWINTSTAT_TMRSRAWINTSTAT_SET_MSK 0x00000001
824 
825 #define ALT_TMR_TMRSRAWINTSTAT_TMRSRAWINTSTAT_CLR_MSK 0xfffffffe
826 
827 #define ALT_TMR_TMRSRAWINTSTAT_TMRSRAWINTSTAT_RESET 0x0
828 
829 #define ALT_TMR_TMRSRAWINTSTAT_TMRSRAWINTSTAT_GET(value) (((value) & 0x00000001) >> 0)
830 
831 #define ALT_TMR_TMRSRAWINTSTAT_TMRSRAWINTSTAT_SET(value) (((value) << 0) & 0x00000001)
832 
833 #ifndef __ASSEMBLY__
834 
845 {
846  const uint32_t timersrawintstat : 1;
847  uint32_t : 31;
848 };
849 
852 #endif /* __ASSEMBLY__ */
853 
855 #define ALT_TMR_TMRSRAWINTSTAT_RESET 0x00000000
856 
857 #define ALT_TMR_TMRSRAWINTSTAT_OFST 0xa8
858 
859 #define ALT_TMR_TMRSRAWINTSTAT_ADDR(base) ALT_CAST(void *, (ALT_CAST(char *, (base)) + ALT_TMR_TMRSRAWINTSTAT_OFST))
860 
888 #define ALT_TMR_TMRSCOMPVER_TMRSCOMPVER_LSB 0
889 
890 #define ALT_TMR_TMRSCOMPVER_TMRSCOMPVER_MSB 31
891 
892 #define ALT_TMR_TMRSCOMPVER_TMRSCOMPVER_WIDTH 32
893 
894 #define ALT_TMR_TMRSCOMPVER_TMRSCOMPVER_SET_MSK 0xffffffff
895 
896 #define ALT_TMR_TMRSCOMPVER_TMRSCOMPVER_CLR_MSK 0x00000000
897 
898 #define ALT_TMR_TMRSCOMPVER_TMRSCOMPVER_RESET 0x3230382a
899 
900 #define ALT_TMR_TMRSCOMPVER_TMRSCOMPVER_GET(value) (((value) & 0xffffffff) >> 0)
901 
902 #define ALT_TMR_TMRSCOMPVER_TMRSCOMPVER_SET(value) (((value) << 0) & 0xffffffff)
903 
904 #ifndef __ASSEMBLY__
905 
916 {
917  const uint32_t timerscompversion : 32;
918 };
919 
922 #endif /* __ASSEMBLY__ */
923 
925 #define ALT_TMR_TMRSCOMPVER_RESET 0x3230382a
926 
927 #define ALT_TMR_TMRSCOMPVER_OFST 0xac
928 
929 #define ALT_TMR_TMRSCOMPVER_ADDR(base) ALT_CAST(void *, (ALT_CAST(char *, (base)) + ALT_TMR_TMRSCOMPVER_OFST))
930 
931 #ifndef __ASSEMBLY__
932 
942 struct ALT_TMR_s
943 {
949  volatile uint32_t _pad_0x14_0x9f[35];
954  volatile uint32_t _pad_0xb0_0x100[20];
955 };
956 
958 typedef volatile struct ALT_TMR_s ALT_TMR_t;
961 {
962  volatile uint32_t timer1loadcount;
963  volatile uint32_t timer1currentval;
964  volatile uint32_t timer1controlreg;
965  volatile uint32_t timer1eoi;
966  volatile uint32_t timer1intstat;
967  volatile uint32_t _pad_0x14_0x9f[35];
968  volatile uint32_t timersintstat;
969  volatile uint32_t timerseoi;
970  volatile uint32_t timersrawintstat;
971  volatile uint32_t timerscompversion;
972  volatile uint32_t _pad_0xb0_0x100[20];
973 };
974 
976 typedef volatile struct ALT_TMR_raw_s ALT_TMR_raw_t;
977 #endif /* __ASSEMBLY__ */
978 
980 #ifdef __cplusplus
981 }
982 #endif /* __cplusplus */
983 #endif /* __ALT_SOCAL_TMR_H__ */
984