Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.
Dependents: 1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB
Fork of mbed by
TARGET_SAMD21G18A/comp_tc.h@121:672067c3ada4, 2016-04-14 (annotated)
- Committer:
- elijahorr
- Date:
- Thu Apr 14 07:28:54 2016 +0000
- Revision:
- 121:672067c3ada4
- Parent:
- 111:4336505e4b1c
.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 111:4336505e4b1c | 1 | /** |
Kojto | 111:4336505e4b1c | 2 | * \file |
Kojto | 111:4336505e4b1c | 3 | * |
Kojto | 111:4336505e4b1c | 4 | * \brief Component description for TC |
Kojto | 111:4336505e4b1c | 5 | * |
Kojto | 111:4336505e4b1c | 6 | * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved. |
Kojto | 111:4336505e4b1c | 7 | * |
Kojto | 111:4336505e4b1c | 8 | * \asf_license_start |
Kojto | 111:4336505e4b1c | 9 | * |
Kojto | 111:4336505e4b1c | 10 | * \page License |
Kojto | 111:4336505e4b1c | 11 | * |
Kojto | 111:4336505e4b1c | 12 | * Redistribution and use in source and binary forms, with or without |
Kojto | 111:4336505e4b1c | 13 | * modification, are permitted provided that the following conditions are met: |
Kojto | 111:4336505e4b1c | 14 | * |
Kojto | 111:4336505e4b1c | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
Kojto | 111:4336505e4b1c | 16 | * this list of conditions and the following disclaimer. |
Kojto | 111:4336505e4b1c | 17 | * |
Kojto | 111:4336505e4b1c | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
Kojto | 111:4336505e4b1c | 19 | * this list of conditions and the following disclaimer in the documentation |
Kojto | 111:4336505e4b1c | 20 | * and/or other materials provided with the distribution. |
Kojto | 111:4336505e4b1c | 21 | * |
Kojto | 111:4336505e4b1c | 22 | * 3. The name of Atmel may not be used to endorse or promote products derived |
Kojto | 111:4336505e4b1c | 23 | * from this software without specific prior written permission. |
Kojto | 111:4336505e4b1c | 24 | * |
Kojto | 111:4336505e4b1c | 25 | * 4. This software may only be redistributed and used in connection with an |
Kojto | 111:4336505e4b1c | 26 | * Atmel microcontroller product. |
Kojto | 111:4336505e4b1c | 27 | * |
Kojto | 111:4336505e4b1c | 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED |
Kojto | 111:4336505e4b1c | 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
Kojto | 111:4336505e4b1c | 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE |
Kojto | 111:4336505e4b1c | 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR |
Kojto | 111:4336505e4b1c | 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
Kojto | 111:4336505e4b1c | 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
Kojto | 111:4336505e4b1c | 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
Kojto | 111:4336505e4b1c | 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
Kojto | 111:4336505e4b1c | 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
Kojto | 111:4336505e4b1c | 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
Kojto | 111:4336505e4b1c | 38 | * POSSIBILITY OF SUCH DAMAGE. |
Kojto | 111:4336505e4b1c | 39 | * |
Kojto | 111:4336505e4b1c | 40 | * \asf_license_stop |
Kojto | 111:4336505e4b1c | 41 | * |
Kojto | 111:4336505e4b1c | 42 | */ |
Kojto | 111:4336505e4b1c | 43 | /* |
Kojto | 111:4336505e4b1c | 44 | * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> |
Kojto | 111:4336505e4b1c | 45 | */ |
Kojto | 111:4336505e4b1c | 46 | |
Kojto | 111:4336505e4b1c | 47 | #ifndef _SAMD21_TC_COMPONENT_ |
Kojto | 111:4336505e4b1c | 48 | #define _SAMD21_TC_COMPONENT_ |
Kojto | 111:4336505e4b1c | 49 | |
Kojto | 111:4336505e4b1c | 50 | /* ========================================================================== */ |
Kojto | 111:4336505e4b1c | 51 | /** SOFTWARE API DEFINITION FOR TC */ |
Kojto | 111:4336505e4b1c | 52 | /* ========================================================================== */ |
Kojto | 111:4336505e4b1c | 53 | /** \addtogroup SAMD21_TC Basic Timer Counter */ |
Kojto | 111:4336505e4b1c | 54 | /*@{*/ |
Kojto | 111:4336505e4b1c | 55 | |
Kojto | 111:4336505e4b1c | 56 | #define TC_U2212 |
Kojto | 111:4336505e4b1c | 57 | #define REV_TC 0x131 |
Kojto | 111:4336505e4b1c | 58 | |
Kojto | 111:4336505e4b1c | 59 | /* -------- TC_CTRLA : (TC Offset: 0x00) (R/W 16) Control A -------- */ |
Kojto | 111:4336505e4b1c | 60 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) |
Kojto | 111:4336505e4b1c | 61 | typedef union { |
Kojto | 111:4336505e4b1c | 62 | struct { |
Kojto | 111:4336505e4b1c | 63 | uint16_t SWRST:1; /*!< bit: 0 Software Reset */ |
Kojto | 111:4336505e4b1c | 64 | uint16_t ENABLE:1; /*!< bit: 1 Enable */ |
Kojto | 111:4336505e4b1c | 65 | uint16_t MODE:2; /*!< bit: 2.. 3 TC Mode */ |
Kojto | 111:4336505e4b1c | 66 | uint16_t :1; /*!< bit: 4 Reserved */ |
Kojto | 111:4336505e4b1c | 67 | uint16_t WAVEGEN:2; /*!< bit: 5.. 6 Waveform Generation Operation */ |
Kojto | 111:4336505e4b1c | 68 | uint16_t :1; /*!< bit: 7 Reserved */ |
Kojto | 111:4336505e4b1c | 69 | uint16_t PRESCALER:3; /*!< bit: 8..10 Prescaler */ |
Kojto | 111:4336505e4b1c | 70 | uint16_t RUNSTDBY:1; /*!< bit: 11 Run in Standby */ |
Kojto | 111:4336505e4b1c | 71 | uint16_t PRESCSYNC:2; /*!< bit: 12..13 Prescaler and Counter Synchronization */ |
Kojto | 111:4336505e4b1c | 72 | uint16_t :2; /*!< bit: 14..15 Reserved */ |
Kojto | 111:4336505e4b1c | 73 | } bit; /*!< Structure used for bit access */ |
Kojto | 111:4336505e4b1c | 74 | uint16_t reg; /*!< Type used for register access */ |
Kojto | 111:4336505e4b1c | 75 | } TC_CTRLA_Type; |
Kojto | 111:4336505e4b1c | 76 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ |
Kojto | 111:4336505e4b1c | 77 | |
Kojto | 111:4336505e4b1c | 78 | #define TC_CTRLA_OFFSET 0x00 /**< \brief (TC_CTRLA offset) Control A */ |
Kojto | 111:4336505e4b1c | 79 | #define TC_CTRLA_RESETVALUE 0x0000ul /**< \brief (TC_CTRLA reset_value) Control A */ |
Kojto | 111:4336505e4b1c | 80 | |
Kojto | 111:4336505e4b1c | 81 | #define TC_CTRLA_SWRST_Pos 0 /**< \brief (TC_CTRLA) Software Reset */ |
Kojto | 111:4336505e4b1c | 82 | #define TC_CTRLA_SWRST (0x1ul << TC_CTRLA_SWRST_Pos) |
Kojto | 111:4336505e4b1c | 83 | #define TC_CTRLA_ENABLE_Pos 1 /**< \brief (TC_CTRLA) Enable */ |
Kojto | 111:4336505e4b1c | 84 | #define TC_CTRLA_ENABLE (0x1ul << TC_CTRLA_ENABLE_Pos) |
Kojto | 111:4336505e4b1c | 85 | #define TC_CTRLA_MODE_Pos 2 /**< \brief (TC_CTRLA) TC Mode */ |
Kojto | 111:4336505e4b1c | 86 | #define TC_CTRLA_MODE_Msk (0x3ul << TC_CTRLA_MODE_Pos) |
Kojto | 111:4336505e4b1c | 87 | #define TC_CTRLA_MODE(value) ((TC_CTRLA_MODE_Msk & ((value) << TC_CTRLA_MODE_Pos))) |
Kojto | 111:4336505e4b1c | 88 | #define TC_CTRLA_MODE_COUNT16_Val 0x0ul /**< \brief (TC_CTRLA) Counter in 16-bit mode */ |
Kojto | 111:4336505e4b1c | 89 | #define TC_CTRLA_MODE_COUNT8_Val 0x1ul /**< \brief (TC_CTRLA) Counter in 8-bit mode */ |
Kojto | 111:4336505e4b1c | 90 | #define TC_CTRLA_MODE_COUNT32_Val 0x2ul /**< \brief (TC_CTRLA) Counter in 32-bit mode */ |
Kojto | 111:4336505e4b1c | 91 | #define TC_CTRLA_MODE_COUNT16 (TC_CTRLA_MODE_COUNT16_Val << TC_CTRLA_MODE_Pos) |
Kojto | 111:4336505e4b1c | 92 | #define TC_CTRLA_MODE_COUNT8 (TC_CTRLA_MODE_COUNT8_Val << TC_CTRLA_MODE_Pos) |
Kojto | 111:4336505e4b1c | 93 | #define TC_CTRLA_MODE_COUNT32 (TC_CTRLA_MODE_COUNT32_Val << TC_CTRLA_MODE_Pos) |
Kojto | 111:4336505e4b1c | 94 | #define TC_CTRLA_WAVEGEN_Pos 5 /**< \brief (TC_CTRLA) Waveform Generation Operation */ |
Kojto | 111:4336505e4b1c | 95 | #define TC_CTRLA_WAVEGEN_Msk (0x3ul << TC_CTRLA_WAVEGEN_Pos) |
Kojto | 111:4336505e4b1c | 96 | #define TC_CTRLA_WAVEGEN(value) ((TC_CTRLA_WAVEGEN_Msk & ((value) << TC_CTRLA_WAVEGEN_Pos))) |
Kojto | 111:4336505e4b1c | 97 | #define TC_CTRLA_WAVEGEN_NFRQ_Val 0x0ul /**< \brief (TC_CTRLA) */ |
Kojto | 111:4336505e4b1c | 98 | #define TC_CTRLA_WAVEGEN_MFRQ_Val 0x1ul /**< \brief (TC_CTRLA) */ |
Kojto | 111:4336505e4b1c | 99 | #define TC_CTRLA_WAVEGEN_NPWM_Val 0x2ul /**< \brief (TC_CTRLA) */ |
Kojto | 111:4336505e4b1c | 100 | #define TC_CTRLA_WAVEGEN_MPWM_Val 0x3ul /**< \brief (TC_CTRLA) */ |
Kojto | 111:4336505e4b1c | 101 | #define TC_CTRLA_WAVEGEN_NFRQ (TC_CTRLA_WAVEGEN_NFRQ_Val << TC_CTRLA_WAVEGEN_Pos) |
Kojto | 111:4336505e4b1c | 102 | #define TC_CTRLA_WAVEGEN_MFRQ (TC_CTRLA_WAVEGEN_MFRQ_Val << TC_CTRLA_WAVEGEN_Pos) |
Kojto | 111:4336505e4b1c | 103 | #define TC_CTRLA_WAVEGEN_NPWM (TC_CTRLA_WAVEGEN_NPWM_Val << TC_CTRLA_WAVEGEN_Pos) |
Kojto | 111:4336505e4b1c | 104 | #define TC_CTRLA_WAVEGEN_MPWM (TC_CTRLA_WAVEGEN_MPWM_Val << TC_CTRLA_WAVEGEN_Pos) |
Kojto | 111:4336505e4b1c | 105 | #define TC_CTRLA_PRESCALER_Pos 8 /**< \brief (TC_CTRLA) Prescaler */ |
Kojto | 111:4336505e4b1c | 106 | #define TC_CTRLA_PRESCALER_Msk (0x7ul << TC_CTRLA_PRESCALER_Pos) |
Kojto | 111:4336505e4b1c | 107 | #define TC_CTRLA_PRESCALER(value) ((TC_CTRLA_PRESCALER_Msk & ((value) << TC_CTRLA_PRESCALER_Pos))) |
Kojto | 111:4336505e4b1c | 108 | #define TC_CTRLA_PRESCALER_DIV1_Val 0x0ul /**< \brief (TC_CTRLA) Prescaler: GCLK_TC */ |
Kojto | 111:4336505e4b1c | 109 | #define TC_CTRLA_PRESCALER_DIV2_Val 0x1ul /**< \brief (TC_CTRLA) Prescaler: GCLK_TC/2 */ |
Kojto | 111:4336505e4b1c | 110 | #define TC_CTRLA_PRESCALER_DIV4_Val 0x2ul /**< \brief (TC_CTRLA) Prescaler: GCLK_TC/4 */ |
Kojto | 111:4336505e4b1c | 111 | #define TC_CTRLA_PRESCALER_DIV8_Val 0x3ul /**< \brief (TC_CTRLA) Prescaler: GCLK_TC/8 */ |
Kojto | 111:4336505e4b1c | 112 | #define TC_CTRLA_PRESCALER_DIV16_Val 0x4ul /**< \brief (TC_CTRLA) Prescaler: GCLK_TC/16 */ |
Kojto | 111:4336505e4b1c | 113 | #define TC_CTRLA_PRESCALER_DIV64_Val 0x5ul /**< \brief (TC_CTRLA) Prescaler: GCLK_TC/64 */ |
Kojto | 111:4336505e4b1c | 114 | #define TC_CTRLA_PRESCALER_DIV256_Val 0x6ul /**< \brief (TC_CTRLA) Prescaler: GCLK_TC/256 */ |
Kojto | 111:4336505e4b1c | 115 | #define TC_CTRLA_PRESCALER_DIV1024_Val 0x7ul /**< \brief (TC_CTRLA) Prescaler: GCLK_TC/1024 */ |
Kojto | 111:4336505e4b1c | 116 | #define TC_CTRLA_PRESCALER_DIV1 (TC_CTRLA_PRESCALER_DIV1_Val << TC_CTRLA_PRESCALER_Pos) |
Kojto | 111:4336505e4b1c | 117 | #define TC_CTRLA_PRESCALER_DIV2 (TC_CTRLA_PRESCALER_DIV2_Val << TC_CTRLA_PRESCALER_Pos) |
Kojto | 111:4336505e4b1c | 118 | #define TC_CTRLA_PRESCALER_DIV4 (TC_CTRLA_PRESCALER_DIV4_Val << TC_CTRLA_PRESCALER_Pos) |
Kojto | 111:4336505e4b1c | 119 | #define TC_CTRLA_PRESCALER_DIV8 (TC_CTRLA_PRESCALER_DIV8_Val << TC_CTRLA_PRESCALER_Pos) |
Kojto | 111:4336505e4b1c | 120 | #define TC_CTRLA_PRESCALER_DIV16 (TC_CTRLA_PRESCALER_DIV16_Val << TC_CTRLA_PRESCALER_Pos) |
Kojto | 111:4336505e4b1c | 121 | #define TC_CTRLA_PRESCALER_DIV64 (TC_CTRLA_PRESCALER_DIV64_Val << TC_CTRLA_PRESCALER_Pos) |
Kojto | 111:4336505e4b1c | 122 | #define TC_CTRLA_PRESCALER_DIV256 (TC_CTRLA_PRESCALER_DIV256_Val << TC_CTRLA_PRESCALER_Pos) |
Kojto | 111:4336505e4b1c | 123 | #define TC_CTRLA_PRESCALER_DIV1024 (TC_CTRLA_PRESCALER_DIV1024_Val << TC_CTRLA_PRESCALER_Pos) |
Kojto | 111:4336505e4b1c | 124 | #define TC_CTRLA_RUNSTDBY_Pos 11 /**< \brief (TC_CTRLA) Run in Standby */ |
Kojto | 111:4336505e4b1c | 125 | #define TC_CTRLA_RUNSTDBY (0x1ul << TC_CTRLA_RUNSTDBY_Pos) |
Kojto | 111:4336505e4b1c | 126 | #define TC_CTRLA_PRESCSYNC_Pos 12 /**< \brief (TC_CTRLA) Prescaler and Counter Synchronization */ |
Kojto | 111:4336505e4b1c | 127 | #define TC_CTRLA_PRESCSYNC_Msk (0x3ul << TC_CTRLA_PRESCSYNC_Pos) |
Kojto | 111:4336505e4b1c | 128 | #define TC_CTRLA_PRESCSYNC(value) ((TC_CTRLA_PRESCSYNC_Msk & ((value) << TC_CTRLA_PRESCSYNC_Pos))) |
Kojto | 111:4336505e4b1c | 129 | #define TC_CTRLA_PRESCSYNC_GCLK_Val 0x0ul /**< \brief (TC_CTRLA) Reload or reset the counter on next generic clock */ |
Kojto | 111:4336505e4b1c | 130 | #define TC_CTRLA_PRESCSYNC_PRESC_Val 0x1ul /**< \brief (TC_CTRLA) Reload or reset the counter on next prescaler clock */ |
Kojto | 111:4336505e4b1c | 131 | #define TC_CTRLA_PRESCSYNC_RESYNC_Val 0x2ul /**< \brief (TC_CTRLA) Reload or reset the counter on next generic clock. Reset the prescaler counter */ |
Kojto | 111:4336505e4b1c | 132 | #define TC_CTRLA_PRESCSYNC_GCLK (TC_CTRLA_PRESCSYNC_GCLK_Val << TC_CTRLA_PRESCSYNC_Pos) |
Kojto | 111:4336505e4b1c | 133 | #define TC_CTRLA_PRESCSYNC_PRESC (TC_CTRLA_PRESCSYNC_PRESC_Val << TC_CTRLA_PRESCSYNC_Pos) |
Kojto | 111:4336505e4b1c | 134 | #define TC_CTRLA_PRESCSYNC_RESYNC (TC_CTRLA_PRESCSYNC_RESYNC_Val << TC_CTRLA_PRESCSYNC_Pos) |
Kojto | 111:4336505e4b1c | 135 | #define TC_CTRLA_MASK 0x3F6Ful /**< \brief (TC_CTRLA) MASK Register */ |
Kojto | 111:4336505e4b1c | 136 | |
Kojto | 111:4336505e4b1c | 137 | /* -------- TC_READREQ : (TC Offset: 0x02) (R/W 16) Read Request -------- */ |
Kojto | 111:4336505e4b1c | 138 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) |
Kojto | 111:4336505e4b1c | 139 | typedef union { |
Kojto | 111:4336505e4b1c | 140 | struct { |
Kojto | 111:4336505e4b1c | 141 | uint16_t ADDR:5; /*!< bit: 0.. 4 Address */ |
Kojto | 111:4336505e4b1c | 142 | uint16_t :9; /*!< bit: 5..13 Reserved */ |
Kojto | 111:4336505e4b1c | 143 | uint16_t RCONT:1; /*!< bit: 14 Read Continuously */ |
Kojto | 111:4336505e4b1c | 144 | uint16_t RREQ:1; /*!< bit: 15 Read Request */ |
Kojto | 111:4336505e4b1c | 145 | } bit; /*!< Structure used for bit access */ |
Kojto | 111:4336505e4b1c | 146 | uint16_t reg; /*!< Type used for register access */ |
Kojto | 111:4336505e4b1c | 147 | } TC_READREQ_Type; |
Kojto | 111:4336505e4b1c | 148 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ |
Kojto | 111:4336505e4b1c | 149 | |
Kojto | 111:4336505e4b1c | 150 | #define TC_READREQ_OFFSET 0x02 /**< \brief (TC_READREQ offset) Read Request */ |
Kojto | 111:4336505e4b1c | 151 | #define TC_READREQ_RESETVALUE 0x0000ul /**< \brief (TC_READREQ reset_value) Read Request */ |
Kojto | 111:4336505e4b1c | 152 | |
Kojto | 111:4336505e4b1c | 153 | #define TC_READREQ_ADDR_Pos 0 /**< \brief (TC_READREQ) Address */ |
Kojto | 111:4336505e4b1c | 154 | #define TC_READREQ_ADDR_Msk (0x1Ful << TC_READREQ_ADDR_Pos) |
Kojto | 111:4336505e4b1c | 155 | #define TC_READREQ_ADDR(value) ((TC_READREQ_ADDR_Msk & ((value) << TC_READREQ_ADDR_Pos))) |
Kojto | 111:4336505e4b1c | 156 | #define TC_READREQ_RCONT_Pos 14 /**< \brief (TC_READREQ) Read Continuously */ |
Kojto | 111:4336505e4b1c | 157 | #define TC_READREQ_RCONT (0x1ul << TC_READREQ_RCONT_Pos) |
Kojto | 111:4336505e4b1c | 158 | #define TC_READREQ_RREQ_Pos 15 /**< \brief (TC_READREQ) Read Request */ |
Kojto | 111:4336505e4b1c | 159 | #define TC_READREQ_RREQ (0x1ul << TC_READREQ_RREQ_Pos) |
Kojto | 111:4336505e4b1c | 160 | #define TC_READREQ_MASK 0xC01Ful /**< \brief (TC_READREQ) MASK Register */ |
Kojto | 111:4336505e4b1c | 161 | |
Kojto | 111:4336505e4b1c | 162 | /* -------- TC_CTRLBCLR : (TC Offset: 0x04) (R/W 8) Control B Clear -------- */ |
Kojto | 111:4336505e4b1c | 163 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) |
Kojto | 111:4336505e4b1c | 164 | typedef union { |
Kojto | 111:4336505e4b1c | 165 | struct { |
Kojto | 111:4336505e4b1c | 166 | uint8_t DIR:1; /*!< bit: 0 Counter Direction */ |
Kojto | 111:4336505e4b1c | 167 | uint8_t :1; /*!< bit: 1 Reserved */ |
Kojto | 111:4336505e4b1c | 168 | uint8_t ONESHOT:1; /*!< bit: 2 One-Shot */ |
Kojto | 111:4336505e4b1c | 169 | uint8_t :3; /*!< bit: 3.. 5 Reserved */ |
Kojto | 111:4336505e4b1c | 170 | uint8_t CMD:2; /*!< bit: 6.. 7 Command */ |
Kojto | 111:4336505e4b1c | 171 | } bit; /*!< Structure used for bit access */ |
Kojto | 111:4336505e4b1c | 172 | uint8_t reg; /*!< Type used for register access */ |
Kojto | 111:4336505e4b1c | 173 | } TC_CTRLBCLR_Type; |
Kojto | 111:4336505e4b1c | 174 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ |
Kojto | 111:4336505e4b1c | 175 | |
Kojto | 111:4336505e4b1c | 176 | #define TC_CTRLBCLR_OFFSET 0x04 /**< \brief (TC_CTRLBCLR offset) Control B Clear */ |
Kojto | 111:4336505e4b1c | 177 | #define TC_CTRLBCLR_RESETVALUE 0x02ul /**< \brief (TC_CTRLBCLR reset_value) Control B Clear */ |
Kojto | 111:4336505e4b1c | 178 | |
Kojto | 111:4336505e4b1c | 179 | #define TC_CTRLBCLR_DIR_Pos 0 /**< \brief (TC_CTRLBCLR) Counter Direction */ |
Kojto | 111:4336505e4b1c | 180 | #define TC_CTRLBCLR_DIR (0x1ul << TC_CTRLBCLR_DIR_Pos) |
Kojto | 111:4336505e4b1c | 181 | #define TC_CTRLBCLR_ONESHOT_Pos 2 /**< \brief (TC_CTRLBCLR) One-Shot */ |
Kojto | 111:4336505e4b1c | 182 | #define TC_CTRLBCLR_ONESHOT (0x1ul << TC_CTRLBCLR_ONESHOT_Pos) |
Kojto | 111:4336505e4b1c | 183 | #define TC_CTRLBCLR_CMD_Pos 6 /**< \brief (TC_CTRLBCLR) Command */ |
Kojto | 111:4336505e4b1c | 184 | #define TC_CTRLBCLR_CMD_Msk (0x3ul << TC_CTRLBCLR_CMD_Pos) |
Kojto | 111:4336505e4b1c | 185 | #define TC_CTRLBCLR_CMD(value) ((TC_CTRLBCLR_CMD_Msk & ((value) << TC_CTRLBCLR_CMD_Pos))) |
Kojto | 111:4336505e4b1c | 186 | #define TC_CTRLBCLR_CMD_NONE_Val 0x0ul /**< \brief (TC_CTRLBCLR) No action */ |
Kojto | 111:4336505e4b1c | 187 | #define TC_CTRLBCLR_CMD_RETRIGGER_Val 0x1ul /**< \brief (TC_CTRLBCLR) Force a start, restart or retrigger */ |
Kojto | 111:4336505e4b1c | 188 | #define TC_CTRLBCLR_CMD_STOP_Val 0x2ul /**< \brief (TC_CTRLBCLR) Force a stop */ |
Kojto | 111:4336505e4b1c | 189 | #define TC_CTRLBCLR_CMD_NONE (TC_CTRLBCLR_CMD_NONE_Val << TC_CTRLBCLR_CMD_Pos) |
Kojto | 111:4336505e4b1c | 190 | #define TC_CTRLBCLR_CMD_RETRIGGER (TC_CTRLBCLR_CMD_RETRIGGER_Val << TC_CTRLBCLR_CMD_Pos) |
Kojto | 111:4336505e4b1c | 191 | #define TC_CTRLBCLR_CMD_STOP (TC_CTRLBCLR_CMD_STOP_Val << TC_CTRLBCLR_CMD_Pos) |
Kojto | 111:4336505e4b1c | 192 | #define TC_CTRLBCLR_MASK 0xC5ul /**< \brief (TC_CTRLBCLR) MASK Register */ |
Kojto | 111:4336505e4b1c | 193 | |
Kojto | 111:4336505e4b1c | 194 | /* -------- TC_CTRLBSET : (TC Offset: 0x05) (R/W 8) Control B Set -------- */ |
Kojto | 111:4336505e4b1c | 195 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) |
Kojto | 111:4336505e4b1c | 196 | typedef union { |
Kojto | 111:4336505e4b1c | 197 | struct { |
Kojto | 111:4336505e4b1c | 198 | uint8_t DIR:1; /*!< bit: 0 Counter Direction */ |
Kojto | 111:4336505e4b1c | 199 | uint8_t :1; /*!< bit: 1 Reserved */ |
Kojto | 111:4336505e4b1c | 200 | uint8_t ONESHOT:1; /*!< bit: 2 One-Shot */ |
Kojto | 111:4336505e4b1c | 201 | uint8_t :3; /*!< bit: 3.. 5 Reserved */ |
Kojto | 111:4336505e4b1c | 202 | uint8_t CMD:2; /*!< bit: 6.. 7 Command */ |
Kojto | 111:4336505e4b1c | 203 | } bit; /*!< Structure used for bit access */ |
Kojto | 111:4336505e4b1c | 204 | uint8_t reg; /*!< Type used for register access */ |
Kojto | 111:4336505e4b1c | 205 | } TC_CTRLBSET_Type; |
Kojto | 111:4336505e4b1c | 206 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ |
Kojto | 111:4336505e4b1c | 207 | |
Kojto | 111:4336505e4b1c | 208 | #define TC_CTRLBSET_OFFSET 0x05 /**< \brief (TC_CTRLBSET offset) Control B Set */ |
Kojto | 111:4336505e4b1c | 209 | #define TC_CTRLBSET_RESETVALUE 0x00ul /**< \brief (TC_CTRLBSET reset_value) Control B Set */ |
Kojto | 111:4336505e4b1c | 210 | |
Kojto | 111:4336505e4b1c | 211 | #define TC_CTRLBSET_DIR_Pos 0 /**< \brief (TC_CTRLBSET) Counter Direction */ |
Kojto | 111:4336505e4b1c | 212 | #define TC_CTRLBSET_DIR (0x1ul << TC_CTRLBSET_DIR_Pos) |
Kojto | 111:4336505e4b1c | 213 | #define TC_CTRLBSET_ONESHOT_Pos 2 /**< \brief (TC_CTRLBSET) One-Shot */ |
Kojto | 111:4336505e4b1c | 214 | #define TC_CTRLBSET_ONESHOT (0x1ul << TC_CTRLBSET_ONESHOT_Pos) |
Kojto | 111:4336505e4b1c | 215 | #define TC_CTRLBSET_CMD_Pos 6 /**< \brief (TC_CTRLBSET) Command */ |
Kojto | 111:4336505e4b1c | 216 | #define TC_CTRLBSET_CMD_Msk (0x3ul << TC_CTRLBSET_CMD_Pos) |
Kojto | 111:4336505e4b1c | 217 | #define TC_CTRLBSET_CMD(value) ((TC_CTRLBSET_CMD_Msk & ((value) << TC_CTRLBSET_CMD_Pos))) |
Kojto | 111:4336505e4b1c | 218 | #define TC_CTRLBSET_CMD_NONE_Val 0x0ul /**< \brief (TC_CTRLBSET) No action */ |
Kojto | 111:4336505e4b1c | 219 | #define TC_CTRLBSET_CMD_RETRIGGER_Val 0x1ul /**< \brief (TC_CTRLBSET) Force a start, restart or retrigger */ |
Kojto | 111:4336505e4b1c | 220 | #define TC_CTRLBSET_CMD_STOP_Val 0x2ul /**< \brief (TC_CTRLBSET) Force a stop */ |
Kojto | 111:4336505e4b1c | 221 | #define TC_CTRLBSET_CMD_NONE (TC_CTRLBSET_CMD_NONE_Val << TC_CTRLBSET_CMD_Pos) |
Kojto | 111:4336505e4b1c | 222 | #define TC_CTRLBSET_CMD_RETRIGGER (TC_CTRLBSET_CMD_RETRIGGER_Val << TC_CTRLBSET_CMD_Pos) |
Kojto | 111:4336505e4b1c | 223 | #define TC_CTRLBSET_CMD_STOP (TC_CTRLBSET_CMD_STOP_Val << TC_CTRLBSET_CMD_Pos) |
Kojto | 111:4336505e4b1c | 224 | #define TC_CTRLBSET_MASK 0xC5ul /**< \brief (TC_CTRLBSET) MASK Register */ |
Kojto | 111:4336505e4b1c | 225 | |
Kojto | 111:4336505e4b1c | 226 | /* -------- TC_CTRLC : (TC Offset: 0x06) (R/W 8) Control C -------- */ |
Kojto | 111:4336505e4b1c | 227 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) |
Kojto | 111:4336505e4b1c | 228 | typedef union { |
Kojto | 111:4336505e4b1c | 229 | struct { |
Kojto | 111:4336505e4b1c | 230 | uint8_t INVEN0:1; /*!< bit: 0 Output Waveform 0 Invert Enable */ |
Kojto | 111:4336505e4b1c | 231 | uint8_t INVEN1:1; /*!< bit: 1 Output Waveform 1 Invert Enable */ |
Kojto | 111:4336505e4b1c | 232 | uint8_t :2; /*!< bit: 2.. 3 Reserved */ |
Kojto | 111:4336505e4b1c | 233 | uint8_t CPTEN0:1; /*!< bit: 4 Capture Channel 0 Enable */ |
Kojto | 111:4336505e4b1c | 234 | uint8_t CPTEN1:1; /*!< bit: 5 Capture Channel 1 Enable */ |
Kojto | 111:4336505e4b1c | 235 | uint8_t :2; /*!< bit: 6.. 7 Reserved */ |
Kojto | 111:4336505e4b1c | 236 | } bit; /*!< Structure used for bit access */ |
Kojto | 111:4336505e4b1c | 237 | struct { |
Kojto | 111:4336505e4b1c | 238 | uint8_t INVEN:2; /*!< bit: 0.. 1 Output Waveform x Invert Enable */ |
Kojto | 111:4336505e4b1c | 239 | uint8_t :2; /*!< bit: 2.. 3 Reserved */ |
Kojto | 111:4336505e4b1c | 240 | uint8_t CPTEN:2; /*!< bit: 4.. 5 Capture Channel x Enable */ |
Kojto | 111:4336505e4b1c | 241 | uint8_t :2; /*!< bit: 6.. 7 Reserved */ |
Kojto | 111:4336505e4b1c | 242 | } vec; /*!< Structure used for vec access */ |
Kojto | 111:4336505e4b1c | 243 | uint8_t reg; /*!< Type used for register access */ |
Kojto | 111:4336505e4b1c | 244 | } TC_CTRLC_Type; |
Kojto | 111:4336505e4b1c | 245 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ |
Kojto | 111:4336505e4b1c | 246 | |
Kojto | 111:4336505e4b1c | 247 | #define TC_CTRLC_OFFSET 0x06 /**< \brief (TC_CTRLC offset) Control C */ |
Kojto | 111:4336505e4b1c | 248 | #define TC_CTRLC_RESETVALUE 0x00ul /**< \brief (TC_CTRLC reset_value) Control C */ |
Kojto | 111:4336505e4b1c | 249 | |
Kojto | 111:4336505e4b1c | 250 | #define TC_CTRLC_INVEN0_Pos 0 /**< \brief (TC_CTRLC) Output Waveform 0 Invert Enable */ |
Kojto | 111:4336505e4b1c | 251 | #define TC_CTRLC_INVEN0 (1 << TC_CTRLC_INVEN0_Pos) |
Kojto | 111:4336505e4b1c | 252 | #define TC_CTRLC_INVEN1_Pos 1 /**< \brief (TC_CTRLC) Output Waveform 1 Invert Enable */ |
Kojto | 111:4336505e4b1c | 253 | #define TC_CTRLC_INVEN1 (1 << TC_CTRLC_INVEN1_Pos) |
Kojto | 111:4336505e4b1c | 254 | #define TC_CTRLC_INVEN_Pos 0 /**< \brief (TC_CTRLC) Output Waveform x Invert Enable */ |
Kojto | 111:4336505e4b1c | 255 | #define TC_CTRLC_INVEN_Msk (0x3ul << TC_CTRLC_INVEN_Pos) |
Kojto | 111:4336505e4b1c | 256 | #define TC_CTRLC_INVEN(value) ((TC_CTRLC_INVEN_Msk & ((value) << TC_CTRLC_INVEN_Pos))) |
Kojto | 111:4336505e4b1c | 257 | #define TC_CTRLC_CPTEN0_Pos 4 /**< \brief (TC_CTRLC) Capture Channel 0 Enable */ |
Kojto | 111:4336505e4b1c | 258 | #define TC_CTRLC_CPTEN0 (1 << TC_CTRLC_CPTEN0_Pos) |
Kojto | 111:4336505e4b1c | 259 | #define TC_CTRLC_CPTEN1_Pos 5 /**< \brief (TC_CTRLC) Capture Channel 1 Enable */ |
Kojto | 111:4336505e4b1c | 260 | #define TC_CTRLC_CPTEN1 (1 << TC_CTRLC_CPTEN1_Pos) |
Kojto | 111:4336505e4b1c | 261 | #define TC_CTRLC_CPTEN_Pos 4 /**< \brief (TC_CTRLC) Capture Channel x Enable */ |
Kojto | 111:4336505e4b1c | 262 | #define TC_CTRLC_CPTEN_Msk (0x3ul << TC_CTRLC_CPTEN_Pos) |
Kojto | 111:4336505e4b1c | 263 | #define TC_CTRLC_CPTEN(value) ((TC_CTRLC_CPTEN_Msk & ((value) << TC_CTRLC_CPTEN_Pos))) |
Kojto | 111:4336505e4b1c | 264 | #define TC_CTRLC_MASK 0x33ul /**< \brief (TC_CTRLC) MASK Register */ |
Kojto | 111:4336505e4b1c | 265 | |
Kojto | 111:4336505e4b1c | 266 | /* -------- TC_DBGCTRL : (TC Offset: 0x08) (R/W 8) Debug Control -------- */ |
Kojto | 111:4336505e4b1c | 267 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) |
Kojto | 111:4336505e4b1c | 268 | typedef union { |
Kojto | 111:4336505e4b1c | 269 | struct { |
Kojto | 111:4336505e4b1c | 270 | uint8_t DBGRUN:1; /*!< bit: 0 Debug Run Mode */ |
Kojto | 111:4336505e4b1c | 271 | uint8_t :7; /*!< bit: 1.. 7 Reserved */ |
Kojto | 111:4336505e4b1c | 272 | } bit; /*!< Structure used for bit access */ |
Kojto | 111:4336505e4b1c | 273 | uint8_t reg; /*!< Type used for register access */ |
Kojto | 111:4336505e4b1c | 274 | } TC_DBGCTRL_Type; |
Kojto | 111:4336505e4b1c | 275 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ |
Kojto | 111:4336505e4b1c | 276 | |
Kojto | 111:4336505e4b1c | 277 | #define TC_DBGCTRL_OFFSET 0x08 /**< \brief (TC_DBGCTRL offset) Debug Control */ |
Kojto | 111:4336505e4b1c | 278 | #define TC_DBGCTRL_RESETVALUE 0x00ul /**< \brief (TC_DBGCTRL reset_value) Debug Control */ |
Kojto | 111:4336505e4b1c | 279 | |
Kojto | 111:4336505e4b1c | 280 | #define TC_DBGCTRL_DBGRUN_Pos 0 /**< \brief (TC_DBGCTRL) Debug Run Mode */ |
Kojto | 111:4336505e4b1c | 281 | #define TC_DBGCTRL_DBGRUN (0x1ul << TC_DBGCTRL_DBGRUN_Pos) |
Kojto | 111:4336505e4b1c | 282 | #define TC_DBGCTRL_MASK 0x01ul /**< \brief (TC_DBGCTRL) MASK Register */ |
Kojto | 111:4336505e4b1c | 283 | |
Kojto | 111:4336505e4b1c | 284 | /* -------- TC_EVCTRL : (TC Offset: 0x0A) (R/W 16) Event Control -------- */ |
Kojto | 111:4336505e4b1c | 285 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) |
Kojto | 111:4336505e4b1c | 286 | typedef union { |
Kojto | 111:4336505e4b1c | 287 | struct { |
Kojto | 111:4336505e4b1c | 288 | uint16_t EVACT:3; /*!< bit: 0.. 2 Event Action */ |
Kojto | 111:4336505e4b1c | 289 | uint16_t :1; /*!< bit: 3 Reserved */ |
Kojto | 111:4336505e4b1c | 290 | uint16_t TCINV:1; /*!< bit: 4 TC Inverted Event Input */ |
Kojto | 111:4336505e4b1c | 291 | uint16_t TCEI:1; /*!< bit: 5 TC Event Input */ |
Kojto | 111:4336505e4b1c | 292 | uint16_t :2; /*!< bit: 6.. 7 Reserved */ |
Kojto | 111:4336505e4b1c | 293 | uint16_t OVFEO:1; /*!< bit: 8 Overflow/Underflow Event Output Enable */ |
Kojto | 111:4336505e4b1c | 294 | uint16_t :3; /*!< bit: 9..11 Reserved */ |
Kojto | 111:4336505e4b1c | 295 | uint16_t MCEO0:1; /*!< bit: 12 Match or Capture Channel 0 Event Output Enable */ |
Kojto | 111:4336505e4b1c | 296 | uint16_t MCEO1:1; /*!< bit: 13 Match or Capture Channel 1 Event Output Enable */ |
Kojto | 111:4336505e4b1c | 297 | uint16_t :2; /*!< bit: 14..15 Reserved */ |
Kojto | 111:4336505e4b1c | 298 | } bit; /*!< Structure used for bit access */ |
Kojto | 111:4336505e4b1c | 299 | struct { |
Kojto | 111:4336505e4b1c | 300 | uint16_t :12; /*!< bit: 0..11 Reserved */ |
Kojto | 111:4336505e4b1c | 301 | uint16_t MCEO:2; /*!< bit: 12..13 Match or Capture Channel x Event Output Enable */ |
Kojto | 111:4336505e4b1c | 302 | uint16_t :2; /*!< bit: 14..15 Reserved */ |
Kojto | 111:4336505e4b1c | 303 | } vec; /*!< Structure used for vec access */ |
Kojto | 111:4336505e4b1c | 304 | uint16_t reg; /*!< Type used for register access */ |
Kojto | 111:4336505e4b1c | 305 | } TC_EVCTRL_Type; |
Kojto | 111:4336505e4b1c | 306 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ |
Kojto | 111:4336505e4b1c | 307 | |
Kojto | 111:4336505e4b1c | 308 | #define TC_EVCTRL_OFFSET 0x0A /**< \brief (TC_EVCTRL offset) Event Control */ |
Kojto | 111:4336505e4b1c | 309 | #define TC_EVCTRL_RESETVALUE 0x0000ul /**< \brief (TC_EVCTRL reset_value) Event Control */ |
Kojto | 111:4336505e4b1c | 310 | |
Kojto | 111:4336505e4b1c | 311 | #define TC_EVCTRL_EVACT_Pos 0 /**< \brief (TC_EVCTRL) Event Action */ |
Kojto | 111:4336505e4b1c | 312 | #define TC_EVCTRL_EVACT_Msk (0x7ul << TC_EVCTRL_EVACT_Pos) |
Kojto | 111:4336505e4b1c | 313 | #define TC_EVCTRL_EVACT(value) ((TC_EVCTRL_EVACT_Msk & ((value) << TC_EVCTRL_EVACT_Pos))) |
Kojto | 111:4336505e4b1c | 314 | #define TC_EVCTRL_EVACT_OFF_Val 0x0ul /**< \brief (TC_EVCTRL) Event action disabled */ |
Kojto | 111:4336505e4b1c | 315 | #define TC_EVCTRL_EVACT_RETRIGGER_Val 0x1ul /**< \brief (TC_EVCTRL) Start, restart or retrigger TC on event */ |
Kojto | 111:4336505e4b1c | 316 | #define TC_EVCTRL_EVACT_COUNT_Val 0x2ul /**< \brief (TC_EVCTRL) Count on event */ |
Kojto | 111:4336505e4b1c | 317 | #define TC_EVCTRL_EVACT_START_Val 0x3ul /**< \brief (TC_EVCTRL) Start TC on event */ |
Kojto | 111:4336505e4b1c | 318 | #define TC_EVCTRL_EVACT_PPW_Val 0x5ul /**< \brief (TC_EVCTRL) Period captured in CC0, pulse width in CC1 */ |
Kojto | 111:4336505e4b1c | 319 | #define TC_EVCTRL_EVACT_PWP_Val 0x6ul /**< \brief (TC_EVCTRL) Period captured in CC1, pulse width in CC0 */ |
Kojto | 111:4336505e4b1c | 320 | #define TC_EVCTRL_EVACT_OFF (TC_EVCTRL_EVACT_OFF_Val << TC_EVCTRL_EVACT_Pos) |
Kojto | 111:4336505e4b1c | 321 | #define TC_EVCTRL_EVACT_RETRIGGER (TC_EVCTRL_EVACT_RETRIGGER_Val << TC_EVCTRL_EVACT_Pos) |
Kojto | 111:4336505e4b1c | 322 | #define TC_EVCTRL_EVACT_COUNT (TC_EVCTRL_EVACT_COUNT_Val << TC_EVCTRL_EVACT_Pos) |
Kojto | 111:4336505e4b1c | 323 | #define TC_EVCTRL_EVACT_START (TC_EVCTRL_EVACT_START_Val << TC_EVCTRL_EVACT_Pos) |
Kojto | 111:4336505e4b1c | 324 | #define TC_EVCTRL_EVACT_PPW (TC_EVCTRL_EVACT_PPW_Val << TC_EVCTRL_EVACT_Pos) |
Kojto | 111:4336505e4b1c | 325 | #define TC_EVCTRL_EVACT_PWP (TC_EVCTRL_EVACT_PWP_Val << TC_EVCTRL_EVACT_Pos) |
Kojto | 111:4336505e4b1c | 326 | #define TC_EVCTRL_TCINV_Pos 4 /**< \brief (TC_EVCTRL) TC Inverted Event Input */ |
Kojto | 111:4336505e4b1c | 327 | #define TC_EVCTRL_TCINV (0x1ul << TC_EVCTRL_TCINV_Pos) |
Kojto | 111:4336505e4b1c | 328 | #define TC_EVCTRL_TCEI_Pos 5 /**< \brief (TC_EVCTRL) TC Event Input */ |
Kojto | 111:4336505e4b1c | 329 | #define TC_EVCTRL_TCEI (0x1ul << TC_EVCTRL_TCEI_Pos) |
Kojto | 111:4336505e4b1c | 330 | #define TC_EVCTRL_OVFEO_Pos 8 /**< \brief (TC_EVCTRL) Overflow/Underflow Event Output Enable */ |
Kojto | 111:4336505e4b1c | 331 | #define TC_EVCTRL_OVFEO (0x1ul << TC_EVCTRL_OVFEO_Pos) |
Kojto | 111:4336505e4b1c | 332 | #define TC_EVCTRL_MCEO0_Pos 12 /**< \brief (TC_EVCTRL) Match or Capture Channel 0 Event Output Enable */ |
Kojto | 111:4336505e4b1c | 333 | #define TC_EVCTRL_MCEO0 (1 << TC_EVCTRL_MCEO0_Pos) |
Kojto | 111:4336505e4b1c | 334 | #define TC_EVCTRL_MCEO1_Pos 13 /**< \brief (TC_EVCTRL) Match or Capture Channel 1 Event Output Enable */ |
Kojto | 111:4336505e4b1c | 335 | #define TC_EVCTRL_MCEO1 (1 << TC_EVCTRL_MCEO1_Pos) |
Kojto | 111:4336505e4b1c | 336 | #define TC_EVCTRL_MCEO_Pos 12 /**< \brief (TC_EVCTRL) Match or Capture Channel x Event Output Enable */ |
Kojto | 111:4336505e4b1c | 337 | #define TC_EVCTRL_MCEO_Msk (0x3ul << TC_EVCTRL_MCEO_Pos) |
Kojto | 111:4336505e4b1c | 338 | #define TC_EVCTRL_MCEO(value) ((TC_EVCTRL_MCEO_Msk & ((value) << TC_EVCTRL_MCEO_Pos))) |
Kojto | 111:4336505e4b1c | 339 | #define TC_EVCTRL_MASK 0x3137ul /**< \brief (TC_EVCTRL) MASK Register */ |
Kojto | 111:4336505e4b1c | 340 | |
Kojto | 111:4336505e4b1c | 341 | /* -------- TC_INTENCLR : (TC Offset: 0x0C) (R/W 8) Interrupt Enable Clear -------- */ |
Kojto | 111:4336505e4b1c | 342 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) |
Kojto | 111:4336505e4b1c | 343 | typedef union { |
Kojto | 111:4336505e4b1c | 344 | struct { |
Kojto | 111:4336505e4b1c | 345 | uint8_t OVF:1; /*!< bit: 0 Overflow Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 346 | uint8_t ERR:1; /*!< bit: 1 Error Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 347 | uint8_t :1; /*!< bit: 2 Reserved */ |
Kojto | 111:4336505e4b1c | 348 | uint8_t SYNCRDY:1; /*!< bit: 3 Synchronization Ready Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 349 | uint8_t MC0:1; /*!< bit: 4 Match or Capture Channel 0 Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 350 | uint8_t MC1:1; /*!< bit: 5 Match or Capture Channel 1 Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 351 | uint8_t :2; /*!< bit: 6.. 7 Reserved */ |
Kojto | 111:4336505e4b1c | 352 | } bit; /*!< Structure used for bit access */ |
Kojto | 111:4336505e4b1c | 353 | struct { |
Kojto | 111:4336505e4b1c | 354 | uint8_t :4; /*!< bit: 0.. 3 Reserved */ |
Kojto | 111:4336505e4b1c | 355 | uint8_t MC:2; /*!< bit: 4.. 5 Match or Capture Channel x Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 356 | uint8_t :2; /*!< bit: 6.. 7 Reserved */ |
Kojto | 111:4336505e4b1c | 357 | } vec; /*!< Structure used for vec access */ |
Kojto | 111:4336505e4b1c | 358 | uint8_t reg; /*!< Type used for register access */ |
Kojto | 111:4336505e4b1c | 359 | } TC_INTENCLR_Type; |
Kojto | 111:4336505e4b1c | 360 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ |
Kojto | 111:4336505e4b1c | 361 | |
Kojto | 111:4336505e4b1c | 362 | #define TC_INTENCLR_OFFSET 0x0C /**< \brief (TC_INTENCLR offset) Interrupt Enable Clear */ |
Kojto | 111:4336505e4b1c | 363 | #define TC_INTENCLR_RESETVALUE 0x00ul /**< \brief (TC_INTENCLR reset_value) Interrupt Enable Clear */ |
Kojto | 111:4336505e4b1c | 364 | |
Kojto | 111:4336505e4b1c | 365 | #define TC_INTENCLR_OVF_Pos 0 /**< \brief (TC_INTENCLR) Overflow Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 366 | #define TC_INTENCLR_OVF (0x1ul << TC_INTENCLR_OVF_Pos) |
Kojto | 111:4336505e4b1c | 367 | #define TC_INTENCLR_ERR_Pos 1 /**< \brief (TC_INTENCLR) Error Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 368 | #define TC_INTENCLR_ERR (0x1ul << TC_INTENCLR_ERR_Pos) |
Kojto | 111:4336505e4b1c | 369 | #define TC_INTENCLR_SYNCRDY_Pos 3 /**< \brief (TC_INTENCLR) Synchronization Ready Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 370 | #define TC_INTENCLR_SYNCRDY (0x1ul << TC_INTENCLR_SYNCRDY_Pos) |
Kojto | 111:4336505e4b1c | 371 | #define TC_INTENCLR_MC0_Pos 4 /**< \brief (TC_INTENCLR) Match or Capture Channel 0 Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 372 | #define TC_INTENCLR_MC0 (1 << TC_INTENCLR_MC0_Pos) |
Kojto | 111:4336505e4b1c | 373 | #define TC_INTENCLR_MC1_Pos 5 /**< \brief (TC_INTENCLR) Match or Capture Channel 1 Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 374 | #define TC_INTENCLR_MC1 (1 << TC_INTENCLR_MC1_Pos) |
Kojto | 111:4336505e4b1c | 375 | #define TC_INTENCLR_MC_Pos 4 /**< \brief (TC_INTENCLR) Match or Capture Channel x Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 376 | #define TC_INTENCLR_MC_Msk (0x3ul << TC_INTENCLR_MC_Pos) |
Kojto | 111:4336505e4b1c | 377 | #define TC_INTENCLR_MC(value) ((TC_INTENCLR_MC_Msk & ((value) << TC_INTENCLR_MC_Pos))) |
Kojto | 111:4336505e4b1c | 378 | #define TC_INTENCLR_MASK 0x3Bul /**< \brief (TC_INTENCLR) MASK Register */ |
Kojto | 111:4336505e4b1c | 379 | |
Kojto | 111:4336505e4b1c | 380 | /* -------- TC_INTENSET : (TC Offset: 0x0D) (R/W 8) Interrupt Enable Set -------- */ |
Kojto | 111:4336505e4b1c | 381 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) |
Kojto | 111:4336505e4b1c | 382 | typedef union { |
Kojto | 111:4336505e4b1c | 383 | struct { |
Kojto | 111:4336505e4b1c | 384 | uint8_t OVF:1; /*!< bit: 0 Overflow Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 385 | uint8_t ERR:1; /*!< bit: 1 Error Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 386 | uint8_t :1; /*!< bit: 2 Reserved */ |
Kojto | 111:4336505e4b1c | 387 | uint8_t SYNCRDY:1; /*!< bit: 3 Synchronization Ready Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 388 | uint8_t MC0:1; /*!< bit: 4 Match or Capture Channel 0 Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 389 | uint8_t MC1:1; /*!< bit: 5 Match or Capture Channel 1 Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 390 | uint8_t :2; /*!< bit: 6.. 7 Reserved */ |
Kojto | 111:4336505e4b1c | 391 | } bit; /*!< Structure used for bit access */ |
Kojto | 111:4336505e4b1c | 392 | struct { |
Kojto | 111:4336505e4b1c | 393 | uint8_t :4; /*!< bit: 0.. 3 Reserved */ |
Kojto | 111:4336505e4b1c | 394 | uint8_t MC:2; /*!< bit: 4.. 5 Match or Capture Channel x Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 395 | uint8_t :2; /*!< bit: 6.. 7 Reserved */ |
Kojto | 111:4336505e4b1c | 396 | } vec; /*!< Structure used for vec access */ |
Kojto | 111:4336505e4b1c | 397 | uint8_t reg; /*!< Type used for register access */ |
Kojto | 111:4336505e4b1c | 398 | } TC_INTENSET_Type; |
Kojto | 111:4336505e4b1c | 399 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ |
Kojto | 111:4336505e4b1c | 400 | |
Kojto | 111:4336505e4b1c | 401 | #define TC_INTENSET_OFFSET 0x0D /**< \brief (TC_INTENSET offset) Interrupt Enable Set */ |
Kojto | 111:4336505e4b1c | 402 | #define TC_INTENSET_RESETVALUE 0x00ul /**< \brief (TC_INTENSET reset_value) Interrupt Enable Set */ |
Kojto | 111:4336505e4b1c | 403 | |
Kojto | 111:4336505e4b1c | 404 | #define TC_INTENSET_OVF_Pos 0 /**< \brief (TC_INTENSET) Overflow Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 405 | #define TC_INTENSET_OVF (0x1ul << TC_INTENSET_OVF_Pos) |
Kojto | 111:4336505e4b1c | 406 | #define TC_INTENSET_ERR_Pos 1 /**< \brief (TC_INTENSET) Error Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 407 | #define TC_INTENSET_ERR (0x1ul << TC_INTENSET_ERR_Pos) |
Kojto | 111:4336505e4b1c | 408 | #define TC_INTENSET_SYNCRDY_Pos 3 /**< \brief (TC_INTENSET) Synchronization Ready Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 409 | #define TC_INTENSET_SYNCRDY (0x1ul << TC_INTENSET_SYNCRDY_Pos) |
Kojto | 111:4336505e4b1c | 410 | #define TC_INTENSET_MC0_Pos 4 /**< \brief (TC_INTENSET) Match or Capture Channel 0 Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 411 | #define TC_INTENSET_MC0 (1 << TC_INTENSET_MC0_Pos) |
Kojto | 111:4336505e4b1c | 412 | #define TC_INTENSET_MC1_Pos 5 /**< \brief (TC_INTENSET) Match or Capture Channel 1 Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 413 | #define TC_INTENSET_MC1 (1 << TC_INTENSET_MC1_Pos) |
Kojto | 111:4336505e4b1c | 414 | #define TC_INTENSET_MC_Pos 4 /**< \brief (TC_INTENSET) Match or Capture Channel x Interrupt Enable */ |
Kojto | 111:4336505e4b1c | 415 | #define TC_INTENSET_MC_Msk (0x3ul << TC_INTENSET_MC_Pos) |
Kojto | 111:4336505e4b1c | 416 | #define TC_INTENSET_MC(value) ((TC_INTENSET_MC_Msk & ((value) << TC_INTENSET_MC_Pos))) |
Kojto | 111:4336505e4b1c | 417 | #define TC_INTENSET_MASK 0x3Bul /**< \brief (TC_INTENSET) MASK Register */ |
Kojto | 111:4336505e4b1c | 418 | |
Kojto | 111:4336505e4b1c | 419 | /* -------- TC_INTFLAG : (TC Offset: 0x0E) (R/W 8) Interrupt Flag Status and Clear -------- */ |
Kojto | 111:4336505e4b1c | 420 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) |
Kojto | 111:4336505e4b1c | 421 | typedef union { |
Kojto | 111:4336505e4b1c | 422 | struct { |
Kojto | 111:4336505e4b1c | 423 | uint8_t OVF:1; /*!< bit: 0 Overflow */ |
Kojto | 111:4336505e4b1c | 424 | uint8_t ERR:1; /*!< bit: 1 Error */ |
Kojto | 111:4336505e4b1c | 425 | uint8_t :1; /*!< bit: 2 Reserved */ |
Kojto | 111:4336505e4b1c | 426 | uint8_t SYNCRDY:1; /*!< bit: 3 Synchronization Ready */ |
Kojto | 111:4336505e4b1c | 427 | uint8_t MC0:1; /*!< bit: 4 Match or Capture Channel 0 */ |
Kojto | 111:4336505e4b1c | 428 | uint8_t MC1:1; /*!< bit: 5 Match or Capture Channel 1 */ |
Kojto | 111:4336505e4b1c | 429 | uint8_t :2; /*!< bit: 6.. 7 Reserved */ |
Kojto | 111:4336505e4b1c | 430 | } bit; /*!< Structure used for bit access */ |
Kojto | 111:4336505e4b1c | 431 | struct { |
Kojto | 111:4336505e4b1c | 432 | uint8_t :4; /*!< bit: 0.. 3 Reserved */ |
Kojto | 111:4336505e4b1c | 433 | uint8_t MC:2; /*!< bit: 4.. 5 Match or Capture Channel x */ |
Kojto | 111:4336505e4b1c | 434 | uint8_t :2; /*!< bit: 6.. 7 Reserved */ |
Kojto | 111:4336505e4b1c | 435 | } vec; /*!< Structure used for vec access */ |
Kojto | 111:4336505e4b1c | 436 | uint8_t reg; /*!< Type used for register access */ |
Kojto | 111:4336505e4b1c | 437 | } TC_INTFLAG_Type; |
Kojto | 111:4336505e4b1c | 438 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ |
Kojto | 111:4336505e4b1c | 439 | |
Kojto | 111:4336505e4b1c | 440 | #define TC_INTFLAG_OFFSET 0x0E /**< \brief (TC_INTFLAG offset) Interrupt Flag Status and Clear */ |
Kojto | 111:4336505e4b1c | 441 | #define TC_INTFLAG_RESETVALUE 0x00ul /**< \brief (TC_INTFLAG reset_value) Interrupt Flag Status and Clear */ |
Kojto | 111:4336505e4b1c | 442 | |
Kojto | 111:4336505e4b1c | 443 | #define TC_INTFLAG_OVF_Pos 0 /**< \brief (TC_INTFLAG) Overflow */ |
Kojto | 111:4336505e4b1c | 444 | #define TC_INTFLAG_OVF (0x1ul << TC_INTFLAG_OVF_Pos) |
Kojto | 111:4336505e4b1c | 445 | #define TC_INTFLAG_ERR_Pos 1 /**< \brief (TC_INTFLAG) Error */ |
Kojto | 111:4336505e4b1c | 446 | #define TC_INTFLAG_ERR (0x1ul << TC_INTFLAG_ERR_Pos) |
Kojto | 111:4336505e4b1c | 447 | #define TC_INTFLAG_SYNCRDY_Pos 3 /**< \brief (TC_INTFLAG) Synchronization Ready */ |
Kojto | 111:4336505e4b1c | 448 | #define TC_INTFLAG_SYNCRDY (0x1ul << TC_INTFLAG_SYNCRDY_Pos) |
Kojto | 111:4336505e4b1c | 449 | #define TC_INTFLAG_MC0_Pos 4 /**< \brief (TC_INTFLAG) Match or Capture Channel 0 */ |
Kojto | 111:4336505e4b1c | 450 | #define TC_INTFLAG_MC0 (1 << TC_INTFLAG_MC0_Pos) |
Kojto | 111:4336505e4b1c | 451 | #define TC_INTFLAG_MC1_Pos 5 /**< \brief (TC_INTFLAG) Match or Capture Channel 1 */ |
Kojto | 111:4336505e4b1c | 452 | #define TC_INTFLAG_MC1 (1 << TC_INTFLAG_MC1_Pos) |
Kojto | 111:4336505e4b1c | 453 | #define TC_INTFLAG_MC_Pos 4 /**< \brief (TC_INTFLAG) Match or Capture Channel x */ |
Kojto | 111:4336505e4b1c | 454 | #define TC_INTFLAG_MC_Msk (0x3ul << TC_INTFLAG_MC_Pos) |
Kojto | 111:4336505e4b1c | 455 | #define TC_INTFLAG_MC(value) ((TC_INTFLAG_MC_Msk & ((value) << TC_INTFLAG_MC_Pos))) |
Kojto | 111:4336505e4b1c | 456 | #define TC_INTFLAG_MASK 0x3Bul /**< \brief (TC_INTFLAG) MASK Register */ |
Kojto | 111:4336505e4b1c | 457 | |
Kojto | 111:4336505e4b1c | 458 | /* -------- TC_STATUS : (TC Offset: 0x0F) (R/ 8) Status -------- */ |
Kojto | 111:4336505e4b1c | 459 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) |
Kojto | 111:4336505e4b1c | 460 | typedef union { |
Kojto | 111:4336505e4b1c | 461 | struct { |
Kojto | 111:4336505e4b1c | 462 | uint8_t :3; /*!< bit: 0.. 2 Reserved */ |
Kojto | 111:4336505e4b1c | 463 | uint8_t STOP:1; /*!< bit: 3 Stop */ |
Kojto | 111:4336505e4b1c | 464 | uint8_t SLAVE:1; /*!< bit: 4 Slave */ |
Kojto | 111:4336505e4b1c | 465 | uint8_t :2; /*!< bit: 5.. 6 Reserved */ |
Kojto | 111:4336505e4b1c | 466 | uint8_t SYNCBUSY:1; /*!< bit: 7 Synchronization Busy */ |
Kojto | 111:4336505e4b1c | 467 | } bit; /*!< Structure used for bit access */ |
Kojto | 111:4336505e4b1c | 468 | uint8_t reg; /*!< Type used for register access */ |
Kojto | 111:4336505e4b1c | 469 | } TC_STATUS_Type; |
Kojto | 111:4336505e4b1c | 470 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ |
Kojto | 111:4336505e4b1c | 471 | |
Kojto | 111:4336505e4b1c | 472 | #define TC_STATUS_OFFSET 0x0F /**< \brief (TC_STATUS offset) Status */ |
Kojto | 111:4336505e4b1c | 473 | #define TC_STATUS_RESETVALUE 0x08ul /**< \brief (TC_STATUS reset_value) Status */ |
Kojto | 111:4336505e4b1c | 474 | |
Kojto | 111:4336505e4b1c | 475 | #define TC_STATUS_STOP_Pos 3 /**< \brief (TC_STATUS) Stop */ |
Kojto | 111:4336505e4b1c | 476 | #define TC_STATUS_STOP (0x1ul << TC_STATUS_STOP_Pos) |
Kojto | 111:4336505e4b1c | 477 | #define TC_STATUS_SLAVE_Pos 4 /**< \brief (TC_STATUS) Slave */ |
Kojto | 111:4336505e4b1c | 478 | #define TC_STATUS_SLAVE (0x1ul << TC_STATUS_SLAVE_Pos) |
Kojto | 111:4336505e4b1c | 479 | #define TC_STATUS_SYNCBUSY_Pos 7 /**< \brief (TC_STATUS) Synchronization Busy */ |
Kojto | 111:4336505e4b1c | 480 | #define TC_STATUS_SYNCBUSY (0x1ul << TC_STATUS_SYNCBUSY_Pos) |
Kojto | 111:4336505e4b1c | 481 | #define TC_STATUS_MASK 0x98ul /**< \brief (TC_STATUS) MASK Register */ |
Kojto | 111:4336505e4b1c | 482 | |
Kojto | 111:4336505e4b1c | 483 | /* -------- TC_COUNT16_COUNT : (TC Offset: 0x10) (R/W 16) COUNT16 COUNT16 Counter Value -------- */ |
Kojto | 111:4336505e4b1c | 484 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) |
Kojto | 111:4336505e4b1c | 485 | typedef union { |
Kojto | 111:4336505e4b1c | 486 | struct { |
Kojto | 111:4336505e4b1c | 487 | uint16_t COUNT:16; /*!< bit: 0..15 Count Value */ |
Kojto | 111:4336505e4b1c | 488 | } bit; /*!< Structure used for bit access */ |
Kojto | 111:4336505e4b1c | 489 | uint16_t reg; /*!< Type used for register access */ |
Kojto | 111:4336505e4b1c | 490 | } TC_COUNT16_COUNT_Type; |
Kojto | 111:4336505e4b1c | 491 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ |
Kojto | 111:4336505e4b1c | 492 | |
Kojto | 111:4336505e4b1c | 493 | #define TC_COUNT16_COUNT_OFFSET 0x10 /**< \brief (TC_COUNT16_COUNT offset) COUNT16 Counter Value */ |
Kojto | 111:4336505e4b1c | 494 | #define TC_COUNT16_COUNT_RESETVALUE 0x0000ul /**< \brief (TC_COUNT16_COUNT reset_value) COUNT16 Counter Value */ |
Kojto | 111:4336505e4b1c | 495 | |
Kojto | 111:4336505e4b1c | 496 | #define TC_COUNT16_COUNT_COUNT_Pos 0 /**< \brief (TC_COUNT16_COUNT) Count Value */ |
Kojto | 111:4336505e4b1c | 497 | #define TC_COUNT16_COUNT_COUNT_Msk (0xFFFFul << TC_COUNT16_COUNT_COUNT_Pos) |
Kojto | 111:4336505e4b1c | 498 | #define TC_COUNT16_COUNT_COUNT(value) ((TC_COUNT16_COUNT_COUNT_Msk & ((value) << TC_COUNT16_COUNT_COUNT_Pos))) |
Kojto | 111:4336505e4b1c | 499 | #define TC_COUNT16_COUNT_MASK 0xFFFFul /**< \brief (TC_COUNT16_COUNT) MASK Register */ |
Kojto | 111:4336505e4b1c | 500 | |
Kojto | 111:4336505e4b1c | 501 | /* -------- TC_COUNT32_COUNT : (TC Offset: 0x10) (R/W 32) COUNT32 COUNT32 Counter Value -------- */ |
Kojto | 111:4336505e4b1c | 502 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) |
Kojto | 111:4336505e4b1c | 503 | typedef union { |
Kojto | 111:4336505e4b1c | 504 | struct { |
Kojto | 111:4336505e4b1c | 505 | uint32_t COUNT:32; /*!< bit: 0..31 Count Value */ |
Kojto | 111:4336505e4b1c | 506 | } bit; /*!< Structure used for bit access */ |
Kojto | 111:4336505e4b1c | 507 | uint32_t reg; /*!< Type used for register access */ |
Kojto | 111:4336505e4b1c | 508 | } TC_COUNT32_COUNT_Type; |
Kojto | 111:4336505e4b1c | 509 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ |
Kojto | 111:4336505e4b1c | 510 | |
Kojto | 111:4336505e4b1c | 511 | #define TC_COUNT32_COUNT_OFFSET 0x10 /**< \brief (TC_COUNT32_COUNT offset) COUNT32 Counter Value */ |
Kojto | 111:4336505e4b1c | 512 | #define TC_COUNT32_COUNT_RESETVALUE 0x00000000ul /**< \brief (TC_COUNT32_COUNT reset_value) COUNT32 Counter Value */ |
Kojto | 111:4336505e4b1c | 513 | |
Kojto | 111:4336505e4b1c | 514 | #define TC_COUNT32_COUNT_COUNT_Pos 0 /**< \brief (TC_COUNT32_COUNT) Count Value */ |
Kojto | 111:4336505e4b1c | 515 | #define TC_COUNT32_COUNT_COUNT_Msk (0xFFFFFFFFul << TC_COUNT32_COUNT_COUNT_Pos) |
Kojto | 111:4336505e4b1c | 516 | #define TC_COUNT32_COUNT_COUNT(value) ((TC_COUNT32_COUNT_COUNT_Msk & ((value) << TC_COUNT32_COUNT_COUNT_Pos))) |
Kojto | 111:4336505e4b1c | 517 | #define TC_COUNT32_COUNT_MASK 0xFFFFFFFFul /**< \brief (TC_COUNT32_COUNT) MASK Register */ |
Kojto | 111:4336505e4b1c | 518 | |
Kojto | 111:4336505e4b1c | 519 | /* -------- TC_COUNT8_COUNT : (TC Offset: 0x10) (R/W 8) COUNT8 COUNT8 Counter Value -------- */ |
Kojto | 111:4336505e4b1c | 520 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) |
Kojto | 111:4336505e4b1c | 521 | typedef union { |
Kojto | 111:4336505e4b1c | 522 | struct { |
Kojto | 111:4336505e4b1c | 523 | uint8_t COUNT:8; /*!< bit: 0.. 7 Counter Value */ |
Kojto | 111:4336505e4b1c | 524 | } bit; /*!< Structure used for bit access */ |
Kojto | 111:4336505e4b1c | 525 | uint8_t reg; /*!< Type used for register access */ |
Kojto | 111:4336505e4b1c | 526 | } TC_COUNT8_COUNT_Type; |
Kojto | 111:4336505e4b1c | 527 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ |
Kojto | 111:4336505e4b1c | 528 | |
Kojto | 111:4336505e4b1c | 529 | #define TC_COUNT8_COUNT_OFFSET 0x10 /**< \brief (TC_COUNT8_COUNT offset) COUNT8 Counter Value */ |
Kojto | 111:4336505e4b1c | 530 | #define TC_COUNT8_COUNT_RESETVALUE 0x00ul /**< \brief (TC_COUNT8_COUNT reset_value) COUNT8 Counter Value */ |
Kojto | 111:4336505e4b1c | 531 | |
Kojto | 111:4336505e4b1c | 532 | #define TC_COUNT8_COUNT_COUNT_Pos 0 /**< \brief (TC_COUNT8_COUNT) Counter Value */ |
Kojto | 111:4336505e4b1c | 533 | #define TC_COUNT8_COUNT_COUNT_Msk (0xFFul << TC_COUNT8_COUNT_COUNT_Pos) |
Kojto | 111:4336505e4b1c | 534 | #define TC_COUNT8_COUNT_COUNT(value) ((TC_COUNT8_COUNT_COUNT_Msk & ((value) << TC_COUNT8_COUNT_COUNT_Pos))) |
Kojto | 111:4336505e4b1c | 535 | #define TC_COUNT8_COUNT_MASK 0xFFul /**< \brief (TC_COUNT8_COUNT) MASK Register */ |
Kojto | 111:4336505e4b1c | 536 | |
Kojto | 111:4336505e4b1c | 537 | /* -------- TC_COUNT8_PER : (TC Offset: 0x14) (R/W 8) COUNT8 COUNT8 Period Value -------- */ |
Kojto | 111:4336505e4b1c | 538 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) |
Kojto | 111:4336505e4b1c | 539 | typedef union { |
Kojto | 111:4336505e4b1c | 540 | struct { |
Kojto | 111:4336505e4b1c | 541 | uint8_t PER:8; /*!< bit: 0.. 7 Period Value */ |
Kojto | 111:4336505e4b1c | 542 | } bit; /*!< Structure used for bit access */ |
Kojto | 111:4336505e4b1c | 543 | uint8_t reg; /*!< Type used for register access */ |
Kojto | 111:4336505e4b1c | 544 | } TC_COUNT8_PER_Type; |
Kojto | 111:4336505e4b1c | 545 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ |
Kojto | 111:4336505e4b1c | 546 | |
Kojto | 111:4336505e4b1c | 547 | #define TC_COUNT8_PER_OFFSET 0x14 /**< \brief (TC_COUNT8_PER offset) COUNT8 Period Value */ |
Kojto | 111:4336505e4b1c | 548 | #define TC_COUNT8_PER_RESETVALUE 0xFFul /**< \brief (TC_COUNT8_PER reset_value) COUNT8 Period Value */ |
Kojto | 111:4336505e4b1c | 549 | |
Kojto | 111:4336505e4b1c | 550 | #define TC_COUNT8_PER_PER_Pos 0 /**< \brief (TC_COUNT8_PER) Period Value */ |
Kojto | 111:4336505e4b1c | 551 | #define TC_COUNT8_PER_PER_Msk (0xFFul << TC_COUNT8_PER_PER_Pos) |
Kojto | 111:4336505e4b1c | 552 | #define TC_COUNT8_PER_PER(value) ((TC_COUNT8_PER_PER_Msk & ((value) << TC_COUNT8_PER_PER_Pos))) |
Kojto | 111:4336505e4b1c | 553 | #define TC_COUNT8_PER_MASK 0xFFul /**< \brief (TC_COUNT8_PER) MASK Register */ |
Kojto | 111:4336505e4b1c | 554 | |
Kojto | 111:4336505e4b1c | 555 | /* -------- TC_COUNT16_CC : (TC Offset: 0x18) (R/W 16) COUNT16 COUNT16 Compare/Capture -------- */ |
Kojto | 111:4336505e4b1c | 556 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) |
Kojto | 111:4336505e4b1c | 557 | typedef union { |
Kojto | 111:4336505e4b1c | 558 | struct { |
Kojto | 111:4336505e4b1c | 559 | uint16_t CC:16; /*!< bit: 0..15 Compare/Capture Value */ |
Kojto | 111:4336505e4b1c | 560 | } bit; /*!< Structure used for bit access */ |
Kojto | 111:4336505e4b1c | 561 | uint16_t reg; /*!< Type used for register access */ |
Kojto | 111:4336505e4b1c | 562 | } TC_COUNT16_CC_Type; |
Kojto | 111:4336505e4b1c | 563 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ |
Kojto | 111:4336505e4b1c | 564 | |
Kojto | 111:4336505e4b1c | 565 | #define TC_COUNT16_CC_OFFSET 0x18 /**< \brief (TC_COUNT16_CC offset) COUNT16 Compare/Capture */ |
Kojto | 111:4336505e4b1c | 566 | #define TC_COUNT16_CC_RESETVALUE 0x0000ul /**< \brief (TC_COUNT16_CC reset_value) COUNT16 Compare/Capture */ |
Kojto | 111:4336505e4b1c | 567 | |
Kojto | 111:4336505e4b1c | 568 | #define TC_COUNT16_CC_CC_Pos 0 /**< \brief (TC_COUNT16_CC) Compare/Capture Value */ |
Kojto | 111:4336505e4b1c | 569 | #define TC_COUNT16_CC_CC_Msk (0xFFFFul << TC_COUNT16_CC_CC_Pos) |
Kojto | 111:4336505e4b1c | 570 | #define TC_COUNT16_CC_CC(value) ((TC_COUNT16_CC_CC_Msk & ((value) << TC_COUNT16_CC_CC_Pos))) |
Kojto | 111:4336505e4b1c | 571 | #define TC_COUNT16_CC_MASK 0xFFFFul /**< \brief (TC_COUNT16_CC) MASK Register */ |
Kojto | 111:4336505e4b1c | 572 | |
Kojto | 111:4336505e4b1c | 573 | /* -------- TC_COUNT32_CC : (TC Offset: 0x18) (R/W 32) COUNT32 COUNT32 Compare/Capture -------- */ |
Kojto | 111:4336505e4b1c | 574 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) |
Kojto | 111:4336505e4b1c | 575 | typedef union { |
Kojto | 111:4336505e4b1c | 576 | struct { |
Kojto | 111:4336505e4b1c | 577 | uint32_t CC:32; /*!< bit: 0..31 Compare/Capture Value */ |
Kojto | 111:4336505e4b1c | 578 | } bit; /*!< Structure used for bit access */ |
Kojto | 111:4336505e4b1c | 579 | uint32_t reg; /*!< Type used for register access */ |
Kojto | 111:4336505e4b1c | 580 | } TC_COUNT32_CC_Type; |
Kojto | 111:4336505e4b1c | 581 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ |
Kojto | 111:4336505e4b1c | 582 | |
Kojto | 111:4336505e4b1c | 583 | #define TC_COUNT32_CC_OFFSET 0x18 /**< \brief (TC_COUNT32_CC offset) COUNT32 Compare/Capture */ |
Kojto | 111:4336505e4b1c | 584 | #define TC_COUNT32_CC_RESETVALUE 0x00000000ul /**< \brief (TC_COUNT32_CC reset_value) COUNT32 Compare/Capture */ |
Kojto | 111:4336505e4b1c | 585 | |
Kojto | 111:4336505e4b1c | 586 | #define TC_COUNT32_CC_CC_Pos 0 /**< \brief (TC_COUNT32_CC) Compare/Capture Value */ |
Kojto | 111:4336505e4b1c | 587 | #define TC_COUNT32_CC_CC_Msk (0xFFFFFFFFul << TC_COUNT32_CC_CC_Pos) |
Kojto | 111:4336505e4b1c | 588 | #define TC_COUNT32_CC_CC(value) ((TC_COUNT32_CC_CC_Msk & ((value) << TC_COUNT32_CC_CC_Pos))) |
Kojto | 111:4336505e4b1c | 589 | #define TC_COUNT32_CC_MASK 0xFFFFFFFFul /**< \brief (TC_COUNT32_CC) MASK Register */ |
Kojto | 111:4336505e4b1c | 590 | |
Kojto | 111:4336505e4b1c | 591 | /* -------- TC_COUNT8_CC : (TC Offset: 0x18) (R/W 8) COUNT8 COUNT8 Compare/Capture -------- */ |
Kojto | 111:4336505e4b1c | 592 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) |
Kojto | 111:4336505e4b1c | 593 | typedef union { |
Kojto | 111:4336505e4b1c | 594 | struct { |
Kojto | 111:4336505e4b1c | 595 | uint8_t CC:8; /*!< bit: 0.. 7 Compare/Capture Value */ |
Kojto | 111:4336505e4b1c | 596 | } bit; /*!< Structure used for bit access */ |
Kojto | 111:4336505e4b1c | 597 | uint8_t reg; /*!< Type used for register access */ |
Kojto | 111:4336505e4b1c | 598 | } TC_COUNT8_CC_Type; |
Kojto | 111:4336505e4b1c | 599 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ |
Kojto | 111:4336505e4b1c | 600 | |
Kojto | 111:4336505e4b1c | 601 | #define TC_COUNT8_CC_OFFSET 0x18 /**< \brief (TC_COUNT8_CC offset) COUNT8 Compare/Capture */ |
Kojto | 111:4336505e4b1c | 602 | #define TC_COUNT8_CC_RESETVALUE 0x00ul /**< \brief (TC_COUNT8_CC reset_value) COUNT8 Compare/Capture */ |
Kojto | 111:4336505e4b1c | 603 | |
Kojto | 111:4336505e4b1c | 604 | #define TC_COUNT8_CC_CC_Pos 0 /**< \brief (TC_COUNT8_CC) Compare/Capture Value */ |
Kojto | 111:4336505e4b1c | 605 | #define TC_COUNT8_CC_CC_Msk (0xFFul << TC_COUNT8_CC_CC_Pos) |
Kojto | 111:4336505e4b1c | 606 | #define TC_COUNT8_CC_CC(value) ((TC_COUNT8_CC_CC_Msk & ((value) << TC_COUNT8_CC_CC_Pos))) |
Kojto | 111:4336505e4b1c | 607 | #define TC_COUNT8_CC_MASK 0xFFul /**< \brief (TC_COUNT8_CC) MASK Register */ |
Kojto | 111:4336505e4b1c | 608 | |
Kojto | 111:4336505e4b1c | 609 | /** \brief TC_COUNT8 hardware registers */ |
Kojto | 111:4336505e4b1c | 610 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) |
Kojto | 111:4336505e4b1c | 611 | typedef struct { /* 8-bit Counter Mode */ |
Kojto | 111:4336505e4b1c | 612 | __IO TC_CTRLA_Type CTRLA; /**< \brief Offset: 0x00 (R/W 16) Control A */ |
Kojto | 111:4336505e4b1c | 613 | __IO TC_READREQ_Type READREQ; /**< \brief Offset: 0x02 (R/W 16) Read Request */ |
Kojto | 111:4336505e4b1c | 614 | __IO TC_CTRLBCLR_Type CTRLBCLR; /**< \brief Offset: 0x04 (R/W 8) Control B Clear */ |
Kojto | 111:4336505e4b1c | 615 | __IO TC_CTRLBSET_Type CTRLBSET; /**< \brief Offset: 0x05 (R/W 8) Control B Set */ |
Kojto | 111:4336505e4b1c | 616 | __IO TC_CTRLC_Type CTRLC; /**< \brief Offset: 0x06 (R/W 8) Control C */ |
Kojto | 111:4336505e4b1c | 617 | RoReg8 Reserved1[0x1]; |
Kojto | 111:4336505e4b1c | 618 | __IO TC_DBGCTRL_Type DBGCTRL; /**< \brief Offset: 0x08 (R/W 8) Debug Control */ |
Kojto | 111:4336505e4b1c | 619 | RoReg8 Reserved2[0x1]; |
Kojto | 111:4336505e4b1c | 620 | __IO TC_EVCTRL_Type EVCTRL; /**< \brief Offset: 0x0A (R/W 16) Event Control */ |
Kojto | 111:4336505e4b1c | 621 | __IO TC_INTENCLR_Type INTENCLR; /**< \brief Offset: 0x0C (R/W 8) Interrupt Enable Clear */ |
Kojto | 111:4336505e4b1c | 622 | __IO TC_INTENSET_Type INTENSET; /**< \brief Offset: 0x0D (R/W 8) Interrupt Enable Set */ |
Kojto | 111:4336505e4b1c | 623 | __IO TC_INTFLAG_Type INTFLAG; /**< \brief Offset: 0x0E (R/W 8) Interrupt Flag Status and Clear */ |
Kojto | 111:4336505e4b1c | 624 | __I TC_STATUS_Type STATUS; /**< \brief Offset: 0x0F (R/ 8) Status */ |
Kojto | 111:4336505e4b1c | 625 | __IO TC_COUNT8_COUNT_Type COUNT; /**< \brief Offset: 0x10 (R/W 8) COUNT8 Counter Value */ |
Kojto | 111:4336505e4b1c | 626 | RoReg8 Reserved3[0x3]; |
Kojto | 111:4336505e4b1c | 627 | __IO TC_COUNT8_PER_Type PER; /**< \brief Offset: 0x14 (R/W 8) COUNT8 Period Value */ |
Kojto | 111:4336505e4b1c | 628 | RoReg8 Reserved4[0x3]; |
Kojto | 111:4336505e4b1c | 629 | __IO TC_COUNT8_CC_Type CC[2]; /**< \brief Offset: 0x18 (R/W 8) COUNT8 Compare/Capture */ |
Kojto | 111:4336505e4b1c | 630 | } TcCount8; |
Kojto | 111:4336505e4b1c | 631 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ |
Kojto | 111:4336505e4b1c | 632 | |
Kojto | 111:4336505e4b1c | 633 | /** \brief TC_COUNT16 hardware registers */ |
Kojto | 111:4336505e4b1c | 634 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) |
Kojto | 111:4336505e4b1c | 635 | typedef struct { /* 16-bit Counter Mode */ |
Kojto | 111:4336505e4b1c | 636 | __IO TC_CTRLA_Type CTRLA; /**< \brief Offset: 0x00 (R/W 16) Control A */ |
Kojto | 111:4336505e4b1c | 637 | __IO TC_READREQ_Type READREQ; /**< \brief Offset: 0x02 (R/W 16) Read Request */ |
Kojto | 111:4336505e4b1c | 638 | __IO TC_CTRLBCLR_Type CTRLBCLR; /**< \brief Offset: 0x04 (R/W 8) Control B Clear */ |
Kojto | 111:4336505e4b1c | 639 | __IO TC_CTRLBSET_Type CTRLBSET; /**< \brief Offset: 0x05 (R/W 8) Control B Set */ |
Kojto | 111:4336505e4b1c | 640 | __IO TC_CTRLC_Type CTRLC; /**< \brief Offset: 0x06 (R/W 8) Control C */ |
Kojto | 111:4336505e4b1c | 641 | RoReg8 Reserved1[0x1]; |
Kojto | 111:4336505e4b1c | 642 | __IO TC_DBGCTRL_Type DBGCTRL; /**< \brief Offset: 0x08 (R/W 8) Debug Control */ |
Kojto | 111:4336505e4b1c | 643 | RoReg8 Reserved2[0x1]; |
Kojto | 111:4336505e4b1c | 644 | __IO TC_EVCTRL_Type EVCTRL; /**< \brief Offset: 0x0A (R/W 16) Event Control */ |
Kojto | 111:4336505e4b1c | 645 | __IO TC_INTENCLR_Type INTENCLR; /**< \brief Offset: 0x0C (R/W 8) Interrupt Enable Clear */ |
Kojto | 111:4336505e4b1c | 646 | __IO TC_INTENSET_Type INTENSET; /**< \brief Offset: 0x0D (R/W 8) Interrupt Enable Set */ |
Kojto | 111:4336505e4b1c | 647 | __IO TC_INTFLAG_Type INTFLAG; /**< \brief Offset: 0x0E (R/W 8) Interrupt Flag Status and Clear */ |
Kojto | 111:4336505e4b1c | 648 | __I TC_STATUS_Type STATUS; /**< \brief Offset: 0x0F (R/ 8) Status */ |
Kojto | 111:4336505e4b1c | 649 | __IO TC_COUNT16_COUNT_Type COUNT; /**< \brief Offset: 0x10 (R/W 16) COUNT16 Counter Value */ |
Kojto | 111:4336505e4b1c | 650 | RoReg8 Reserved3[0x6]; |
Kojto | 111:4336505e4b1c | 651 | __IO TC_COUNT16_CC_Type CC[2]; /**< \brief Offset: 0x18 (R/W 16) COUNT16 Compare/Capture */ |
Kojto | 111:4336505e4b1c | 652 | } TcCount16; |
Kojto | 111:4336505e4b1c | 653 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ |
Kojto | 111:4336505e4b1c | 654 | |
Kojto | 111:4336505e4b1c | 655 | /** \brief TC_COUNT32 hardware registers */ |
Kojto | 111:4336505e4b1c | 656 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) |
Kojto | 111:4336505e4b1c | 657 | typedef struct { /* 32-bit Counter Mode */ |
Kojto | 111:4336505e4b1c | 658 | __IO TC_CTRLA_Type CTRLA; /**< \brief Offset: 0x00 (R/W 16) Control A */ |
Kojto | 111:4336505e4b1c | 659 | __IO TC_READREQ_Type READREQ; /**< \brief Offset: 0x02 (R/W 16) Read Request */ |
Kojto | 111:4336505e4b1c | 660 | __IO TC_CTRLBCLR_Type CTRLBCLR; /**< \brief Offset: 0x04 (R/W 8) Control B Clear */ |
Kojto | 111:4336505e4b1c | 661 | __IO TC_CTRLBSET_Type CTRLBSET; /**< \brief Offset: 0x05 (R/W 8) Control B Set */ |
Kojto | 111:4336505e4b1c | 662 | __IO TC_CTRLC_Type CTRLC; /**< \brief Offset: 0x06 (R/W 8) Control C */ |
Kojto | 111:4336505e4b1c | 663 | RoReg8 Reserved1[0x1]; |
Kojto | 111:4336505e4b1c | 664 | __IO TC_DBGCTRL_Type DBGCTRL; /**< \brief Offset: 0x08 (R/W 8) Debug Control */ |
Kojto | 111:4336505e4b1c | 665 | RoReg8 Reserved2[0x1]; |
Kojto | 111:4336505e4b1c | 666 | __IO TC_EVCTRL_Type EVCTRL; /**< \brief Offset: 0x0A (R/W 16) Event Control */ |
Kojto | 111:4336505e4b1c | 667 | __IO TC_INTENCLR_Type INTENCLR; /**< \brief Offset: 0x0C (R/W 8) Interrupt Enable Clear */ |
Kojto | 111:4336505e4b1c | 668 | __IO TC_INTENSET_Type INTENSET; /**< \brief Offset: 0x0D (R/W 8) Interrupt Enable Set */ |
Kojto | 111:4336505e4b1c | 669 | __IO TC_INTFLAG_Type INTFLAG; /**< \brief Offset: 0x0E (R/W 8) Interrupt Flag Status and Clear */ |
Kojto | 111:4336505e4b1c | 670 | __I TC_STATUS_Type STATUS; /**< \brief Offset: 0x0F (R/ 8) Status */ |
Kojto | 111:4336505e4b1c | 671 | __IO TC_COUNT32_COUNT_Type COUNT; /**< \brief Offset: 0x10 (R/W 32) COUNT32 Counter Value */ |
Kojto | 111:4336505e4b1c | 672 | RoReg8 Reserved3[0x4]; |
Kojto | 111:4336505e4b1c | 673 | __IO TC_COUNT32_CC_Type CC[2]; /**< \brief Offset: 0x18 (R/W 32) COUNT32 Compare/Capture */ |
Kojto | 111:4336505e4b1c | 674 | } TcCount32; |
Kojto | 111:4336505e4b1c | 675 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ |
Kojto | 111:4336505e4b1c | 676 | |
Kojto | 111:4336505e4b1c | 677 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) |
Kojto | 111:4336505e4b1c | 678 | typedef union { |
Kojto | 111:4336505e4b1c | 679 | TcCount8 COUNT8; /**< \brief Offset: 0x00 8-bit Counter Mode */ |
Kojto | 111:4336505e4b1c | 680 | TcCount16 COUNT16; /**< \brief Offset: 0x00 16-bit Counter Mode */ |
Kojto | 111:4336505e4b1c | 681 | TcCount32 COUNT32; /**< \brief Offset: 0x00 32-bit Counter Mode */ |
Kojto | 111:4336505e4b1c | 682 | } Tc; |
Kojto | 111:4336505e4b1c | 683 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ |
Kojto | 111:4336505e4b1c | 684 | |
Kojto | 111:4336505e4b1c | 685 | /*@}*/ |
Kojto | 111:4336505e4b1c | 686 | |
Kojto | 111:4336505e4b1c | 687 | #endif /* _SAMD21_TC_COMPONENT_ */ |