Martin Johnson / STM32F3-Discovery

Dependents:   Space_Invaders_Demo neopixels gpio_test_stm32f3_discovery gpio_test_systimer ... more

Committer:
MartinJohnson
Date:
Thu Apr 26 03:11:18 2018 +0000
Revision:
1:f8e3e71af478
Parent:
0:404f5a4f1385
Add stdio.h serial I/O support for the version D discovery board.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MartinJohnson 0:404f5a4f1385 1 /**
MartinJohnson 0:404f5a4f1385 2 ******************************************************************************
MartinJohnson 0:404f5a4f1385 3 * @file stm32f30x_hrtim.h
MartinJohnson 0:404f5a4f1385 4 * @author MCD Application Team
MartinJohnson 0:404f5a4f1385 5 * @version V1.2.3
MartinJohnson 0:404f5a4f1385 6 * @date 10-July-2015
MartinJohnson 0:404f5a4f1385 7 * @brief This file contains all the functions prototypes for the HRTIM firmware
MartinJohnson 0:404f5a4f1385 8 * library.
MartinJohnson 0:404f5a4f1385 9 ******************************************************************************
MartinJohnson 0:404f5a4f1385 10 * @attention
MartinJohnson 0:404f5a4f1385 11 *
MartinJohnson 0:404f5a4f1385 12 * <h2><center>&copy; COPYRIGHT 2015 STMicroelectronics</center></h2>
MartinJohnson 0:404f5a4f1385 13 *
MartinJohnson 0:404f5a4f1385 14 * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
MartinJohnson 0:404f5a4f1385 15 * You may not use this file except in compliance with the License.
MartinJohnson 0:404f5a4f1385 16 * You may obtain a copy of the License at:
MartinJohnson 0:404f5a4f1385 17 *
MartinJohnson 0:404f5a4f1385 18 * http://www.st.com/software_license_agreement_liberty_v2
MartinJohnson 0:404f5a4f1385 19 *
MartinJohnson 0:404f5a4f1385 20 * Unless required by applicable law or agreed to in writing, software
MartinJohnson 0:404f5a4f1385 21 * distributed under the License is distributed on an "AS IS" BASIS,
MartinJohnson 0:404f5a4f1385 22 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
MartinJohnson 0:404f5a4f1385 23 * See the License for the specific language governing permissions and
MartinJohnson 0:404f5a4f1385 24 * limitations under the License.
MartinJohnson 0:404f5a4f1385 25 *
MartinJohnson 0:404f5a4f1385 26 ******************************************************************************
MartinJohnson 0:404f5a4f1385 27 */
MartinJohnson 0:404f5a4f1385 28
MartinJohnson 0:404f5a4f1385 29 /* Define to prevent recursive inclusion -------------------------------------*/
MartinJohnson 0:404f5a4f1385 30 #ifndef __STM32F30x_HRTIM_H
MartinJohnson 0:404f5a4f1385 31 #define __STM32F30x_HRTIM_H
MartinJohnson 0:404f5a4f1385 32
MartinJohnson 0:404f5a4f1385 33 #ifdef __cplusplus
MartinJohnson 0:404f5a4f1385 34 extern "C" {
MartinJohnson 0:404f5a4f1385 35 #endif
MartinJohnson 0:404f5a4f1385 36
MartinJohnson 0:404f5a4f1385 37 /* Includes ------------------------------------------------------------------*/
MartinJohnson 0:404f5a4f1385 38 #include "stm32f30x.h"
MartinJohnson 0:404f5a4f1385 39
MartinJohnson 0:404f5a4f1385 40 /** @addtogroup STM32F30x_StdPeriph_Driver
MartinJohnson 0:404f5a4f1385 41 * @{
MartinJohnson 0:404f5a4f1385 42 */
MartinJohnson 0:404f5a4f1385 43
MartinJohnson 0:404f5a4f1385 44 /** @addtogroup ADC
MartinJohnson 0:404f5a4f1385 45 * @{
MartinJohnson 0:404f5a4f1385 46 */
MartinJohnson 0:404f5a4f1385 47
MartinJohnson 0:404f5a4f1385 48 /* Exported types ------------------------------------------------------------*/
MartinJohnson 0:404f5a4f1385 49
MartinJohnson 0:404f5a4f1385 50 /**
MartinJohnson 0:404f5a4f1385 51 * @brief HRTIM Configuration Structure definition - Time base related parameters
MartinJohnson 0:404f5a4f1385 52 */
MartinJohnson 0:404f5a4f1385 53 typedef struct
MartinJohnson 0:404f5a4f1385 54 {
MartinJohnson 0:404f5a4f1385 55 uint32_t Period; /*!< Specifies the timer period
MartinJohnson 0:404f5a4f1385 56 The period value must be above 3 periods of the fHRTIM clock.
MartinJohnson 0:404f5a4f1385 57 Maximum value is = 0xFFDF */
MartinJohnson 0:404f5a4f1385 58 uint32_t RepetitionCounter; /*!< Specifies the timer repetition period
MartinJohnson 0:404f5a4f1385 59 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
MartinJohnson 0:404f5a4f1385 60 uint32_t PrescalerRatio; /*!< Specifies the timer clock prescaler ratio.
MartinJohnson 0:404f5a4f1385 61 This parameter can be any value of @ref HRTIM_PrescalerRatio */
MartinJohnson 0:404f5a4f1385 62 uint32_t Mode; /*!< Specifies the counter operating mode
MartinJohnson 0:404f5a4f1385 63 This parameter can be any value of @ref HRTIM_Mode */
MartinJohnson 0:404f5a4f1385 64 } HRTIM_BaseInitTypeDef;
MartinJohnson 0:404f5a4f1385 65 /**
MartinJohnson 0:404f5a4f1385 66 * @brief Waveform mode initialization parameters definition
MartinJohnson 0:404f5a4f1385 67 */
MartinJohnson 0:404f5a4f1385 68 typedef struct {
MartinJohnson 0:404f5a4f1385 69 uint32_t HalfModeEnable; /*!< Specifies whether or not half mode is enabled
MartinJohnson 0:404f5a4f1385 70 This parameter can be a combination of @ref HRTIM_HalfModeEnable */
MartinJohnson 0:404f5a4f1385 71 uint32_t StartOnSync; /*!< Specifies whether or not timer is reset by a rising edge on the synchronization input (when enabled)
MartinJohnson 0:404f5a4f1385 72 This parameter can be a combination of @ref HRTIM_StartOnSyncInputEvent */
MartinJohnson 0:404f5a4f1385 73 uint32_t ResetOnSync; /*!< Specifies whether or not timer is reset by a rising edge on the synchronization input (when enabled)
MartinJohnson 0:404f5a4f1385 74 This parameter can be a combination of @ref HRTIM_ResetOnSyncInputEvent */
MartinJohnson 0:404f5a4f1385 75 uint32_t DACSynchro; /*!< Indicates whether or not the a DAC synchronization event is generated
MartinJohnson 0:404f5a4f1385 76 This parameter can be any value of @ref HRTIM_DACSynchronization */
MartinJohnson 0:404f5a4f1385 77 uint32_t PreloadEnable; /*!< Specifies whether or not register preload is enabled
MartinJohnson 0:404f5a4f1385 78 This parameter can be a combination of @ref HRTIM_RegisterPreloadEnable */
MartinJohnson 0:404f5a4f1385 79 uint32_t UpdateGating; /*!< Specifies how the update occurs with respect to a burst DMA transaction or
MartinJohnson 0:404f5a4f1385 80 update enable inputs (Slave timers only)
MartinJohnson 0:404f5a4f1385 81 This parameter can be any value of @ref HRTIM_UpdateGating */
MartinJohnson 0:404f5a4f1385 82 uint32_t BurstMode; /*!< Specifies how the timer behaves during a burst mode operation
MartinJohnson 0:404f5a4f1385 83 This parameter can be a combination of @ref HRTIM_TimerBurstMode */
MartinJohnson 0:404f5a4f1385 84 uint32_t RepetitionUpdate; /*!< Specifies whether or not registers update is triggered by the repetition event
MartinJohnson 0:404f5a4f1385 85 This parameter can be a combination of @ref HRTIM_TimerRepetitionUpdate */
MartinJohnson 0:404f5a4f1385 86 } HRTIM_TimerInitTypeDef;
MartinJohnson 0:404f5a4f1385 87
MartinJohnson 0:404f5a4f1385 88 /**
MartinJohnson 0:404f5a4f1385 89 * @brief Basic output compare mode configuration definition
MartinJohnson 0:404f5a4f1385 90 */
MartinJohnson 0:404f5a4f1385 91 typedef struct {
MartinJohnson 0:404f5a4f1385 92 uint32_t Mode; /*!< Specifies the output compare mode (toggle, active, inactive)
MartinJohnson 0:404f5a4f1385 93 This parameter can be a combination of @ref HRTIM_BasicOCMode */
MartinJohnson 0:404f5a4f1385 94 uint32_t Pulse; /*!< Specifies the compare value to be loaded into the Compare Register.
MartinJohnson 0:404f5a4f1385 95 The compare value must be above or equal to 3 periods of the fHRTIM clock */
MartinJohnson 0:404f5a4f1385 96 uint32_t Polarity; /*!< Specifies the output polarity
MartinJohnson 0:404f5a4f1385 97 This parameter can be any value of @ref HRTIM_Output_Polarity */
MartinJohnson 0:404f5a4f1385 98 uint32_t IdleState; /*!< Specifies whether the output level is active or inactive when in IDLE state
MartinJohnson 0:404f5a4f1385 99 This parameter can be any value of @ref HRTIM_OutputIDLEState */
MartinJohnson 0:404f5a4f1385 100 } HRTIM_BasicOCChannelCfgTypeDef;
MartinJohnson 0:404f5a4f1385 101
MartinJohnson 0:404f5a4f1385 102 /**
MartinJohnson 0:404f5a4f1385 103 * @brief Basic PWM output mode configuration definition
MartinJohnson 0:404f5a4f1385 104 */
MartinJohnson 0:404f5a4f1385 105 typedef struct {
MartinJohnson 0:404f5a4f1385 106 uint32_t Pulse; /*!< Specifies the compare value to be loaded into the Compare Register.
MartinJohnson 0:404f5a4f1385 107 The compare value must be above or equal to 3 periods of the fHRTIM clock */
MartinJohnson 0:404f5a4f1385 108 uint32_t Polarity; /*!< Specifies the output polarity
MartinJohnson 0:404f5a4f1385 109 This parameter can be any value of @ref HRTIM_OutputPolarity */
MartinJohnson 0:404f5a4f1385 110 uint32_t IdleState; /*!< Specifies whether the output level is active or inactive when in IDLE state
MartinJohnson 0:404f5a4f1385 111 This parameter can be any value of @ref HRTIM_OutputIDLEState */
MartinJohnson 0:404f5a4f1385 112 } HRTIM_BasicPWMChannelCfgTypeDef;
MartinJohnson 0:404f5a4f1385 113
MartinJohnson 0:404f5a4f1385 114 /**
MartinJohnson 0:404f5a4f1385 115 * @brief Basic capture mode configuration definition
MartinJohnson 0:404f5a4f1385 116 */
MartinJohnson 0:404f5a4f1385 117 typedef struct {
MartinJohnson 0:404f5a4f1385 118 uint32_t CaptureUnit; /*!< Specifies the external event Channel
MartinJohnson 0:404f5a4f1385 119 This parameter can be any 'EEVx' value of @ref HRTIM_CaptureUnit */
MartinJohnson 0:404f5a4f1385 120 uint32_t Event; /*!< Specifies the external event triggering the capture
MartinJohnson 0:404f5a4f1385 121 This parameter can be any 'EEVx' value of @ref HRTIM_ExternalEventChannels */
MartinJohnson 0:404f5a4f1385 122 uint32_t EventPolarity; /*!< Specifies the polarity of the external event (in case of level sensitivity)
MartinJohnson 0:404f5a4f1385 123 This parameter can be a value of @ref HRTIM_ExternalEventPolarity */
MartinJohnson 0:404f5a4f1385 124 uint32_t EventSensitivity; /*!< Specifies the sensitivity of the external event
MartinJohnson 0:404f5a4f1385 125 This parameter can be a value of @ref HRTIM_ExternalEventSensitivity */
MartinJohnson 0:404f5a4f1385 126 uint32_t EventFilter; /*!< Defines the frequency used to sample the External Event and the length of the digital filter
MartinJohnson 0:404f5a4f1385 127 This parameter can be a value of @ref HRTIM_ExternalEventFilter */
MartinJohnson 0:404f5a4f1385 128 } HRTIM_BasicCaptureChannelCfgTypeDef;
MartinJohnson 0:404f5a4f1385 129
MartinJohnson 0:404f5a4f1385 130 /**
MartinJohnson 0:404f5a4f1385 131 * @brief Basic One Pulse mode configuration definition
MartinJohnson 0:404f5a4f1385 132 */
MartinJohnson 0:404f5a4f1385 133 typedef struct {
MartinJohnson 0:404f5a4f1385 134 uint32_t Pulse; /*!< Specifies the compare value to be loaded into the Compare Register.
MartinJohnson 0:404f5a4f1385 135 The compare value must be above or equal to 3 periods of the fHRTIM clock */
MartinJohnson 0:404f5a4f1385 136 uint32_t OutputPolarity; /*!< Specifies the output polarity
MartinJohnson 0:404f5a4f1385 137 This parameter can be any value of @ref HRTIM_Output_Polarity */
MartinJohnson 0:404f5a4f1385 138 uint32_t OutputIdleState; /*!< Specifies whether the output level is active or inactive when in IDLE state
MartinJohnson 0:404f5a4f1385 139 This parameter can be any value of @ref HRTIM_Output_IDLE_State */
MartinJohnson 0:404f5a4f1385 140 uint32_t Event; /*!< Specifies the external event triggering the pulse generation
MartinJohnson 0:404f5a4f1385 141 This parameter can be any 'EEVx' value of @ref HRTIM_Capture_Unit_Trigger */
MartinJohnson 0:404f5a4f1385 142 uint32_t EventPolarity; /*!< Specifies the polarity of the external event (in case of level sensitivity)
MartinJohnson 0:404f5a4f1385 143 This parameter can be a value of @ref HRTIM_ExternalEventPolarity */
MartinJohnson 0:404f5a4f1385 144 uint32_t EventSensitivity; /*!< Specifies the sensitivity of the external event
MartinJohnson 0:404f5a4f1385 145 This parameter can be a value of @ref HRTIM_ExternalEventSensitivity */
MartinJohnson 0:404f5a4f1385 146 uint32_t EventFilter; /*!< Defines the frequency used to sample the External Event and the length of the digital filter
MartinJohnson 0:404f5a4f1385 147 This parameter can be a value of @ref HRTIM_ExternalEventFilter */
MartinJohnson 0:404f5a4f1385 148 } HRTIM_BasicOnePulseChannelCfgTypeDef;
MartinJohnson 0:404f5a4f1385 149
MartinJohnson 0:404f5a4f1385 150 /**
MartinJohnson 0:404f5a4f1385 151 * @brief Timer configuration definition
MartinJohnson 0:404f5a4f1385 152 */
MartinJohnson 0:404f5a4f1385 153 typedef struct {
MartinJohnson 0:404f5a4f1385 154 uint32_t PushPull; /*!< Specifies whether or not the push-pull mode is enabled
MartinJohnson 0:404f5a4f1385 155 This parameter can be a value of @ref HRTIM_TimerPushPullMode */
MartinJohnson 0:404f5a4f1385 156 uint32_t FaultEnable; /*!< Specifies which fault channels are enabled for the timer
MartinJohnson 0:404f5a4f1385 157 This parameter can be a combination of @ref HRTIM_TimerFaultEnabling */
MartinJohnson 0:404f5a4f1385 158 uint32_t FaultLock; /*!< Specifies whether or not fault enabling status is write protected
MartinJohnson 0:404f5a4f1385 159 This parameter can be a value of @ref HRTIM_TimerFaultLock */
MartinJohnson 0:404f5a4f1385 160 uint32_t DeadTimeInsertion; /*!< Specifies whether or not dead time insertion is enabled for the timer
MartinJohnson 0:404f5a4f1385 161 This parameter can be a value of @ref HRTIM_TimerDeadtimeInsertion */
MartinJohnson 0:404f5a4f1385 162 uint32_t DelayedProtectionMode; /*!< Specifies the delayed protection mode
MartinJohnson 0:404f5a4f1385 163 This parameter can be a value of @ref HRTIM_TimerDelayedProtectionMode */
MartinJohnson 0:404f5a4f1385 164 uint32_t UpdateTrigger; /*!< Specifies source(s) triggering the timer registers update
MartinJohnson 0:404f5a4f1385 165 This parameter can be a combination of @ref HRTIM_TimerUpdateTrigger */
MartinJohnson 0:404f5a4f1385 166 uint32_t ResetTrigger; /*!< Specifies source(s) triggering the timer counter reset
MartinJohnson 0:404f5a4f1385 167 This parameter can be a combination of @ref HRTIM_TimerResetTrigger */
MartinJohnson 0:404f5a4f1385 168 uint32_t ResetUpdate; /*!< Specifies whether or not registers update is triggered when the timer counter is reset
MartinJohnson 0:404f5a4f1385 169 This parameter can be a combination of @ref HRTIM_TimerResetUpdate */
MartinJohnson 0:404f5a4f1385 170 } HRTIM_TimerCfgTypeDef;
MartinJohnson 0:404f5a4f1385 171
MartinJohnson 0:404f5a4f1385 172 /**
MartinJohnson 0:404f5a4f1385 173 * @brief Compare unit configuration definition
MartinJohnson 0:404f5a4f1385 174 */
MartinJohnson 0:404f5a4f1385 175 typedef struct {
MartinJohnson 0:404f5a4f1385 176 uint32_t CompareValue; /*!< Specifies the compare value of the timer compare unit
MartinJohnson 0:404f5a4f1385 177 the minimum value must be greater than or equal to 3 periods of the fHRTIM clock
MartinJohnson 0:404f5a4f1385 178 the maximum value must be less than or equal to 0xFFFF - 1 periods of the fHRTIM clock */
MartinJohnson 0:404f5a4f1385 179 uint32_t AutoDelayedMode; /*!< Specifies the auto delayed mode for compare unit 2 or 4
MartinJohnson 0:404f5a4f1385 180 This parameter can be a value of @ref HRTIM_CompareUnitAutoDelayedMode */
MartinJohnson 0:404f5a4f1385 181 uint32_t AutoDelayedTimeout; /*!< Specifies compare value for timing unit 1 or 3 when auto delayed mode with time out is selected
MartinJohnson 0:404f5a4f1385 182 CompareValue + AutoDelayedTimeout must be less than 0xFFFF */
MartinJohnson 0:404f5a4f1385 183 } HRTIM_CompareCfgTypeDef;
MartinJohnson 0:404f5a4f1385 184
MartinJohnson 0:404f5a4f1385 185 /**
MartinJohnson 0:404f5a4f1385 186 * @brief Capture unit configuration definition
MartinJohnson 0:404f5a4f1385 187 */
MartinJohnson 0:404f5a4f1385 188 typedef struct {
MartinJohnson 0:404f5a4f1385 189 uint32_t Trigger; /*!< Specifies source(s) triggering the capture
MartinJohnson 0:404f5a4f1385 190 This parameter can be a combination of @ref HRTIM_CaptureUnitTrigger */
MartinJohnson 0:404f5a4f1385 191 } HRTIM_CaptureCfgTypeDef;
MartinJohnson 0:404f5a4f1385 192
MartinJohnson 0:404f5a4f1385 193 /**
MartinJohnson 0:404f5a4f1385 194 * @brief Output configuration definition
MartinJohnson 0:404f5a4f1385 195 */
MartinJohnson 0:404f5a4f1385 196 typedef struct {
MartinJohnson 0:404f5a4f1385 197 uint32_t Polarity; /*!< Specifies the output polarity
MartinJohnson 0:404f5a4f1385 198 This parameter can be any value of @ref HRTIM_Output_Polarity */
MartinJohnson 0:404f5a4f1385 199 uint32_t SetSource; /*!< Specifies the event(s) transitioning the output from its inactive level to its active level
MartinJohnson 0:404f5a4f1385 200 This parameter can be any value of @ref HRTIM_OutputSetSource */
MartinJohnson 0:404f5a4f1385 201 uint32_t ResetSource; /*!< Specifies the event(s) transitioning the output from its active level to its inactive level
MartinJohnson 0:404f5a4f1385 202 This parameter can be any value of @ref HRTIM_OutputResetSource */
MartinJohnson 0:404f5a4f1385 203 uint32_t IdleMode; /*!< Specifies whether or not the output is affected by a burst mode operation
MartinJohnson 0:404f5a4f1385 204 This parameter can be any value of @ref HRTIM_OutputIdleMode */
MartinJohnson 0:404f5a4f1385 205 uint32_t IdleState; /*!< Specifies whether the output level is active or inactive when in IDLE state
MartinJohnson 0:404f5a4f1385 206 This parameter can be any value of @ref HRTIM_OutputIDLEState */
MartinJohnson 0:404f5a4f1385 207 uint32_t FaultState; /*!< Specifies whether the output level is active or inactive when in FAULT state
MartinJohnson 0:404f5a4f1385 208 This parameter can be any value of @ref HRTIM_OutputFAULTState */
MartinJohnson 0:404f5a4f1385 209 uint32_t ChopperModeEnable; /*!< Indicates whether or not the chopper mode is enabled
MartinJohnson 0:404f5a4f1385 210 This parameter can be any value of @ref HRTIM_OutputChopperModeEnable */
MartinJohnson 0:404f5a4f1385 211 uint32_t BurstModeEntryDelayed; /* !<Indicates whether or not deadtime is inserted when entering the IDLE state
MartinJohnson 0:404f5a4f1385 212 during a burst mode operation
MartinJohnson 0:404f5a4f1385 213 This parameters can be any value of @ref HRTIM_OutputBurstModeEntryDelayed */
MartinJohnson 0:404f5a4f1385 214 } HRTIM_OutputCfgTypeDef;
MartinJohnson 0:404f5a4f1385 215
MartinJohnson 0:404f5a4f1385 216 /**
MartinJohnson 0:404f5a4f1385 217 * @brief External event filtering in timing units configuration definition
MartinJohnson 0:404f5a4f1385 218 */
MartinJohnson 0:404f5a4f1385 219 typedef struct {
MartinJohnson 0:404f5a4f1385 220 uint32_t Filter; /*!< Specifies the type of event filtering within the timing unit
MartinJohnson 0:404f5a4f1385 221 This parameter can be a value of @ref HRTIM_TimerExternalEventFilter */
MartinJohnson 0:404f5a4f1385 222 uint32_t Latch; /*!< Specifies whether or not the signal is latched
MartinJohnson 0:404f5a4f1385 223 This parameter can be a value of @ref HRTIM_TimerExternalEventLatch */
MartinJohnson 0:404f5a4f1385 224 } HRTIM_TimerEventFilteringCfgTypeDef;
MartinJohnson 0:404f5a4f1385 225
MartinJohnson 0:404f5a4f1385 226 /**
MartinJohnson 0:404f5a4f1385 227 * @brief Dead time feature configuration definition
MartinJohnson 0:404f5a4f1385 228 */
MartinJohnson 0:404f5a4f1385 229 typedef struct {
MartinJohnson 0:404f5a4f1385 230 uint32_t Prescaler; /*!< Specifies the Deadtime Prescaler
MartinJohnson 0:404f5a4f1385 231 This parameter can be a number between 0x0 and = 0x7 */
MartinJohnson 0:404f5a4f1385 232 uint32_t RisingValue; /*!< Specifies the Deadtime following a rising edge
MartinJohnson 0:404f5a4f1385 233 This parameter can be a number between 0x0 and 0xFF */
MartinJohnson 0:404f5a4f1385 234 uint32_t RisingSign; /*!< Specifies whether the deadtime is positive or negative on rising edge
MartinJohnson 0:404f5a4f1385 235 This parameter can be a value of @ref HRTIM_DeadtimeRisingSign */
MartinJohnson 0:404f5a4f1385 236 uint32_t RisingLock; /*!< Specifies whether or not deadtime rising settings (value and sign) are write protected
MartinJohnson 0:404f5a4f1385 237 This parameter can be a value of @ref HRTIM_DeadtimeRisingLock */
MartinJohnson 0:404f5a4f1385 238 uint32_t RisingSignLock; /*!< Specifies whether or not deadtime rising sign is write protected
MartinJohnson 0:404f5a4f1385 239 This parameter can be a value of @ref HRTIM_DeadtimeRisingSignLock */
MartinJohnson 0:404f5a4f1385 240 uint32_t FallingValue; /*!< Specifies the Deadtime following a falling edge
MartinJohnson 0:404f5a4f1385 241 This parameter can be a number between 0x0 and 0xFF */
MartinJohnson 0:404f5a4f1385 242 uint32_t FallingSign; /*!< Specifies whether the deadtime is positive or negative on falling edge
MartinJohnson 0:404f5a4f1385 243 This parameter can be a value of @ref HRTIM_DeadtimeFallingSign */
MartinJohnson 0:404f5a4f1385 244 uint32_t FallingLock; /*!< Specifies whether or not deadtime falling settings (value and sign) are write protected
MartinJohnson 0:404f5a4f1385 245 This parameter can be a value of @ref HRTIM_DeadtimeFallingLock */
MartinJohnson 0:404f5a4f1385 246 uint32_t FallingSignLock; /*!< Specifies whether or not deadtime falling sign is write protected
MartinJohnson 0:404f5a4f1385 247 This parameter can be a value of @ref HRTIM_DeadtimeFallingSignLock */
MartinJohnson 0:404f5a4f1385 248 } HRTIM_DeadTimeCfgTypeDef;
MartinJohnson 0:404f5a4f1385 249
MartinJohnson 0:404f5a4f1385 250 /**
MartinJohnson 0:404f5a4f1385 251 * @brief Chopper mode configuration definition
MartinJohnson 0:404f5a4f1385 252 */
MartinJohnson 0:404f5a4f1385 253 typedef struct {
MartinJohnson 0:404f5a4f1385 254 uint32_t CarrierFreq; /*!< Specifies the Timer carrier frequency value.
MartinJohnson 0:404f5a4f1385 255 This parameter can be a value between 0 and 0xF */
MartinJohnson 0:404f5a4f1385 256 uint32_t DutyCycle; /*!< Specifies the Timer chopper duty cycle value.
MartinJohnson 0:404f5a4f1385 257 This parameter can be a value between 0 and 0x7 */
MartinJohnson 0:404f5a4f1385 258 uint32_t StartPulse; /*!< Specifies the Timer pulse width value.
MartinJohnson 0:404f5a4f1385 259 This parameter can be a value between 0 and 0xF */
MartinJohnson 0:404f5a4f1385 260 } HRTIM_ChopperModeCfgTypeDef;
MartinJohnson 0:404f5a4f1385 261
MartinJohnson 0:404f5a4f1385 262 /**
MartinJohnson 0:404f5a4f1385 263 * @brief Master synchronization configuration definition
MartinJohnson 0:404f5a4f1385 264 */
MartinJohnson 0:404f5a4f1385 265 typedef struct {
MartinJohnson 0:404f5a4f1385 266 uint32_t SyncInputSource; /*!< Specifies the external synchronization input source
MartinJohnson 0:404f5a4f1385 267 This parameter can be a value of @ref HRTIM_SynchronizationInputSource */
MartinJohnson 0:404f5a4f1385 268 uint32_t SyncOutputSource; /*!< Specifies the source and event to be sent on the external synchronization outputs
MartinJohnson 0:404f5a4f1385 269 This parameter can be a value of @ref HRTIM_SynchronizationOutputSource */
MartinJohnson 0:404f5a4f1385 270 uint32_t SyncOutputPolarity; /*!< Specifies the conditioning of the event to be sent on the external synchronization outputs
MartinJohnson 0:404f5a4f1385 271 This parameter can be a value of @ref HRTIM_SynchronizationOutputPolarity */
MartinJohnson 0:404f5a4f1385 272 } HRTIM_SynchroCfgTypeDef;
MartinJohnson 0:404f5a4f1385 273
MartinJohnson 0:404f5a4f1385 274 /**
MartinJohnson 0:404f5a4f1385 275 * @brief External event channel configuration definition
MartinJohnson 0:404f5a4f1385 276 */
MartinJohnson 0:404f5a4f1385 277 typedef struct {
MartinJohnson 0:404f5a4f1385 278 uint32_t Source; /*!< Identifies the source of the external event
MartinJohnson 0:404f5a4f1385 279 This parameter can be a value of @ref HRTIM_ExternalEventSources */
MartinJohnson 0:404f5a4f1385 280 uint32_t Polarity; /*!< Specifies the polarity of the external event (in case of level sensitivity)
MartinJohnson 0:404f5a4f1385 281 This parameter can be a value of @ref HRTIM_ExternalEventPolarity */
MartinJohnson 0:404f5a4f1385 282 uint32_t Sensitivity; /*!< Specifies the sensitivity of the external event
MartinJohnson 0:404f5a4f1385 283 This parameter can be a value of @ref HRTIM_ExternalEventSensitivity */
MartinJohnson 0:404f5a4f1385 284 uint32_t Filter; /*!< Defines the frequency used to sample the External Event and the length of the digital filter
MartinJohnson 0:404f5a4f1385 285 This parameter can be a value of @ref HRTIM_ExternalEventFilter */
MartinJohnson 0:404f5a4f1385 286 uint32_t FastMode; /*!< Indicates whether or not low latency mode is enabled for the external event
MartinJohnson 0:404f5a4f1385 287 This parameter can be a value of @ref HRTIM_ExternalEventFastMode */
MartinJohnson 0:404f5a4f1385 288 } HRTIM_EventCfgTypeDef;
MartinJohnson 0:404f5a4f1385 289
MartinJohnson 0:404f5a4f1385 290 /**
MartinJohnson 0:404f5a4f1385 291 * @brief Fault channel configuration definition
MartinJohnson 0:404f5a4f1385 292 */
MartinJohnson 0:404f5a4f1385 293 typedef struct {
MartinJohnson 0:404f5a4f1385 294 uint32_t Source; /*!< Identifies the source of the fault
MartinJohnson 0:404f5a4f1385 295 This parameter can be a value of @ref HRTIM_FaultSources */
MartinJohnson 0:404f5a4f1385 296 uint32_t Polarity; /*!< Specifies the polarity of the fault event
MartinJohnson 0:404f5a4f1385 297 This parameter can be a value of @ref HRTIM_FaultPolarity */
MartinJohnson 0:404f5a4f1385 298 uint32_t Filter; /*!< Defines the frequency used to sample the Fault input and the length of the digital filter
MartinJohnson 0:404f5a4f1385 299 This parameter can be a value of @ref HRTIM_FaultFilter */
MartinJohnson 0:404f5a4f1385 300 uint32_t Lock; /*!< Indicates whether or not fault programming bits are write protected
MartinJohnson 0:404f5a4f1385 301 This parameter can be a value of @ref HRTIM_FaultLock */
MartinJohnson 0:404f5a4f1385 302 } HRTIM_FaultCfgTypeDef;
MartinJohnson 0:404f5a4f1385 303
MartinJohnson 0:404f5a4f1385 304 /**
MartinJohnson 0:404f5a4f1385 305 * @brief Burst mode configuration definition
MartinJohnson 0:404f5a4f1385 306 */
MartinJohnson 0:404f5a4f1385 307 typedef struct {
MartinJohnson 0:404f5a4f1385 308 uint32_t Mode; /*!< Specifies the burst mode operating mode
MartinJohnson 0:404f5a4f1385 309 This parameter can be a value of @ref HRTIM_BurstModeOperatingMode */
MartinJohnson 0:404f5a4f1385 310 uint32_t ClockSource; /*!< Specifies the burst mode clock source
MartinJohnson 0:404f5a4f1385 311 This parameter can be a value of @ref HRTIM_BurstModeClockSource */
MartinJohnson 0:404f5a4f1385 312 uint32_t Prescaler; /*!< Specifies the burst mode prescaler
MartinJohnson 0:404f5a4f1385 313 This parameter can be a value of @ref HRTIM_BurstModePrescaler */
MartinJohnson 0:404f5a4f1385 314 uint32_t PreloadEnable; /*!< Specifies whether or not preload is enabled for burst mode related registers (HRTIM_BMCMPR and HRTIM_BMPER)
MartinJohnson 0:404f5a4f1385 315 This parameter can be a combination of @ref HRTIM_BurstModeRegisterPreloadEnable */
MartinJohnson 0:404f5a4f1385 316 uint32_t Trigger; /*!< Specifies the event(s) triggering the burst operation
MartinJohnson 0:404f5a4f1385 317 This parameter can be a combination of @ref HRTIM_BurstModeTrigger */
MartinJohnson 0:404f5a4f1385 318 uint32_t IdleDuration; /*!< Specifies number of periods during which the selected timers are in idle state
MartinJohnson 0:404f5a4f1385 319 This parameter can be a number between 0x0 and 0xFFFF */
MartinJohnson 0:404f5a4f1385 320 uint32_t Period; /*!< Specifies burst mode repetition period
MartinJohnson 0:404f5a4f1385 321 This parameter can be a number between 0x1 and 0xFFFF */
MartinJohnson 0:404f5a4f1385 322 } HRTIM_BurstModeCfgTypeDef;
MartinJohnson 0:404f5a4f1385 323
MartinJohnson 0:404f5a4f1385 324 /**
MartinJohnson 0:404f5a4f1385 325 * @brief ADC trigger configuration definition
MartinJohnson 0:404f5a4f1385 326 */
MartinJohnson 0:404f5a4f1385 327 typedef struct {
MartinJohnson 0:404f5a4f1385 328 uint32_t UpdateSource; /*!< Specifies the ADC trigger update source
MartinJohnson 0:404f5a4f1385 329 This parameter can be a combination of @ref HRTIM_ADCTriggerUpdateSource */
MartinJohnson 0:404f5a4f1385 330 uint32_t Trigger; /*!< Specifies the event(s) triggering the ADC conversion
MartinJohnson 0:404f5a4f1385 331 This parameter can be a combination of @ref HRTIM_ADCTriggerEvent */
MartinJohnson 0:404f5a4f1385 332 } HRTIM_ADCTriggerCfgTypeDef;
MartinJohnson 0:404f5a4f1385 333
MartinJohnson 0:404f5a4f1385 334
MartinJohnson 0:404f5a4f1385 335 /* Exported constants --------------------------------------------------------*/
MartinJohnson 0:404f5a4f1385 336 /** @defgroup HRTIM_Exported_Constants
MartinJohnson 0:404f5a4f1385 337 * @{
MartinJohnson 0:404f5a4f1385 338 */
MartinJohnson 0:404f5a4f1385 339
MartinJohnson 0:404f5a4f1385 340 /** @defgroup HRTIM_TimerIndex
MartinJohnson 0:404f5a4f1385 341 * @{
MartinJohnson 0:404f5a4f1385 342 * @brief Constants defining the timer indexes
MartinJohnson 0:404f5a4f1385 343 */
MartinJohnson 0:404f5a4f1385 344 #define HRTIM_TIMERINDEX_TIMER_A (uint32_t)0x0 /*!< Index associated to timer A */
MartinJohnson 0:404f5a4f1385 345 #define HRTIM_TIMERINDEX_TIMER_B (uint32_t)0x1 /*!< Index associated to timer B */
MartinJohnson 0:404f5a4f1385 346 #define HRTIM_TIMERINDEX_TIMER_C (uint32_t)0x2 /*!< Index associated to timer C */
MartinJohnson 0:404f5a4f1385 347 #define HRTIM_TIMERINDEX_TIMER_D (uint32_t)0x3 /*!< Index associated to timer D */
MartinJohnson 0:404f5a4f1385 348 #define HRTIM_TIMERINDEX_TIMER_E (uint32_t)0x4 /*!< Index associated to timer E */
MartinJohnson 0:404f5a4f1385 349 #define HRTIM_TIMERINDEX_MASTER (uint32_t)0x5 /*!< Index associated to master timer */
MartinJohnson 0:404f5a4f1385 350 #define HRTIM_COMMONINDEX (uint32_t)0x6 /*!< Index associated to Common space */
MartinJohnson 0:404f5a4f1385 351
MartinJohnson 0:404f5a4f1385 352 #define IS_HRTIM_TIMERINDEX(TIMERINDEX)\
MartinJohnson 0:404f5a4f1385 353 (((TIMERINDEX) == HRTIM_TIMERINDEX_MASTER) || \
MartinJohnson 0:404f5a4f1385 354 ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_A) || \
MartinJohnson 0:404f5a4f1385 355 ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_B) || \
MartinJohnson 0:404f5a4f1385 356 ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_C) || \
MartinJohnson 0:404f5a4f1385 357 ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_D) || \
MartinJohnson 0:404f5a4f1385 358 ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_E))
MartinJohnson 0:404f5a4f1385 359
MartinJohnson 0:404f5a4f1385 360 #define IS_HRTIM_TIMING_UNIT(TIMERINDEX)\
MartinJohnson 0:404f5a4f1385 361 (((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_A) || \
MartinJohnson 0:404f5a4f1385 362 ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_B) || \
MartinJohnson 0:404f5a4f1385 363 ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_C) || \
MartinJohnson 0:404f5a4f1385 364 ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_D) || \
MartinJohnson 0:404f5a4f1385 365 ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_E))
MartinJohnson 0:404f5a4f1385 366 /**
MartinJohnson 0:404f5a4f1385 367 * @}
MartinJohnson 0:404f5a4f1385 368 */
MartinJohnson 0:404f5a4f1385 369
MartinJohnson 0:404f5a4f1385 370 /** @defgroup HRTIM_TimerIdentifier
MartinJohnson 0:404f5a4f1385 371 * @{
MartinJohnson 0:404f5a4f1385 372 * @brief Constants defining timer identifiers
MartinJohnson 0:404f5a4f1385 373 */
MartinJohnson 0:404f5a4f1385 374 #define HRTIM_TIMERID_MASTER (HRTIM_MCR_MCEN) /*!< Master identifier*/
MartinJohnson 0:404f5a4f1385 375 #define HRTIM_TIMERID_TIMER_A (HRTIM_MCR_TACEN) /*!< Timer A identifier */
MartinJohnson 0:404f5a4f1385 376 #define HRTIM_TIMERID_TIMER_B (HRTIM_MCR_TBCEN) /*!< Timer B identifier */
MartinJohnson 0:404f5a4f1385 377 #define HRTIM_TIMERID_TIMER_C (HRTIM_MCR_TCCEN) /*!< Timer C identifier */
MartinJohnson 0:404f5a4f1385 378 #define HRTIM_TIMERID_TIMER_D (HRTIM_MCR_TDCEN) /*!< Timer D identifier */
MartinJohnson 0:404f5a4f1385 379 #define HRTIM_TIMERID_TIMER_E (HRTIM_MCR_TECEN) /*!< Timer E identifier */
MartinJohnson 0:404f5a4f1385 380
MartinJohnson 0:404f5a4f1385 381 #define IS_HRTIM_TIMERID(TIMERID)\
MartinJohnson 0:404f5a4f1385 382 (((TIMERID) == HRTIM_TIMERID_MASTER) || \
MartinJohnson 0:404f5a4f1385 383 ((TIMERID) == HRTIM_TIMERID_TIMER_A) || \
MartinJohnson 0:404f5a4f1385 384 ((TIMERID) == HRTIM_TIMERID_TIMER_B) || \
MartinJohnson 0:404f5a4f1385 385 ((TIMERID) == HRTIM_TIMERID_TIMER_C) || \
MartinJohnson 0:404f5a4f1385 386 ((TIMERID) == HRTIM_TIMERID_TIMER_D) || \
MartinJohnson 0:404f5a4f1385 387 ((TIMERID) == HRTIM_TIMERID_TIMER_E))
MartinJohnson 0:404f5a4f1385 388 /**
MartinJohnson 0:404f5a4f1385 389 * @}
MartinJohnson 0:404f5a4f1385 390 */
MartinJohnson 0:404f5a4f1385 391
MartinJohnson 0:404f5a4f1385 392 /** @defgroup HRTIM_CompareUnit
MartinJohnson 0:404f5a4f1385 393 * @{
MartinJohnson 0:404f5a4f1385 394 * @brief Constants defining compare unit identifiers
MartinJohnson 0:404f5a4f1385 395 */
MartinJohnson 0:404f5a4f1385 396 #define HRTIM_COMPAREUNIT_1 (uint32_t)0x00000001 /*!< Compare unit 1 identifier */
MartinJohnson 0:404f5a4f1385 397 #define HRTIM_COMPAREUNIT_2 (uint32_t)0x00000002 /*!< Compare unit 2 identifier */
MartinJohnson 0:404f5a4f1385 398 #define HRTIM_COMPAREUNIT_3 (uint32_t)0x00000004 /*!< Compare unit 3 identifier */
MartinJohnson 0:404f5a4f1385 399 #define HRTIM_COMPAREUNIT_4 (uint32_t)0x00000008 /*!< Compare unit 4 identifier */
MartinJohnson 0:404f5a4f1385 400
MartinJohnson 0:404f5a4f1385 401 #define IS_HRTIM_COMPAREUNIT(COMPAREUNIT)\
MartinJohnson 0:404f5a4f1385 402 (((COMPAREUNIT) == HRTIM_COMPAREUNIT_1) || \
MartinJohnson 0:404f5a4f1385 403 ((COMPAREUNIT) == HRTIM_COMPAREUNIT_2) || \
MartinJohnson 0:404f5a4f1385 404 ((COMPAREUNIT) == HRTIM_COMPAREUNIT_3) || \
MartinJohnson 0:404f5a4f1385 405 ((COMPAREUNIT) == HRTIM_COMPAREUNIT_4))
MartinJohnson 0:404f5a4f1385 406 /**
MartinJohnson 0:404f5a4f1385 407 * @}
MartinJohnson 0:404f5a4f1385 408 */
MartinJohnson 0:404f5a4f1385 409
MartinJohnson 0:404f5a4f1385 410 /** @defgroup HRTIM_CaptureUnit
MartinJohnson 0:404f5a4f1385 411 * @{
MartinJohnson 0:404f5a4f1385 412 * @brief Constants defining capture unit identifiers
MartinJohnson 0:404f5a4f1385 413 */
MartinJohnson 0:404f5a4f1385 414 #define HRTIM_CAPTUREUNIT_1 (uint32_t)0x00000001 /*!< Capture unit 1 identifier */
MartinJohnson 0:404f5a4f1385 415 #define HRTIM_CAPTUREUNIT_2 (uint32_t)0x00000002 /*!< Capture unit 2 identifier */
MartinJohnson 0:404f5a4f1385 416
MartinJohnson 0:404f5a4f1385 417 #define IS_HRTIM_CAPTUREUNIT(CAPTUREUNIT)\
MartinJohnson 0:404f5a4f1385 418 (((CAPTUREUNIT) == HRTIM_CAPTUREUNIT_1) || \
MartinJohnson 0:404f5a4f1385 419 ((CAPTUREUNIT) == HRTIM_CAPTUREUNIT_2))
MartinJohnson 0:404f5a4f1385 420 /**
MartinJohnson 0:404f5a4f1385 421 * @}
MartinJohnson 0:404f5a4f1385 422 */
MartinJohnson 0:404f5a4f1385 423
MartinJohnson 0:404f5a4f1385 424 /** @defgroup HRTIM_TimerOutput
MartinJohnson 0:404f5a4f1385 425 * @{
MartinJohnson 0:404f5a4f1385 426 * @brief Constants defining timer output identifiers
MartinJohnson 0:404f5a4f1385 427 */
MartinJohnson 0:404f5a4f1385 428 #define HRTIM_OUTPUT_TA1 (uint32_t)0x00000001 /*!< Timer A - Output 1 identifier */
MartinJohnson 0:404f5a4f1385 429 #define HRTIM_OUTPUT_TA2 (uint32_t)0x00000002 /*!< Timer A - Output 2 identifier */
MartinJohnson 0:404f5a4f1385 430 #define HRTIM_OUTPUT_TB1 (uint32_t)0x00000004 /*!< Timer B - Output 1 identifier */
MartinJohnson 0:404f5a4f1385 431 #define HRTIM_OUTPUT_TB2 (uint32_t)0x00000008 /*!< Timer B - Output 2 identifier */
MartinJohnson 0:404f5a4f1385 432 #define HRTIM_OUTPUT_TC1 (uint32_t)0x00000010 /*!< Timer C - Output 1 identifier */
MartinJohnson 0:404f5a4f1385 433 #define HRTIM_OUTPUT_TC2 (uint32_t)0x00000020 /*!< Timer C - Output 2 identifier */
MartinJohnson 0:404f5a4f1385 434 #define HRTIM_OUTPUT_TD1 (uint32_t)0x00000040 /*!< Timer D - Output 1 identifier */
MartinJohnson 0:404f5a4f1385 435 #define HRTIM_OUTPUT_TD2 (uint32_t)0x00000080 /*!< Timer D - Output 2 identifier */
MartinJohnson 0:404f5a4f1385 436 #define HRTIM_OUTPUT_TE1 (uint32_t)0x00000100 /*!< Timer E - Output 1 identifier */
MartinJohnson 0:404f5a4f1385 437 #define HRTIM_OUTPUT_TE2 (uint32_t)0x00000200 /*!< Timer E - Output 2 identifier */
MartinJohnson 0:404f5a4f1385 438
MartinJohnson 0:404f5a4f1385 439 #define IS_HRTIM_OUTPUT(OUTPUT)\
MartinJohnson 0:404f5a4f1385 440 (((OUTPUT) == HRTIM_OUTPUT_TA1) || \
MartinJohnson 0:404f5a4f1385 441 ((OUTPUT) == HRTIM_OUTPUT_TA2) || \
MartinJohnson 0:404f5a4f1385 442 ((OUTPUT) == HRTIM_OUTPUT_TB1) || \
MartinJohnson 0:404f5a4f1385 443 ((OUTPUT) == HRTIM_OUTPUT_TB2) || \
MartinJohnson 0:404f5a4f1385 444 ((OUTPUT) == HRTIM_OUTPUT_TC1) || \
MartinJohnson 0:404f5a4f1385 445 ((OUTPUT) == HRTIM_OUTPUT_TC2) || \
MartinJohnson 0:404f5a4f1385 446 ((OUTPUT) == HRTIM_OUTPUT_TD1) || \
MartinJohnson 0:404f5a4f1385 447 ((OUTPUT) == HRTIM_OUTPUT_TD2) || \
MartinJohnson 0:404f5a4f1385 448 ((OUTPUT) == HRTIM_OUTPUT_TE1) || \
MartinJohnson 0:404f5a4f1385 449 ((OUTPUT) == HRTIM_OUTPUT_TE2))
MartinJohnson 0:404f5a4f1385 450
MartinJohnson 0:404f5a4f1385 451 #define IS_HRTIM_TIMER_OUTPUT(TIMER, OUTPUT)\
MartinJohnson 0:404f5a4f1385 452 ((((TIMER) == HRTIM_TIMERINDEX_TIMER_A) && \
MartinJohnson 0:404f5a4f1385 453 (((OUTPUT) == HRTIM_OUTPUT_TA1) || \
MartinJohnson 0:404f5a4f1385 454 ((OUTPUT) == HRTIM_OUTPUT_TA2))) \
MartinJohnson 0:404f5a4f1385 455 || \
MartinJohnson 0:404f5a4f1385 456 (((TIMER) == HRTIM_TIMERINDEX_TIMER_B) && \
MartinJohnson 0:404f5a4f1385 457 (((OUTPUT) == HRTIM_OUTPUT_TB1) || \
MartinJohnson 0:404f5a4f1385 458 ((OUTPUT) == HRTIM_OUTPUT_TB2))) \
MartinJohnson 0:404f5a4f1385 459 || \
MartinJohnson 0:404f5a4f1385 460 (((TIMER) == HRTIM_TIMERINDEX_TIMER_C) && \
MartinJohnson 0:404f5a4f1385 461 (((OUTPUT) == HRTIM_OUTPUT_TC1) || \
MartinJohnson 0:404f5a4f1385 462 ((OUTPUT) == HRTIM_OUTPUT_TC2))) \
MartinJohnson 0:404f5a4f1385 463 || \
MartinJohnson 0:404f5a4f1385 464 (((TIMER) == HRTIM_TIMERINDEX_TIMER_D) && \
MartinJohnson 0:404f5a4f1385 465 (((OUTPUT) == HRTIM_OUTPUT_TD1) || \
MartinJohnson 0:404f5a4f1385 466 ((OUTPUT) == HRTIM_OUTPUT_TD2))) \
MartinJohnson 0:404f5a4f1385 467 || \
MartinJohnson 0:404f5a4f1385 468 (((TIMER) == HRTIM_TIMERINDEX_TIMER_E) && \
MartinJohnson 0:404f5a4f1385 469 (((OUTPUT) == HRTIM_OUTPUT_TE1) || \
MartinJohnson 0:404f5a4f1385 470 ((OUTPUT) == HRTIM_OUTPUT_TE2))))
MartinJohnson 0:404f5a4f1385 471 /**
MartinJohnson 0:404f5a4f1385 472 * @}
MartinJohnson 0:404f5a4f1385 473 */
MartinJohnson 0:404f5a4f1385 474
MartinJohnson 0:404f5a4f1385 475 /** @defgroup HRTIM_ADCTrigger
MartinJohnson 0:404f5a4f1385 476 * @{
MartinJohnson 0:404f5a4f1385 477 * @brief Constants defining ADC triggers identifiers
MartinJohnson 0:404f5a4f1385 478 */
MartinJohnson 0:404f5a4f1385 479 #define HRTIM_ADCTRIGGER_1 (uint32_t)0x00000001 /*!< ADC trigger 1 identifier */
MartinJohnson 0:404f5a4f1385 480 #define HRTIM_ADCTRIGGER_2 (uint32_t)0x00000002 /*!< ADC trigger 1 identifier */
MartinJohnson 0:404f5a4f1385 481 #define HRTIM_ADCTRIGGER_3 (uint32_t)0x00000004 /*!< ADC trigger 1 identifier */
MartinJohnson 0:404f5a4f1385 482 #define HRTIM_ADCTRIGGER_4 (uint32_t)0x00000008 /*!< ADC trigger 1 identifier */
MartinJohnson 0:404f5a4f1385 483
MartinJohnson 0:404f5a4f1385 484 #define IS_HRTIM_ADCTRIGGER(ADCTRIGGER)\
MartinJohnson 0:404f5a4f1385 485 (((ADCTRIGGER) == HRTIM_ADCTRIGGER_1) || \
MartinJohnson 0:404f5a4f1385 486 ((ADCTRIGGER) == HRTIM_ADCTRIGGER_2) || \
MartinJohnson 0:404f5a4f1385 487 ((ADCTRIGGER) == HRTIM_ADCTRIGGER_3) || \
MartinJohnson 0:404f5a4f1385 488 ((ADCTRIGGER) == HRTIM_ADCTRIGGER_4))
MartinJohnson 0:404f5a4f1385 489 /**
MartinJohnson 0:404f5a4f1385 490 * @}
MartinJohnson 0:404f5a4f1385 491 */
MartinJohnson 0:404f5a4f1385 492
MartinJohnson 0:404f5a4f1385 493 /** @defgroup HRTIM_ExternalEventChannels
MartinJohnson 0:404f5a4f1385 494 * @{
MartinJohnson 0:404f5a4f1385 495 * @brief Constants defining external event channel identifiers
MartinJohnson 0:404f5a4f1385 496 */
MartinJohnson 0:404f5a4f1385 497 #define HRTIM_EVENT_NONE ((uint32_t)0x00000000) /*!< Undefined event channel */
MartinJohnson 0:404f5a4f1385 498 #define HRTIM_EVENT_1 ((uint32_t)0x00000001) /*!< External event channel 1 identifier */
MartinJohnson 0:404f5a4f1385 499 #define HRTIM_EVENT_2 ((uint32_t)0x00000002) /*!< External event channel 2 identifier */
MartinJohnson 0:404f5a4f1385 500 #define HRTIM_EVENT_3 ((uint32_t)0x00000004) /*!< External event channel 3 identifier */
MartinJohnson 0:404f5a4f1385 501 #define HRTIM_EVENT_4 ((uint32_t)0x00000008) /*!< External event channel 4 identifier */
MartinJohnson 0:404f5a4f1385 502 #define HRTIM_EVENT_5 ((uint32_t)0x00000010) /*!< External event channel 5 identifier */
MartinJohnson 0:404f5a4f1385 503 #define HRTIM_EVENT_6 ((uint32_t)0x00000020) /*!< External event channel 6 identifier */
MartinJohnson 0:404f5a4f1385 504 #define HRTIM_EVENT_7 ((uint32_t)0x00000040) /*!< External event channel 7 identifier */
MartinJohnson 0:404f5a4f1385 505 #define HRTIM_EVENT_8 ((uint32_t)0x00000080) /*!< External event channel 8 identifier */
MartinJohnson 0:404f5a4f1385 506 #define HRTIM_EVENT_9 ((uint32_t)0x00000100) /*!< External event channel 9 identifier */
MartinJohnson 0:404f5a4f1385 507 #define HRTIM_EVENT_10 ((uint32_t)0x00000200) /*!< External event channel 10 identifier */
MartinJohnson 0:404f5a4f1385 508
MartinJohnson 0:404f5a4f1385 509 #define IS_HRTIM_EVENT(EVENT)\
MartinJohnson 0:404f5a4f1385 510 (((EVENT) == HRTIM_EVENT_1) || \
MartinJohnson 0:404f5a4f1385 511 ((EVENT) == HRTIM_EVENT_2) || \
MartinJohnson 0:404f5a4f1385 512 ((EVENT) == HRTIM_EVENT_3) || \
MartinJohnson 0:404f5a4f1385 513 ((EVENT) == HRTIM_EVENT_4) || \
MartinJohnson 0:404f5a4f1385 514 ((EVENT) == HRTIM_EVENT_5) || \
MartinJohnson 0:404f5a4f1385 515 ((EVENT) == HRTIM_EVENT_6) || \
MartinJohnson 0:404f5a4f1385 516 ((EVENT) == HRTIM_EVENT_7) || \
MartinJohnson 0:404f5a4f1385 517 ((EVENT) == HRTIM_EVENT_8) || \
MartinJohnson 0:404f5a4f1385 518 ((EVENT) == HRTIM_EVENT_9) || \
MartinJohnson 0:404f5a4f1385 519 ((EVENT) == HRTIM_EVENT_10))
MartinJohnson 0:404f5a4f1385 520 /**
MartinJohnson 0:404f5a4f1385 521 * @}
MartinJohnson 0:404f5a4f1385 522 */
MartinJohnson 0:404f5a4f1385 523
MartinJohnson 0:404f5a4f1385 524 /** @defgroup HRTIM_FaultChannel
MartinJohnson 0:404f5a4f1385 525 * @{
MartinJohnson 0:404f5a4f1385 526 * @brief Constants defining fault channel identifiers
MartinJohnson 0:404f5a4f1385 527 */
MartinJohnson 0:404f5a4f1385 528 #define HRTIM_FAULT_1 ((uint32_t)0x01) /*!< Fault channel 1 identifier */
MartinJohnson 0:404f5a4f1385 529 #define HRTIM_FAULT_2 ((uint32_t)0x02) /*!< Fault channel 2 identifier */
MartinJohnson 0:404f5a4f1385 530 #define HRTIM_FAULT_3 ((uint32_t)0x04) /*!< Fault channel 3 identifier */
MartinJohnson 0:404f5a4f1385 531 #define HRTIM_FAULT_4 ((uint32_t)0x08) /*!< Fault channel 4 identifier */
MartinJohnson 0:404f5a4f1385 532 #define HRTIM_FAULT_5 ((uint32_t)0x10) /*!< Fault channel 5 identifier */
MartinJohnson 0:404f5a4f1385 533
MartinJohnson 0:404f5a4f1385 534 #define IS_HRTIM_FAULT(FAULT)\
MartinJohnson 0:404f5a4f1385 535 (((FAULT) == HRTIM_FAULT_1) || \
MartinJohnson 0:404f5a4f1385 536 ((FAULT) == HRTIM_FAULT_2) || \
MartinJohnson 0:404f5a4f1385 537 ((FAULT) == HRTIM_FAULT_3) || \
MartinJohnson 0:404f5a4f1385 538 ((FAULT) == HRTIM_FAULT_4) || \
MartinJohnson 0:404f5a4f1385 539 ((FAULT) == HRTIM_FAULT_5))
MartinJohnson 0:404f5a4f1385 540 /**
MartinJohnson 0:404f5a4f1385 541 * @}
MartinJohnson 0:404f5a4f1385 542 */
MartinJohnson 0:404f5a4f1385 543
MartinJohnson 0:404f5a4f1385 544
MartinJohnson 0:404f5a4f1385 545 /** @defgroup HRTIM_PrescalerRatio
MartinJohnson 0:404f5a4f1385 546 * @{
MartinJohnson 0:404f5a4f1385 547 * @brief Constants defining timer high-resolution clock prescaler ratio.
MartinJohnson 0:404f5a4f1385 548 */
MartinJohnson 0:404f5a4f1385 549 #define HRTIM_PRESCALERRATIO_MUL32 ((uint32_t)0x00000000) /*!< fHRCK: 4.608 GHz - Resolution: 217 ps - Min PWM frequency: 70.3 kHz (fHRTIM=144MHz) */
MartinJohnson 0:404f5a4f1385 550 #define HRTIM_PRESCALERRATIO_MUL16 ((uint32_t)0x00000001) /*!< fHRCK: 2.304 GHz - Resolution: 434 ps - Min PWM frequency: 35.1 KHz (fHRTIM=144MHz) */
MartinJohnson 0:404f5a4f1385 551 #define HRTIM_PRESCALERRATIO_MUL8 ((uint32_t)0x00000002) /*!< fHRCK: 1.152 GHz - Resolution: 868 ps - Min PWM frequency: 17.6 kHz (fHRTIM=144MHz) */
MartinJohnson 0:404f5a4f1385 552 #define HRTIM_PRESCALERRATIO_MUL4 ((uint32_t)0x00000003) /*!< fHRCK: 576 MHz - Resolution: 1.73 ns - Min PWM frequency: 8.8 kHz (fHRTIM=144MHz) */
MartinJohnson 0:404f5a4f1385 553 #define HRTIM_PRESCALERRATIO_MUL2 ((uint32_t)0x00000004) /*!< fHRCK: 288 MHz - Resolution: 3.47 ns - Min PWM frequency: 4.4 kHz (fHRTIM=144MHz) */
MartinJohnson 0:404f5a4f1385 554 #define HRTIM_PRESCALERRATIO_DIV1 ((uint32_t)0x00000005) /*!< fHRCK: 144 MHz - Resolution: 6.95 ns - Min PWM frequency: 2.2 kHz (fHRTIM=144MHz) */
MartinJohnson 0:404f5a4f1385 555 #define HRTIM_PRESCALERRATIO_DIV2 ((uint32_t)0x00000006) /*!< fHRCK: 72 MHz - Resolution: 13.88 ns- Min PWM frequency: 1.1 kHz (fHRTIM=144MHz) */
MartinJohnson 0:404f5a4f1385 556 #define HRTIM_PRESCALERRATIO_DIV4 ((uint32_t)0x00000007) /*!< fHRCK: 36 MHz - Resolution: 27.7 ns- Min PWM frequency: 550Hz (fHRTIM=144MHz) */
MartinJohnson 0:404f5a4f1385 557
MartinJohnson 0:404f5a4f1385 558 #define IS_HRTIM_PRESCALERRATIO(PRESCALERRATIO)\
MartinJohnson 0:404f5a4f1385 559 (((PRESCALERRATIO) == HRTIM_PRESCALERRATIO_MUL32) || \
MartinJohnson 0:404f5a4f1385 560 ((PRESCALERRATIO) == HRTIM_PRESCALERRATIO_MUL16) || \
MartinJohnson 0:404f5a4f1385 561 ((PRESCALERRATIO) == HRTIM_PRESCALERRATIO_MUL8) || \
MartinJohnson 0:404f5a4f1385 562 ((PRESCALERRATIO) == HRTIM_PRESCALERRATIO_MUL4) || \
MartinJohnson 0:404f5a4f1385 563 ((PRESCALERRATIO) == HRTIM_PRESCALERRATIO_MUL2) || \
MartinJohnson 0:404f5a4f1385 564 ((PRESCALERRATIO) == HRTIM_PRESCALERRATIO_DIV1) || \
MartinJohnson 0:404f5a4f1385 565 ((PRESCALERRATIO) == HRTIM_PRESCALERRATIO_DIV2) || \
MartinJohnson 0:404f5a4f1385 566 ((PRESCALERRATIO) == HRTIM_PRESCALERRATIO_DIV4))
MartinJohnson 0:404f5a4f1385 567 /**
MartinJohnson 0:404f5a4f1385 568 * @}
MartinJohnson 0:404f5a4f1385 569 */
MartinJohnson 0:404f5a4f1385 570
MartinJohnson 0:404f5a4f1385 571 /** @defgroup HRTIM_Mode
MartinJohnson 0:404f5a4f1385 572 * @{
MartinJohnson 0:404f5a4f1385 573 * @brief Constants defining timer counter operating mode.
MartinJohnson 0:404f5a4f1385 574 */
MartinJohnson 0:404f5a4f1385 575 #define HRTIM_MODE_CONTINOUS ((uint32_t)0x00000008) /*!< The timer operates in continuous (free-running) mode */
MartinJohnson 0:404f5a4f1385 576 #define HRTIM_MODE_SINGLESHOT ((uint32_t)0x00000000) /*!< The timer operates in non retriggerable single-shot mode */
MartinJohnson 0:404f5a4f1385 577 #define HRTIM_MODE_SINGLESHOT_RETRIGGERABLE ((uint32_t)0x00000010) /*!< The timer operates in retriggerable single-shot mode */
MartinJohnson 0:404f5a4f1385 578
MartinJohnson 0:404f5a4f1385 579 #define IS_HRTIM_MODE(MODE)\
MartinJohnson 0:404f5a4f1385 580 (((MODE) == HRTIM_MODE_CONTINOUS) || \
MartinJohnson 0:404f5a4f1385 581 ((MODE) == HRTIM_MODE_SINGLESHOT) || \
MartinJohnson 0:404f5a4f1385 582 ((MODE) == HRTIM_MODE_SINGLESHOT_RETRIGGERABLE))
MartinJohnson 0:404f5a4f1385 583
MartinJohnson 0:404f5a4f1385 584 #define IS_HRTIM_MODE_ONEPULSE(MODE)\
MartinJohnson 0:404f5a4f1385 585 (((MODE) == HRTIM_MODE_SINGLESHOT) || \
MartinJohnson 0:404f5a4f1385 586 ((MODE) == HRTIM_MODE_SINGLESHOT_RETRIGGERABLE))
MartinJohnson 0:404f5a4f1385 587
MartinJohnson 0:404f5a4f1385 588 /**
MartinJohnson 0:404f5a4f1385 589 * @}
MartinJohnson 0:404f5a4f1385 590 */
MartinJohnson 0:404f5a4f1385 591
MartinJohnson 0:404f5a4f1385 592 /** @defgroup HRTIM_HalfModeEnable
MartinJohnson 0:404f5a4f1385 593 * @{
MartinJohnson 0:404f5a4f1385 594 * @brief Constants defining half mode enabling status.
MartinJohnson 0:404f5a4f1385 595 */
MartinJohnson 0:404f5a4f1385 596 #define HRTIM_HALFMODE_DISABLED ((uint32_t)0x00000000) /*!< Half mode is disabled */
MartinJohnson 0:404f5a4f1385 597 #define HRTIM_HALFMODE_ENABLED ((uint32_t)0x00000020) /*!< Half mode is enabled */
MartinJohnson 0:404f5a4f1385 598
MartinJohnson 0:404f5a4f1385 599 #define IS_HRTIM_HALFMODE(HALFMODE)\
MartinJohnson 0:404f5a4f1385 600 (((HALFMODE) == HRTIM_HALFMODE_DISABLED) || \
MartinJohnson 0:404f5a4f1385 601 ((HALFMODE) == HRTIM_HALFMODE_ENABLED))
MartinJohnson 0:404f5a4f1385 602 /**
MartinJohnson 0:404f5a4f1385 603 * @}
MartinJohnson 0:404f5a4f1385 604 */
MartinJohnson 0:404f5a4f1385 605
MartinJohnson 0:404f5a4f1385 606 /** @defgroup HRTIM_StartOnSyncInputEvent
MartinJohnson 0:404f5a4f1385 607 * @{
MartinJohnson 0:404f5a4f1385 608 * @brief Constants defining the timer behaviour following the synchronization event
MartinJohnson 0:404f5a4f1385 609 */
MartinJohnson 0:404f5a4f1385 610 #define HRTIM_SYNCSTART_DISABLED ((uint32_t)0x00000000) /*!< Synchronization input event has effect on the timer */
MartinJohnson 0:404f5a4f1385 611 #define HRTIM_SYNCSTART_ENABLED (HRTIM_MCR_SYNCSTRTM) /*!< Synchronization input event starts the timer */
MartinJohnson 0:404f5a4f1385 612
MartinJohnson 0:404f5a4f1385 613 #define IS_HRTIM_SYNCSTART(SYNCSTART)\
MartinJohnson 0:404f5a4f1385 614 (((SYNCSTART) == HRTIM_SYNCSTART_DISABLED) || \
MartinJohnson 0:404f5a4f1385 615 ((SYNCSTART) == HRTIM_SYNCSTART_ENABLED))
MartinJohnson 0:404f5a4f1385 616 /**
MartinJohnson 0:404f5a4f1385 617 * @}
MartinJohnson 0:404f5a4f1385 618 */
MartinJohnson 0:404f5a4f1385 619
MartinJohnson 0:404f5a4f1385 620 /** @defgroup HRTIM_ResetOnSyncInputEvent
MartinJohnson 0:404f5a4f1385 621 * @{
MartinJohnson 0:404f5a4f1385 622 * @brief Constants defining the timer behaviour following the synchronization event
MartinJohnson 0:404f5a4f1385 623 */
MartinJohnson 0:404f5a4f1385 624 #define HRTIM_SYNCRESET_DISABLED ((uint32_t)0x00000000) /*!< Synchronization input event has effect on the timer */
MartinJohnson 0:404f5a4f1385 625 #define HRTIM_SYNCRESET_ENABLED (HRTIM_MCR_SYNCRSTM) /*!< Synchronization input event resets the timer */
MartinJohnson 0:404f5a4f1385 626
MartinJohnson 0:404f5a4f1385 627 #define IS_HRTIM_SYNCRESET(SYNCRESET)\
MartinJohnson 0:404f5a4f1385 628 (((SYNCRESET) == HRTIM_SYNCRESET_DISABLED) || \
MartinJohnson 0:404f5a4f1385 629 ((SYNCRESET) == HRTIM_SYNCRESET_ENABLED))
MartinJohnson 0:404f5a4f1385 630 /**
MartinJohnson 0:404f5a4f1385 631 * @}
MartinJohnson 0:404f5a4f1385 632 */
MartinJohnson 0:404f5a4f1385 633
MartinJohnson 0:404f5a4f1385 634 /** @defgroup HRTIM_DACSynchronization
MartinJohnson 0:404f5a4f1385 635 * @{
MartinJohnson 0:404f5a4f1385 636 * @brief Constants defining on which output the DAC synchronization event is sent
MartinJohnson 0:404f5a4f1385 637 */
MartinJohnson 0:404f5a4f1385 638 #define HRTIM_DACSYNC_NONE (uint32_t)0x00000000 /*!< No DAC synchronization event generated */
MartinJohnson 0:404f5a4f1385 639 #define HRTIM_DACSYNC_DACTRIGOUT_1 (HRTIM_MCR_DACSYNC_0) /*!< DAC synchronization event generated on DACTrigOut1 output upon timer update */
MartinJohnson 0:404f5a4f1385 640 #define HRTIM_DACSYNC_DACTRIGOUT_2 (HRTIM_MCR_DACSYNC_1) /*!< DAC synchronization event generated on DACTrigOut2 output upon timer update */
MartinJohnson 0:404f5a4f1385 641 #define HRTIM_DACSYNC_DACTRIGOUT_3 (HRTIM_MCR_DACSYNC_1 | HRTIM_MCR_DACSYNC_0) /*!< DAC update generated on DACTrigOut3 output upon timer update */
MartinJohnson 0:404f5a4f1385 642
MartinJohnson 0:404f5a4f1385 643 #define IS_HRTIM_DACSYNC(DACSYNC)\
MartinJohnson 0:404f5a4f1385 644 (((DACSYNC) == HRTIM_DACSYNC_NONE) || \
MartinJohnson 0:404f5a4f1385 645 ((DACSYNC) == HRTIM_DACSYNC_DACTRIGOUT_1) || \
MartinJohnson 0:404f5a4f1385 646 ((DACSYNC) == HRTIM_DACSYNC_DACTRIGOUT_2) || \
MartinJohnson 0:404f5a4f1385 647 ((DACSYNC) == HRTIM_DACSYNC_DACTRIGOUT_3))
MartinJohnson 0:404f5a4f1385 648 /**
MartinJohnson 0:404f5a4f1385 649 * @}
MartinJohnson 0:404f5a4f1385 650 */
MartinJohnson 0:404f5a4f1385 651
MartinJohnson 0:404f5a4f1385 652 /** @defgroup HRTIM_RegisterPreloadEnable
MartinJohnson 0:404f5a4f1385 653 * @{
MartinJohnson 0:404f5a4f1385 654 * @brief Constants defining whether a write access into a preloadable
MartinJohnson 0:404f5a4f1385 655 * register is done into the active or the preload register.
MartinJohnson 0:404f5a4f1385 656 */
MartinJohnson 0:404f5a4f1385 657 #define HRTIM_PRELOAD_DISABLED ((uint32_t)0x00000000) /*!< Preload disabled: the write access is directly done into the active register */
MartinJohnson 0:404f5a4f1385 658 #define HRTIM_PRELOAD_ENABLED (HRTIM_MCR_PREEN) /*!< Preload enabled: the write access is done into the preload register */
MartinJohnson 0:404f5a4f1385 659
MartinJohnson 0:404f5a4f1385 660 #define IS_HRTIM_PRELOAD(PRELOAD)\
MartinJohnson 0:404f5a4f1385 661 (((PRELOAD) == HRTIM_PRELOAD_DISABLED) || \
MartinJohnson 0:404f5a4f1385 662 ((PRELOAD) == HRTIM_PRELOAD_ENABLED))
MartinJohnson 0:404f5a4f1385 663 /**
MartinJohnson 0:404f5a4f1385 664 * @}
MartinJohnson 0:404f5a4f1385 665 */
MartinJohnson 0:404f5a4f1385 666
MartinJohnson 0:404f5a4f1385 667 /** @defgroup HRTIM_UpdateGating
MartinJohnson 0:404f5a4f1385 668 * @{
MartinJohnson 0:404f5a4f1385 669 * @brief Constants defining how the update occurs relatively to the burst DMA
MartinJohnson 0:404f5a4f1385 670 * transaction and the external update request on update enable inputs 1 to 3.
MartinJohnson 0:404f5a4f1385 671 */
MartinJohnson 0:404f5a4f1385 672 #define HRTIM_UPDATEGATING_INDEPENDENT (uint32_t)0x00000000 /*!< Update done independently from the DMA burst transfer completion */
MartinJohnson 0:404f5a4f1385 673 #define HRTIM_UPDATEGATING_DMABURST (HRTIM_TIMCR_UPDGAT_0) /*!< Update done when the DMA burst transfer is completed */
MartinJohnson 0:404f5a4f1385 674 #define HRTIM_UPDATEGATING_DMABURST_UPDATE (HRTIM_TIMCR_UPDGAT_1) /*!< Update done on timer roll-over following a DMA burst transfer completion*/
MartinJohnson 0:404f5a4f1385 675 #define HRTIM_UPDATEGATING_UPDEN1 (HRTIM_TIMCR_UPDGAT_1 | HRTIM_TIMCR_UPDGAT_0) /*!< Slave timer only - Update done on a rising edge of HRTIM update enable input 1 */
MartinJohnson 0:404f5a4f1385 676 #define HRTIM_UPDATEGATING_UPDEN2 (HRTIM_TIMCR_UPDGAT_2) /*!< Slave timer only - Update done on a rising edge of HRTIM update enable input 2 */
MartinJohnson 0:404f5a4f1385 677 #define HRTIM_UPDATEGATING_UPDEN3 (HRTIM_TIMCR_UPDGAT_2 | HRTIM_TIMCR_UPDGAT_0) /*!< Slave timer only - Update done on a rising edge of HRTIM update enable input 3 */
MartinJohnson 0:404f5a4f1385 678 #define HRTIM_UPDATEGATING_UPDEN1_UPDATE (HRTIM_TIMCR_UPDGAT_2 | HRTIM_TIMCR_UPDGAT_1) /*!< Slave timer only - Update done on the update event following a rising edge of HRTIM update enable input 1 */
MartinJohnson 0:404f5a4f1385 679 #define HRTIM_UPDATEGATING_UPDEN2_UPDATE (HRTIM_TIMCR_UPDGAT_2 | HRTIM_TIMCR_UPDGAT_1 | HRTIM_TIMCR_UPDGAT_0) /*!< Slave timer only - Update done on the update event following a rising edge of HRTIM update enable input 2 */
MartinJohnson 0:404f5a4f1385 680 #define HRTIM_UPDATEGATING_UPDEN3_UPDATE (HRTIM_TIMCR_UPDGAT_3) /*!< Slave timer only - Update done on the update event following a rising edge of HRTIM update enable input 3 */
MartinJohnson 0:404f5a4f1385 681
MartinJohnson 0:404f5a4f1385 682 #define IS_HRTIM_UPDATEGATING_MASTER(UPDATEGATING)\
MartinJohnson 0:404f5a4f1385 683 (((UPDATEGATING) == HRTIM_UPDATEGATING_INDEPENDENT) || \
MartinJohnson 0:404f5a4f1385 684 ((UPDATEGATING) == HRTIM_UPDATEGATING_DMABURST) || \
MartinJohnson 0:404f5a4f1385 685 ((UPDATEGATING) == HRTIM_UPDATEGATING_DMABURST_UPDATE))
MartinJohnson 0:404f5a4f1385 686
MartinJohnson 0:404f5a4f1385 687 #define IS_HRTIM_UPDATEGATING_TIM(UPDATEGATING)\
MartinJohnson 0:404f5a4f1385 688 (((UPDATEGATING) == HRTIM_UPDATEGATING_INDEPENDENT) || \
MartinJohnson 0:404f5a4f1385 689 ((UPDATEGATING) == HRTIM_UPDATEGATING_DMABURST) || \
MartinJohnson 0:404f5a4f1385 690 ((UPDATEGATING) == HRTIM_UPDATEGATING_DMABURST_UPDATE) || \
MartinJohnson 0:404f5a4f1385 691 ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN1) || \
MartinJohnson 0:404f5a4f1385 692 ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN2) || \
MartinJohnson 0:404f5a4f1385 693 ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN3) || \
MartinJohnson 0:404f5a4f1385 694 ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN1_UPDATE) || \
MartinJohnson 0:404f5a4f1385 695 ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN2_UPDATE) || \
MartinJohnson 0:404f5a4f1385 696 ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN3_UPDATE))
MartinJohnson 0:404f5a4f1385 697 /**
MartinJohnson 0:404f5a4f1385 698 * @}
MartinJohnson 0:404f5a4f1385 699 */
MartinJohnson 0:404f5a4f1385 700
MartinJohnson 0:404f5a4f1385 701 /** @defgroup HRTIM_TimerBurstMode
MartinJohnson 0:404f5a4f1385 702 * @{
MartinJohnson 0:404f5a4f1385 703 * @brief Constants defining how the timer behaves during a burst
MartinJohnson 0:404f5a4f1385 704 mode operation.
MartinJohnson 0:404f5a4f1385 705 */
MartinJohnson 0:404f5a4f1385 706 #define HRTIM_TIMERBURSTMODE_MAINTAINCLOCK (uint32_t)0x000000 /*!< Timer counter clock is maintained and the timer operates normally */
MartinJohnson 0:404f5a4f1385 707 #define HRTIM_TIMERBURSTMODE_RESETCOUNTER (HRTIM_BMCR_MTBM) /*!< Timer counter clock is stopped and the counter is reset */
MartinJohnson 0:404f5a4f1385 708
MartinJohnson 0:404f5a4f1385 709 #define IS_HRTIM_TIMERBURSTMODE(TIMERBURSTMODE) \
MartinJohnson 0:404f5a4f1385 710 (((TIMERBURSTMODE) == HRTIM_TIMERBURSTMODE_MAINTAINCLOCK) || \
MartinJohnson 0:404f5a4f1385 711 ((TIMERBURSTMODE) == HRTIM_TIMERBURSTMODE_RESETCOUNTER))
MartinJohnson 0:404f5a4f1385 712 /**
MartinJohnson 0:404f5a4f1385 713 * @}
MartinJohnson 0:404f5a4f1385 714 */
MartinJohnson 0:404f5a4f1385 715
MartinJohnson 0:404f5a4f1385 716 /** @defgroup HRTIM_TimerRepetitionUpdate
MartinJohnson 0:404f5a4f1385 717 * @{
MartinJohnson 0:404f5a4f1385 718 * @brief Constants defining whether registers are updated when the timer
MartinJohnson 0:404f5a4f1385 719 * repetition period is completed (either due to roll-over or
MartinJohnson 0:404f5a4f1385 720 * reset events)
MartinJohnson 0:404f5a4f1385 721 */
MartinJohnson 0:404f5a4f1385 722 #define HRTIM_UPDATEONREPETITION_DISABLED (uint32_t)0x00000000 /*!< Update on repetition disabled */
MartinJohnson 0:404f5a4f1385 723 #define HRTIM_UPDATEONREPETITION_ENABLED (HRTIM_MCR_MREPU) /*!< Update on repetition enabled */
MartinJohnson 0:404f5a4f1385 724
MartinJohnson 0:404f5a4f1385 725 #define IS_HRTIM_UPDATEONREPETITION(UPDATEONREPETITION) \
MartinJohnson 0:404f5a4f1385 726 (((UPDATEONREPETITION) == HRTIM_UPDATEONREPETITION_DISABLED) || \
MartinJohnson 0:404f5a4f1385 727 ((UPDATEONREPETITION) == HRTIM_UPDATEONREPETITION_ENABLED))
MartinJohnson 0:404f5a4f1385 728 /**
MartinJohnson 0:404f5a4f1385 729 * @}
MartinJohnson 0:404f5a4f1385 730 */
MartinJohnson 0:404f5a4f1385 731
MartinJohnson 0:404f5a4f1385 732
MartinJohnson 0:404f5a4f1385 733 /** @defgroup HRTIM_TimerPushPullMode
MartinJohnson 0:404f5a4f1385 734 * @{
MartinJohnson 0:404f5a4f1385 735 * @brief Constants defining whether or not the push-pull mode is enabled for
MartinJohnson 0:404f5a4f1385 736 * a timer.
MartinJohnson 0:404f5a4f1385 737 */
MartinJohnson 0:404f5a4f1385 738 #define HRTIM_TIMPUSHPULLMODE_DISABLED ((uint32_t)0x00000000) /*!< Push-Pull mode disabled */
MartinJohnson 0:404f5a4f1385 739 #define HRTIM_TIMPUSHPULLMODE_ENABLED ((uint32_t)HRTIM_TIMCR_PSHPLL) /*!< Push-Pull mode enabled */
MartinJohnson 0:404f5a4f1385 740
MartinJohnson 0:404f5a4f1385 741 #define IS_HRTIM_TIMPUSHPULLMODE(TIMPUSHPULLMODE)\
MartinJohnson 0:404f5a4f1385 742 (((TIMPUSHPULLMODE) == HRTIM_TIMPUSHPULLMODE_DISABLED) || \
MartinJohnson 0:404f5a4f1385 743 ((TIMPUSHPULLMODE) == HRTIM_TIMPUSHPULLMODE_ENABLED))
MartinJohnson 0:404f5a4f1385 744 /**
MartinJohnson 0:404f5a4f1385 745 * @}
MartinJohnson 0:404f5a4f1385 746 */
MartinJohnson 0:404f5a4f1385 747
MartinJohnson 0:404f5a4f1385 748 /** @defgroup HRTIM_TimerFaultEnabling
MartinJohnson 0:404f5a4f1385 749 * @{
MartinJohnson 0:404f5a4f1385 750 * @brief Constants defining whether a faut channel is enabled for a timer
MartinJohnson 0:404f5a4f1385 751 */
MartinJohnson 0:404f5a4f1385 752 #define HRTIM_TIMFAULTENABLE_NONE (uint32_t)0x00000000 /*!< No fault enabled */
MartinJohnson 0:404f5a4f1385 753 #define HRTIM_TIMFAULTENABLE_FAULT1 (HRTIM_FLTR_FLT1EN) /*!< Fault 1 enabled */
MartinJohnson 0:404f5a4f1385 754 #define HRTIM_TIMFAULTENABLE_FAULT2 (HRTIM_FLTR_FLT2EN) /*!< Fault 2 enabled */
MartinJohnson 0:404f5a4f1385 755 #define HRTIM_TIMFAULTENABLE_FAULT3 (HRTIM_FLTR_FLT3EN) /*!< Fault 3 enabled */
MartinJohnson 0:404f5a4f1385 756 #define HRTIM_TIMFAULTENABLE_FAULT4 (HRTIM_FLTR_FLT4EN) /*!< Fault 4 enabled */
MartinJohnson 0:404f5a4f1385 757 #define HRTIM_TIMFAULTENABLE_FAULT5 (HRTIM_FLTR_FLT5EN) /*!< Fault 5 enabled */
MartinJohnson 0:404f5a4f1385 758
MartinJohnson 0:404f5a4f1385 759 #define IS_HRTIM_TIMFAULTENABLE(TIMFAULTENABLE) (((TIMFAULTENABLE) & 0xFFFFFFE0) == 0x00000000)
MartinJohnson 0:404f5a4f1385 760
MartinJohnson 0:404f5a4f1385 761 /**
MartinJohnson 0:404f5a4f1385 762 * @}
MartinJohnson 0:404f5a4f1385 763 */
MartinJohnson 0:404f5a4f1385 764
MartinJohnson 0:404f5a4f1385 765 /** @defgroup HRTIM_TimerFaultLock
MartinJohnson 0:404f5a4f1385 766 * @{
MartinJohnson 0:404f5a4f1385 767 * @brief Constants defining whether or not fault enabling bits are write
MartinJohnson 0:404f5a4f1385 768 * protected for a timer
MartinJohnson 0:404f5a4f1385 769 */
MartinJohnson 0:404f5a4f1385 770 #define HRTIM_TIMFAULTLOCK_READWRITE ((uint32_t)0x00000000) /*!< Timer fault enabling bits are read/write */
MartinJohnson 0:404f5a4f1385 771 #define HRTIM_TIMFAULTLOCK_READONLY (HRTIM_FLTR_FLTCLK) /*!< Timer fault enabling bits are read only */
MartinJohnson 0:404f5a4f1385 772
MartinJohnson 0:404f5a4f1385 773 #define IS_HRTIM_TIMFAULTLOCK(TIMFAULTLOCK)\
MartinJohnson 0:404f5a4f1385 774 (((TIMFAULTLOCK) == HRTIM_TIMFAULTLOCK_READWRITE) || \
MartinJohnson 0:404f5a4f1385 775 ((TIMFAULTLOCK) == HRTIM_TIMFAULTLOCK_READONLY))
MartinJohnson 0:404f5a4f1385 776 /**
MartinJohnson 0:404f5a4f1385 777 * @}
MartinJohnson 0:404f5a4f1385 778 */
MartinJohnson 0:404f5a4f1385 779
MartinJohnson 0:404f5a4f1385 780 /** @defgroup HRTIM_TimerDeadtimeInsertion
MartinJohnson 0:404f5a4f1385 781 * @{
MartinJohnson 0:404f5a4f1385 782 * @brief Constants defining whether or not fault the dead time insertion
MartinJohnson 0:404f5a4f1385 783 * feature is enabled for a timer
MartinJohnson 0:404f5a4f1385 784 */
MartinJohnson 0:404f5a4f1385 785 #define HRTIM_TIMDEADTIMEINSERTION_DISABLED ((uint32_t)0x00000000) /*!< Output 1 and output 2 signals are independent */
MartinJohnson 0:404f5a4f1385 786 #define HRTIM_TIMDEADTIMEINSERTION_ENABLED HRTIM_OUTR_DTEN /*!< Deadtime is inserted between output 1 and output 2 */
MartinJohnson 0:404f5a4f1385 787
MartinJohnson 0:404f5a4f1385 788 #define IS_HRTIM_TIMDEADTIMEINSERTION(TIMDEADTIMEINSERTION)\
MartinJohnson 0:404f5a4f1385 789 (((TIMDEADTIMEINSERTION) == HRTIM_TIMDEADTIMEINSERTION_DISABLED) || \
MartinJohnson 0:404f5a4f1385 790 ((TIMDEADTIMEINSERTION) == HRTIM_TIMDEADTIMEINSERTION_ENABLED))
MartinJohnson 0:404f5a4f1385 791 /**
MartinJohnson 0:404f5a4f1385 792 * @}
MartinJohnson 0:404f5a4f1385 793 */
MartinJohnson 0:404f5a4f1385 794
MartinJohnson 0:404f5a4f1385 795 /** @defgroup HRTIM_TimerDelayedProtectionMode
MartinJohnson 0:404f5a4f1385 796 * @{
MartinJohnson 0:404f5a4f1385 797 * @brief Constants defining all possible delayed protection modes
MartinJohnson 0:404f5a4f1385 798 * for a timer. Also define the source and outputs on which the delayed
MartinJohnson 0:404f5a4f1385 799 * protection schemes are applied
MartinJohnson 0:404f5a4f1385 800 */
MartinJohnson 0:404f5a4f1385 801 #define HRTIM_TIMDELAYEDPROTECTION_DISABLED ((uint32_t)0x00000000) /*!< No action */
MartinJohnson 0:404f5a4f1385 802 #define HRTIM_TIMDELAYEDPROTECTION_DELAYEDOUT1_EEV68 (HRTIM_OUTR_DLYPRTEN) /*!< Output 1 delayed Idle on external Event 6 or 8 */
MartinJohnson 0:404f5a4f1385 803 #define HRTIM_TIMDELAYEDPROTECTION_DELAYEDOUT2_EEV68 (HRTIM_OUTR_DLYPRT_0 | HRTIM_OUTR_DLYPRTEN) /*!< Output 2 delayed Idle on external Event 6 or 8 */
MartinJohnson 0:404f5a4f1385 804 #define HRTIM_TIMDELAYEDPROTECTION_DELAYEDBOTH_EEV68 (HRTIM_OUTR_DLYPRT_1 | HRTIM_OUTR_DLYPRTEN) /*!< Output 1 and output 2 delayed Idle on external Event 6 or 8 */
MartinJohnson 0:404f5a4f1385 805 #define HRTIM_TIMDELAYEDPROTECTION_BALANCED_EEV68 (HRTIM_OUTR_DLYPRT_1 | HRTIM_OUTR_DLYPRT_0 | HRTIM_OUTR_DLYPRTEN) /*!< Balanced Idle on external Event 6 or 8 */
MartinJohnson 0:404f5a4f1385 806 #define HRTIM_TIMDELAYEDPROTECTION_DELAYEDOUT1_DEEV79 (HRTIM_OUTR_DLYPRT_2 | HRTIM_OUTR_DLYPRTEN) /*!< Output 1 delayed Idle on external Event 7 or 9 */
MartinJohnson 0:404f5a4f1385 807 #define HRTIM_TIMDELAYEDPROTECTION_DELAYEDOUT2_DEEV79 (HRTIM_OUTR_DLYPRT_2 | HRTIM_OUTR_DLYPRT_0 | HRTIM_OUTR_DLYPRTEN) /*!< Output 2 delayed Idle on external Event 7 or 9 */
MartinJohnson 0:404f5a4f1385 808 #define HRTIM_TIMDELAYEDPROTECTION_DELAYEDBOTH_EEV79 (HRTIM_OUTR_DLYPRT_2 | HRTIM_OUTR_DLYPRT_1 | HRTIM_OUTR_DLYPRTEN) /*!< Output 1 and output2 delayed Idle on external Event 7 or 9 */
MartinJohnson 0:404f5a4f1385 809 #define HRTIM_TIMDELAYEDPROTECTION_BALANCED_EEV79 (HRTIM_OUTR_DLYPRT_2 | HRTIM_OUTR_DLYPRT_1 | HRTIM_OUTR_DLYPRT_0 | HRTIM_OUTR_DLYPRTEN) /*!< Balanced Idle on external Event 7 or 9 */
MartinJohnson 0:404f5a4f1385 810
MartinJohnson 0:404f5a4f1385 811 #define IS_HRTIM_TIMDELAYEDPROTECTION(TIMDELAYEDPROTECTION)\
MartinJohnson 0:404f5a4f1385 812 (((TIMDELAYEDPROTECTION) == HRTIM_TIMDELAYEDPROTECTION_DISABLED) || \
MartinJohnson 0:404f5a4f1385 813 ((TIMDELAYEDPROTECTION) == HRTIM_TIMDELAYEDPROTECTION_DELAYEDOUT1_EEV68) || \
MartinJohnson 0:404f5a4f1385 814 ((TIMDELAYEDPROTECTION) == HRTIM_TIMDELAYEDPROTECTION_DELAYEDOUT2_EEV68) || \
MartinJohnson 0:404f5a4f1385 815 ((TIMDELAYEDPROTECTION) == HRTIM_TIMDELAYEDPROTECTION_DELAYEDBOTH_EEV68) || \
MartinJohnson 0:404f5a4f1385 816 ((TIMDELAYEDPROTECTION) == HRTIM_TIMDELAYEDPROTECTION_BALANCED_EEV68) || \
MartinJohnson 0:404f5a4f1385 817 ((TIMDELAYEDPROTECTION) == HRTIM_TIMDELAYEDPROTECTION_DELAYEDOUT1_DEEV79) || \
MartinJohnson 0:404f5a4f1385 818 ((TIMDELAYEDPROTECTION) == HRTIM_TIMDELAYEDPROTECTION_DELAYEDOUT2_DEEV79) || \
MartinJohnson 0:404f5a4f1385 819 ((TIMDELAYEDPROTECTION) == HRTIM_TIMDELAYEDPROTECTION_DELAYEDBOTH_EEV79) || \
MartinJohnson 0:404f5a4f1385 820 ((TIMDELAYEDPROTECTION) == HRTIM_TIMDELAYEDPROTECTION_BALANCED_EEV79))
MartinJohnson 0:404f5a4f1385 821 /**
MartinJohnson 0:404f5a4f1385 822 * @}
MartinJohnson 0:404f5a4f1385 823 */
MartinJohnson 0:404f5a4f1385 824
MartinJohnson 0:404f5a4f1385 825 /** @defgroup HRTIM_TimerUpdateTrigger
MartinJohnson 0:404f5a4f1385 826 * @{
MartinJohnson 0:404f5a4f1385 827 * @brief Constants defining whether the registers update is done synchronously
MartinJohnson 0:404f5a4f1385 828 * with any other timer or master update
MartinJohnson 0:404f5a4f1385 829 */
MartinJohnson 0:404f5a4f1385 830 #define HRTIM_TIMUPDATETRIGGER_NONE (uint32_t)0x00000000 /*!< Register update is disabled */
MartinJohnson 0:404f5a4f1385 831 #define HRTIM_TIMUPDATETRIGGER_MASTER (HRTIM_TIMCR_MSTU) /*!< Register update is triggered by the master timer update */
MartinJohnson 0:404f5a4f1385 832 #define HRTIM_TIMUPDATETRIGGER_TIMER_A (HRTIM_TIMCR_TAU) /*!< Register update is triggered by the timer A update */
MartinJohnson 0:404f5a4f1385 833 #define HRTIM_TIMUPDATETRIGGER_TIMER_B (HRTIM_TIMCR_TBU) /*!< Register update is triggered by the timer B update */
MartinJohnson 0:404f5a4f1385 834 #define HRTIM_TIMUPDATETRIGGER_TIMER_C (HRTIM_TIMCR_TCU) /*!< Register update is triggered by the timer C update*/
MartinJohnson 0:404f5a4f1385 835 #define HRTIM_TIMUPDATETRIGGER_TIMER_D (HRTIM_TIMCR_TDU) /*!< Register update is triggered by the timer D update */
MartinJohnson 0:404f5a4f1385 836 #define HRTIM_TIMUPDATETRIGGER_TIMER_E (HRTIM_TIMCR_TEU) /*!< Register update is triggered by the timer E update */
MartinJohnson 0:404f5a4f1385 837
MartinJohnson 0:404f5a4f1385 838 #define IS_HRTIM_TIMUPDATETRIGGER(TIMUPDATETRIGGER) (((TIMUPDATETRIGGER) & 0xFE07FFFF) == 0x00000000)
MartinJohnson 0:404f5a4f1385 839 /**
MartinJohnson 0:404f5a4f1385 840 * @}
MartinJohnson 0:404f5a4f1385 841 */
MartinJohnson 0:404f5a4f1385 842
MartinJohnson 0:404f5a4f1385 843 /** @defgroup HRTIM_TimerResetTrigger
MartinJohnson 0:404f5a4f1385 844 * @{
MartinJohnson 0:404f5a4f1385 845 * @brief Constants defining the events that can be selected to trigger the reset
MartinJohnson 0:404f5a4f1385 846 * of the timer counter
MartinJohnson 0:404f5a4f1385 847 */
MartinJohnson 0:404f5a4f1385 848 #define HRTIM_TIMRESETTRIGGER_NONE (uint32_t)0x00000000 /*!< No counter reset trigger */
MartinJohnson 0:404f5a4f1385 849 #define HRTIM_TIMRESETTRIGGER_UPDATE (HRTIM_RSTR_UPDATE) /*!< The timer counter is reset upon update event */
MartinJohnson 0:404f5a4f1385 850 #define HRTIM_TIMRESETTRIGGER_CMP2 (HRTIM_RSTR_CMP2) /*!< The timer counter is reset upon Timer Compare 2 event */
MartinJohnson 0:404f5a4f1385 851 #define HRTIM_TIMRESETTRIGGER_CMP4 (HRTIM_RSTR_CMP4) /*!< The timer counter is reset upon Timer Compare 4 event */
MartinJohnson 0:404f5a4f1385 852 #define HRTIM_TIMRESETTRIGGER_MASTER_PER (HRTIM_RSTR_MSTPER) /*!< The timer counter is reset upon master timer period event */
MartinJohnson 0:404f5a4f1385 853 #define HRTIM_TIMRESETTRIGGER_MASTER_CMP1 (HRTIM_RSTR_MSTCMP1) /*!< The timer counter is reset upon master timer Compare 1 event */
MartinJohnson 0:404f5a4f1385 854 #define HRTIM_TIMRESETTRIGGER_MASTER_CMP2 (HRTIM_RSTR_MSTCMP2) /*!< The timer counter is reset upon master timer Compare 2 event */
MartinJohnson 0:404f5a4f1385 855 #define HRTIM_TIMRESETTRIGGER_MASTER_CMP3 (HRTIM_RSTR_MSTCMP3) /*!< The timer counter is reset upon master timer Compare 3 event */
MartinJohnson 0:404f5a4f1385 856 #define HRTIM_TIMRESETTRIGGER_MASTER_CMP4 (HRTIM_RSTR_MSTCMP4) /*!< The timer counter is reset upon master timer Compare 4 event */
MartinJohnson 0:404f5a4f1385 857 #define HRTIM_TIMRESETTRIGGER_EEV_1 (HRTIM_RSTR_EXTEVNT1) /*!< The timer counter is reset upon external event 1 */
MartinJohnson 0:404f5a4f1385 858 #define HRTIM_TIMRESETTRIGGER_EEV_2 (HRTIM_RSTR_EXTEVNT2) /*!< The timer counter is reset upon external event 2 */
MartinJohnson 0:404f5a4f1385 859 #define HRTIM_TIMRESETTRIGGER_EEV_3 (HRTIM_RSTR_EXTEVNT3) /*!< The timer counter is reset upon external event 3 */
MartinJohnson 0:404f5a4f1385 860 #define HRTIM_TIMRESETTRIGGER_EEV_4 (HRTIM_RSTR_EXTEVNT4) /*!< The timer counter is reset upon external event 4 */
MartinJohnson 0:404f5a4f1385 861 #define HRTIM_TIMRESETTRIGGER_EEV_5 (HRTIM_RSTR_EXTEVNT5) /*!< The timer counter is reset upon external event 5 */
MartinJohnson 0:404f5a4f1385 862 #define HRTIM_TIMRESETTRIGGER_EEV_6 (HRTIM_RSTR_EXTEVNT6) /*!< The timer counter is reset upon external event 6 */
MartinJohnson 0:404f5a4f1385 863 #define HRTIM_TIMRESETTRIGGER_EEV_7 (HRTIM_RSTR_EXTEVNT7) /*!< The timer counter is reset upon external event 7 */
MartinJohnson 0:404f5a4f1385 864 #define HRTIM_TIMRESETTRIGGER_EEV_8 (HRTIM_RSTR_EXTEVNT8) /*!< The timer counter is reset upon external event 8 */
MartinJohnson 0:404f5a4f1385 865 #define HRTIM_TIMRESETTRIGGER_EEV_9 (HRTIM_RSTR_EXTEVNT9) /*!< The timer counter is reset upon external event 9 */
MartinJohnson 0:404f5a4f1385 866 #define HRTIM_TIMRESETTRIGGER_EEV_10 (HRTIM_RSTR_EXTEVNT10) /*!< The timer counter is reset upon external event 10 */
MartinJohnson 0:404f5a4f1385 867 #define HRTIM_TIMRESETTRIGGER_OTHER1_CMP1 (HRTIM_RSTR_TIMBCMP1) /*!< The timer counter is reset upon other timer Compare 1 event */
MartinJohnson 0:404f5a4f1385 868 #define HRTIM_TIMRESETTRIGGER_OTHER1_CMP2 (HRTIM_RSTR_TIMBCMP2) /*!< The timer counter is reset upon other timer Compare 2 event */
MartinJohnson 0:404f5a4f1385 869 #define HRTIM_TIMRESETTRIGGER_OTHER1_CMP4 (HRTIM_RSTR_TIMBCMP4) /*!< The timer counter is reset upon other timer Compare 4 event */
MartinJohnson 0:404f5a4f1385 870 #define HRTIM_TIMRESETTRIGGER_OTHER2_CMP1 (HRTIM_RSTR_TIMCCMP1) /*!< The timer counter is reset upon other timer Compare 1 event */
MartinJohnson 0:404f5a4f1385 871 #define HRTIM_TIMRESETTRIGGER_OTHER2_CMP2 (HRTIM_RSTR_TIMCCMP2) /*!< The timer counter is reset upon other timer Compare 2 event */
MartinJohnson 0:404f5a4f1385 872 #define HRTIM_TIMRESETTRIGGER_OTHER2_CMP4 (HRTIM_RSTR_TIMCCMP4) /*!< The timer counter is reset upon other timer Compare 4 event */
MartinJohnson 0:404f5a4f1385 873 #define HRTIM_TIMRESETTRIGGER_OTHER3_CMP1 (HRTIM_RSTR_TIMDCMP1) /*!< The timer counter is reset upon other timer Compare 1 event */
MartinJohnson 0:404f5a4f1385 874 #define HRTIM_TIMRESETTRIGGER_OTHER3_CMP2 (HRTIM_RSTR_TIMDCMP2) /*!< The timer counter is reset upon other timer Compare 2 event */
MartinJohnson 0:404f5a4f1385 875 #define HRTIM_TIMRESETTRIGGER_OTHER3_CMP4 (HRTIM_RSTR_TIMDCMP4) /*!< The timer counter is reset upon other timer Compare 4 event */
MartinJohnson 0:404f5a4f1385 876 #define HRTIM_TIMRESETTRIGGER_OTHER4_CMP1 (HRTIM_RSTR_TIMECMP1) /*!< The timer counter is reset upon other timer Compare 1 event */
MartinJohnson 0:404f5a4f1385 877 #define HRTIM_TIMRESETTRIGGER_OTHER4_CMP2 (HRTIM_RSTR_TIMECMP2) /*!< The timer counter is reset upon other timer Compare 2 event */
MartinJohnson 0:404f5a4f1385 878 #define HRTIM_TIMRESETTRIGGER_OTHER4_CMP4 (HRTIM_RSTR_TIMECMP4) /*!< The timer counter is reset upon other timer Compare 4 event */
MartinJohnson 0:404f5a4f1385 879
MartinJohnson 0:404f5a4f1385 880 #define IS_HRTIM_TIMRESETTRIGGER(TIMRESETTRIGGER) (((TIMRESETTRIGGER) & 0x800000001) == 0x00000000)
MartinJohnson 0:404f5a4f1385 881
MartinJohnson 0:404f5a4f1385 882 /**
MartinJohnson 0:404f5a4f1385 883 * @}
MartinJohnson 0:404f5a4f1385 884 */
MartinJohnson 0:404f5a4f1385 885
MartinJohnson 0:404f5a4f1385 886 /** @defgroup HRTIM_TimerResetUpdate
MartinJohnson 0:404f5a4f1385 887 * @{
MartinJohnson 0:404f5a4f1385 888 * @brief Constants defining whether the register are updated upon Timerx
MartinJohnson 0:404f5a4f1385 889 * counter reset or rollover to 0 after reaching the period value
MartinJohnson 0:404f5a4f1385 890 * in continuous mode
MartinJohnson 0:404f5a4f1385 891 */
MartinJohnson 0:404f5a4f1385 892 #define HRTIM_TIMUPDATEONRESET_DISABLED (uint32_t)0x00000000 /*!< Update by timer x reset / rollover disabled */
MartinJohnson 0:404f5a4f1385 893 #define HRTIM_TIMUPDATEONRESET_ENABLED (HRTIM_TIMCR_TRSTU) /*!< Update by timer x reset / rollover enabled */
MartinJohnson 0:404f5a4f1385 894
MartinJohnson 0:404f5a4f1385 895 #define IS_HRTIM_TIMUPDATEONRESET(TIMUPDATEONRESET) \
MartinJohnson 0:404f5a4f1385 896 (((TIMUPDATEONRESET) == HRTIM_TIMUPDATEONRESET_DISABLED) || \
MartinJohnson 0:404f5a4f1385 897 ((TIMUPDATEONRESET) == HRTIM_TIMUPDATEONRESET_ENABLED))
MartinJohnson 0:404f5a4f1385 898 /**
MartinJohnson 0:404f5a4f1385 899 * @}
MartinJohnson 0:404f5a4f1385 900 */
MartinJohnson 0:404f5a4f1385 901
MartinJohnson 0:404f5a4f1385 902 /** @defgroup HRTIM_CompareUnitAutoDelayedMode
MartinJohnson 0:404f5a4f1385 903 * @{
MartinJohnson 0:404f5a4f1385 904 * @brief Constants defining whether the compare register is behaving in
MartinJohnson 0:404f5a4f1385 905 * regular mode (compare match issued as soon as counter equal compare),
MartinJohnson 0:404f5a4f1385 906 * or in auto-delayed mode
MartinJohnson 0:404f5a4f1385 907 */
MartinJohnson 0:404f5a4f1385 908 #define HRTIM_AUTODELAYEDMODE_REGULAR ((uint32_t)0x00000000) /*!< standard compare mode */
MartinJohnson 0:404f5a4f1385 909 #define HRTIM_AUTODELAYEDMODE_AUTODELAYED_NOTIMEOUT (HRTIM_TIMCR_DELCMP2_0) /*!< Compare event generated only if a capture has occurred */
MartinJohnson 0:404f5a4f1385 910 #define HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP1 (HRTIM_TIMCR_DELCMP2_1) /*!< Compare event generated if a capture has occurred or after a Compare 1 match (timeout if capture event is missing) */
MartinJohnson 0:404f5a4f1385 911 #define HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP3 (HRTIM_TIMCR_DELCMP2_1 | HRTIM_TIMCR_DELCMP2_0) /*!< Compare event generated if a capture has occurred or after a Compare 3 match (timeout if capture event is missing) */
MartinJohnson 0:404f5a4f1385 912
MartinJohnson 0:404f5a4f1385 913 #define IS_HRTIM_AUTODELAYEDMODE(AUTODELAYEDMODE)\
MartinJohnson 0:404f5a4f1385 914 (((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_REGULAR) || \
MartinJohnson 0:404f5a4f1385 915 ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_NOTIMEOUT) || \
MartinJohnson 0:404f5a4f1385 916 ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP1) || \
MartinJohnson 0:404f5a4f1385 917 ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP3))
MartinJohnson 0:404f5a4f1385 918
MartinJohnson 0:404f5a4f1385 919 /* Auto delayed mode is only available for compare units 2 and 4 */
MartinJohnson 0:404f5a4f1385 920 #define IS_HRTIM_COMPAREUNIT_AUTODELAYEDMODE(COMPAREUNIT, AUTODELAYEDMODE) \
MartinJohnson 0:404f5a4f1385 921 ((((COMPAREUNIT) == HRTIM_COMPAREUNIT_1) && \
MartinJohnson 0:404f5a4f1385 922 ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_REGULAR)) \
MartinJohnson 0:404f5a4f1385 923 || \
MartinJohnson 0:404f5a4f1385 924 (((COMPAREUNIT) == HRTIM_COMPAREUNIT_2) && \
MartinJohnson 0:404f5a4f1385 925 (((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_REGULAR) || \
MartinJohnson 0:404f5a4f1385 926 ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_NOTIMEOUT) || \
MartinJohnson 0:404f5a4f1385 927 ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP1) || \
MartinJohnson 0:404f5a4f1385 928 ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP3))) \
MartinJohnson 0:404f5a4f1385 929 || \
MartinJohnson 0:404f5a4f1385 930 (((COMPAREUNIT) == HRTIM_COMPAREUNIT_3) && \
MartinJohnson 0:404f5a4f1385 931 ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_REGULAR)) \
MartinJohnson 0:404f5a4f1385 932 || \
MartinJohnson 0:404f5a4f1385 933 (((COMPAREUNIT) == HRTIM_COMPAREUNIT_4) && \
MartinJohnson 0:404f5a4f1385 934 (((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_REGULAR) || \
MartinJohnson 0:404f5a4f1385 935 ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_NOTIMEOUT) || \
MartinJohnson 0:404f5a4f1385 936 ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP1) || \
MartinJohnson 0:404f5a4f1385 937 ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP3))))
MartinJohnson 0:404f5a4f1385 938 /**
MartinJohnson 0:404f5a4f1385 939 * @}
MartinJohnson 0:404f5a4f1385 940 */
MartinJohnson 0:404f5a4f1385 941
MartinJohnson 0:404f5a4f1385 942 /** @defgroup HRTIM_BasicOCMode
MartinJohnson 0:404f5a4f1385 943 * @{
MartinJohnson 0:404f5a4f1385 944 * @brief Constants defining the behaviour of the output signal when the timer
MartinJohnson 0:404f5a4f1385 945 operates in basic output compare mode
MartinJohnson 0:404f5a4f1385 946 */
MartinJohnson 0:404f5a4f1385 947 #define HRTIM_BASICOCMODE_TOGGLE ((uint32_t)0x00000001) /*!< Output toggles when the timer counter reaches the compare value */
MartinJohnson 0:404f5a4f1385 948 #define HRTIM_BASICOCMODE_INACTIVE ((uint32_t)0x00000002) /*!< Output forced to active level when the timer counter reaches the compare value */
MartinJohnson 0:404f5a4f1385 949 #define HRTIM_BASICOCMODE_ACTIVE ((uint32_t)0x00000003) /*!< Output forced to inactive level when the timer counter reaches the compare value */
MartinJohnson 0:404f5a4f1385 950
MartinJohnson 0:404f5a4f1385 951 #define IS_HRTIM_BASICOCMODE(BASICOCMODE)\
MartinJohnson 0:404f5a4f1385 952 (((BASICOCMODE) == HRTIM_BASICOCMODE_TOGGLE) || \
MartinJohnson 0:404f5a4f1385 953 ((BASICOCMODE) == HRTIM_BASICOCMODE_INACTIVE) || \
MartinJohnson 0:404f5a4f1385 954 ((BASICOCMODE) == HRTIM_BASICOCMODE_ACTIVE))
MartinJohnson 0:404f5a4f1385 955 /**
MartinJohnson 0:404f5a4f1385 956 * @}
MartinJohnson 0:404f5a4f1385 957 */
MartinJohnson 0:404f5a4f1385 958
MartinJohnson 0:404f5a4f1385 959 /** @defgroup HRTIM_OutputPolarity
MartinJohnson 0:404f5a4f1385 960 * @{
MartinJohnson 0:404f5a4f1385 961 * @brief Constants defining the polarity of a timer output
MartinJohnson 0:404f5a4f1385 962 */
MartinJohnson 0:404f5a4f1385 963 #define HRTIM_OUTPUTPOLARITY_HIGH ((uint32_t)0x00000000) /*!< Output is active HIGH */
MartinJohnson 0:404f5a4f1385 964 #define HRTIM_OUTPUTPOLARITY_LOW (HRTIM_OUTR_POL1) /*!< Output is active LOW */
MartinJohnson 0:404f5a4f1385 965
MartinJohnson 0:404f5a4f1385 966 #define IS_HRTIM_OUTPUTPOLARITY(OUTPUTPOLARITY)\
MartinJohnson 0:404f5a4f1385 967 (((OUTPUTPOLARITY) == HRTIM_OUTPUTPOLARITY_HIGH) || \
MartinJohnson 0:404f5a4f1385 968 ((OUTPUTPOLARITY) == HRTIM_OUTPUTPOLARITY_LOW))
MartinJohnson 0:404f5a4f1385 969 /**
MartinJohnson 0:404f5a4f1385 970 * @}
MartinJohnson 0:404f5a4f1385 971 */
MartinJohnson 0:404f5a4f1385 972
MartinJohnson 0:404f5a4f1385 973 /** @defgroup HRTIM_OutputSetSource
MartinJohnson 0:404f5a4f1385 974 * @{
MartinJohnson 0:404f5a4f1385 975 * @brief Constants defining the events that can be selected to configure the
MartinJohnson 0:404f5a4f1385 976 * set crossbar of a timer output
MartinJohnson 0:404f5a4f1385 977 */
MartinJohnson 0:404f5a4f1385 978 #define HRTIM_OUTPUTSET_NONE (uint32_t)0x00000000 /*!< Reset the output set crossbar */
MartinJohnson 0:404f5a4f1385 979 #define HRTIM_OUTPUTSET_RESYNC (HRTIM_SET1R_RESYNC) /*!< Timer reset event coming solely from software or SYNC input forces the output to its active state */
MartinJohnson 0:404f5a4f1385 980 #define HRTIM_OUTPUTSET_TIMPER (HRTIM_SET1R_PER) /*!< Timer period event forces the output to its active state */
MartinJohnson 0:404f5a4f1385 981 #define HRTIM_OUTPUTSET_TIMCMP1 (HRTIM_SET1R_CMP1) /*!< Timer compare 1 event forces the output to its active state */
MartinJohnson 0:404f5a4f1385 982 #define HRTIM_OUTPUTSET_TIMCMP2 (HRTIM_SET1R_CMP2) /*!< Timer compare 2 event forces the output to its active state */
MartinJohnson 0:404f5a4f1385 983 #define HRTIM_OUTPUTSET_TIMCMP3 (HRTIM_SET1R_CMP3) /*!< Timer compare 3 event forces the output to its active state */
MartinJohnson 0:404f5a4f1385 984 #define HRTIM_OUTPUTSET_TIMCMP4 (HRTIM_SET1R_CMP4) /*!< Timer compare 4 event forces the output to its active state */
MartinJohnson 0:404f5a4f1385 985 #define HRTIM_OUTPUTSET_MASTERPER (HRTIM_SET1R_MSTPER) /*!< The master timer period event forces the output to its active state */
MartinJohnson 0:404f5a4f1385 986 #define HRTIM_OUTPUTSET_MASTERCMP1 (HRTIM_SET1R_MSTCMP1) /*!< Master Timer compare 1 event forces the output to its active state */
MartinJohnson 0:404f5a4f1385 987 #define HRTIM_OUTPUTSET_MASTERCMP2 (HRTIM_SET1R_MSTCMP2) /*!< Master Timer compare 2 event forces the output to its active state */
MartinJohnson 0:404f5a4f1385 988 #define HRTIM_OUTPUTSET_MASTERCMP3 (HRTIM_SET1R_MSTCMP3) /*!< Master Timer compare 3 event forces the output to its active state */
MartinJohnson 0:404f5a4f1385 989 #define HRTIM_OUTPUTSET_MASTERCMP4 (HRTIM_SET1R_MSTCMP4) /*!< Master Timer compare 4 event forces the output to its active state */
MartinJohnson 0:404f5a4f1385 990 #define HRTIM_OUTPUTSET_TIMEV_1 (HRTIM_SET1R_TIMEVNT1) /*!< Timer event 1 forces the output to its active state */
MartinJohnson 0:404f5a4f1385 991 #define HRTIM_OUTPUTSET_TIMEV_2 (HRTIM_SET1R_TIMEVNT2) /*!< Timer event 2 forces the output to its active state */
MartinJohnson 0:404f5a4f1385 992 #define HRTIM_OUTPUTSET_TIMEV_3 (HRTIM_SET1R_TIMEVNT3) /*!< Timer event 3 forces the output to its active state */
MartinJohnson 0:404f5a4f1385 993 #define HRTIM_OUTPUTSET_TIMEV_4 (HRTIM_SET1R_TIMEVNT4) /*!< Timer event 4 forces the output to its active state */
MartinJohnson 0:404f5a4f1385 994 #define HRTIM_OUTPUTSET_TIMEV_5 (HRTIM_SET1R_TIMEVNT5) /*!< Timer event 5 forces the output to its active state */
MartinJohnson 0:404f5a4f1385 995 #define HRTIM_OUTPUTSET_TIMEV_6 (HRTIM_SET1R_TIMEVNT6) /*!< Timer event 6 forces the output to its active state */
MartinJohnson 0:404f5a4f1385 996 #define HRTIM_OUTPUTSET_TIMEV_7 (HRTIM_SET1R_TIMEVNT7) /*!< Timer event 7 forces the output to its active state */
MartinJohnson 0:404f5a4f1385 997 #define HRTIM_OUTPUTSET_TIMEV_8 (HRTIM_SET1R_TIMEVNT8) /*!< Timer event 8 forces the output to its active state */
MartinJohnson 0:404f5a4f1385 998 #define HRTIM_OUTPUTSET_TIMEV_9 (HRTIM_SET1R_TIMEVNT9) /*!< Timer event 9 forces the output to its active state */
MartinJohnson 0:404f5a4f1385 999 #define HRTIM_OUTPUTSET_EEV_1 (HRTIM_SET1R_EXTVNT1) /*!< External event 1 forces the output to its active state */
MartinJohnson 0:404f5a4f1385 1000 #define HRTIM_OUTPUTSET_EEV_2 (HRTIM_SET1R_EXTVNT2) /*!< External event 2 forces the output to its active state */
MartinJohnson 0:404f5a4f1385 1001 #define HRTIM_OUTPUTSET_EEV_3 (HRTIM_SET1R_EXTVNT3) /*!< External event 3 forces the output to its active state */
MartinJohnson 0:404f5a4f1385 1002 #define HRTIM_OUTPUTSET_EEV_4 (HRTIM_SET1R_EXTVNT4) /*!< External event 4 forces the output to its active state */
MartinJohnson 0:404f5a4f1385 1003 #define HRTIM_OUTPUTSET_EEV_5 (HRTIM_SET1R_EXTVNT5) /*!< External event 5 forces the output to its active state */
MartinJohnson 0:404f5a4f1385 1004 #define HRTIM_OUTPUTSET_EEV_6 (HRTIM_SET1R_EXTVNT6) /*!< External event 6 forces the output to its active state */
MartinJohnson 0:404f5a4f1385 1005 #define HRTIM_OUTPUTSET_EEV_7 (HRTIM_SET1R_EXTVNT7) /*!< External event 7 forces the output to its active state */
MartinJohnson 0:404f5a4f1385 1006 #define HRTIM_OUTPUTSET_EEV_8 (HRTIM_SET1R_EXTVNT8) /*!< External event 8 forces the output to its active state */
MartinJohnson 0:404f5a4f1385 1007 #define HRTIM_OUTPUTSET_EEV_9 (HRTIM_SET1R_EXTVNT9) /*!< External event 9 forces the output to its active state */
MartinJohnson 0:404f5a4f1385 1008 #define HRTIM_OUTPUTSET_EEV_10 (HRTIM_SET1R_EXTVNT10) /*!< External event 10 forces the output to its active state */
MartinJohnson 0:404f5a4f1385 1009 #define HRTIM_OUTPUTSET_UPDATE (HRTIM_SET1R_UPDATE) /*!< Timer register update event forces the output to its active state */
MartinJohnson 0:404f5a4f1385 1010
MartinJohnson 0:404f5a4f1385 1011 #define IS_HRTIM_OUTPUTSET(OUTPUTSET)\
MartinJohnson 0:404f5a4f1385 1012 (((OUTPUTSET) == HRTIM_OUTPUTSET_NONE) || \
MartinJohnson 0:404f5a4f1385 1013 ((OUTPUTSET) == HRTIM_OUTPUTSET_RESYNC) || \
MartinJohnson 0:404f5a4f1385 1014 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMPER) || \
MartinJohnson 0:404f5a4f1385 1015 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMCMP1) || \
MartinJohnson 0:404f5a4f1385 1016 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMCMP2) || \
MartinJohnson 0:404f5a4f1385 1017 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMCMP3) || \
MartinJohnson 0:404f5a4f1385 1018 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMCMP4) || \
MartinJohnson 0:404f5a4f1385 1019 ((OUTPUTSET) == HRTIM_OUTPUTSET_MASTERPER) || \
MartinJohnson 0:404f5a4f1385 1020 ((OUTPUTSET) == HRTIM_OUTPUTSET_MASTERCMP1) || \
MartinJohnson 0:404f5a4f1385 1021 ((OUTPUTSET) == HRTIM_OUTPUTSET_MASTERCMP2) || \
MartinJohnson 0:404f5a4f1385 1022 ((OUTPUTSET) == HRTIM_OUTPUTSET_MASTERCMP3) || \
MartinJohnson 0:404f5a4f1385 1023 ((OUTPUTSET) == HRTIM_OUTPUTSET_MASTERCMP4) || \
MartinJohnson 0:404f5a4f1385 1024 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_1) || \
MartinJohnson 0:404f5a4f1385 1025 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_2) || \
MartinJohnson 0:404f5a4f1385 1026 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_3) || \
MartinJohnson 0:404f5a4f1385 1027 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_4) || \
MartinJohnson 0:404f5a4f1385 1028 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_5) || \
MartinJohnson 0:404f5a4f1385 1029 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_6) || \
MartinJohnson 0:404f5a4f1385 1030 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_7) || \
MartinJohnson 0:404f5a4f1385 1031 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_8) || \
MartinJohnson 0:404f5a4f1385 1032 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_9) || \
MartinJohnson 0:404f5a4f1385 1033 ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_1) || \
MartinJohnson 0:404f5a4f1385 1034 ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_2) || \
MartinJohnson 0:404f5a4f1385 1035 ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_3) || \
MartinJohnson 0:404f5a4f1385 1036 ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_4) || \
MartinJohnson 0:404f5a4f1385 1037 ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_5) || \
MartinJohnson 0:404f5a4f1385 1038 ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_6) || \
MartinJohnson 0:404f5a4f1385 1039 ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_7) || \
MartinJohnson 0:404f5a4f1385 1040 ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_8) || \
MartinJohnson 0:404f5a4f1385 1041 ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_9) || \
MartinJohnson 0:404f5a4f1385 1042 ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_10) || \
MartinJohnson 0:404f5a4f1385 1043 ((OUTPUTSET) == HRTIM_OUTPUTSET_UPDATE))
MartinJohnson 0:404f5a4f1385 1044 /**
MartinJohnson 0:404f5a4f1385 1045 * @}
MartinJohnson 0:404f5a4f1385 1046 */
MartinJohnson 0:404f5a4f1385 1047
MartinJohnson 0:404f5a4f1385 1048 /** @defgroup HRTIM_OutputResetSource
MartinJohnson 0:404f5a4f1385 1049 * @{
MartinJohnson 0:404f5a4f1385 1050 * @brief Constants defining the events that can be selected to configure the
MartinJohnson 0:404f5a4f1385 1051 * set crossbar of a timer output
MartinJohnson 0:404f5a4f1385 1052 */
MartinJohnson 0:404f5a4f1385 1053 #define HRTIM_OUTPUTRESET_NONE (uint32_t)0x00000000 /*!< Reset the output reset crossbar */
MartinJohnson 0:404f5a4f1385 1054 #define HRTIM_OUTPUTRESET_RESYNC (HRTIM_RST1R_RESYNC) /*!< Timer reset event coming solely from software or SYNC input forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1055 #define HRTIM_OUTPUTRESET_TIMPER (HRTIM_RST1R_PER) /*!< Timer period event forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1056 #define HRTIM_OUTPUTRESET_TIMCMP1 (HRTIM_RST1R_CMP1) /*!< Timer compare 1 event forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1057 #define HRTIM_OUTPUTRESET_TIMCMP2 (HRTIM_RST1R_CMP2) /*!< Timer compare 2 event forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1058 #define HRTIM_OUTPUTRESET_TIMCMP3 (HRTIM_RST1R_CMP3) /*!< Timer compare 3 event forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1059 #define HRTIM_OUTPUTRESET_TIMCMP4 (HRTIM_RST1R_CMP4) /*!< Timer compare 4 event forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1060 #define HRTIM_OUTPUTRESET_MASTERPER (HRTIM_RST1R_MSTPER) /*!< The master timer period event forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1061 #define HRTIM_OUTPUTRESET_MASTERCMP1 (HRTIM_RST1R_MSTCMP1) /*!< Master Timer compare 1 event forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1062 #define HRTIM_OUTPUTRESET_MASTERCMP2 (HRTIM_RST1R_MSTCMP2) /*!< Master Timer compare 2 event forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1063 #define HRTIM_OUTPUTRESET_MASTERCMP3 (HRTIM_RST1R_MSTCMP3) /*!< Master Timer compare 3 event forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1064 #define HRTIM_OUTPUTRESET_MASTERCMP4 (HRTIM_RST1R_MSTCMP4) /*!< Master Timer compare 4 event forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1065 #define HRTIM_OUTPUTRESET_TIMEV_1 (HRTIM_RST1R_TIMEVNT1) /*!< Timer event 1 forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1066 #define HRTIM_OUTPUTRESET_TIMEV_2 (HRTIM_RST1R_TIMEVNT2) /*!< Timer event 2 forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1067 #define HRTIM_OUTPUTRESET_TIMEV_3 (HRTIM_RST1R_TIMEVNT3) /*!< Timer event 3 forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1068 #define HRTIM_OUTPUTRESET_TIMEV_4 (HRTIM_RST1R_TIMEVNT4) /*!< Timer event 4 forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1069 #define HRTIM_OUTPUTRESET_TIMEV_5 (HRTIM_RST1R_TIMEVNT5) /*!< Timer event 5 forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1070 #define HRTIM_OUTPUTRESET_TIMEV_6 (HRTIM_RST1R_TIMEVNT6) /*!< Timer event 6 forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1071 #define HRTIM_OUTPUTRESET_TIMEV_7 (HRTIM_RST1R_TIMEVNT7) /*!< Timer event 7 forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1072 #define HRTIM_OUTPUTRESET_TIMEV_8 (HRTIM_RST1R_TIMEVNT8) /*!< Timer event 8 forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1073 #define HRTIM_OUTPUTRESET_TIMEV_9 (HRTIM_RST1R_TIMEVNT9) /*!< Timer event 9 forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1074 #define HRTIM_OUTPUTRESET_EEV_1 (HRTIM_RST1R_EXTVNT1) /*!< External event 1 forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1075 #define HRTIM_OUTPUTRESET_EEV_2 (HRTIM_RST1R_EXTVNT2) /*!< External event 2 forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1076 #define HRTIM_OUTPUTRESET_EEV_3 (HRTIM_RST1R_EXTVNT3) /*!< External event 3 forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1077 #define HRTIM_OUTPUTRESET_EEV_4 (HRTIM_RST1R_EXTVNT4) /*!< External event 4 forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1078 #define HRTIM_OUTPUTRESET_EEV_5 (HRTIM_RST1R_EXTVNT5) /*!< External event 5 forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1079 #define HRTIM_OUTPUTRESET_EEV_6 (HRTIM_RST1R_EXTVNT6) /*!< External event 6 forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1080 #define HRTIM_OUTPUTRESET_EEV_7 (HRTIM_RST1R_EXTVNT7) /*!< External event 7 forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1081 #define HRTIM_OUTPUTRESET_EEV_8 (HRTIM_RST1R_EXTVNT8) /*!< External event 8 forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1082 #define HRTIM_OUTPUTRESET_EEV_9 (HRTIM_RST1R_EXTVNT9) /*!< External event 9 forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1083 #define HRTIM_OUTPUTRESET_EEV_10 (HRTIM_RST1R_EXTVNT10) /*!< External event 10 forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1084 #define HRTIM_OUTPUTRESET_UPDATE (HRTIM_RST1R_UPDATE) /*!< Timer register update event forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 1085
MartinJohnson 0:404f5a4f1385 1086 #define IS_HRTIM_OUTPUTRESET(OUTPUTRESET)\
MartinJohnson 0:404f5a4f1385 1087 (((OUTPUTRESET) == HRTIM_OUTPUTRESET_NONE) || \
MartinJohnson 0:404f5a4f1385 1088 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_RESYNC) || \
MartinJohnson 0:404f5a4f1385 1089 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMPER) || \
MartinJohnson 0:404f5a4f1385 1090 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMCMP1) || \
MartinJohnson 0:404f5a4f1385 1091 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMCMP2) || \
MartinJohnson 0:404f5a4f1385 1092 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMCMP3) || \
MartinJohnson 0:404f5a4f1385 1093 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMCMP4) || \
MartinJohnson 0:404f5a4f1385 1094 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_MASTERPER) || \
MartinJohnson 0:404f5a4f1385 1095 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_MASTERCMP1) || \
MartinJohnson 0:404f5a4f1385 1096 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_MASTERCMP2) || \
MartinJohnson 0:404f5a4f1385 1097 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_MASTERCMP3) || \
MartinJohnson 0:404f5a4f1385 1098 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_MASTERCMP4) || \
MartinJohnson 0:404f5a4f1385 1099 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_1) || \
MartinJohnson 0:404f5a4f1385 1100 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_2) || \
MartinJohnson 0:404f5a4f1385 1101 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_3) || \
MartinJohnson 0:404f5a4f1385 1102 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_4) || \
MartinJohnson 0:404f5a4f1385 1103 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_5) || \
MartinJohnson 0:404f5a4f1385 1104 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_6) || \
MartinJohnson 0:404f5a4f1385 1105 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_7) || \
MartinJohnson 0:404f5a4f1385 1106 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_8) || \
MartinJohnson 0:404f5a4f1385 1107 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_9) || \
MartinJohnson 0:404f5a4f1385 1108 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_1) || \
MartinJohnson 0:404f5a4f1385 1109 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_2) || \
MartinJohnson 0:404f5a4f1385 1110 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_3) || \
MartinJohnson 0:404f5a4f1385 1111 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_4) || \
MartinJohnson 0:404f5a4f1385 1112 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_5) || \
MartinJohnson 0:404f5a4f1385 1113 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_6) || \
MartinJohnson 0:404f5a4f1385 1114 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_7) || \
MartinJohnson 0:404f5a4f1385 1115 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_8) || \
MartinJohnson 0:404f5a4f1385 1116 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_9) || \
MartinJohnson 0:404f5a4f1385 1117 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_10) || \
MartinJohnson 0:404f5a4f1385 1118 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_UPDATE))
MartinJohnson 0:404f5a4f1385 1119 /**
MartinJohnson 0:404f5a4f1385 1120 * @}
MartinJohnson 0:404f5a4f1385 1121 */
MartinJohnson 0:404f5a4f1385 1122
MartinJohnson 0:404f5a4f1385 1123 /** @defgroup HRTIM_OutputIdleMode
MartinJohnson 0:404f5a4f1385 1124 * @{
MartinJohnson 0:404f5a4f1385 1125 * @brief Constants defining whether or not the timer output transition to its
MartinJohnson 0:404f5a4f1385 1126 IDLE state when burst mode is entered
MartinJohnson 0:404f5a4f1385 1127 */
MartinJohnson 0:404f5a4f1385 1128 #define HRTIM_OUTPUTIDLEMODE_NONE (uint32_t)0x00000000 /*!< The output is not affected by the burst mode operation */
MartinJohnson 0:404f5a4f1385 1129 #define HRTIM_OUTPUTIDLEMODE_IDLE (HRTIM_OUTR_IDLM1) /*!< The output is in idle state when requested by the burst mode controller */
MartinJohnson 0:404f5a4f1385 1130
MartinJohnson 0:404f5a4f1385 1131 #define IS_HRTIM_OUTPUTIDLEMODE(OUTPUTIDLEMODE)\
MartinJohnson 0:404f5a4f1385 1132 (((OUTPUTIDLEMODE) == HRTIM_OUTPUTIDLEMODE_NONE) || \
MartinJohnson 0:404f5a4f1385 1133 ((OUTPUTIDLEMODE) == HRTIM_OUTPUTIDLEMODE_IDLE))
MartinJohnson 0:404f5a4f1385 1134 /**
MartinJohnson 0:404f5a4f1385 1135 * @}
MartinJohnson 0:404f5a4f1385 1136 */
MartinJohnson 0:404f5a4f1385 1137
MartinJohnson 0:404f5a4f1385 1138 /** @defgroup HRTIM_OutputIDLEState
MartinJohnson 0:404f5a4f1385 1139 * @{
MartinJohnson 0:404f5a4f1385 1140 * @brief Constants defining the IDLE state of a timer output
MartinJohnson 0:404f5a4f1385 1141 */
MartinJohnson 0:404f5a4f1385 1142 #define HRTIM_OUTPUTIDLESTATE_INACTIVE (uint32_t)0x00000000 /*!< Output at inactive level when in IDLE state */
MartinJohnson 0:404f5a4f1385 1143 #define HRTIM_OUTPUTIDLESTATE_ACTIVE (HRTIM_OUTR_IDLES1) /*!< Output at active level when in IDLE state */
MartinJohnson 0:404f5a4f1385 1144
MartinJohnson 0:404f5a4f1385 1145 #define IS_HRTIM_OUTPUTIDLESTATE(OUTPUTIDLESTATE)\
MartinJohnson 0:404f5a4f1385 1146 (((OUTPUTIDLESTATE) == HRTIM_OUTPUTIDLESTATE_INACTIVE) || \
MartinJohnson 0:404f5a4f1385 1147 ((OUTPUTIDLESTATE) == HRTIM_OUTPUTIDLESTATE_ACTIVE))
MartinJohnson 0:404f5a4f1385 1148 /**
MartinJohnson 0:404f5a4f1385 1149 * @}
MartinJohnson 0:404f5a4f1385 1150 */
MartinJohnson 0:404f5a4f1385 1151
MartinJohnson 0:404f5a4f1385 1152 /** @defgroup HRTIM_OutputFAULTState
MartinJohnson 0:404f5a4f1385 1153 * @{
MartinJohnson 0:404f5a4f1385 1154 * @brief Constants defining the FAULT state of a timer output
MartinJohnson 0:404f5a4f1385 1155 */
MartinJohnson 0:404f5a4f1385 1156 #define HRTIM_OUTPUTFAULTSTATE_NONE (uint32_t)0x00000000 /*!< The output is not affected by the fault input */
MartinJohnson 0:404f5a4f1385 1157 #define HRTIM_OUTPUTFAULTSTATE_ACTIVE (HRTIM_OUTR_FAULT1_0) /*!< Output at active level when in FAULT state */
MartinJohnson 0:404f5a4f1385 1158 #define HRTIM_OUTPUTFAULTSTATE_INACTIVE (HRTIM_OUTR_FAULT1_1) /*!< Output at inactive level when in FAULT state */
MartinJohnson 0:404f5a4f1385 1159 #define HRTIM_OUTPUTFAULTSTATE_HIGHZ (HRTIM_OUTR_FAULT1_1 | HRTIM_OUTR_FAULT1_0) /*!< Output is tri-stated when in FAULT state */
MartinJohnson 0:404f5a4f1385 1160
MartinJohnson 0:404f5a4f1385 1161 #define IS_HRTIM_OUTPUTFAULTSTATE(OUTPUTFAULTSTATE)\
MartinJohnson 0:404f5a4f1385 1162 (((OUTPUTFAULTSTATE) == HRTIM_OUTPUTFAULTSTATE_NONE) || \
MartinJohnson 0:404f5a4f1385 1163 ((OUTPUTFAULTSTATE) == HRTIM_OUTPUTFAULTSTATE_ACTIVE) || \
MartinJohnson 0:404f5a4f1385 1164 ((OUTPUTFAULTSTATE) == HRTIM_OUTPUTFAULTSTATE_INACTIVE) || \
MartinJohnson 0:404f5a4f1385 1165 ((OUTPUTFAULTSTATE) == HRTIM_OUTPUTFAULTSTATE_HIGHZ))
MartinJohnson 0:404f5a4f1385 1166 /**
MartinJohnson 0:404f5a4f1385 1167 * @}
MartinJohnson 0:404f5a4f1385 1168 */
MartinJohnson 0:404f5a4f1385 1169
MartinJohnson 0:404f5a4f1385 1170 /** @defgroup HRTIM_OutputChopperModeEnable
MartinJohnson 0:404f5a4f1385 1171 * @{
MartinJohnson 0:404f5a4f1385 1172 * @brief Constants defining whether or not chopper mode is enabled for a timer
MartinJohnson 0:404f5a4f1385 1173 output
MartinJohnson 0:404f5a4f1385 1174 */
MartinJohnson 0:404f5a4f1385 1175 #define HRTIM_OUTPUTCHOPPERMODE_DISABLED (uint32_t)0x00000000 /*!< The output is not affected by the fault input */
MartinJohnson 0:404f5a4f1385 1176 #define HRTIM_OUTPUTCHOPPERMODE_ENABLED (HRTIM_OUTR_CHP1) /*!< Output at active level when in FAULT state */
MartinJohnson 0:404f5a4f1385 1177
MartinJohnson 0:404f5a4f1385 1178 #define IS_HRTIM_OUTPUTCHOPPERMODE(OUTPUTCHOPPERMODE)\
MartinJohnson 0:404f5a4f1385 1179 (((OUTPUTCHOPPERMODE) == HRTIM_OUTPUTCHOPPERMODE_DISABLED) || \
MartinJohnson 0:404f5a4f1385 1180 ((OUTPUTCHOPPERMODE) == HRTIM_OUTPUTCHOPPERMODE_ENABLED))
MartinJohnson 0:404f5a4f1385 1181 /**
MartinJohnson 0:404f5a4f1385 1182 * @}
MartinJohnson 0:404f5a4f1385 1183 */
MartinJohnson 0:404f5a4f1385 1184
MartinJohnson 0:404f5a4f1385 1185 /** @defgroup HRTIM_OutputBurstModeEntryDelayed
MartinJohnson 0:404f5a4f1385 1186 * @{
MartinJohnson 0:404f5a4f1385 1187 * @brief Constants defining the idle mode entry is delayed by forcing a
MartinJohnson 0:404f5a4f1385 1188 deadtime insertion before switching the outputs to their idle state
MartinJohnson 0:404f5a4f1385 1189 */
MartinJohnson 0:404f5a4f1385 1190 #define HRTIM_OUTPUTBURSTMODEENTRY_REGULAR (uint32_t)0x00000000 /*!< The programmed Idle state is applied immediately to the Output */
MartinJohnson 0:404f5a4f1385 1191 #define HRTIM_OUTPUTBURSTMODEENTRY_DELAYED (HRTIM_OUTR_DIDL1) /*!< Deadtime is inserted on output before entering the idle mode */
MartinJohnson 0:404f5a4f1385 1192
MartinJohnson 0:404f5a4f1385 1193 #define IS_HRTIM_OUTPUTBURSTMODEENTRY(OUTPUTBURSTMODEENTRY)\
MartinJohnson 0:404f5a4f1385 1194 (((OUTPUTBURSTMODEENTRY) == HRTIM_OUTPUTBURSTMODEENTRY_REGULAR) || \
MartinJohnson 0:404f5a4f1385 1195 ((OUTPUTBURSTMODEENTRY) == HRTIM_OUTPUTBURSTMODEENTRY_DELAYED))
MartinJohnson 0:404f5a4f1385 1196 /**
MartinJohnson 0:404f5a4f1385 1197 * @}
MartinJohnson 0:404f5a4f1385 1198 */
MartinJohnson 0:404f5a4f1385 1199
MartinJohnson 0:404f5a4f1385 1200 /** @defgroup HRTIM_CaptureUnitTrigger
MartinJohnson 0:404f5a4f1385 1201 * @{
MartinJohnson 0:404f5a4f1385 1202 * @brief Constants defining the events that can be selected to trigger the
MartinJohnson 0:404f5a4f1385 1203 * capture of the timing unit counter
MartinJohnson 0:404f5a4f1385 1204 */
MartinJohnson 0:404f5a4f1385 1205 #define HRTIM_CAPTURETRIGGER_NONE (uint32_t)0x00000000 /*!< Capture trigger is disabled */
MartinJohnson 0:404f5a4f1385 1206 #define HRTIM_CAPTURETRIGGER_UPDATE (HRTIM_CPT1CR_UPDCPT) /*!< The update event triggers the Capture */
MartinJohnson 0:404f5a4f1385 1207 #define HRTIM_CAPTURETRIGGER_EEV_1 (HRTIM_CPT1CR_EXEV1CPT) /*!< The External event 1 triggers the Capture */
MartinJohnson 0:404f5a4f1385 1208 #define HRTIM_CAPTURETRIGGER_EEV_2 (HRTIM_CPT1CR_EXEV2CPT) /*!< The External event 2 triggers the Capture */
MartinJohnson 0:404f5a4f1385 1209 #define HRTIM_CAPTURETRIGGER_EEV_3 (HRTIM_CPT1CR_EXEV3CPT) /*!< The External event 3 triggers the Capture */
MartinJohnson 0:404f5a4f1385 1210 #define HRTIM_CAPTURETRIGGER_EEV_4 (HRTIM_CPT1CR_EXEV4CPT) /*!< The External event 4 triggers the Capture */
MartinJohnson 0:404f5a4f1385 1211 #define HRTIM_CAPTURETRIGGER_EEV_5 (HRTIM_CPT1CR_EXEV5CPT) /*!< The External event 5 triggers the Capture */
MartinJohnson 0:404f5a4f1385 1212 #define HRTIM_CAPTURETRIGGER_EEV_6 (HRTIM_CPT1CR_EXEV6CPT) /*!< The External event 6 triggers the Capture */
MartinJohnson 0:404f5a4f1385 1213 #define HRTIM_CAPTURETRIGGER_EEV_7 (HRTIM_CPT1CR_EXEV7CPT) /*!< The External event 7 triggers the Capture */
MartinJohnson 0:404f5a4f1385 1214 #define HRTIM_CAPTURETRIGGER_EEV_8 (HRTIM_CPT1CR_EXEV8CPT) /*!< The External event 8 triggers the Capture */
MartinJohnson 0:404f5a4f1385 1215 #define HRTIM_CAPTURETRIGGER_EEV_9 (HRTIM_CPT1CR_EXEV9CPT) /*!< The External event 9 triggers the Capture */
MartinJohnson 0:404f5a4f1385 1216 #define HRTIM_CAPTURETRIGGER_EEV_10 (HRTIM_CPT1CR_EXEV10CPT) /*!< The External event 10 triggers the Capture */
MartinJohnson 0:404f5a4f1385 1217 #define HRTIM_CAPTURETRIGGER_TA1_SET (HRTIM_CPT1CR_TA1SET) /*!< Capture is triggered by TA1 output inactive to active transition */
MartinJohnson 0:404f5a4f1385 1218 #define HRTIM_CAPTURETRIGGER_TA1_RESET (HRTIM_CPT1CR_TA1RST) /*!< Capture is triggered by TA1 output active to inactive transition */
MartinJohnson 0:404f5a4f1385 1219 #define HRTIM_CAPTURETRIGGER_TIMERA_CMP1 (HRTIM_CPT1CR_TA1CMP1) /*!< Timer A Compare 1 triggers Capture */
MartinJohnson 0:404f5a4f1385 1220 #define HRTIM_CAPTURETRIGGER_TIMERA_CMP2 (HRTIM_CPT1CR_TA1CMP2) /*!< Timer A Compare 2 triggers Capture */
MartinJohnson 0:404f5a4f1385 1221 #define HRTIM_CAPTURETRIGGER_TB1_SET (HRTIM_CPT1CR_TB1SET) /*!< Capture is triggered by TB1 output inactive to active transition */
MartinJohnson 0:404f5a4f1385 1222 #define HRTIM_CAPTURETRIGGER_TB1_RESET (HRTIM_CPT1CR_TB1RST) /*!< Capture is triggered by TB1 output active to inactive transition */
MartinJohnson 0:404f5a4f1385 1223 #define HRTIM_CAPTURETRIGGER_TIMERB_CMP1 (HRTIM_CPT1CR_TB1CMP1) /*!< Timer B Compare 1 triggers Capture */
MartinJohnson 0:404f5a4f1385 1224 #define HRTIM_CAPTURETRIGGER_TIMERB_CMP2 (HRTIM_CPT1CR_TB1CMP2) /*!< Timer B Compare 2 triggers Capture */
MartinJohnson 0:404f5a4f1385 1225 #define HRTIM_CAPTURETRIGGER_TC1_SET (HRTIM_CPT1CR_TC1SET) /*!< Capture is triggered by TC1 output inactive to active transition */
MartinJohnson 0:404f5a4f1385 1226 #define HRTIM_CAPTURETRIGGER_TC1_RESET (HRTIM_CPT1CR_TC1RST) /*!< Capture is triggered by TC1 output active to inactive transition */
MartinJohnson 0:404f5a4f1385 1227 #define HRTIM_CAPTURETRIGGER_TIMERC_CMP1 (HRTIM_CPT1CR_TC1CMP1) /*!< Timer C Compare 1 triggers Capture */
MartinJohnson 0:404f5a4f1385 1228 #define HRTIM_CAPTURETRIGGER_TIMERC_CMP2 (HRTIM_CPT1CR_TC1CMP2) /*!< Timer C Compare 2 triggers Capture */
MartinJohnson 0:404f5a4f1385 1229 #define HRTIM_CAPTURETRIGGER_TD1_SET (HRTIM_CPT1CR_TD1SET) /*!< Capture is triggered by TD1 output inactive to active transition */
MartinJohnson 0:404f5a4f1385 1230 #define HRTIM_CAPTURETRIGGER_TD1_RESET (HRTIM_CPT1CR_TD1RST) /*!< Capture is triggered by TD1 output active to inactive transition */
MartinJohnson 0:404f5a4f1385 1231 #define HRTIM_CAPTURETRIGGER_TIMERD_CMP1 (HRTIM_CPT1CR_TD1CMP1) /*!< Timer D Compare 1 triggers Capture */
MartinJohnson 0:404f5a4f1385 1232 #define HRTIM_CAPTURETRIGGER_TIMERD_CMP2 (HRTIM_CPT1CR_TD1CMP2) /*!< Timer D Compare 2 triggers Capture */
MartinJohnson 0:404f5a4f1385 1233 #define HRTIM_CAPTURETRIGGER_TE1_SET (HRTIM_CPT1CR_TE1SET) /*!< Capture is triggered by TE1 output inactive to active transition */
MartinJohnson 0:404f5a4f1385 1234 #define HRTIM_CAPTURETRIGGER_TE1_RESET (HRTIM_CPT1CR_TE1RST) /*!< Capture is triggered by TE1 output active to inactive transition */
MartinJohnson 0:404f5a4f1385 1235 #define HRTIM_CAPTURETRIGGER_TIMERE_CMP1 (HRTIM_CPT1CR_TE1CMP1) /*!< Timer E Compare 1 triggers Capture */
MartinJohnson 0:404f5a4f1385 1236 #define HRTIM_CAPTURETRIGGER_TIMERE_CMP2 (HRTIM_CPT1CR_TE1CMP2) /*!< Timer E Compare 2 triggers Capture */
MartinJohnson 0:404f5a4f1385 1237
MartinJohnson 0:404f5a4f1385 1238 #define IS_HRTIM_TIMER_CAPTURETRIGGER(TIMER, CAPTURETRIGGER) \
MartinJohnson 0:404f5a4f1385 1239 (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_NONE) || \
MartinJohnson 0:404f5a4f1385 1240 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_UPDATE) || \
MartinJohnson 0:404f5a4f1385 1241 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_1) || \
MartinJohnson 0:404f5a4f1385 1242 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_2) || \
MartinJohnson 0:404f5a4f1385 1243 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_3) || \
MartinJohnson 0:404f5a4f1385 1244 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_4) || \
MartinJohnson 0:404f5a4f1385 1245 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_5) || \
MartinJohnson 0:404f5a4f1385 1246 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_6) || \
MartinJohnson 0:404f5a4f1385 1247 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_7) || \
MartinJohnson 0:404f5a4f1385 1248 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_8) || \
MartinJohnson 0:404f5a4f1385 1249 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_9) || \
MartinJohnson 0:404f5a4f1385 1250 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_10) \
MartinJohnson 0:404f5a4f1385 1251 || \
MartinJohnson 0:404f5a4f1385 1252 (((TIMER) == HRTIM_TIMERINDEX_TIMER_A) && \
MartinJohnson 0:404f5a4f1385 1253 (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_SET) || \
MartinJohnson 0:404f5a4f1385 1254 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_RESET) || \
MartinJohnson 0:404f5a4f1385 1255 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP1) || \
MartinJohnson 0:404f5a4f1385 1256 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP2))) \
MartinJohnson 0:404f5a4f1385 1257 || \
MartinJohnson 0:404f5a4f1385 1258 (((TIMER) == HRTIM_TIMERINDEX_TIMER_B) && \
MartinJohnson 0:404f5a4f1385 1259 (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_SET) || \
MartinJohnson 0:404f5a4f1385 1260 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_RESET) || \
MartinJohnson 0:404f5a4f1385 1261 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP1) || \
MartinJohnson 0:404f5a4f1385 1262 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP2))) \
MartinJohnson 0:404f5a4f1385 1263 || \
MartinJohnson 0:404f5a4f1385 1264 (((TIMER) == HRTIM_TIMERINDEX_TIMER_C) && \
MartinJohnson 0:404f5a4f1385 1265 (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_SET) || \
MartinJohnson 0:404f5a4f1385 1266 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_RESET) || \
MartinJohnson 0:404f5a4f1385 1267 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP1) || \
MartinJohnson 0:404f5a4f1385 1268 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP2))) \
MartinJohnson 0:404f5a4f1385 1269 || \
MartinJohnson 0:404f5a4f1385 1270 (((TIMER) == HRTIM_TIMERINDEX_TIMER_D) && \
MartinJohnson 0:404f5a4f1385 1271 (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_SET) || \
MartinJohnson 0:404f5a4f1385 1272 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_RESET) || \
MartinJohnson 0:404f5a4f1385 1273 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP1) || \
MartinJohnson 0:404f5a4f1385 1274 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP2))) \
MartinJohnson 0:404f5a4f1385 1275 || \
MartinJohnson 0:404f5a4f1385 1276 (((TIMER) == HRTIM_TIMERINDEX_TIMER_E) && \
MartinJohnson 0:404f5a4f1385 1277 (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_SET) || \
MartinJohnson 0:404f5a4f1385 1278 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_RESET) || \
MartinJohnson 0:404f5a4f1385 1279 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP1) || \
MartinJohnson 0:404f5a4f1385 1280 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP2))))
MartinJohnson 0:404f5a4f1385 1281 /**
MartinJohnson 0:404f5a4f1385 1282 * @}
MartinJohnson 0:404f5a4f1385 1283 */
MartinJohnson 0:404f5a4f1385 1284
MartinJohnson 0:404f5a4f1385 1285 /** @defgroup HRTIM_TimerExternalEventFilter
MartinJohnson 0:404f5a4f1385 1286 * @{
MartinJohnson 0:404f5a4f1385 1287 * @brief Constants defining the event filtering applied to external events
MartinJohnson 0:404f5a4f1385 1288 * by a timer
MartinJohnson 0:404f5a4f1385 1289 */
MartinJohnson 0:404f5a4f1385 1290 #define HRTIM_TIMEVENTFILTER_NONE (0x00000000)
MartinJohnson 0:404f5a4f1385 1291 #define HRTIM_TIMEVENTFILTER_BLANKINGCMP1 (HRTIM_EEFR1_EE1FLTR_0) /*!< Blanking from counter reset/roll-over to Compare 1 */
MartinJohnson 0:404f5a4f1385 1292 #define HRTIM_TIMEVENTFILTER_BLANKINGCMP2 (HRTIM_EEFR1_EE1FLTR_1) /*!< Blanking from counter reset/roll-over to Compare 2 */
MartinJohnson 0:404f5a4f1385 1293 #define HRTIM_TIMEVENTFILTER_BLANKINGCMP3 (HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_0) /*!< Blanking from counter reset/roll-over to Compare 3 */
MartinJohnson 0:404f5a4f1385 1294 #define HRTIM_TIMEVENTFILTER_BLANKINGCMP4 (HRTIM_EEFR1_EE1FLTR_2) /*!< Blanking from counter reset/roll-over to Compare 4 */
MartinJohnson 0:404f5a4f1385 1295 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR1 (HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_0) /*!< Blanking from another timing unit: TIMFLTR1 source */
MartinJohnson 0:404f5a4f1385 1296 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR2 (HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_1) /*!< Blanking from another timing unit: TIMFLTR2 source */
MartinJohnson 0:404f5a4f1385 1297 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR3 (HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_0) /*!< Blanking from another timing unit: TIMFLTR3 source */
MartinJohnson 0:404f5a4f1385 1298 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR4 (HRTIM_EEFR1_EE1FLTR_3) /*!< Blanking from another timing unit: TIMFLTR4 source */
MartinJohnson 0:404f5a4f1385 1299 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR5 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_0) /*!< Blanking from another timing unit: TIMFLTR5 source */
MartinJohnson 0:404f5a4f1385 1300 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR6 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_1) /*!< Blanking from another timing unit: TIMFLTR6 source */
MartinJohnson 0:404f5a4f1385 1301 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR7 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_0) /*!< Blanking from another timing unit: TIMFLTR7 source */
MartinJohnson 0:404f5a4f1385 1302 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR8 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2) /*!< Blanking from another timing unit: TIMFLTR8 source */
MartinJohnson 0:404f5a4f1385 1303 #define HRTIM_TIMEVENTFILTER_WINDOWINGCMP2 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_0) /*!< Windowing from counter reset/roll-over to Compare 2 */
MartinJohnson 0:404f5a4f1385 1304 #define HRTIM_TIMEVENTFILTER_WINDOWINGCMP3 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_1) /*!< Windowing from counter reset/roll-over to Compare 3 */
MartinJohnson 0:404f5a4f1385 1305 #define HRTIM_TIMEVENTFILTER_WINDOWINGTIM (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_0) /*!< Windowing from another timing unit: TIMWIN source */
MartinJohnson 0:404f5a4f1385 1306
MartinJohnson 0:404f5a4f1385 1307 #define IS_HRTIM_TIMEVENTFILTER(TIMEVENTFILTER)\
MartinJohnson 0:404f5a4f1385 1308 (((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_NONE) || \
MartinJohnson 0:404f5a4f1385 1309 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGCMP1) || \
MartinJohnson 0:404f5a4f1385 1310 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGCMP2) || \
MartinJohnson 0:404f5a4f1385 1311 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGCMP3) || \
MartinJohnson 0:404f5a4f1385 1312 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGCMP4) || \
MartinJohnson 0:404f5a4f1385 1313 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR1) || \
MartinJohnson 0:404f5a4f1385 1314 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR2) || \
MartinJohnson 0:404f5a4f1385 1315 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR3) || \
MartinJohnson 0:404f5a4f1385 1316 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR4) || \
MartinJohnson 0:404f5a4f1385 1317 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR5) || \
MartinJohnson 0:404f5a4f1385 1318 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR6) || \
MartinJohnson 0:404f5a4f1385 1319 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR7) || \
MartinJohnson 0:404f5a4f1385 1320 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR8) || \
MartinJohnson 0:404f5a4f1385 1321 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_WINDOWINGCMP2) || \
MartinJohnson 0:404f5a4f1385 1322 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_WINDOWINGCMP3) || \
MartinJohnson 0:404f5a4f1385 1323 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_WINDOWINGTIM))
MartinJohnson 0:404f5a4f1385 1324 /**
MartinJohnson 0:404f5a4f1385 1325 * @}
MartinJohnson 0:404f5a4f1385 1326 */
MartinJohnson 0:404f5a4f1385 1327
MartinJohnson 0:404f5a4f1385 1328 /** @defgroup HRTIM_TimerExternalEventLatch
MartinJohnson 0:404f5a4f1385 1329 * @{
MartinJohnson 0:404f5a4f1385 1330 * @brief Constants defining whether or not the external event is
MartinJohnson 0:404f5a4f1385 1331 * memorized (latched) and generated as soon as the blanking period
MartinJohnson 0:404f5a4f1385 1332 * is completed or the window ends
MartinJohnson 0:404f5a4f1385 1333 */
MartinJohnson 0:404f5a4f1385 1334 #define HRTIM_TIMEVENTLATCH_DISABLED ((uint32_t)0x00000000) /*!< Event is ignored if it happens during a blank, or passed through during a window */
MartinJohnson 0:404f5a4f1385 1335 #define HRTIM_TIMEVENTLATCH_ENABLED HRTIM_EEFR1_EE1LTCH /*!< Event 1 is latched and delayed till the end of the blanking or windowing period */ /*!< Blanking from counter reset/roll-over to Compare 1 */
MartinJohnson 0:404f5a4f1385 1336
MartinJohnson 0:404f5a4f1385 1337 #define IS_HRTIM_TIMEVENTLATCH(TIMEVENTLATCH)\
MartinJohnson 0:404f5a4f1385 1338 (((TIMEVENTLATCH) == HRTIM_TIMEVENTLATCH_DISABLED) || \
MartinJohnson 0:404f5a4f1385 1339 ((TIMEVENTLATCH) == HRTIM_TIMEVENTLATCH_ENABLED))
MartinJohnson 0:404f5a4f1385 1340 /**
MartinJohnson 0:404f5a4f1385 1341 * @}
MartinJohnson 0:404f5a4f1385 1342 */
MartinJohnson 0:404f5a4f1385 1343
MartinJohnson 0:404f5a4f1385 1344 /** @defgroup HRTIM_DeadtimeRisingSign
MartinJohnson 0:404f5a4f1385 1345 * @{
MartinJohnson 0:404f5a4f1385 1346 * @brief Constants defining whether the deadtime is positive or negative
MartinJohnson 0:404f5a4f1385 1347 * (overlapping signal) on rising edge
MartinJohnson 0:404f5a4f1385 1348 */
MartinJohnson 0:404f5a4f1385 1349 #define HRTIM_TIMDEADTIME_RISINGSIGN_POSITIVE ((uint32_t)0x00000000) /*!< Positive deadtime on rising edge */
MartinJohnson 0:404f5a4f1385 1350 #define HRTIM_TIMDEADTIME_RISINGSIGN_NEGATIVE (HRTIM_DTR_SDTR) /*!< Negative deadtime on rising edge */
MartinJohnson 0:404f5a4f1385 1351
MartinJohnson 0:404f5a4f1385 1352 #define IS_HRTIM_TIMDEADTIME_RISINGSIGN(RISINGSIGN)\
MartinJohnson 0:404f5a4f1385 1353 (((RISINGSIGN) == HRTIM_TIMDEADTIME_RISINGSIGN_POSITIVE) || \
MartinJohnson 0:404f5a4f1385 1354 ((RISINGSIGN) == HRTIM_TIMDEADTIME_RISINGSIGN_NEGATIVE))
MartinJohnson 0:404f5a4f1385 1355 /**
MartinJohnson 0:404f5a4f1385 1356 * @}
MartinJohnson 0:404f5a4f1385 1357 */
MartinJohnson 0:404f5a4f1385 1358
MartinJohnson 0:404f5a4f1385 1359 /** @defgroup HRTIM_DeadtimeRisingLock
MartinJohnson 0:404f5a4f1385 1360 * @{
MartinJohnson 0:404f5a4f1385 1361 * @brief Constants defining whether or not the deadtime (rising sign and
MartinJohnson 0:404f5a4f1385 1362 * value) is write protected
MartinJohnson 0:404f5a4f1385 1363 */
MartinJohnson 0:404f5a4f1385 1364 #define HRTIM_TIMDEADTIME_RISINGLOCK_WRITE ((uint32_t)0x00000000) /*!< Deadtime rising value and sign is writable */
MartinJohnson 0:404f5a4f1385 1365 #define HRTIM_TIMDEADTIME_RISINGLOCK_READONLY (HRTIM_DTR_DTRLK) /*!< Deadtime rising value and sign is read-only */
MartinJohnson 0:404f5a4f1385 1366
MartinJohnson 0:404f5a4f1385 1367 #define IS_HRTIM_TIMDEADTIME_RISINGLOCK(RISINGLOCK)\
MartinJohnson 0:404f5a4f1385 1368 (((RISINGLOCK) == HRTIM_TIMDEADTIME_RISINGLOCK_WRITE) || \
MartinJohnson 0:404f5a4f1385 1369 ((RISINGLOCK) == HRTIM_TIMDEADTIME_RISINGLOCK_READONLY))
MartinJohnson 0:404f5a4f1385 1370 /**
MartinJohnson 0:404f5a4f1385 1371 * @}
MartinJohnson 0:404f5a4f1385 1372 */
MartinJohnson 0:404f5a4f1385 1373
MartinJohnson 0:404f5a4f1385 1374 /** @defgroup HRTIM_DeadtimeRisingSignLock
MartinJohnson 0:404f5a4f1385 1375 * @{
MartinJohnson 0:404f5a4f1385 1376 * @brief Constants defining whether or not the deadtime rising sign is write
MartinJohnson 0:404f5a4f1385 1377 * protected
MartinJohnson 0:404f5a4f1385 1378 */
MartinJohnson 0:404f5a4f1385 1379 #define HRTIM_TIMDEADTIME_RISINGSIGNLOCK_WRITE ((uint32_t)0x00000000) /*!< Deadtime rising sign is writable */
MartinJohnson 0:404f5a4f1385 1380 #define HRTIM_TIMDEADTIME_RISINGSIGNLOCK_READONLY (HRTIM_DTR_DTRSLK) /*!< Deadtime rising sign is read-only */
MartinJohnson 0:404f5a4f1385 1381
MartinJohnson 0:404f5a4f1385 1382 #define IS_HRTIM_TIMDEADTIME_RISINGSIGNLOCK(RISINGSIGNLOCK)\
MartinJohnson 0:404f5a4f1385 1383 (((RISINGSIGNLOCK) == HRTIM_TIMDEADTIME_RISINGSIGNLOCK_WRITE) || \
MartinJohnson 0:404f5a4f1385 1384 ((RISINGSIGNLOCK) == HRTIM_TIMDEADTIME_RISINGSIGNLOCK_READONLY))
MartinJohnson 0:404f5a4f1385 1385 /**
MartinJohnson 0:404f5a4f1385 1386 * @}
MartinJohnson 0:404f5a4f1385 1387 */
MartinJohnson 0:404f5a4f1385 1388
MartinJohnson 0:404f5a4f1385 1389 /** @defgroup HRTIM_DeadtimeFallingSign
MartinJohnson 0:404f5a4f1385 1390 * @{
MartinJohnson 0:404f5a4f1385 1391 * @brief Constants defining whether the deadtime is positive or negative
MartinJohnson 0:404f5a4f1385 1392 * (overlapping signal) on falling edge
MartinJohnson 0:404f5a4f1385 1393 */
MartinJohnson 0:404f5a4f1385 1394 #define HRTIM_TIMDEADTIME_FALLINGSIGN_POSITIVE ((uint32_t)0x00000000) /*!< Positive deadtime on falling edge */
MartinJohnson 0:404f5a4f1385 1395 #define HRTIM_TIMDEADTIME_FALLINGSIGN_NEGATIVE (HRTIM_DTR_SDTF) /*!< Negative deadtime on falling edge */
MartinJohnson 0:404f5a4f1385 1396
MartinJohnson 0:404f5a4f1385 1397 #define IS_HRTIM_TIMDEADTIME_FALLINGSIGN(FALLINGSIGN)\
MartinJohnson 0:404f5a4f1385 1398 (((FALLINGSIGN) == HRTIM_TIMDEADTIME_FALLINGSIGN_POSITIVE) || \
MartinJohnson 0:404f5a4f1385 1399 ((FALLINGSIGN) == HRTIM_TIMDEADTIME_FALLINGSIGN_NEGATIVE))
MartinJohnson 0:404f5a4f1385 1400 /**
MartinJohnson 0:404f5a4f1385 1401 * @}
MartinJohnson 0:404f5a4f1385 1402 */
MartinJohnson 0:404f5a4f1385 1403
MartinJohnson 0:404f5a4f1385 1404 /** @defgroup HRTIM_DeadtimeFallingLock
MartinJohnson 0:404f5a4f1385 1405 * @{
MartinJohnson 0:404f5a4f1385 1406 * @brief Constants defining whether or not the deadtime (falling sign and
MartinJohnson 0:404f5a4f1385 1407 * value) is write protected
MartinJohnson 0:404f5a4f1385 1408 */
MartinJohnson 0:404f5a4f1385 1409 #define HRTIM_TIMDEADTIME_FALLINGLOCK_WRITE ((uint32_t)0x00000000) /*!< Deadtime falling value and sign is writable */
MartinJohnson 0:404f5a4f1385 1410 #define HRTIM_TIMDEADTIME_FALLINGLOCK_READONLY (HRTIM_DTR_DTFLK) /*!< Deadtime falling value and sign is read-only */
MartinJohnson 0:404f5a4f1385 1411
MartinJohnson 0:404f5a4f1385 1412 #define IS_HRTIM_TIMDEADTIME_FALLINGLOCK(FALLINGLOCK)\
MartinJohnson 0:404f5a4f1385 1413 (((FALLINGLOCK) == HRTIM_TIMDEADTIME_FALLINGLOCK_WRITE) || \
MartinJohnson 0:404f5a4f1385 1414 ((FALLINGLOCK) == HRTIM_TIMDEADTIME_FALLINGLOCK_READONLY))
MartinJohnson 0:404f5a4f1385 1415 /**
MartinJohnson 0:404f5a4f1385 1416 * @}
MartinJohnson 0:404f5a4f1385 1417 */
MartinJohnson 0:404f5a4f1385 1418
MartinJohnson 0:404f5a4f1385 1419 /** @defgroup HRTIM_DeadtimeFallingSignLock
MartinJohnson 0:404f5a4f1385 1420 * @{
MartinJohnson 0:404f5a4f1385 1421 * @brief Constants defining whether or not the deadtime falling sign is write
MartinJohnson 0:404f5a4f1385 1422 * protected
MartinJohnson 0:404f5a4f1385 1423 */
MartinJohnson 0:404f5a4f1385 1424 #define HRTIM_TIMDEADTIME_FALLINGSIGNLOCK_WRITE ((uint32_t)0x00000000) /*!< Deadtime falling sign is writable */
MartinJohnson 0:404f5a4f1385 1425 #define HRTIM_TIMDEADTIME_FALLINGSIGNLOCK_READONLY (HRTIM_DTR_DTFSLK) /*!< Deadtime falling sign is read-only */
MartinJohnson 0:404f5a4f1385 1426
MartinJohnson 0:404f5a4f1385 1427 #define IS_HRTIM_TIMDEADTIME_FALLINGSIGNLOCK(FALLINGSIGNLOCK)\
MartinJohnson 0:404f5a4f1385 1428 (((FALLINGSIGNLOCK) == HRTIM_TIMDEADTIME_FALLINGSIGNLOCK_WRITE) || \
MartinJohnson 0:404f5a4f1385 1429 ((FALLINGSIGNLOCK) == HRTIM_TIMDEADTIME_FALLINGSIGNLOCK_READONLY))
MartinJohnson 0:404f5a4f1385 1430 /**
MartinJohnson 0:404f5a4f1385 1431 * @}
MartinJohnson 0:404f5a4f1385 1432 */
MartinJohnson 0:404f5a4f1385 1433
MartinJohnson 0:404f5a4f1385 1434 /** @defgroup HRTIM_SynchronizationInputSource
MartinJohnson 0:404f5a4f1385 1435 * @{
MartinJohnson 0:404f5a4f1385 1436 * @brief Constants defining defining the synchronization input source
MartinJohnson 0:404f5a4f1385 1437 */
MartinJohnson 0:404f5a4f1385 1438 #define HRTIM_SYNCINPUTSOURCE_NONE (uint32_t)0x00000000 /*!< disabled. HRTIM is not synchronized and runs in standalone mode */
MartinJohnson 0:404f5a4f1385 1439 #define HRTIM_SYNCINPUTSOURCE_INTERNALEVENT HRTIM_MCR_SYNC_IN_1 /*!< The HRTIM is synchronized with the on-chip timer */
MartinJohnson 0:404f5a4f1385 1440 #define HRTIM_SYNCINPUTSOURCE_EXTERNALEVENT (HRTIM_MCR_SYNC_IN_1 | HRTIM_MCR_SYNC_IN_0) /*!< A positive pulse on SYNCIN input triggers the HRTIM */
MartinJohnson 0:404f5a4f1385 1441
MartinJohnson 0:404f5a4f1385 1442 #define IS_HRTIM_SYNCINPUTSOURCE(SYNCINPUTSOURCE)\
MartinJohnson 0:404f5a4f1385 1443 (((SYNCINPUTSOURCE) == HRTIM_SYNCINPUTSOURCE_NONE) || \
MartinJohnson 0:404f5a4f1385 1444 ((SYNCINPUTSOURCE) == HRTIM_SYNCINPUTSOURCE_INTERNALEVENT) || \
MartinJohnson 0:404f5a4f1385 1445 ((SYNCINPUTSOURCE) == HRTIM_SYNCINPUTSOURCE_EXTERNALEVENT))
MartinJohnson 0:404f5a4f1385 1446 /**
MartinJohnson 0:404f5a4f1385 1447 * @}
MartinJohnson 0:404f5a4f1385 1448 */
MartinJohnson 0:404f5a4f1385 1449
MartinJohnson 0:404f5a4f1385 1450 /** @defgroup HRTIM_SynchronizationOutputSource
MartinJohnson 0:404f5a4f1385 1451 * @{
MartinJohnson 0:404f5a4f1385 1452 * @brief Constants defining the source and event to be sent on the
MartinJohnson 0:404f5a4f1385 1453 * synchronization outputs
MartinJohnson 0:404f5a4f1385 1454 */
MartinJohnson 0:404f5a4f1385 1455 #define HRTIM_SYNCOUTPUTSOURCE_MASTER_START (uint32_t)0x00000000 /*!< A pulse is sent on the SYNCOUT output (16x fHRTIM clock cycles) upon master timer start event */
MartinJohnson 0:404f5a4f1385 1456 #define HRTIM_SYNCOUTPUTSOURCE_MASTER_CMP1 (HRTIM_MCR_SYNC_SRC_0) /*!< A pulse is sent on the SYNCOUT output (16x fHRTIM clock cycles) upon master timer compare 1 event*/
MartinJohnson 0:404f5a4f1385 1457 #define HRTIM_SYNCOUTPUTSOURCE_TIMA_START (HRTIM_MCR_SYNC_SRC_1) /*!< A pulse is sent on the SYNCOUT output (16x fHRTIM clock cycles) upon timer A start or reset events */
MartinJohnson 0:404f5a4f1385 1458 #define HRTIM_SYNCOUTPUTSOURCE_TIMA_CMP1 (HRTIM_MCR_SYNC_SRC_1 | HRTIM_MCR_SYNC_SRC_0) /*!< A pulse is sent on the SYNCOUT output (16x fHRTIM clock cycles) upon timer A compare 1 event */
MartinJohnson 0:404f5a4f1385 1459
MartinJohnson 0:404f5a4f1385 1460 #define IS_HRTIM_SYNCOUTPUTSOURCE(SYNCOUTPUTSOURCE)\
MartinJohnson 0:404f5a4f1385 1461 (((SYNCOUTPUTSOURCE) == HRTIM_SYNCOUTPUTSOURCE_MASTER_START) || \
MartinJohnson 0:404f5a4f1385 1462 ((SYNCOUTPUTSOURCE) == HRTIM_SYNCOUTPUTSOURCE_MASTER_CMP1) || \
MartinJohnson 0:404f5a4f1385 1463 ((SYNCOUTPUTSOURCE) == HRTIM_SYNCOUTPUTSOURCE_TIMA_START) || \
MartinJohnson 0:404f5a4f1385 1464 ((SYNCOUTPUTSOURCE) == HRTIM_SYNCOUTPUTSOURCE_TIMA_CMP1))
MartinJohnson 0:404f5a4f1385 1465 /**
MartinJohnson 0:404f5a4f1385 1466 * @}
MartinJohnson 0:404f5a4f1385 1467 */
MartinJohnson 0:404f5a4f1385 1468
MartinJohnson 0:404f5a4f1385 1469 /** @defgroup HRTIM_SynchronizationOutputPolarity
MartinJohnson 0:404f5a4f1385 1470 * @{
MartinJohnson 0:404f5a4f1385 1471 * @brief Constants defining the routing and conditioning of the synchronization output event
MartinJohnson 0:404f5a4f1385 1472 */
MartinJohnson 0:404f5a4f1385 1473 #define HRTIM_SYNCOUTPUTPOLARITY_NONE (uint32_t)0x00000000 /*!< Synchronization output event is disabled */
MartinJohnson 0:404f5a4f1385 1474 #define HRTIM_SYNCOUTPUTPOLARITY_POSITIVE (HRTIM_MCR_SYNC_OUT_0) /*!< Positive pulse on SCOUT output (16x fHRTIM clock cycles) */
MartinJohnson 0:404f5a4f1385 1475 #define HRTIM_SYNCOUTPUTPOLARITY_NEGATIVE (HRTIM_MCR_SYNC_OUT_1 | HRTIM_MCR_SYNC_OUT_0) /*!< Positive pulse on SCOUT output (16x fHRTIM clock cycles) */
MartinJohnson 0:404f5a4f1385 1476
MartinJohnson 0:404f5a4f1385 1477 #define IS_HRTIM_SYNCOUTPUTPOLARITY(SYNCOUTPUTPOLARITY)\
MartinJohnson 0:404f5a4f1385 1478 (((SYNCOUTPUTPOLARITY) == HRTIM_SYNCOUTPUTPOLARITY_NONE) || \
MartinJohnson 0:404f5a4f1385 1479 ((SYNCOUTPUTPOLARITY) == HRTIM_SYNCOUTPUTPOLARITY_POSITIVE) || \
MartinJohnson 0:404f5a4f1385 1480 ((SYNCOUTPUTPOLARITY) == HRTIM_SYNCOUTPUTPOLARITY_NEGATIVE))
MartinJohnson 0:404f5a4f1385 1481 /**
MartinJohnson 0:404f5a4f1385 1482 * @}
MartinJohnson 0:404f5a4f1385 1483 */
MartinJohnson 0:404f5a4f1385 1484
MartinJohnson 0:404f5a4f1385 1485 /** @defgroup HRTIM_ExternalEventSources
MartinJohnson 0:404f5a4f1385 1486 * @{
MartinJohnson 0:404f5a4f1385 1487 * @brief Constants defining available sources associated to external events
MartinJohnson 0:404f5a4f1385 1488 */
MartinJohnson 0:404f5a4f1385 1489 #define HRTIM_EVENTSRC_1 ((uint32_t)0x00000000) /*!< External event source 1 */
MartinJohnson 0:404f5a4f1385 1490 #define HRTIM_EVENTSRC_2 (HRTIM_EECR1_EE1SRC_0) /*!< External event source 2 */
MartinJohnson 0:404f5a4f1385 1491 #define HRTIM_EVENTSRC_3 (HRTIM_EECR1_EE1SRC_1) /*!< External event source 3 */
MartinJohnson 0:404f5a4f1385 1492 #define HRTIM_EVENTSRC_4 (HRTIM_EECR1_EE1SRC_1 | HRTIM_EECR1_EE1SRC_0) /*!< External event source 4 */
MartinJohnson 0:404f5a4f1385 1493
MartinJohnson 0:404f5a4f1385 1494 #define IS_HRTIM_EVENTSRC(EVENTSRC)\
MartinJohnson 0:404f5a4f1385 1495 (((EVENTSRC) == HRTIM_EVENTSRC_1) || \
MartinJohnson 0:404f5a4f1385 1496 ((EVENTSRC) == HRTIM_EVENTSRC_2) || \
MartinJohnson 0:404f5a4f1385 1497 ((EVENTSRC) == HRTIM_EVENTSRC_3) || \
MartinJohnson 0:404f5a4f1385 1498 ((EVENTSRC) == HRTIM_EVENTSRC_4))
MartinJohnson 0:404f5a4f1385 1499 /**
MartinJohnson 0:404f5a4f1385 1500 * @}
MartinJohnson 0:404f5a4f1385 1501 */
MartinJohnson 0:404f5a4f1385 1502
MartinJohnson 0:404f5a4f1385 1503 /** @defgroup HRTIM_ExternalEventPolarity
MartinJohnson 0:404f5a4f1385 1504 * @{
MartinJohnson 0:404f5a4f1385 1505 * @brief Constants defining the polarity of an external event
MartinJohnson 0:404f5a4f1385 1506 */
MartinJohnson 0:404f5a4f1385 1507 #define HRTIM_EVENTPOLARITY_HIGH ((uint32_t)0x00000000) /*!< External event is active high */
MartinJohnson 0:404f5a4f1385 1508 #define HRTIM_EVENTPOLARITY_LOW (HRTIM_EECR1_EE1POL) /*!< External event is active low */
MartinJohnson 0:404f5a4f1385 1509
MartinJohnson 0:404f5a4f1385 1510 #define IS_HRTIM_EVENTPOLARITY(EVENTPOLARITY)\
MartinJohnson 0:404f5a4f1385 1511 (((EVENTPOLARITY) == HRTIM_EVENTPOLARITY_HIGH) || \
MartinJohnson 0:404f5a4f1385 1512 ((EVENTPOLARITY) == HRTIM_EVENTPOLARITY_LOW))
MartinJohnson 0:404f5a4f1385 1513 /**
MartinJohnson 0:404f5a4f1385 1514 * @}
MartinJohnson 0:404f5a4f1385 1515 */
MartinJohnson 0:404f5a4f1385 1516
MartinJohnson 0:404f5a4f1385 1517 /** @defgroup HRTIM_ExternalEventSensitivity
MartinJohnson 0:404f5a4f1385 1518 * @{
MartinJohnson 0:404f5a4f1385 1519 * @brief Constants defining the sensitivity (level-sensitive or edge-sensitive)
MartinJohnson 0:404f5a4f1385 1520 * of an external event
MartinJohnson 0:404f5a4f1385 1521 */
MartinJohnson 0:404f5a4f1385 1522 #define HRTIM_EVENTSENSITIVITY_LEVEL ((uint32_t)0x00000000) /*!< External event is active on level */
MartinJohnson 0:404f5a4f1385 1523 #define HRTIM_EVENTSENSITIVITY_RISINGEDGE (HRTIM_EECR1_EE1SNS_0) /*!< External event is active on Rising edge */
MartinJohnson 0:404f5a4f1385 1524 #define HRTIM_EVENTSENSITIVITY_FALLINGEDGE (HRTIM_EECR1_EE1SNS_1) /*!< External event is active on Falling edge */
MartinJohnson 0:404f5a4f1385 1525 #define HRTIM_EVENTSENSITIVITY_BOTHEDGES (HRTIM_EECR1_EE1SNS_1 | HRTIM_EECR1_EE1SNS_0) /*!< External event is active on Rising and Falling edges */
MartinJohnson 0:404f5a4f1385 1526
MartinJohnson 0:404f5a4f1385 1527 #define IS_HRTIM_EVENTSENSITIVITY(EVENTSENSITIVITY)\
MartinJohnson 0:404f5a4f1385 1528 (((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_LEVEL) || \
MartinJohnson 0:404f5a4f1385 1529 ((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_RISINGEDGE) || \
MartinJohnson 0:404f5a4f1385 1530 ((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_FALLINGEDGE) || \
MartinJohnson 0:404f5a4f1385 1531 ((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_BOTHEDGES))
MartinJohnson 0:404f5a4f1385 1532 /**
MartinJohnson 0:404f5a4f1385 1533 * @}
MartinJohnson 0:404f5a4f1385 1534 */
MartinJohnson 0:404f5a4f1385 1535
MartinJohnson 0:404f5a4f1385 1536 /** @defgroup HRTIM_ExternalEventFastMode
MartinJohnson 0:404f5a4f1385 1537 * @{
MartinJohnson 0:404f5a4f1385 1538 * @brief Constants defining whether or not an external event is programmed in
MartinJohnson 0:404f5a4f1385 1539 fast mode
MartinJohnson 0:404f5a4f1385 1540 */
MartinJohnson 0:404f5a4f1385 1541 #define HRTIM_EVENTFASTMODE_DISABLE ((uint32_t)0x00000000) /*!< External Event is acting asynchronously on outputs (low latency mode) */
MartinJohnson 0:404f5a4f1385 1542 #define HRTIM_EVENTFASTMODE_ENABLE (HRTIM_EECR1_EE1FAST) /*!< External Event is re-synchronized by the HRTIM logic before acting on outputs */
MartinJohnson 0:404f5a4f1385 1543
MartinJohnson 0:404f5a4f1385 1544 #define IS_HRTIM_EVENTFASTMODE(EVENTFASTMODE)\
MartinJohnson 0:404f5a4f1385 1545 (((EVENTFASTMODE) == HRTIM_EVENTFASTMODE_ENABLE) || \
MartinJohnson 0:404f5a4f1385 1546 ((EVENTFASTMODE) == HRTIM_EVENTFASTMODE_DISABLE))
MartinJohnson 0:404f5a4f1385 1547
MartinJohnson 0:404f5a4f1385 1548 #define IS_HRTIM_FASTMODE_AVAILABLE(EVENT)\
MartinJohnson 0:404f5a4f1385 1549 (((EVENT) == HRTIM_EVENT_1) || \
MartinJohnson 0:404f5a4f1385 1550 ((EVENT) == HRTIM_EVENT_2) || \
MartinJohnson 0:404f5a4f1385 1551 ((EVENT) == HRTIM_EVENT_3) || \
MartinJohnson 0:404f5a4f1385 1552 ((EVENT) == HRTIM_EVENT_4) || \
MartinJohnson 0:404f5a4f1385 1553 ((EVENT) == HRTIM_EVENT_5))
MartinJohnson 0:404f5a4f1385 1554 /**
MartinJohnson 0:404f5a4f1385 1555 * @}
MartinJohnson 0:404f5a4f1385 1556 */
MartinJohnson 0:404f5a4f1385 1557
MartinJohnson 0:404f5a4f1385 1558 /** @defgroup HRTIM_ExternalEventFilter
MartinJohnson 0:404f5a4f1385 1559 * @{
MartinJohnson 0:404f5a4f1385 1560 * @brief Constants defining the frequency used to sample an external event 6
MartinJohnson 0:404f5a4f1385 1561 * input and the length (N) of the digital filter applied
MartinJohnson 0:404f5a4f1385 1562 */
MartinJohnson 0:404f5a4f1385 1563 #define HRTIM_EVENTFILTER_NONE ((uint32_t)0x00000000) /*!< Filter disabled */
MartinJohnson 0:404f5a4f1385 1564 #define HRTIM_EVENTFILTER_1 (HRTIM_EECR3_EE6F_0) /*!< fSAMPLING= fHRTIM, N=2 */
MartinJohnson 0:404f5a4f1385 1565 #define HRTIM_EVENTFILTER_2 (HRTIM_EECR3_EE6F_1) /*!< fSAMPLING= fHRTIM, N=4 */
MartinJohnson 0:404f5a4f1385 1566 #define HRTIM_EVENTFILTER_3 (HRTIM_EECR3_EE6F_1 | HRTIM_EECR3_EE6F_0) /*!< fSAMPLING= fHRTIM, N=8 */
MartinJohnson 0:404f5a4f1385 1567 #define HRTIM_EVENTFILTER_4 (HRTIM_EECR3_EE6F_2) /*!< fSAMPLING= fEEVS/2, N=6 */
MartinJohnson 0:404f5a4f1385 1568 #define HRTIM_EVENTFILTER_5 (HRTIM_EECR3_EE6F_2 | HRTIM_EECR3_EE6F_0) /*!< fSAMPLING= fEEVS/2, N=8 */
MartinJohnson 0:404f5a4f1385 1569 #define HRTIM_EVENTFILTER_6 (HRTIM_EECR3_EE6F_2 | HRTIM_EECR3_EE6F_1) /*!< fSAMPLING= fEEVS/4, N=6 */
MartinJohnson 0:404f5a4f1385 1570 #define HRTIM_EVENTFILTER_7 (HRTIM_EECR3_EE6F_2 | HRTIM_EECR3_EE6F_1 | HRTIM_EECR3_EE6F_0) /*!< fSAMPLING= fEEVS/4, N=8 */
MartinJohnson 0:404f5a4f1385 1571 #define HRTIM_EVENTFILTER_8 (HRTIM_EECR3_EE6F_3) /*!< fSAMPLING= fEEVS/8, N=6 */
MartinJohnson 0:404f5a4f1385 1572 #define HRTIM_EVENTFILTER_9 (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_0) /*!< fSAMPLING= fEEVS/8, N=8 */
MartinJohnson 0:404f5a4f1385 1573 #define HRTIM_EVENTFILTER_10 (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_1) /*!< fSAMPLING= fEEVS/16, N=5 */
MartinJohnson 0:404f5a4f1385 1574 #define HRTIM_EVENTFILTER_11 (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_1 | HRTIM_EECR3_EE6F_0) /*!< fSAMPLING= fEEVS/16, N=6 */
MartinJohnson 0:404f5a4f1385 1575 #define HRTIM_EVENTFILTER_12 (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_2) /*!< fSAMPLING= fEEVS/16, N=8 */
MartinJohnson 0:404f5a4f1385 1576 #define HRTIM_EVENTFILTER_13 (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_2 | HRTIM_EECR3_EE6F_0) /*!< fSAMPLING= fEEVS/32, N=5 */
MartinJohnson 0:404f5a4f1385 1577 #define HRTIM_EVENTFILTER_14 (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_2 | HRTIM_EECR3_EE6F_1) /*!< fSAMPLING= fEEVS/32, N=6 */
MartinJohnson 0:404f5a4f1385 1578 #define HRTIM_EVENTFILTER_15 (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_2 | HRTIM_EECR3_EE6F_1 | HRTIM_EECR3_EE6F_0) /*!< fSAMPLING= fEEVS/32, N=8 */
MartinJohnson 0:404f5a4f1385 1579
MartinJohnson 0:404f5a4f1385 1580 #define IS_HRTIM_EVENTFILTER(EVENTFILTER)\
MartinJohnson 0:404f5a4f1385 1581 (((EVENTFILTER) == HRTIM_EVENTFILTER_NONE) || \
MartinJohnson 0:404f5a4f1385 1582 ((EVENTFILTER) == HRTIM_EVENTFILTER_1) || \
MartinJohnson 0:404f5a4f1385 1583 ((EVENTFILTER) == HRTIM_EVENTFILTER_2) || \
MartinJohnson 0:404f5a4f1385 1584 ((EVENTFILTER) == HRTIM_EVENTFILTER_3) || \
MartinJohnson 0:404f5a4f1385 1585 ((EVENTFILTER) == HRTIM_EVENTFILTER_4) || \
MartinJohnson 0:404f5a4f1385 1586 ((EVENTFILTER) == HRTIM_EVENTFILTER_5) || \
MartinJohnson 0:404f5a4f1385 1587 ((EVENTFILTER) == HRTIM_EVENTFILTER_6) || \
MartinJohnson 0:404f5a4f1385 1588 ((EVENTFILTER) == HRTIM_EVENTFILTER_7) || \
MartinJohnson 0:404f5a4f1385 1589 ((EVENTFILTER) == HRTIM_EVENTFILTER_8) || \
MartinJohnson 0:404f5a4f1385 1590 ((EVENTFILTER) == HRTIM_EVENTFILTER_9) || \
MartinJohnson 0:404f5a4f1385 1591 ((EVENTFILTER) == HRTIM_EVENTFILTER_10) || \
MartinJohnson 0:404f5a4f1385 1592 ((EVENTFILTER) == HRTIM_EVENTFILTER_11) || \
MartinJohnson 0:404f5a4f1385 1593 ((EVENTFILTER) == HRTIM_EVENTFILTER_12) || \
MartinJohnson 0:404f5a4f1385 1594 ((EVENTFILTER) == HRTIM_EVENTFILTER_13) || \
MartinJohnson 0:404f5a4f1385 1595 ((EVENTFILTER) == HRTIM_EVENTFILTER_14) || \
MartinJohnson 0:404f5a4f1385 1596 ((EVENTFILTER) == HRTIM_EVENTFILTER_15))
MartinJohnson 0:404f5a4f1385 1597 /**
MartinJohnson 0:404f5a4f1385 1598 * @}
MartinJohnson 0:404f5a4f1385 1599 */
MartinJohnson 0:404f5a4f1385 1600
MartinJohnson 0:404f5a4f1385 1601 /** @defgroup HRTIM_ ExternalEventPrescaler
MartinJohnson 0:404f5a4f1385 1602 * @{
MartinJohnson 0:404f5a4f1385 1603 * @brief Constants defining division ratio between the timer clock frequency
MartinJohnson 0:404f5a4f1385 1604 * fHRTIM) and the external event signal sampling clock (fEEVS)
MartinJohnson 0:404f5a4f1385 1605 * used by the digital filters
MartinJohnson 0:404f5a4f1385 1606 */
MartinJohnson 0:404f5a4f1385 1607 #define HRTIM_EVENTPRESCALER_DIV1 ((uint32_t)0x00000000) /*!< fEEVS=fHRTIM */
MartinJohnson 0:404f5a4f1385 1608 #define HRTIM_EVENTPRESCALER_DIV2 (HRTIM_EECR3_EEVSD_0) /*!< fEEVS=fHRTIM / 2 */
MartinJohnson 0:404f5a4f1385 1609 #define HRTIM_EVENTPRESCALER_DIV4 (HRTIM_EECR3_EEVSD_1) /*!< fEEVS=fHRTIM / 4 */
MartinJohnson 0:404f5a4f1385 1610 #define HRTIM_EVENTPRESCALER_DIV8 (HRTIM_EECR3_EEVSD_1 | HRTIM_EECR3_EEVSD_0) /*!< fEEVS=fHRTIM / 8 */
MartinJohnson 0:404f5a4f1385 1611
MartinJohnson 0:404f5a4f1385 1612 #define IS_HRTIM_EVENTPRESCALER(EVENTPRESCALER)\
MartinJohnson 0:404f5a4f1385 1613 (((EVENTPRESCALER) == HRTIM_EVENTPRESCALER_DIV1) || \
MartinJohnson 0:404f5a4f1385 1614 ((EVENTPRESCALER) == HRTIM_EVENTPRESCALER_DIV2) || \
MartinJohnson 0:404f5a4f1385 1615 ((EVENTPRESCALER) == HRTIM_EVENTPRESCALER_DIV4) || \
MartinJohnson 0:404f5a4f1385 1616 ((EVENTPRESCALER) == HRTIM_EVENTPRESCALER_DIV8))
MartinJohnson 0:404f5a4f1385 1617 /**
MartinJohnson 0:404f5a4f1385 1618 * @}
MartinJohnson 0:404f5a4f1385 1619 */
MartinJohnson 0:404f5a4f1385 1620
MartinJohnson 0:404f5a4f1385 1621 /** @defgroup HRTIM_FaultSources
MartinJohnson 0:404f5a4f1385 1622 * @{
MartinJohnson 0:404f5a4f1385 1623 * @brief Constants defining whether a faults is be triggered by any external
MartinJohnson 0:404f5a4f1385 1624 * or internal fault source
MartinJohnson 0:404f5a4f1385 1625 */
MartinJohnson 0:404f5a4f1385 1626 #define HRTIM_FAULTSOURCE_DIGITALINPUT ((uint32_t)0x00000000) /*!< Fault input is FLT input pin */
MartinJohnson 0:404f5a4f1385 1627 #define HRTIM_FAULTSOURCE_INTERNAL (HRTIM_FLTINR1_FLT1SRC) /*!< Fault input is FLT_Int signal (e.g. internal comparator) */
MartinJohnson 0:404f5a4f1385 1628
MartinJohnson 0:404f5a4f1385 1629
MartinJohnson 0:404f5a4f1385 1630 #define IS_HRTIM_FAULTSOURCE(FAULTSOURCE)\
MartinJohnson 0:404f5a4f1385 1631 (((FAULTSOURCE) == HRTIM_FAULTSOURCE_DIGITALINPUT) || \
MartinJohnson 0:404f5a4f1385 1632 ((FAULTSOURCE) == HRTIM_FAULTSOURCE_INTERNAL))
MartinJohnson 0:404f5a4f1385 1633 /**
MartinJohnson 0:404f5a4f1385 1634 * @}
MartinJohnson 0:404f5a4f1385 1635 */
MartinJohnson 0:404f5a4f1385 1636
MartinJohnson 0:404f5a4f1385 1637 /** @defgroup HRTIM_FaultPolarity
MartinJohnson 0:404f5a4f1385 1638 * @{
MartinJohnson 0:404f5a4f1385 1639 * @brief Constants defining the polarity of a fault event
MartinJohnson 0:404f5a4f1385 1640 */
MartinJohnson 0:404f5a4f1385 1641 #define HRTIM_FAULTPOLARITY_LOW ((uint32_t)0x00000000) /*!< Fault input is active low */
MartinJohnson 0:404f5a4f1385 1642 #define HRTIM_FAULTPOLARITY_HIGH (HRTIM_FLTINR1_FLT1P) /*!< Fault input is active high */
MartinJohnson 0:404f5a4f1385 1643
MartinJohnson 0:404f5a4f1385 1644 #define IS_HRTIM_FAULTPOLARITY(HRTIM_FAULTPOLARITY)\
MartinJohnson 0:404f5a4f1385 1645 (((HRTIM_FAULTPOLARITY) == HRTIM_FAULTPOLARITY_LOW) || \
MartinJohnson 0:404f5a4f1385 1646 ((HRTIM_FAULTPOLARITY) == HRTIM_FAULTPOLARITY_HIGH))
MartinJohnson 0:404f5a4f1385 1647 /**
MartinJohnson 0:404f5a4f1385 1648 * @}
MartinJohnson 0:404f5a4f1385 1649 */
MartinJohnson 0:404f5a4f1385 1650
MartinJohnson 0:404f5a4f1385 1651 /** @defgroup HRTIM_FaultFilter
MartinJohnson 0:404f5a4f1385 1652 * @{
MartinJohnson 0:404f5a4f1385 1653 * @ brief Constants defining the frequency used to sample the fault input and
MartinJohnson 0:404f5a4f1385 1654 * the length (N) of the digital filter applied
MartinJohnson 0:404f5a4f1385 1655 */
MartinJohnson 0:404f5a4f1385 1656 #define HRTIM_FAULTFILTER_NONE ((uint32_t)0x00000000) /*!< Filter disabled */
MartinJohnson 0:404f5a4f1385 1657 #define HRTIM_FAULTFILTER_1 (HRTIM_FLTINR1_FLT1F_0) /*!< fSAMPLING= fHRTIM, N=2 */
MartinJohnson 0:404f5a4f1385 1658 #define HRTIM_FAULTFILTER_2 (HRTIM_FLTINR1_FLT1F_1) /*!< fSAMPLING= fHRTIM, N=4 */
MartinJohnson 0:404f5a4f1385 1659 #define HRTIM_FAULTFILTER_3 (HRTIM_FLTINR1_FLT1F_1 | HRTIM_FLTINR1_FLT1F_0) /*!< fSAMPLING= fHRTIM, N=8 */
MartinJohnson 0:404f5a4f1385 1660 #define HRTIM_FAULTFILTER_4 (HRTIM_FLTINR1_FLT1F_2) /*!< fSAMPLING= fFLTS/2, N=6 */
MartinJohnson 0:404f5a4f1385 1661 #define HRTIM_FAULTFILTER_5 (HRTIM_FLTINR1_FLT1F_2 | HRTIM_FLTINR1_FLT1F_0) /*!< fSAMPLING= fFLTS/2, N=8 */
MartinJohnson 0:404f5a4f1385 1662 #define HRTIM_FAULTFILTER_6 (HRTIM_FLTINR1_FLT1F_2 | HRTIM_FLTINR1_FLT1F_1) /*!< fSAMPLING= fFLTS/4, N=6 */
MartinJohnson 0:404f5a4f1385 1663 #define HRTIM_FAULTFILTER_7 (HRTIM_FLTINR1_FLT1F_2 | HRTIM_FLTINR1_FLT1F_1 | HRTIM_FLTINR1_FLT1F_0) /*!< fSAMPLING= fFLTS/4, N=8 */
MartinJohnson 0:404f5a4f1385 1664 #define HRTIM_FAULTFILTER_8 (HRTIM_FLTINR1_FLT1F_3) /*!< fSAMPLING= fFLTS/8, N=6 */
MartinJohnson 0:404f5a4f1385 1665 #define HRTIM_FAULTFILTER_9 (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_0) /*!< fSAMPLING= fFLTS/8, N=8 */
MartinJohnson 0:404f5a4f1385 1666 #define HRTIM_FAULTFILTER_10 (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_1) /*!< fSAMPLING= fFLTS/16, N=5 */
MartinJohnson 0:404f5a4f1385 1667 #define HRTIM_FAULTFILTER_11 (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_1 | HRTIM_FLTINR1_FLT1F_0) /*!< fSAMPLING= fFLTS/16, N=6 */
MartinJohnson 0:404f5a4f1385 1668 #define HRTIM_FAULTFILTER_12 (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_2) /*!< fSAMPLING= fFLTS/16, N=8 */
MartinJohnson 0:404f5a4f1385 1669 #define HRTIM_FAULTFILTER_13 (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_2 | HRTIM_FLTINR1_FLT1F_0) /*!< fSAMPLING= fFLTS/32, N=5 */
MartinJohnson 0:404f5a4f1385 1670 #define HRTIM_FAULTFILTER_14 (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_2 | HRTIM_FLTINR1_FLT1F_1) /*!< fSAMPLING= fFLTS/32, N=6 */
MartinJohnson 0:404f5a4f1385 1671 #define HRTIM_FAULTFILTER_15 (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_2 | HRTIM_FLTINR1_FLT1F_1 | HRTIM_FLTINR1_FLT1F_0) /*!< fSAMPLING= fFLTS/32, N=8 */
MartinJohnson 0:404f5a4f1385 1672
MartinJohnson 0:404f5a4f1385 1673 #define IS_HRTIM_FAULTFILTER(FAULTFILTER)\
MartinJohnson 0:404f5a4f1385 1674 (((FAULTFILTER) == HRTIM_FAULTFILTER_NONE) || \
MartinJohnson 0:404f5a4f1385 1675 ((FAULTFILTER) == HRTIM_FAULTFILTER_1) || \
MartinJohnson 0:404f5a4f1385 1676 ((FAULTFILTER) == HRTIM_FAULTFILTER_2) || \
MartinJohnson 0:404f5a4f1385 1677 ((FAULTFILTER) == HRTIM_FAULTFILTER_3) || \
MartinJohnson 0:404f5a4f1385 1678 ((FAULTFILTER) == HRTIM_FAULTFILTER_4) || \
MartinJohnson 0:404f5a4f1385 1679 ((FAULTFILTER) == HRTIM_FAULTFILTER_5) || \
MartinJohnson 0:404f5a4f1385 1680 ((FAULTFILTER) == HRTIM_FAULTFILTER_6) || \
MartinJohnson 0:404f5a4f1385 1681 ((FAULTFILTER) == HRTIM_FAULTFILTER_7) || \
MartinJohnson 0:404f5a4f1385 1682 ((FAULTFILTER) == HRTIM_FAULTFILTER_8) || \
MartinJohnson 0:404f5a4f1385 1683 ((FAULTFILTER) == HRTIM_FAULTFILTER_9) || \
MartinJohnson 0:404f5a4f1385 1684 ((FAULTFILTER) == HRTIM_FAULTFILTER_10) || \
MartinJohnson 0:404f5a4f1385 1685 ((FAULTFILTER) == HRTIM_FAULTFILTER_11) || \
MartinJohnson 0:404f5a4f1385 1686 ((FAULTFILTER) == HRTIM_FAULTFILTER_12) || \
MartinJohnson 0:404f5a4f1385 1687 ((FAULTFILTER) == HRTIM_FAULTFILTER_13) || \
MartinJohnson 0:404f5a4f1385 1688 ((FAULTFILTER) == HRTIM_FAULTFILTER_14) || \
MartinJohnson 0:404f5a4f1385 1689 ((FAULTFILTER) == HRTIM_FAULTFILTER_15))
MartinJohnson 0:404f5a4f1385 1690 /**
MartinJohnson 0:404f5a4f1385 1691 * @}
MartinJohnson 0:404f5a4f1385 1692 */
MartinJohnson 0:404f5a4f1385 1693
MartinJohnson 0:404f5a4f1385 1694 /** @defgroup HRTIM_FaultLock
MartinJohnson 0:404f5a4f1385 1695 * @{
MartinJohnson 0:404f5a4f1385 1696 * @brief Constants defining whether or not the fault programming bits are
MartinJohnson 0:404f5a4f1385 1697 write protected
MartinJohnson 0:404f5a4f1385 1698 */
MartinJohnson 0:404f5a4f1385 1699 #define HRTIM_FAULTLOCK_READWRITE ((uint32_t)0x00000000) /*!< Fault settings bits are read/write */
MartinJohnson 0:404f5a4f1385 1700 #define HRTIM_FAULTLOCK_READONLY (HRTIM_FLTINR1_FLT1LCK) /*!< Fault settings bits are read only */
MartinJohnson 0:404f5a4f1385 1701
MartinJohnson 0:404f5a4f1385 1702 #define IS_HRTIM_FAULTLOCK(FAULTLOCK)\
MartinJohnson 0:404f5a4f1385 1703 (((FAULTLOCK) == HRTIM_FAULTLOCK_READWRITE) || \
MartinJohnson 0:404f5a4f1385 1704 ((FAULTLOCK) == HRTIM_FAULTLOCK_READONLY))
MartinJohnson 0:404f5a4f1385 1705 /**
MartinJohnson 0:404f5a4f1385 1706 * @}
MartinJohnson 0:404f5a4f1385 1707 */
MartinJohnson 0:404f5a4f1385 1708
MartinJohnson 0:404f5a4f1385 1709 /** @defgroup HRTIM_ExternalFaultPrescaler
MartinJohnson 0:404f5a4f1385 1710 * @{
MartinJohnson 0:404f5a4f1385 1711 * @brief Constants defining the division ratio between the timer clock
MartinJohnson 0:404f5a4f1385 1712 * frequency (fHRTIM) and the fault signal sampling clock (fFLTS) used
MartinJohnson 0:404f5a4f1385 1713 * by the digital filters.
MartinJohnson 0:404f5a4f1385 1714 */
MartinJohnson 0:404f5a4f1385 1715 #define HRTIM_FAULTPRESCALER_DIV1 ((uint32_t)0x00000000) /*!< fFLTS=fHRTIM */
MartinJohnson 0:404f5a4f1385 1716 #define HRTIM_FAULTPRESCALER_DIV2 (HRTIM_FLTINR2_FLTSD_0) /*!< fFLTS=fHRTIM / 2 */
MartinJohnson 0:404f5a4f1385 1717 #define HRTIM_FAULTPRESCALER_DIV4 (HRTIM_FLTINR2_FLTSD_1) /*!< fFLTS=fHRTIM / 4 */
MartinJohnson 0:404f5a4f1385 1718 #define HRTIM_FAULTPRESCALER_DIV8 (HRTIM_FLTINR2_FLTSD_1 | HRTIM_FLTINR2_FLTSD_0) /*!< fFLTS=fHRTIM / 8 */
MartinJohnson 0:404f5a4f1385 1719
MartinJohnson 0:404f5a4f1385 1720 #define IS_HRTIM_FAULTPRESCALER(FAULTPRESCALER)\
MartinJohnson 0:404f5a4f1385 1721 (((FAULTPRESCALER) == HRTIM_FAULTPRESCALER_DIV1) || \
MartinJohnson 0:404f5a4f1385 1722 ((FAULTPRESCALER) == HRTIM_FAULTPRESCALER_DIV2) || \
MartinJohnson 0:404f5a4f1385 1723 ((FAULTPRESCALER) == HRTIM_FAULTPRESCALER_DIV4) || \
MartinJohnson 0:404f5a4f1385 1724 ((FAULTPRESCALER) == HRTIM_FAULTPRESCALER_DIV8))
MartinJohnson 0:404f5a4f1385 1725 /**
MartinJohnson 0:404f5a4f1385 1726 * @}
MartinJohnson 0:404f5a4f1385 1727 */
MartinJohnson 0:404f5a4f1385 1728
MartinJohnson 0:404f5a4f1385 1729 /** @defgroup HRTIM_BurstModeOperatingmode
MartinJohnson 0:404f5a4f1385 1730 * @{
MartinJohnson 0:404f5a4f1385 1731 * @brief Constants defining if the burst mode is entered once or if it is
MartinJohnson 0:404f5a4f1385 1732 * continuously operating
MartinJohnson 0:404f5a4f1385 1733 */
MartinJohnson 0:404f5a4f1385 1734 #define HRTIM_BURSTMODE_SINGLESHOT ((uint32_t)0x00000000) /*!< Burst mode operates in single shot mode */
MartinJohnson 0:404f5a4f1385 1735 #define HRTIM_BURSTMODE_CONTINOUS (HRTIM_BMCR_BMOM) /*!< Burst mode operates in continuous mode */
MartinJohnson 0:404f5a4f1385 1736
MartinJohnson 0:404f5a4f1385 1737 #define IS_HRTIM_BURSTMODE(BURSTMODE)\
MartinJohnson 0:404f5a4f1385 1738 (((BURSTMODE) == HRTIM_BURSTMODE_SINGLESHOT) || \
MartinJohnson 0:404f5a4f1385 1739 ((BURSTMODE) == HRTIM_BURSTMODE_CONTINOUS))
MartinJohnson 0:404f5a4f1385 1740 /**
MartinJohnson 0:404f5a4f1385 1741 * @}
MartinJohnson 0:404f5a4f1385 1742 */
MartinJohnson 0:404f5a4f1385 1743
MartinJohnson 0:404f5a4f1385 1744 /** @defgroup HRTIM_BurstModeClockSource
MartinJohnson 0:404f5a4f1385 1745 * @{
MartinJohnson 0:404f5a4f1385 1746 * @brief Constants defining the clock source for the burst mode counter
MartinJohnson 0:404f5a4f1385 1747 */
MartinJohnson 0:404f5a4f1385 1748 #define HRTIM_BURSTMODECLOCKSOURCE_MASTER ((uint32_t)0x00000000) /*!< Master timer counter reset/roll-over is used as clock source for the burst mode counter */
MartinJohnson 0:404f5a4f1385 1749 #define HRTIM_BURSTMODECLOCKSOURCE_TIMER_A (HRTIM_BMCR_BMCLK_0) /*!< Timer A counter reset/roll-over is used as clock source for the burst mode counter */
MartinJohnson 0:404f5a4f1385 1750 #define HRTIM_BURSTMODECLOCKSOURCE_TIMER_B (HRTIM_BMCR_BMCLK_1) /*!< Timer B counter reset/roll-over is used as clock source for the burst mode counter */
MartinJohnson 0:404f5a4f1385 1751 #define HRTIM_BURSTMODECLOCKSOURCE_TIMER_C (HRTIM_BMCR_BMCLK_1 | HRTIM_BMCR_BMCLK_0) /*!< Timer C counter reset/roll-over is used as clock source for the burst mode counter */
MartinJohnson 0:404f5a4f1385 1752 #define HRTIM_BURSTMODECLOCKSOURCE_TIMER_D (HRTIM_BMCR_BMCLK_2) /*!< Timer D counter reset/roll-over is used as clock source for the burst mode counter */
MartinJohnson 0:404f5a4f1385 1753 #define HRTIM_BURSTMODECLOCKSOURCE_TIMER_E (HRTIM_BMCR_BMCLK_2 | HRTIM_BMCR_BMCLK_0) /*!< Timer E counter reset/roll-over is used as clock source for the burst mode counter */
MartinJohnson 0:404f5a4f1385 1754 #define HRTIM_BURSTMODECLOCKSOURCE_ONCHIPEV_1 (HRTIM_BMCR_BMCLK_2 | HRTIM_BMCR_BMCLK_1) /*!< On-chip Event 1 (BMClk[1]), acting as a burst mode counter clock */
MartinJohnson 0:404f5a4f1385 1755 #define HRTIM_BURSTMODECLOCKSOURCE_ONCHIPEV_2 (HRTIM_BMCR_BMCLK_2 | HRTIM_BMCR_BMCLK_1 | HRTIM_BMCR_BMCLK_0) /*!< On-chip Event 2 (BMClk[2]), acting as a burst mode counter clock */
MartinJohnson 0:404f5a4f1385 1756 #define HRTIM_BURSTMODECLOCKSOURCE_ONCHIPEV_3 (HRTIM_BMCR_BMCLK_3) /*!< On-chip Event 3 (BMClk[3]), acting as a burst mode counter clock */
MartinJohnson 0:404f5a4f1385 1757 #define HRTIM_BURSTMODECLOCKSOURCE_ONCHIPEV_4 (HRTIM_BMCR_BMCLK_3 | HRTIM_BMCR_BMCLK_0) /*!< On-chip Event 4 (BMClk[4]), acting as a burst mode counter clock */
MartinJohnson 0:404f5a4f1385 1758 #define HRTIM_BURSTMODECLOCKSOURCE_FHRTIM (HRTIM_BMCR_BMCLK_3 | HRTIM_BMCR_BMCLK_1) /*!< Prescaled fHRTIM clock is used as clock source for the burst mode counter */
MartinJohnson 0:404f5a4f1385 1759
MartinJohnson 0:404f5a4f1385 1760 #define IS_HRTIM_BURSTMODECLOCKSOURCE(BURSTMODECLOCKSOURCE)\
MartinJohnson 0:404f5a4f1385 1761 (((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_MASTER) || \
MartinJohnson 0:404f5a4f1385 1762 ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIMER_A) || \
MartinJohnson 0:404f5a4f1385 1763 ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIMER_B) || \
MartinJohnson 0:404f5a4f1385 1764 ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIMER_C) || \
MartinJohnson 0:404f5a4f1385 1765 ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIMER_D) || \
MartinJohnson 0:404f5a4f1385 1766 ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIMER_E) || \
MartinJohnson 0:404f5a4f1385 1767 ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_ONCHIPEV_1) || \
MartinJohnson 0:404f5a4f1385 1768 ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_ONCHIPEV_2) || \
MartinJohnson 0:404f5a4f1385 1769 ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_ONCHIPEV_3) || \
MartinJohnson 0:404f5a4f1385 1770 ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_ONCHIPEV_4) || \
MartinJohnson 0:404f5a4f1385 1771 ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_FHRTIM))
MartinJohnson 0:404f5a4f1385 1772 /**
MartinJohnson 0:404f5a4f1385 1773 * @}
MartinJohnson 0:404f5a4f1385 1774 */
MartinJohnson 0:404f5a4f1385 1775
MartinJohnson 0:404f5a4f1385 1776 /** @defgroup HRTIM_BurstModePrescaler
MartinJohnson 0:404f5a4f1385 1777 * @{
MartinJohnson 0:404f5a4f1385 1778 * @brief Constants defining the prescaling ratio of the fHRTIM clock
MartinJohnson 0:404f5a4f1385 1779 * for the burst mode controller
MartinJohnson 0:404f5a4f1385 1780 */
MartinJohnson 0:404f5a4f1385 1781 #define HRTIM_BURSTMODEPRESCALER_DIV1 ((uint32_t)0x00000000) /*!< fBRST = fHRTIM */
MartinJohnson 0:404f5a4f1385 1782 #define HRTIM_BURSTMODEPRESCALER_DIV2 (HRTIM_BMCR_BMPSC_0) /*!< fBRST = fHRTIM/2 */
MartinJohnson 0:404f5a4f1385 1783 #define HRTIM_BURSTMODEPRESCALER_DIV4 (HRTIM_BMCR_BMPSC_1) /*!< fBRST = fHRTIM/4 */
MartinJohnson 0:404f5a4f1385 1784 #define HRTIM_BURSTMODEPRESCALER_DIV8 (HRTIM_BMCR_BMPSC_1 | HRTIM_BMCR_BMPSC_0) /*!< fBRST = fHRTIM/8 */
MartinJohnson 0:404f5a4f1385 1785 #define HRTIM_BURSTMODEPRESCALER_DIV16 (HRTIM_BMCR_BMPSC_2) /*!< fBRST = fHRTIM/16 */
MartinJohnson 0:404f5a4f1385 1786 #define HRTIM_BURSTMODEPRESCALER_DIV32 (HRTIM_BMCR_BMPSC_2 | HRTIM_BMCR_BMPSC_0) /*!< fBRST = fHRTIM/32 */
MartinJohnson 0:404f5a4f1385 1787 #define HRTIM_BURSTMODEPRESCALER_DIV64 (HRTIM_BMCR_BMPSC_2 | HRTIM_BMCR_BMPSC_1) /*!< fBRST = fHRTIM/64 */
MartinJohnson 0:404f5a4f1385 1788 #define HRTIM_BURSTMODEPRESCALER_DIV128 (HRTIM_BMCR_BMPSC_2 | HRTIM_BMCR_BMPSC_1 | HRTIM_BMCR_BMPSC_0) /*!< fBRST = fHRTIM/128 */
MartinJohnson 0:404f5a4f1385 1789 #define HRTIM_BURSTMODEPRESCALER_DIV256 (HRTIM_BMCR_BMPSC_3) /*!< fBRST = fHRTIM/256 */
MartinJohnson 0:404f5a4f1385 1790 #define HRTIM_BURSTMODEPRESCALER_DIV512 (HRTIM_BMCR_BMPSC_3 | HRTIM_BMCR_BMPSC_0) /*!< fBRST = fHRTIM/512 */
MartinJohnson 0:404f5a4f1385 1791 #define HRTIM_BURSTMODEPRESCALER_DIV1024 (HRTIM_BMCR_BMPSC_3 | HRTIM_BMCR_BMPSC_1) /*!< fBRST = fHRTIM/1024 */
MartinJohnson 0:404f5a4f1385 1792 #define HRTIM_BURSTMODEPRESCALER_DIV2048 (HRTIM_BMCR_BMPSC_3 | HRTIM_BMCR_BMPSC_1 | HRTIM_BMCR_BMPSC_0) /*!< fBRST = fHRTIM/2048*/
MartinJohnson 0:404f5a4f1385 1793 #define HRTIM_BURSTMODEPRESCALER_DIV4096 (HRTIM_BMCR_BMPSC_3 | HRTIM_BMCR_BMPSC_2) /*!< fBRST = fHRTIM/4096 */
MartinJohnson 0:404f5a4f1385 1794 #define HRTIM_BURSTMODEPRESCALER_DIV8192 (HRTIM_BMCR_BMPSC_3 | HRTIM_BMCR_BMPSC_2 | HRTIM_BMCR_BMPSC_0) /*!< fBRST = fHRTIM/8192 */
MartinJohnson 0:404f5a4f1385 1795 #define HRTIM_BURSTMODEPRESCALER_DIV16384 (HRTIM_BMCR_BMPSC_3 | HRTIM_BMCR_BMPSC_2 | HRTIM_BMCR_BMPSC_1) /*!< fBRST = fHRTIM/16384 */
MartinJohnson 0:404f5a4f1385 1796 #define HRTIM_BURSTMODEPRESCALER_DIV32768 (HRTIM_BMCR_BMPSC_3 | HRTIM_BMCR_BMPSC_2 | HRTIM_BMCR_BMPSC_1 | HRTIM_BMCR_BMPSC_0) /*!< fBRST = fHRTIM/32768 */
MartinJohnson 0:404f5a4f1385 1797
MartinJohnson 0:404f5a4f1385 1798 #define IS_HRTIM_HRTIM_BURSTMODEPRESCALER(BURSTMODEPRESCALER)\
MartinJohnson 0:404f5a4f1385 1799 (((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV1) || \
MartinJohnson 0:404f5a4f1385 1800 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV2) || \
MartinJohnson 0:404f5a4f1385 1801 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV4) || \
MartinJohnson 0:404f5a4f1385 1802 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV8) || \
MartinJohnson 0:404f5a4f1385 1803 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV16) || \
MartinJohnson 0:404f5a4f1385 1804 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV32) || \
MartinJohnson 0:404f5a4f1385 1805 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV64) || \
MartinJohnson 0:404f5a4f1385 1806 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV128) || \
MartinJohnson 0:404f5a4f1385 1807 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV256) || \
MartinJohnson 0:404f5a4f1385 1808 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV512) || \
MartinJohnson 0:404f5a4f1385 1809 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV1024) || \
MartinJohnson 0:404f5a4f1385 1810 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV2048) || \
MartinJohnson 0:404f5a4f1385 1811 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV4096) || \
MartinJohnson 0:404f5a4f1385 1812 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV8192) || \
MartinJohnson 0:404f5a4f1385 1813 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV16384) || \
MartinJohnson 0:404f5a4f1385 1814 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV32768))
MartinJohnson 0:404f5a4f1385 1815 /**
MartinJohnson 0:404f5a4f1385 1816 * @}
MartinJohnson 0:404f5a4f1385 1817 */
MartinJohnson 0:404f5a4f1385 1818
MartinJohnson 0:404f5a4f1385 1819 /** @defgroup HRTIM_BurstModeRegisterPreloadEnable
MartinJohnson 0:404f5a4f1385 1820 * @{
MartinJohnson 0:404f5a4f1385 1821 * @brief Constants defining whether or not burst mode registers preload
MartinJohnson 0:404f5a4f1385 1822 mechanism is enabled, i.e. a write access into a preloadable register
MartinJohnson 0:404f5a4f1385 1823 (HRTIM_BMCMPR, HRTIM_BMPER) is done into the active or the preload register
MartinJohnson 0:404f5a4f1385 1824 */
MartinJohnson 0:404f5a4f1385 1825 #define HRIM_BURSTMODEPRELOAD_DISABLED ((uint32_t)0x00000000) /*!< Preload disabled: the write access is directly done into active registers */
MartinJohnson 0:404f5a4f1385 1826 #define HRIM_BURSTMODEPRELOAD_ENABLED (HRTIM_BMCR_BMPREN) /*!< Preload enabled: the write access is done into preload registers */
MartinJohnson 0:404f5a4f1385 1827
MartinJohnson 0:404f5a4f1385 1828 #define IS_HRTIM_BURSTMODEPRELOAD(BURSTMODEPRELOAD)\
MartinJohnson 0:404f5a4f1385 1829 (((BURSTMODEPRELOAD) == HRIM_BURSTMODEPRELOAD_DISABLED) || \
MartinJohnson 0:404f5a4f1385 1830 ((BURSTMODEPRELOAD) == HRIM_BURSTMODEPRELOAD_ENABLED))
MartinJohnson 0:404f5a4f1385 1831 /**
MartinJohnson 0:404f5a4f1385 1832 * @}
MartinJohnson 0:404f5a4f1385 1833 */
MartinJohnson 0:404f5a4f1385 1834
MartinJohnson 0:404f5a4f1385 1835 /** @defgroup HRTIM_BurstModeTrigger
MartinJohnson 0:404f5a4f1385 1836 * @{
MartinJohnson 0:404f5a4f1385 1837 * @brief Constants defining the events that can be used tor trig the burst
MartinJohnson 0:404f5a4f1385 1838 * mode operation
MartinJohnson 0:404f5a4f1385 1839 */
MartinJohnson 0:404f5a4f1385 1840 #define HRTIM_BURSTMODETRIGGER_NONE (uint32_t)0x00000000
MartinJohnson 0:404f5a4f1385 1841 #define HRTIM_BURSTMODETRIGGER_SOFTWARE (HRTIM_BMTRGR_SW) /*!< Software trigger */
MartinJohnson 0:404f5a4f1385 1842 #define HRTIM_BURSTMODETRIGGER_MASTER_RESET (HRTIM_BMTRGR_MSTRST) /*!< Master reset */
MartinJohnson 0:404f5a4f1385 1843 #define HRTIM_BURSTMODETRIGGER_MASTER_REPETITION (HRTIM_BMTRGR_MSTREP) /*!< Master repetition */
MartinJohnson 0:404f5a4f1385 1844 #define HRTIM_BURSTMODETRIGGER_MASTER_CMP1 (HRTIM_BMTRGR_MSTCMP1) /*!< Master compare 1 */
MartinJohnson 0:404f5a4f1385 1845 #define HRTIM_BURSTMODETRIGGER_MASTER_CMP2 (HRTIM_BMTRGR_MSTCMP2) /*!< Master compare 2 */
MartinJohnson 0:404f5a4f1385 1846 #define HRTIM_BURSTMODETRIGGER_MASTER_CMP3 (HRTIM_BMTRGR_MSTCMP3) /*!< Master compare 3 */
MartinJohnson 0:404f5a4f1385 1847 #define HRTIM_BURSTMODETRIGGER_MASTER_CMP4 (HRTIM_BMTRGR_MSTCMP4) /*!< Master compare 4 */
MartinJohnson 0:404f5a4f1385 1848 #define HRTIM_BURSTMODETRIGGER_TIMERA_RESET (HRTIM_BMTRGR_TARST) /*!< Timer A reset */
MartinJohnson 0:404f5a4f1385 1849 #define HRTIM_BURSTMODETRIGGER_TIMERA_REPETITION (HRTIM_BMTRGR_TAREP) /*!< Timer A repetition */
MartinJohnson 0:404f5a4f1385 1850 #define HRTIM_BURSTMODETRIGGER_TIMERA_CMP1 (HRTIM_BMTRGR_TACMP1) /*!< Timer A compare 1 */
MartinJohnson 0:404f5a4f1385 1851 #define HRTIM_BURSTMODETRIGGER_TIMERA_CMP2 (HRTIM_BMTRGR_TACMP2) /*!< Timer A compare 2 */
MartinJohnson 0:404f5a4f1385 1852 #define HRTIM_BURSTMODETRIGGER_TIMERB_RESET (HRTIM_BMTRGR_TBRST) /*!< Timer B reset */
MartinJohnson 0:404f5a4f1385 1853 #define HRTIM_BURSTMODETRIGGER_TIMERB_REPETITION (HRTIM_BMTRGR_TBREP) /*!< Timer B repetition */
MartinJohnson 0:404f5a4f1385 1854 #define HRTIM_BURSTMODETRIGGER_TIMERB_CMP1 (HRTIM_BMTRGR_TBCMP1) /*!< Timer B compare 1 */
MartinJohnson 0:404f5a4f1385 1855 #define HRTIM_BURSTMODETRIGGER_TIMERB_CMP2 (HRTIM_BMTRGR_TBCMP2) /*!< Timer B compare 2 */
MartinJohnson 0:404f5a4f1385 1856 #define HRTIM_BURSTMODETRIGGER_TIMERC_RESET (HRTIM_BMTRGR_TCRST) /*!< Timer C reset */
MartinJohnson 0:404f5a4f1385 1857 #define HRTIM_BURSTMODETRIGGER_TIMERC_REPETITION (HRTIM_BMTRGR_TCREP) /*!< Timer C repetition */
MartinJohnson 0:404f5a4f1385 1858 #define HRTIM_BURSTMODETRIGGER_TIMERC_CMP1 (HRTIM_BMTRGR_TCCMP1) /*!< Timer C compare 1 */
MartinJohnson 0:404f5a4f1385 1859 #define HRTIM_BURSTMODETRIGGER_TIMERC_CMP2 (HRTIM_BMTRGR_TCCMP2) /*!< Timer C compare 2 */
MartinJohnson 0:404f5a4f1385 1860 #define HRTIM_BURSTMODETRIGGER_TIMERD_RESET (HRTIM_BMTRGR_TDRST) /*!< Timer D reset */
MartinJohnson 0:404f5a4f1385 1861 #define HRTIM_BURSTMODETRIGGER_TIMERD_REPETITION (HRTIM_BMTRGR_TDREP) /*!< Timer D repetition */
MartinJohnson 0:404f5a4f1385 1862 #define HRTIM_BURSTMODETRIGGER_TIMERD_CMP1 (HRTIM_BMTRGR_TDCMP1) /*!< Timer D compare 1 */
MartinJohnson 0:404f5a4f1385 1863 #define HRTIM_BURSTMODETRIGGER_TIMERD_CMP2 (HRTIM_BMTRGR_TDCMP2) /*!< Timer D compare 2 */
MartinJohnson 0:404f5a4f1385 1864 #define HRTIM_BURSTMODETRIGGER_TIMERE_RESET (HRTIM_BMTRGR_TERST) /*!< Timer E reset */
MartinJohnson 0:404f5a4f1385 1865 #define HRTIM_BURSTMODETRIGGER_TIMERE_REPETITION (HRTIM_BMTRGR_TEREP) /*!< Timer E repetition */
MartinJohnson 0:404f5a4f1385 1866 #define HRTIM_BURSTMODETRIGGER_TIMERE_CMP1 (HRTIM_BMTRGR_TECMP1) /*!< Timer E compare 1 */
MartinJohnson 0:404f5a4f1385 1867 #define HRTIM_BURSTMODETRIGGER_TIMERE_CMP2 (HRTIM_BMTRGR_TECMP2) /*!< Timer E compare 2 */
MartinJohnson 0:404f5a4f1385 1868 #define HRTIM_BURSTMODETRIGGER_TIMERA_EVENT7 (HRTIM_BMTRGR_TAEEV7) /*!< Timer A period following External Event 7 */
MartinJohnson 0:404f5a4f1385 1869 #define HRTIM_BURSTMODETRIGGER_TIMERD_EVENT8 (HRTIM_BMTRGR_TDEEV8) /*!< Timer D period following External Event 8 */
MartinJohnson 0:404f5a4f1385 1870 #define HRTIM_BURSTMODETRIGGER_EVENT_7 (HRTIM_BMTRGR_EEV7) /*!< External Event 7 */
MartinJohnson 0:404f5a4f1385 1871 #define HRTIM_BURSTMODETRIGGER_EVENT_8 (HRTIM_BMTRGR_EEV8) /*!< External Event 8 */
MartinJohnson 0:404f5a4f1385 1872 #define HRTIM_BURSTMODETRIGGER_EVENT_ONCHIP (HRTIM_BMTRGR_OCHPEV) /*!< On-chip Event */
MartinJohnson 0:404f5a4f1385 1873
MartinJohnson 0:404f5a4f1385 1874 #define IS_HRTIM_BURSTMODETRIGGER(BURSTMODETRIGGER)\
MartinJohnson 0:404f5a4f1385 1875 (((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_NONE) || \
MartinJohnson 0:404f5a4f1385 1876 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_MASTER_RESET) || \
MartinJohnson 0:404f5a4f1385 1877 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_MASTER_REPETITION) || \
MartinJohnson 0:404f5a4f1385 1878 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_MASTER_CMP1) || \
MartinJohnson 0:404f5a4f1385 1879 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_MASTER_CMP2) || \
MartinJohnson 0:404f5a4f1385 1880 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_MASTER_CMP3) || \
MartinJohnson 0:404f5a4f1385 1881 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_MASTER_CMP4) || \
MartinJohnson 0:404f5a4f1385 1882 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERA_RESET) || \
MartinJohnson 0:404f5a4f1385 1883 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERA_REPETITION) || \
MartinJohnson 0:404f5a4f1385 1884 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERA_CMP1) || \
MartinJohnson 0:404f5a4f1385 1885 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERA_CMP2) || \
MartinJohnson 0:404f5a4f1385 1886 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERB_RESET) || \
MartinJohnson 0:404f5a4f1385 1887 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERB_REPETITION) || \
MartinJohnson 0:404f5a4f1385 1888 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERB_CMP1) || \
MartinJohnson 0:404f5a4f1385 1889 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERB_CMP2) || \
MartinJohnson 0:404f5a4f1385 1890 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERC_RESET) || \
MartinJohnson 0:404f5a4f1385 1891 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERC_REPETITION) || \
MartinJohnson 0:404f5a4f1385 1892 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERC_CMP1) || \
MartinJohnson 0:404f5a4f1385 1893 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERC_CMP2) || \
MartinJohnson 0:404f5a4f1385 1894 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERD_RESET) || \
MartinJohnson 0:404f5a4f1385 1895 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERD_REPETITION) || \
MartinJohnson 0:404f5a4f1385 1896 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERD_CMP1) || \
MartinJohnson 0:404f5a4f1385 1897 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERD_CMP2) || \
MartinJohnson 0:404f5a4f1385 1898 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERE_RESET) || \
MartinJohnson 0:404f5a4f1385 1899 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERE_REPETITION) || \
MartinJohnson 0:404f5a4f1385 1900 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERE_CMP1) || \
MartinJohnson 0:404f5a4f1385 1901 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERE_CMP2) || \
MartinJohnson 0:404f5a4f1385 1902 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERA_EVENT7) || \
MartinJohnson 0:404f5a4f1385 1903 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERD_EVENT8) || \
MartinJohnson 0:404f5a4f1385 1904 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_EVENT_7) || \
MartinJohnson 0:404f5a4f1385 1905 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_EVENT_8) || \
MartinJohnson 0:404f5a4f1385 1906 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_EVENT_ONCHIP))
MartinJohnson 0:404f5a4f1385 1907 /**
MartinJohnson 0:404f5a4f1385 1908 * @}
MartinJohnson 0:404f5a4f1385 1909 */
MartinJohnson 0:404f5a4f1385 1910
MartinJohnson 0:404f5a4f1385 1911 /** @defgroup HRTIM_ADCTriggerUpdateSource
MartinJohnson 0:404f5a4f1385 1912 * @{
MartinJohnson 0:404f5a4f1385 1913 * @brief constants defining the source triggering the update of the
MartinJohnson 0:404f5a4f1385 1914 HRTIM_ADCxR register (transfer from preload to active register).
MartinJohnson 0:404f5a4f1385 1915 */
MartinJohnson 0:404f5a4f1385 1916 #define HRTIM_ADCTRIGGERUPDATE_MASTER (uint32_t)0x00000000 /*!< Master timer */
MartinJohnson 0:404f5a4f1385 1917 #define HRTIM_ADCTRIGGERUPDATE_TIMER_A (HRTIM_CR1_ADC1USRC_0) /*!< Timer A */
MartinJohnson 0:404f5a4f1385 1918 #define HRTIM_ADCTRIGGERUPDATE_TIMER_B (HRTIM_CR1_ADC1USRC_1) /*!< Timer B */
MartinJohnson 0:404f5a4f1385 1919 #define HRTIM_ADCTRIGGERUPDATE_TIMER_C (HRTIM_CR1_ADC1USRC_1 | HRTIM_CR1_ADC1USRC_0) /*!< Timer C */
MartinJohnson 0:404f5a4f1385 1920 #define HRTIM_ADCTRIGGERUPDATE_TIMER_D (HRTIM_CR1_ADC1USRC_2) /*!< Timer D */
MartinJohnson 0:404f5a4f1385 1921 #define HRTIM_ADCTRIGGERUPDATE_TIMER_E (HRTIM_CR1_ADC1USRC_2 | HRTIM_CR1_ADC1USRC_0) /*!< Timer E */
MartinJohnson 0:404f5a4f1385 1922
MartinJohnson 0:404f5a4f1385 1923 #define IS_HRTIM_ADCTRIGGERUPDATE(ADCTRIGGERUPDATE)\
MartinJohnson 0:404f5a4f1385 1924 (((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_MASTER) || \
MartinJohnson 0:404f5a4f1385 1925 ((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_TIMER_A) || \
MartinJohnson 0:404f5a4f1385 1926 ((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_TIMER_B) || \
MartinJohnson 0:404f5a4f1385 1927 ((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_TIMER_C) || \
MartinJohnson 0:404f5a4f1385 1928 ((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_TIMER_D) || \
MartinJohnson 0:404f5a4f1385 1929 ((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_TIMER_E))
MartinJohnson 0:404f5a4f1385 1930 /**
MartinJohnson 0:404f5a4f1385 1931 * @}
MartinJohnson 0:404f5a4f1385 1932 */
MartinJohnson 0:404f5a4f1385 1933
MartinJohnson 0:404f5a4f1385 1934 /** @defgroup HRTIM_ADCTriggerEvent
MartinJohnson 0:404f5a4f1385 1935 * @{
MartinJohnson 0:404f5a4f1385 1936 * @brief constants defining the events triggering ADC conversion.
MartinJohnson 0:404f5a4f1385 1937 * HRTIM_ADCTRIGGEREVENT13_*: ADC Triggers 1 and 3
MartinJohnson 0:404f5a4f1385 1938 * HRTIM_ADCTRIGGEREVENT24_*: ADC Triggers 2 and 4
MartinJohnson 0:404f5a4f1385 1939 */
MartinJohnson 0:404f5a4f1385 1940 #define HRTIM_ADCTRIGGEREVENT13_NONE (uint32_t)0x00000000 /*!< No ADC trigger event */
MartinJohnson 0:404f5a4f1385 1941 #define HRTIM_ADCTRIGGEREVENT13_MASTER_CMP1 (HRTIM_ADC1R_AD1MC1) /*!< ADC Trigger on master compare 1 */
MartinJohnson 0:404f5a4f1385 1942 #define HRTIM_ADCTRIGGEREVENT13_MASTER_CMP2 (HRTIM_ADC1R_AD1MC2) /*!< ADC Trigger on master compare 2 */
MartinJohnson 0:404f5a4f1385 1943 #define HRTIM_ADCTRIGGEREVENT13_MASTER_CMP3 (HRTIM_ADC1R_AD1MC3) /*!< ADC Trigger on master compare 3 */
MartinJohnson 0:404f5a4f1385 1944 #define HRTIM_ADCTRIGGEREVENT13_MASTER_CMP4 (HRTIM_ADC1R_AD1MC4) /*!< ADC Trigger on master compare 4 */
MartinJohnson 0:404f5a4f1385 1945 #define HRTIM_ADCTRIGGEREVENT13_MASTER_PERIOD (HRTIM_ADC1R_AD1MPER) /*!< ADC Trigger on master period */
MartinJohnson 0:404f5a4f1385 1946 #define HRTIM_ADCTRIGGEREVENT13_EVENT_1 (HRTIM_ADC1R_AD1EEV1) /*!< ADC Trigger on external event 1 */
MartinJohnson 0:404f5a4f1385 1947 #define HRTIM_ADCTRIGGEREVENT13_EVENT_2 (HRTIM_ADC1R_AD1EEV2) /*!< ADC Trigger on external event 2 */
MartinJohnson 0:404f5a4f1385 1948 #define HRTIM_ADCTRIGGEREVENT13_EVENT_3 (HRTIM_ADC1R_AD1EEV3) /*!< ADC Trigger on external event 3 */
MartinJohnson 0:404f5a4f1385 1949 #define HRTIM_ADCTRIGGEREVENT13_EVENT_4 (HRTIM_ADC1R_AD1EEV4) /*!< ADC Trigger on external event 4 */
MartinJohnson 0:404f5a4f1385 1950 #define HRTIM_ADCTRIGGEREVENT13_EVENT_5 (HRTIM_ADC1R_AD1EEV5) /*!< ADC Trigger on external event 5 */
MartinJohnson 0:404f5a4f1385 1951 #define HRTIM_ADCTRIGGEREVENT13_TIMERA_CMP2 (HRTIM_ADC1R_AD1TAC2) /*!< ADC Trigger on Timer A compare 2 */
MartinJohnson 0:404f5a4f1385 1952 #define HRTIM_ADCTRIGGEREVENT13_TIMERA_CMP3 (HRTIM_ADC1R_AD1TAC3) /*!< ADC Trigger on Timer A compare 3 */
MartinJohnson 0:404f5a4f1385 1953 #define HRTIM_ADCTRIGGEREVENT13_TIMERA_CMP4 (HRTIM_ADC1R_AD1TAC4) /*!< ADC Trigger on Timer A compare 4 */
MartinJohnson 0:404f5a4f1385 1954 #define HRTIM_ADCTRIGGEREVENT13_TIMERA_PERIOD (HRTIM_ADC1R_AD1TAPER) /*!< ADC Trigger on Timer A period */
MartinJohnson 0:404f5a4f1385 1955 #define HRTIM_ADCTRIGGEREVENT13_TIMERA_RESET (HRTIM_ADC1R_AD1TARST) /*!< ADC Trigger on Timer A reset */
MartinJohnson 0:404f5a4f1385 1956 #define HRTIM_ADCTRIGGEREVENT13_TIMERB_CMP2 (HRTIM_ADC1R_AD1TBC2) /*!< ADC Trigger on Timer B compare 2 */
MartinJohnson 0:404f5a4f1385 1957 #define HRTIM_ADCTRIGGEREVENT13_TIMERB_CMP3 (HRTIM_ADC1R_AD1TBC3) /*!< ADC Trigger on Timer B compare 3 */
MartinJohnson 0:404f5a4f1385 1958 #define HRTIM_ADCTRIGGEREVENT13_TIMERB_CMP4 (HRTIM_ADC1R_AD1TBC4) /*!< ADC Trigger on Timer B compare 4 */
MartinJohnson 0:404f5a4f1385 1959 #define HRTIM_ADCTRIGGEREVENT13_TIMERB_PERIOD (HRTIM_ADC1R_AD1TBPER) /*!< ADC Trigger on Timer B period */
MartinJohnson 0:404f5a4f1385 1960 #define HRTIM_ADCTRIGGEREVENT13_TIMERB_RESET (HRTIM_ADC1R_AD1TBRST) /*!< ADC Trigger on Timer B reset */
MartinJohnson 0:404f5a4f1385 1961 #define HRTIM_ADCTRIGGEREVENT13_TIMERC_CMP2 (HRTIM_ADC1R_AD1TCC2) /*!< ADC Trigger on Timer C compare 2 */
MartinJohnson 0:404f5a4f1385 1962 #define HRTIM_ADCTRIGGEREVENT13_TIMERC_CMP3 (HRTIM_ADC1R_AD1TCC3) /*!< ADC Trigger on Timer C compare 3 */
MartinJohnson 0:404f5a4f1385 1963 #define HRTIM_ADCTRIGGEREVENT13_TIMERC_CMP4 (HRTIM_ADC1R_AD1TCC4) /*!< ADC Trigger on Timer C compare 4 */
MartinJohnson 0:404f5a4f1385 1964 #define HRTIM_ADCTRIGGEREVENT13_TIMERC_PERIOD (HRTIM_ADC1R_AD1TCPER) /*!< ADC Trigger on Timer C period */
MartinJohnson 0:404f5a4f1385 1965 #define HRTIM_ADCTRIGGEREVENT13_TIMERD_CMP2 (HRTIM_ADC1R_AD1TDC2) /*!< ADC Trigger on Timer D compare 2 */
MartinJohnson 0:404f5a4f1385 1966 #define HRTIM_ADCTRIGGEREVENT13_TIMERD_CMP3 (HRTIM_ADC1R_AD1TDC3) /*!< ADC Trigger on Timer D compare 3 */
MartinJohnson 0:404f5a4f1385 1967 #define HRTIM_ADCTRIGGEREVENT13_TIMERD_CMP4 (HRTIM_ADC1R_AD1TDC4) /*!< ADC Trigger on Timer D compare 4 */
MartinJohnson 0:404f5a4f1385 1968 #define HRTIM_ADCTRIGGEREVENT13_TIMERD_PERIOD (HRTIM_ADC1R_AD1TDPER) /*!< ADC Trigger on Timer D period */
MartinJohnson 0:404f5a4f1385 1969 #define HRTIM_ADCTRIGGEREVENT13_TIMERE_CMP2 (HRTIM_ADC1R_AD1TEC2) /*!< ADC Trigger on Timer E compare 2 */
MartinJohnson 0:404f5a4f1385 1970 #define HRTIM_ADCTRIGGEREVENT13_TIMERE_CMP3 (HRTIM_ADC1R_AD1TEC3) /*!< ADC Trigger on Timer E compare 3 */
MartinJohnson 0:404f5a4f1385 1971 #define HRTIM_ADCTRIGGEREVENT13_TIMERE_CMP4 (HRTIM_ADC1R_AD1TEC4) /*!< ADC Trigger on Timer E compare 4 */
MartinJohnson 0:404f5a4f1385 1972 #define HRTIM_ADCTRIGGEREVENT13_TIMERE_PERIOD (HRTIM_ADC1R_AD1TEPER) /*!< ADC Trigger on Timer E period */
MartinJohnson 0:404f5a4f1385 1973
MartinJohnson 0:404f5a4f1385 1974 #define HRTIM_ADCTRIGGEREVENT24_NONE (uint32_t)0x00000000 /*!< No ADC trigger event */
MartinJohnson 0:404f5a4f1385 1975 #define HRTIM_ADCTRIGGEREVENT24_MASTER_CMP1 (HRTIM_ADC2R_AD2MC1) /*!< ADC Trigger on master compare 1 */
MartinJohnson 0:404f5a4f1385 1976 #define HRTIM_ADCTRIGGEREVENT24_MASTER_CMP2 (HRTIM_ADC2R_AD2MC2) /*!< ADC Trigger on master compare 2 */
MartinJohnson 0:404f5a4f1385 1977 #define HRTIM_ADCTRIGGEREVENT24_MASTER_CMP3 (HRTIM_ADC2R_AD2MC3) /*!< ADC Trigger on master compare 3 */
MartinJohnson 0:404f5a4f1385 1978 #define HRTIM_ADCTRIGGEREVENT24_MASTER_CMP4 (HRTIM_ADC2R_AD2MC4) /*!< ADC Trigger on master compare 4 */
MartinJohnson 0:404f5a4f1385 1979 #define HRTIM_ADCTRIGGEREVENT24_MASTER_PERIOD (HRTIM_ADC2R_AD2MPER) /*!< ADC Trigger on master period */
MartinJohnson 0:404f5a4f1385 1980 #define HRTIM_ADCTRIGGEREVENT24_EVENT_6 (HRTIM_ADC2R_AD2EEV6) /*!< ADC Trigger on external event 6 */
MartinJohnson 0:404f5a4f1385 1981 #define HRTIM_ADCTRIGGEREVENT24_EVENT_7 (HRTIM_ADC2R_AD2EEV7) /*!< ADC Trigger on external event 7 */
MartinJohnson 0:404f5a4f1385 1982 #define HRTIM_ADCTRIGGEREVENT24_EVENT_8 (HRTIM_ADC2R_AD2EEV8) /*!< ADC Trigger on external event 8 */
MartinJohnson 0:404f5a4f1385 1983 #define HRTIM_ADCTRIGGEREVENT24_EVENT_9 (HRTIM_ADC2R_AD2EEV9) /*!< ADC Trigger on external event 9 */
MartinJohnson 0:404f5a4f1385 1984 #define HRTIM_ADCTRIGGEREVENT24_EVENT_10 (HRTIM_ADC2R_AD2EEV10) /*!< ADC Trigger on external event 10 */
MartinJohnson 0:404f5a4f1385 1985 #define HRTIM_ADCTRIGGEREVENT24_TIMERA_CMP2 (HRTIM_ADC2R_AD2TAC2) /*!< ADC Trigger on Timer A compare 2 */
MartinJohnson 0:404f5a4f1385 1986 #define HRTIM_ADCTRIGGEREVENT24_TIMERA_CMP3 (HRTIM_ADC2R_AD2TAC3) /*!< ADC Trigger on Timer A compare 3 */
MartinJohnson 0:404f5a4f1385 1987 #define HRTIM_ADCTRIGGEREVENT24_TIMERA_CMP4 (HRTIM_ADC2R_AD2TAC4) /*!< ADC Trigger on Timer A compare 4 */
MartinJohnson 0:404f5a4f1385 1988 #define HRTIM_ADCTRIGGEREVENT24_TIMERA_PERIOD (HRTIM_ADC2R_AD2TAPER) /*!< ADC Trigger on Timer A period */
MartinJohnson 0:404f5a4f1385 1989 #define HRTIM_ADCTRIGGEREVENT24_TIMERB_CMP2 (HRTIM_ADC2R_AD2TBC2) /*!< ADC Trigger on Timer B compare 2 */
MartinJohnson 0:404f5a4f1385 1990 #define HRTIM_ADCTRIGGEREVENT24_TIMERB_CMP3 (HRTIM_ADC2R_AD2TBC3) /*!< ADC Trigger on Timer B compare 3 */
MartinJohnson 0:404f5a4f1385 1991 #define HRTIM_ADCTRIGGEREVENT24_TIMERB_CMP4 (HRTIM_ADC2R_AD2TBC4) /*!< ADC Trigger on Timer B compare 4 */
MartinJohnson 0:404f5a4f1385 1992 #define HRTIM_ADCTRIGGEREVENT24_TIMERB_PERIOD (HRTIM_ADC2R_AD2TBPER) /*!< ADC Trigger on Timer B period */
MartinJohnson 0:404f5a4f1385 1993 #define HRTIM_ADCTRIGGEREVENT24_TIMERC_CMP2 (HRTIM_ADC2R_AD2TCC2) /*!< ADC Trigger on Timer C compare 2 */
MartinJohnson 0:404f5a4f1385 1994 #define HRTIM_ADCTRIGGEREVENT24_TIMERC_CMP3 (HRTIM_ADC2R_AD2TCC3) /*!< ADC Trigger on Timer C compare 3 */
MartinJohnson 0:404f5a4f1385 1995 #define HRTIM_ADCTRIGGEREVENT24_TIMERC_CMP4 (HRTIM_ADC2R_AD2TCC4) /*!< ADC Trigger on Timer C compare 4 */
MartinJohnson 0:404f5a4f1385 1996 #define HRTIM_ADCTRIGGEREVENT24_TIMERC_PERIOD (HRTIM_ADC2R_AD2TCPER) /*!< ADC Trigger on Timer C period */
MartinJohnson 0:404f5a4f1385 1997 #define HRTIM_ADCTRIGGEREVENT24_TIMERC_RESET (HRTIM_ADC2R_AD2TCRST) /*!< ADC Trigger on Timer C reset */
MartinJohnson 0:404f5a4f1385 1998 #define HRTIM_ADCTRIGGEREVENT24_TIMERD_CMP2 (HRTIM_ADC2R_AD2TDC2) /*!< ADC Trigger on Timer D compare 2 */
MartinJohnson 0:404f5a4f1385 1999 #define HRTIM_ADCTRIGGEREVENT24_TIMERD_CMP3 (HRTIM_ADC2R_AD2TDC3) /*!< ADC Trigger on Timer D compare 3 */
MartinJohnson 0:404f5a4f1385 2000 #define HRTIM_ADCTRIGGEREVENT24_TIMERD_CMP4 (HRTIM_ADC2R_AD2TDC4) /*!< ADC Trigger on Timer D compare 4 */
MartinJohnson 0:404f5a4f1385 2001 #define HRTIM_ADCTRIGGEREVENT24_TIMERD_PERIOD (HRTIM_ADC2R_AD2TDPER) /*!< ADC Trigger on Timer D period */
MartinJohnson 0:404f5a4f1385 2002 #define HRTIM_ADCTRIGGEREVENT24_TIMERD_RESET (HRTIM_ADC2R_AD2TDRST) /*!< ADC Trigger on Timer D reset */
MartinJohnson 0:404f5a4f1385 2003 #define HRTIM_ADCTRIGGEREVENT24_TIMERE_CMP2 (HRTIM_ADC2R_AD2TEC2) /*!< ADC Trigger on Timer E compare 2 */
MartinJohnson 0:404f5a4f1385 2004 #define HRTIM_ADCTRIGGEREVENT24_TIMERE_CMP3 (HRTIM_ADC2R_AD2TEC3) /*!< ADC Trigger on Timer E compare 3 */
MartinJohnson 0:404f5a4f1385 2005 #define HRTIM_ADCTRIGGEREVENT24_TIMERE_CMP4 (HRTIM_ADC2R_AD2TEC4) /*!< ADC Trigger on Timer E compare 4 */
MartinJohnson 0:404f5a4f1385 2006 #define HRTIM_ADCTRIGGEREVENT24_TIMERE_RESET (HRTIM_ADC2R_AD2TERST) /*!< ADC Trigger on Timer E reset */
MartinJohnson 0:404f5a4f1385 2007
MartinJohnson 0:404f5a4f1385 2008 /**
MartinJohnson 0:404f5a4f1385 2009 * @}
MartinJohnson 0:404f5a4f1385 2010 */
MartinJohnson 0:404f5a4f1385 2011
MartinJohnson 0:404f5a4f1385 2012 /** @defgroup HRTIM_DLLCalibrationRate
MartinJohnson 0:404f5a4f1385 2013 * @{
MartinJohnson 0:404f5a4f1385 2014 * @brief Constants defining the DLL calibration periods (in micro seconds)
MartinJohnson 0:404f5a4f1385 2015 */
MartinJohnson 0:404f5a4f1385 2016
MartinJohnson 0:404f5a4f1385 2017 #define HRTIM_SINGLE_CALIBRATION (uint32_t)0xFFFFFFFF /*!< Non periodic DLL calibration */
MartinJohnson 0:404f5a4f1385 2018 #define HRTIM_CALIBRATIONRATE_7300 (uint32_t)0x00000000 /*!< 1048576 * tHRTIM (7.3 ms) */
MartinJohnson 0:404f5a4f1385 2019 #define HRTIM_CALIBRATIONRATE_910 (HRTIM_DLLCR_CALRTE_0) /*!< 131072 * tHRTIM (910 µs) */
MartinJohnson 0:404f5a4f1385 2020 #define HRTIM_CALIBRATIONRATE_114 (HRTIM_DLLCR_CALRTE_1) /*!< 131072 * tHRTIM (910 µs) */
MartinJohnson 0:404f5a4f1385 2021 #define HRTIM_CALIBRATIONRATE_14 (HRTIM_DLLCR_CALRTE_1 | HRTIM_DLLCR_CALRTE_0) /*!< 131072 * tHRTIM (910 µs) */
MartinJohnson 0:404f5a4f1385 2022
MartinJohnson 0:404f5a4f1385 2023 #define IS_HRTIM_CALIBRATIONRATE(CALIBRATIONRATE)\
MartinJohnson 0:404f5a4f1385 2024 (((CALIBRATIONRATE) == HRTIM_CALIBRATIONRATE_7300) || \
MartinJohnson 0:404f5a4f1385 2025 ((CALIBRATIONRATE) == HRTIM_CALIBRATIONRATE_910) || \
MartinJohnson 0:404f5a4f1385 2026 ((CALIBRATIONRATE) == HRTIM_CALIBRATIONRATE_114) || \
MartinJohnson 0:404f5a4f1385 2027 ((CALIBRATIONRATE) == HRTIM_CALIBRATIONRATE_14))
MartinJohnson 0:404f5a4f1385 2028 /**
MartinJohnson 0:404f5a4f1385 2029 * @}
MartinJohnson 0:404f5a4f1385 2030 */
MartinJohnson 0:404f5a4f1385 2031
MartinJohnson 0:404f5a4f1385 2032 /** @defgroup HRTIM_BurstDMARegistersUpdate
MartinJohnson 0:404f5a4f1385 2033 * @{
MartinJohnson 0:404f5a4f1385 2034 * @brief Constants defining the registers that can be written during a burst
MartinJohnson 0:404f5a4f1385 2035 * DMA operation
MartinJohnson 0:404f5a4f1385 2036 */
MartinJohnson 0:404f5a4f1385 2037 #define HRTIM_BURSTDMA_NONE (uint32_t)0x00000000 /*!< No register is updated by Burst DMA accesses */
MartinJohnson 0:404f5a4f1385 2038 #define HRTIM_BURSTDMA_CR (HRTIM_BDTUPR_TIMCR) /*!< MCR or TIMxCR register is updated by Burst DMA accesses */
MartinJohnson 0:404f5a4f1385 2039 #define HRTIM_BURSTDMA_ICR (HRTIM_BDTUPR_TIMICR) /*!< MICR or TIMxICR register is updated by Burst DMA accesses */
MartinJohnson 0:404f5a4f1385 2040 #define HRTIM_BURSTDMA_DIER (HRTIM_BDTUPR_TIMDIER) /*!< MDIER or TIMxDIER register is updated by Burst DMA accesses */
MartinJohnson 0:404f5a4f1385 2041 #define HRTIM_BURSTDMA_CNT (HRTIM_BDTUPR_TIMCNT) /*!< MCNTR or CNTxCR register is updated by Burst DMA accesses */
MartinJohnson 0:404f5a4f1385 2042 #define HRTIM_BURSTDMA_PER (HRTIM_BDTUPR_TIMPER) /*!< MPER or PERxR register is updated by Burst DMA accesses */
MartinJohnson 0:404f5a4f1385 2043 #define HRTIM_BURSTDMA_REP (HRTIM_BDTUPR_TIMREP) /*!< MREPR or REPxR register is updated by Burst DMA accesses */
MartinJohnson 0:404f5a4f1385 2044 #define HRTIM_BURSTDMA_CMP1 (HRTIM_BDTUPR_TIMCMP1) /*!< MCMP1R or CMP1xR register is updated by Burst DMA accesses */
MartinJohnson 0:404f5a4f1385 2045 #define HRTIM_BURSTDMA_CMP2 (HRTIM_BDTUPR_TIMCMP2) /*!< MCMP2R or CMP2xR register is updated by Burst DMA accesses */
MartinJohnson 0:404f5a4f1385 2046 #define HRTIM_BURSTDMA_CMP3 (HRTIM_BDTUPR_TIMCMP3) /*!< MCMP3R or CMP3xR register is updated by Burst DMA accesses */
MartinJohnson 0:404f5a4f1385 2047 #define HRTIM_BURSTDMA_CMP4 (HRTIM_BDTUPR_TIMCMP4) /*!< MCMP4R or CMP4xR register is updated by Burst DMA accesses */
MartinJohnson 0:404f5a4f1385 2048 #define HRTIM_BURSTDMA_DTR (HRTIM_BDTUPR_TIMDTR) /*!< TDxR register is updated by Burst DMA accesses */
MartinJohnson 0:404f5a4f1385 2049 #define HRTIM_BURSTDMA_SET1R (HRTIM_BDTUPR_TIMSET1R) /*!< SET1R register is updated by Burst DMA accesses */
MartinJohnson 0:404f5a4f1385 2050 #define HRTIM_BURSTDMA_RST1R (HRTIM_BDTUPR_TIMRST1R) /*!< RST1R register is updated by Burst DMA accesses */
MartinJohnson 0:404f5a4f1385 2051 #define HRTIM_BURSTDMA_SET2R (HRTIM_BDTUPR_TIMSET2R) /*!< SET2R register is updated by Burst DMA accesses */
MartinJohnson 0:404f5a4f1385 2052 #define HRTIM_BURSTDMA_RST2R (HRTIM_BDTUPR_TIMRST2R) /*!< RST1R register is updated by Burst DMA accesses */
MartinJohnson 0:404f5a4f1385 2053 #define HRTIM_BURSTDMA_EEFR1 (HRTIM_BDTUPR_TIMEEFR1) /*!< EEFxR1 register is updated by Burst DMA accesses */
MartinJohnson 0:404f5a4f1385 2054 #define HRTIM_BURSTDMA_EEFR2 (HRTIM_BDTUPR_TIMEEFR2) /*!< EEFxR2 register is updated by Burst DMA accesses */
MartinJohnson 0:404f5a4f1385 2055 #define HRTIM_BURSTDMA_RSTR (HRTIM_BDTUPR_TIMRSTR) /*!< RSTxR register is updated by Burst DMA accesses */
MartinJohnson 0:404f5a4f1385 2056 #define HRTIM_BURSTDMA_CHPR (HRTIM_BDTUPR_TIMCHPR) /*!< CHPxR register is updated by Burst DMA accesses */
MartinJohnson 0:404f5a4f1385 2057 #define HRTIM_BURSTDMA_OUTR (HRTIM_BDTUPR_TIMOUTR) /*!< OUTxR register is updated by Burst DMA accesses */
MartinJohnson 0:404f5a4f1385 2058 #define HRTIM_BURSTDMA_FLTR (HRTIM_BDTUPR_TIMFLTR) /*!< FLTxR register is updated by Burst DMA accesses */
MartinJohnson 0:404f5a4f1385 2059
MartinJohnson 0:404f5a4f1385 2060 #define IS_HRTIM_TIMER_BURSTDMA(TIMER, BURSTDMA) \
MartinJohnson 0:404f5a4f1385 2061 ((((TIMER) == HRTIM_TIMERINDEX_MASTER) && (((BURSTDMA) & 0xFFFFFC000) == 0x00000000)) \
MartinJohnson 0:404f5a4f1385 2062 || \
MartinJohnson 0:404f5a4f1385 2063 (((TIMER) == HRTIM_TIMERINDEX_TIMER_A) && (((BURSTDMA) & 0xFFE00000) == 0x00000000)) \
MartinJohnson 0:404f5a4f1385 2064 || \
MartinJohnson 0:404f5a4f1385 2065 (((TIMER) == HRTIM_TIMERINDEX_TIMER_B) && (((BURSTDMA) & 0xFFE00000) == 0x00000000)) \
MartinJohnson 0:404f5a4f1385 2066 || \
MartinJohnson 0:404f5a4f1385 2067 (((TIMER) == HRTIM_TIMERINDEX_TIMER_C) && (((BURSTDMA) & 0xFFE00000) == 0x00000000)) \
MartinJohnson 0:404f5a4f1385 2068 || \
MartinJohnson 0:404f5a4f1385 2069 (((TIMER) == HRTIM_TIMERINDEX_TIMER_D) && (((BURSTDMA) & 0xFFE00000) == 0x00000000)) \
MartinJohnson 0:404f5a4f1385 2070 || \
MartinJohnson 0:404f5a4f1385 2071 (((TIMER) == HRTIM_TIMERINDEX_TIMER_E) && (((BURSTDMA) & 0xFFE00000) == 0x00000000)))
MartinJohnson 0:404f5a4f1385 2072 /**
MartinJohnson 0:404f5a4f1385 2073 * @}
MartinJohnson 0:404f5a4f1385 2074 */
MartinJohnson 0:404f5a4f1385 2075
MartinJohnson 0:404f5a4f1385 2076 /** @defgroup HRTIM_BursttModeControl
MartinJohnson 0:404f5a4f1385 2077 * @{
MartinJohnson 0:404f5a4f1385 2078 * @brief Constants used to enable or disable the burst mode controller
MartinJohnson 0:404f5a4f1385 2079 */
MartinJohnson 0:404f5a4f1385 2080 #define HRTIM_BURSTMODECTL_DISABLED (uint32_t)0x00000000 /*!< Burst mode disabled */
MartinJohnson 0:404f5a4f1385 2081 #define HRTIM_BURSTMODECTL_ENABLED (HRTIM_BMCR_BME) /*!< Burst mode enabled */
MartinJohnson 0:404f5a4f1385 2082
MartinJohnson 0:404f5a4f1385 2083 #define IS_HRTIM_BURSTMODECTL(BURSTMODECTL)\
MartinJohnson 0:404f5a4f1385 2084 (((BURSTMODECTL) == HRTIM_BURSTMODECTL_DISABLED) || \
MartinJohnson 0:404f5a4f1385 2085 ((BURSTMODECTL) == HRTIM_BURSTMODECTL_ENABLED))
MartinJohnson 0:404f5a4f1385 2086 /**
MartinJohnson 0:404f5a4f1385 2087 * @}
MartinJohnson 0:404f5a4f1385 2088 */
MartinJohnson 0:404f5a4f1385 2089
MartinJohnson 0:404f5a4f1385 2090 /** @defgroup HRTIM_FaultModeControl
MartinJohnson 0:404f5a4f1385 2091 * @{
MartinJohnson 0:404f5a4f1385 2092 * @brief Constants used to enable or disable the Fault mode
MartinJohnson 0:404f5a4f1385 2093 */
MartinJohnson 0:404f5a4f1385 2094 #define HRTIM_FAULT_DISABLED (uint32_t)0x00000000 /*!< Fault mode disabled */
MartinJohnson 0:404f5a4f1385 2095 #define HRTIM_FAULT_ENABLED (HRTIM_FLTINR1_FLT1E) /*!< Fault mode enabled */
MartinJohnson 0:404f5a4f1385 2096
MartinJohnson 0:404f5a4f1385 2097 #define IS_HRTIM_FAULTCTL(FAULTCTL)\
MartinJohnson 0:404f5a4f1385 2098 (((FAULTCTL) == HRTIM_FAULT_DISABLED) || \
MartinJohnson 0:404f5a4f1385 2099 ((FAULTCTL) == HRTIM_FAULT_ENABLED))
MartinJohnson 0:404f5a4f1385 2100 /**
MartinJohnson 0:404f5a4f1385 2101 * @}
MartinJohnson 0:404f5a4f1385 2102 */
MartinJohnson 0:404f5a4f1385 2103
MartinJohnson 0:404f5a4f1385 2104 /** @defgroup HRTIM_SoftwareTimerUpdate
MartinJohnson 0:404f5a4f1385 2105 * @{
MartinJohnson 0:404f5a4f1385 2106 * @brief Constants used to force timer registers update
MartinJohnson 0:404f5a4f1385 2107 */
MartinJohnson 0:404f5a4f1385 2108 #define HRTIM_TIMERUPDATE_MASTER (HRTIM_CR2_MSWU) /*!< Forces an immediate transfer from the preload to the active register in the master timer */
MartinJohnson 0:404f5a4f1385 2109 #define HRTIM_TIMERUPDATE_A (HRTIM_CR2_TASWU) /*!< Forces an immediate transfer from the preload to the active register in the timer A */
MartinJohnson 0:404f5a4f1385 2110 #define HRTIM_TIMERUPDATE_B (HRTIM_CR2_TBSWU) /*!< Forces an immediate transfer from the preload to the active register in the timer B */
MartinJohnson 0:404f5a4f1385 2111 #define HRTIM_TIMERUPDATE_C (HRTIM_CR2_TCSWU) /*!< Forces an immediate transfer from the preload to the active register in the timer C */
MartinJohnson 0:404f5a4f1385 2112 #define HRTIM_TIMERUPDATE_D (HRTIM_CR2_TDSWU) /*!< Forces an immediate transfer from the preload to the active register in the timer D */
MartinJohnson 0:404f5a4f1385 2113 #define HRTIM_TIMERUPDATE_E (HRTIM_CR2_TESWU) /*!< Forces an immediate transfer from the preload to the active register in the timer E */
MartinJohnson 0:404f5a4f1385 2114
MartinJohnson 0:404f5a4f1385 2115 #define IS_HRTIM_TIMERUPDATE(TIMERUPDATE) (((TIMERUPDATE) & 0xFFFFFFC0) == 0x00000000)
MartinJohnson 0:404f5a4f1385 2116 /**
MartinJohnson 0:404f5a4f1385 2117 * @}
MartinJohnson 0:404f5a4f1385 2118 */
MartinJohnson 0:404f5a4f1385 2119
MartinJohnson 0:404f5a4f1385 2120 /** @defgroup HRTIM_SoftwareTimerReset
MartinJohnson 0:404f5a4f1385 2121 * @{
MartinJohnson 0:404f5a4f1385 2122 * @brief Constants used to force timer counter reset
MartinJohnson 0:404f5a4f1385 2123 */
MartinJohnson 0:404f5a4f1385 2124 #define HRTIM_TIMERRESET_MASTER (HRTIM_CR2_MRST) /*!< Resets the master timer counter */
MartinJohnson 0:404f5a4f1385 2125 #define HRTIM_TIMERRESET_A (HRTIM_CR2_TARST) /*!< Resets the timer A counter */
MartinJohnson 0:404f5a4f1385 2126 #define HRTIM_TIMERRESET_B (HRTIM_CR2_TBRST) /*!< Resets the timer B counter */
MartinJohnson 0:404f5a4f1385 2127 #define HRTIM_TIMERRESET_C (HRTIM_CR2_TCRST) /*!< Resets the timer C counter */
MartinJohnson 0:404f5a4f1385 2128 #define HRTIM_TIMERRESET_D (HRTIM_CR2_TDRST) /*!< Resets the timer D counter */
MartinJohnson 0:404f5a4f1385 2129 #define HRTIM_TIMERRESET_E (HRTIM_CR2_TERST) /*!< Resets the timer E counter */
MartinJohnson 0:404f5a4f1385 2130
MartinJohnson 0:404f5a4f1385 2131 #define IS_HRTIM_TIMERRESET(TIMERRESET) (((TIMERRESET) & 0xFFFFC0FF) == 0x00000000)
MartinJohnson 0:404f5a4f1385 2132 /**
MartinJohnson 0:404f5a4f1385 2133 * @}
MartinJohnson 0:404f5a4f1385 2134 */
MartinJohnson 0:404f5a4f1385 2135
MartinJohnson 0:404f5a4f1385 2136 /** @defgroup HRTIM_OutputLevel
MartinJohnson 0:404f5a4f1385 2137 * @{
MartinJohnson 0:404f5a4f1385 2138 * @brief Constants defining the level of a timer output
MartinJohnson 0:404f5a4f1385 2139 */
MartinJohnson 0:404f5a4f1385 2140 #define HRTIM_OUTPUTLEVEL_ACTIVE (uint32_t)0x00000001 /*!< Forces the output to its active state */
MartinJohnson 0:404f5a4f1385 2141 #define HRTIM_OUTPUTLEVEL_INACTIVE (uint32_t)0x00000002 /*!< Forces the output to its inactive state */
MartinJohnson 0:404f5a4f1385 2142
MartinJohnson 0:404f5a4f1385 2143 #define IS_HRTIM_OUTPUTLEVEL(OUTPUTLEVEL)\
MartinJohnson 0:404f5a4f1385 2144 (((OUTPUTLEVEL) == HRTIM_OUTPUTLEVEL_ACTIVE) || \
MartinJohnson 0:404f5a4f1385 2145 ((OUTPUTLEVEL) == HRTIM_OUTPUTLEVEL_INACTIVE))
MartinJohnson 0:404f5a4f1385 2146 /**
MartinJohnson 0:404f5a4f1385 2147 * @}
MartinJohnson 0:404f5a4f1385 2148 */
MartinJohnson 0:404f5a4f1385 2149
MartinJohnson 0:404f5a4f1385 2150 /** @defgroup HRTIM_OutputState
MartinJohnson 0:404f5a4f1385 2151 * @{
MartinJohnson 0:404f5a4f1385 2152 * @brief Constants defining the state of a timer output
MartinJohnson 0:404f5a4f1385 2153 */
MartinJohnson 0:404f5a4f1385 2154 #define HRTIM_OUTPUTSTATE_IDLE (uint32_t)0x00000001 /*!< Main operating mode, where the output can take the active or
MartinJohnson 0:404f5a4f1385 2155 inactive level as programmed in the crossbar unit */
MartinJohnson 0:404f5a4f1385 2156 #define HRTIM_OUTPUTSTATE_RUN (uint32_t)0x00000002 /*!< Default operating state (e.g. after an HRTIM reset, when the
MartinJohnson 0:404f5a4f1385 2157 outputs are disabled by software or during a burst mode operation */
MartinJohnson 0:404f5a4f1385 2158 #define HRTIM_OUTPUTSTATE_FAULT (uint32_t)0x00000003 /*!< Safety state, entered in case of a shut-down request on
MartinJohnson 0:404f5a4f1385 2159 FAULTx inputs */
MartinJohnson 0:404f5a4f1385 2160 /**
MartinJohnson 0:404f5a4f1385 2161 * @}
MartinJohnson 0:404f5a4f1385 2162 */
MartinJohnson 0:404f5a4f1385 2163
MartinJohnson 0:404f5a4f1385 2164 /** @defgroup HRTIM_BurstModeStatus
MartinJohnson 0:404f5a4f1385 2165 * @{
MartinJohnson 0:404f5a4f1385 2166 * @brief Constants defining the operating state of the burst mode controller
MartinJohnson 0:404f5a4f1385 2167 */
MartinJohnson 0:404f5a4f1385 2168 #define HRTIM_BURSTMODESTATUS_NORMAL (uint32_t) 0x00000000 /*!< Normal operation */
MartinJohnson 0:404f5a4f1385 2169 #define HRTIM_BURSTMODESTATUS_ONGOING (HRTIM_BMCR_BMSTAT) /*!< Burst operation on-going */
MartinJohnson 0:404f5a4f1385 2170 /**
MartinJohnson 0:404f5a4f1385 2171 * @}
MartinJohnson 0:404f5a4f1385 2172 */
MartinJohnson 0:404f5a4f1385 2173
MartinJohnson 0:404f5a4f1385 2174 /** @defgroup HRTIM_CurrentPushPullStatus
MartinJohnson 0:404f5a4f1385 2175 * @{
MartinJohnson 0:404f5a4f1385 2176 * @brief Constants defining on which output the signal is currently applied
MartinJohnson 0:404f5a4f1385 2177 * in push-pull mode
MartinJohnson 0:404f5a4f1385 2178 */
MartinJohnson 0:404f5a4f1385 2179 #define HRTIM_PUSHPULL_CURRENTSTATUS_OUTPUT1 (uint32_t) 0x00000000 /*!< Signal applied on output 1 and output 2 forced inactive */
MartinJohnson 0:404f5a4f1385 2180 #define HRTIM_PUSHPULL_CURRENTSTATUS_OUTPUT2 (HRTIM_TIMISR_CPPSTAT) /*!< Signal applied on output 2 and output 1 forced inactive */
MartinJohnson 0:404f5a4f1385 2181 /**
MartinJohnson 0:404f5a4f1385 2182 * @}
MartinJohnson 0:404f5a4f1385 2183 */
MartinJohnson 0:404f5a4f1385 2184
MartinJohnson 0:404f5a4f1385 2185 /** @defgroup HRTIM_IdlePushPullStatus
MartinJohnson 0:404f5a4f1385 2186 * @{
MartinJohnson 0:404f5a4f1385 2187 * @brief Constants defining on which output the signal was applied, in
MartinJohnson 0:404f5a4f1385 2188 * push-pull mode balanced fault mode or delayed idle mode, when the
MartinJohnson 0:404f5a4f1385 2189 * protection was triggered
MartinJohnson 0:404f5a4f1385 2190 */
MartinJohnson 0:404f5a4f1385 2191 #define HRTIM_PUSHPULL_IDLESTATUS_OUTPUT1 (uint32_t) 0x00000000 /*!< Protection occurred when the output 1 was active and output 2 forced inactive */
MartinJohnson 0:404f5a4f1385 2192 #define HRTIM_PUSHPULL_IDLESTATUS_OUTPUT2 (HRTIM_TIMISR_IPPSTAT) /*!< Protection occurred when the output 2 was active and output 1 forced inactive */
MartinJohnson 0:404f5a4f1385 2193 /**
MartinJohnson 0:404f5a4f1385 2194 * @}
MartinJohnson 0:404f5a4f1385 2195 */
MartinJohnson 0:404f5a4f1385 2196
MartinJohnson 0:404f5a4f1385 2197 /** @defgroup HRTIM_CommonInterrupt
MartinJohnson 0:404f5a4f1385 2198 * @{
MartinJohnson 0:404f5a4f1385 2199 */
MartinJohnson 0:404f5a4f1385 2200 #define HRTIM_IT_FLT1 HRTIM_ISR_FLT1 /*!< Fault 1 interrupt flag */
MartinJohnson 0:404f5a4f1385 2201 #define HRTIM_IT_FLT2 HRTIM_ISR_FLT2 /*!< Fault 2 interrupt flag */
MartinJohnson 0:404f5a4f1385 2202 #define HRTIM_IT_FLT3 HRTIM_ISR_FLT3 /*!< Fault 3 interrupt flag */
MartinJohnson 0:404f5a4f1385 2203 #define HRTIM_IT_FLT4 HRTIM_ISR_FLT4 /*!< Fault 4 interrupt flag */
MartinJohnson 0:404f5a4f1385 2204 #define HRTIM_IT_FLT5 HRTIM_ISR_FLT5 /*!< Fault 5 interrupt flag */
MartinJohnson 0:404f5a4f1385 2205 #define HRTIM_IT_SYSFLT HRTIM_ISR_SYSFLT /*!< System Fault interrupt flag */
MartinJohnson 0:404f5a4f1385 2206 #define HRTIM_IT_DLLRDY HRTIM_ISR_DLLRDY /*!< DLL ready interrupt flag */
MartinJohnson 0:404f5a4f1385 2207 #define HRTIM_IT_BMPER HRTIM_ISR_BMPER /*!< Burst mode period interrupt flag */
MartinJohnson 0:404f5a4f1385 2208
MartinJohnson 0:404f5a4f1385 2209 #define IS_HRTIM_IT(IT)\
MartinJohnson 0:404f5a4f1385 2210 (((IT) == HRTIM_ISR_FLT1) || \
MartinJohnson 0:404f5a4f1385 2211 ((IT) == HRTIM_ISR_FLT2) || \
MartinJohnson 0:404f5a4f1385 2212 ((IT) == HRTIM_ISR_FLT3) || \
MartinJohnson 0:404f5a4f1385 2213 ((IT) == HRTIM_ISR_FLT4) || \
MartinJohnson 0:404f5a4f1385 2214 ((IT) == HRTIM_ISR_FLT5) || \
MartinJohnson 0:404f5a4f1385 2215 ((IT) == HRTIM_ISR_SYSFLT) || \
MartinJohnson 0:404f5a4f1385 2216 ((IT) == HRTIM_ISR_DLLRDY) || \
MartinJohnson 0:404f5a4f1385 2217 ((IT) == HRTIM_ISR_BMPER))
MartinJohnson 0:404f5a4f1385 2218
MartinJohnson 0:404f5a4f1385 2219 /**
MartinJohnson 0:404f5a4f1385 2220 * @}
MartinJohnson 0:404f5a4f1385 2221 */
MartinJohnson 0:404f5a4f1385 2222 /** @defgroup HRTIM_CommonFlag
MartinJohnson 0:404f5a4f1385 2223 * @{
MartinJohnson 0:404f5a4f1385 2224 */
MartinJohnson 0:404f5a4f1385 2225 #define HRTIM_FLAG_FLT1 HRTIM_ISR_FLT1 /*!< Fault 1 interrupt flag */
MartinJohnson 0:404f5a4f1385 2226 #define HRTIM_FLAG_FLT2 HRTIM_ISR_FLT2 /*!< Fault 2 interrupt flag */
MartinJohnson 0:404f5a4f1385 2227 #define HRTIM_FLAG_FLT3 HRTIM_ISR_FLT3 /*!< Fault 3 interrupt flag */
MartinJohnson 0:404f5a4f1385 2228 #define HRTIM_FLAG_FLT4 HRTIM_ISR_FLT4 /*!< Fault 4 interrupt flag */
MartinJohnson 0:404f5a4f1385 2229 #define HRTIM_FLAG_FLT5 HRTIM_ISR_FLT5 /*!< Fault 5 interrupt flag */
MartinJohnson 0:404f5a4f1385 2230 #define HRTIM_FLAG_SYSFLT HRTIM_ISR_SYSFLT /*!< System Fault interrupt flag */
MartinJohnson 0:404f5a4f1385 2231 #define HRTIM_FLAG_DLLRDY HRTIM_ISR_DLLRDY /*!< DLL ready interrupt flag */
MartinJohnson 0:404f5a4f1385 2232 #define HRTIM_FLAG_BMPER HRTIM_ISR_BMPER /*!< Burst mode period interrupt flag */
MartinJohnson 0:404f5a4f1385 2233
MartinJohnson 0:404f5a4f1385 2234 #define IS_HRTIM_FLAG(FLAG)\
MartinJohnson 0:404f5a4f1385 2235 (((FLAG) == HRTIM_ISR_FLT1) || \
MartinJohnson 0:404f5a4f1385 2236 ((FLAG) == HRTIM_ISR_FLT2) || \
MartinJohnson 0:404f5a4f1385 2237 ((FLAG) == HRTIM_ISR_FLT3) || \
MartinJohnson 0:404f5a4f1385 2238 ((FLAG) == HRTIM_ISR_FLT4) || \
MartinJohnson 0:404f5a4f1385 2239 ((FLAG) == HRTIM_ISR_FLT5) || \
MartinJohnson 0:404f5a4f1385 2240 ((FLAG) == HRTIM_ISR_SYSFLT) || \
MartinJohnson 0:404f5a4f1385 2241 ((FLAG) == HRTIM_ISR_DLLRDY) || \
MartinJohnson 0:404f5a4f1385 2242 ((FLAG) == HRTIM_ISR_BMPER))
MartinJohnson 0:404f5a4f1385 2243 /**
MartinJohnson 0:404f5a4f1385 2244 * @}
MartinJohnson 0:404f5a4f1385 2245 */
MartinJohnson 0:404f5a4f1385 2246
MartinJohnson 0:404f5a4f1385 2247 /** @defgroup HRTIM_MasterInterrupt
MartinJohnson 0:404f5a4f1385 2248 * @{
MartinJohnson 0:404f5a4f1385 2249 */
MartinJohnson 0:404f5a4f1385 2250 #define HRTIM_MASTER_IT_MCMP1 HRTIM_MDIER_MCMP1IE /*!< Master compare 1 interrupt flag */
MartinJohnson 0:404f5a4f1385 2251 #define HRTIM_MASTER_IT_MCMP2 HRTIM_MDIER_MCMP2IE /*!< Master compare 2 interrupt flag */
MartinJohnson 0:404f5a4f1385 2252 #define HRTIM_MASTER_IT_MCMP3 HRTIM_MDIER_MCMP3IE /*!< Master compare 3 interrupt flag */
MartinJohnson 0:404f5a4f1385 2253 #define HRTIM_MASTER_IT_MCMP4 HRTIM_MDIER_MCMP4IE /*!< Master compare 4 interrupt flag */
MartinJohnson 0:404f5a4f1385 2254 #define HRTIM_MASTER_IT_MREP HRTIM_MDIER_MREPIE /*!< Master Repetition interrupt flag */
MartinJohnson 0:404f5a4f1385 2255 #define HRTIM_MASTER_IT_SYNC HRTIM_MDIER_SYNCIE /*!< Synchronization input interrupt flag */
MartinJohnson 0:404f5a4f1385 2256 #define HRTIM_MASTER_IT_MUPD HRTIM_MDIER_MUPDIE /*!< Master update interrupt flag */
MartinJohnson 0:404f5a4f1385 2257
MartinJohnson 0:404f5a4f1385 2258 #define IS_HRTIM_MASTER_IT(IT)\
MartinJohnson 0:404f5a4f1385 2259 (((IT) == HRTIM_MDIER_MCMP1IE) || \
MartinJohnson 0:404f5a4f1385 2260 ((IT) == HRTIM_MDIER_MCMP2IE) || \
MartinJohnson 0:404f5a4f1385 2261 ((IT) == HRTIM_MDIER_MCMP3IE) || \
MartinJohnson 0:404f5a4f1385 2262 ((IT) == HRTIM_MDIER_MCMP4IE) || \
MartinJohnson 0:404f5a4f1385 2263 ((IT) == HRTIM_MDIER_MREPIE) || \
MartinJohnson 0:404f5a4f1385 2264 ((IT) == HRTIM_MDIER_SYNCIE) || \
MartinJohnson 0:404f5a4f1385 2265 ((IT) == HRTIM_MDIER_MUPDIE))
MartinJohnson 0:404f5a4f1385 2266
MartinJohnson 0:404f5a4f1385 2267 /** @defgroup HRTIM_MasterFlag
MartinJohnson 0:404f5a4f1385 2268 * @{
MartinJohnson 0:404f5a4f1385 2269 */
MartinJohnson 0:404f5a4f1385 2270 #define HRTIM_MASTER_FLAG_MCMP1 HRTIM_MISR_MCMP1 /*!< Master compare 1 interrupt flag */
MartinJohnson 0:404f5a4f1385 2271 #define HRTIM_MASTER_FLAG_MCMP2 HRTIM_MISR_MCMP2 /*!< Master compare 2 interrupt flag */
MartinJohnson 0:404f5a4f1385 2272 #define HRTIM_MASTER_FLAG_MCMP3 HRTIM_MISR_MCMP3 /*!< Master compare 3 interrupt flag */
MartinJohnson 0:404f5a4f1385 2273 #define HRTIM_MASTER_FLAG_MCMP4 HRTIM_MISR_MCMP4 /*!< Master compare 4 interrupt flag */
MartinJohnson 0:404f5a4f1385 2274 #define HRTIM_MASTER_FLAG_MREP HRTIM_MISR_MREP /*!< Master Repetition interrupt flag */
MartinJohnson 0:404f5a4f1385 2275 #define HRTIM_MASTER_FLAG_SYNC HRTIM_MISR_SYNC /*!< Synchronization input interrupt flag */
MartinJohnson 0:404f5a4f1385 2276 #define HRTIM_MASTER_FLAG_MUPD HRTIM_MISR_MUPD /*!< Master update interrupt flag */
MartinJohnson 0:404f5a4f1385 2277
MartinJohnson 0:404f5a4f1385 2278 #define IS_HRTIM_MASTER_FLAG(FLAG)\
MartinJohnson 0:404f5a4f1385 2279 (((FLAG) == HRTIM_MISR_MCMP1) || \
MartinJohnson 0:404f5a4f1385 2280 ((FLAG) == HRTIM_MISR_MCMP2) || \
MartinJohnson 0:404f5a4f1385 2281 ((FLAG) == HRTIM_MISR_MCMP3) || \
MartinJohnson 0:404f5a4f1385 2282 ((FLAG) == HRTIM_MISR_MCMP4) || \
MartinJohnson 0:404f5a4f1385 2283 ((FLAG) == HRTIM_MISR_MREP) || \
MartinJohnson 0:404f5a4f1385 2284 ((FLAG) == HRTIM_MISR_SYNC) || \
MartinJohnson 0:404f5a4f1385 2285 ((FLAG) == HRTIM_MISR_MUPD))
MartinJohnson 0:404f5a4f1385 2286 /**
MartinJohnson 0:404f5a4f1385 2287 * @}
MartinJohnson 0:404f5a4f1385 2288 */
MartinJohnson 0:404f5a4f1385 2289
MartinJohnson 0:404f5a4f1385 2290 /** @defgroup HRTIM_TimingUnitInterrupt
MartinJohnson 0:404f5a4f1385 2291 * @{
MartinJohnson 0:404f5a4f1385 2292 */
MartinJohnson 0:404f5a4f1385 2293 #define HRTIM_TIM_IT_CMP1 HRTIM_TIMDIER_CMP1IE /*!< Timer compare 1 interrupt flag */
MartinJohnson 0:404f5a4f1385 2294 #define HRTIM_TIM_IT_CMP2 HRTIM_TIMDIER_CMP2IE /*!< Timer compare 2 interrupt flag */
MartinJohnson 0:404f5a4f1385 2295 #define HRTIM_TIM_IT_CMP3 HRTIM_TIMDIER_CMP3IE /*!< Timer compare 3 interrupt flag */
MartinJohnson 0:404f5a4f1385 2296 #define HRTIM_TIM_IT_CMP4 HRTIM_TIMDIER_CMP4IE /*!< Timer compare 4 interrupt flag */
MartinJohnson 0:404f5a4f1385 2297 #define HRTIM_TIM_IT_REP HRTIM_TIMDIER_REPIE /*!< Timer repetition interrupt flag */
MartinJohnson 0:404f5a4f1385 2298 #define HRTIM_TIM_IT_UPD HRTIM_TIMDIER_UPDIE /*!< Timer update interrupt flag */
MartinJohnson 0:404f5a4f1385 2299 #define HRTIM_TIM_IT_CPT1 HRTIM_TIMDIER_CPT1IE /*!< Timer capture 1 interrupt flag */
MartinJohnson 0:404f5a4f1385 2300 #define HRTIM_TIM_IT_CPT2 HRTIM_TIMDIER_CPT2IE /*!< Timer capture 2 interrupt flag */
MartinJohnson 0:404f5a4f1385 2301 #define HRTIM_TIM_IT_SET1 HRTIM_TIMDIER_SET1IE /*!< Timer output 1 set interrupt flag */
MartinJohnson 0:404f5a4f1385 2302 #define HRTIM_TIM_IT_RST1 HRTIM_TIMDIER_RST1IE /*!< Timer output 1 reset interrupt flag */
MartinJohnson 0:404f5a4f1385 2303 #define HRTIM_TIM_IT_SET2 HRTIM_TIMDIER_SET2IE /*!< Timer output 2 set interrupt flag */
MartinJohnson 0:404f5a4f1385 2304 #define HRTIM_TIM_IT_RST2 HRTIM_TIMDIER_RST2IE /*!< Timer output 2 reset interrupt flag */
MartinJohnson 0:404f5a4f1385 2305 #define HRTIM_TIM_IT_RST HRTIM_TIMDIER_RSTIE /*!< Timer reset interrupt flag */
MartinJohnson 0:404f5a4f1385 2306 #define HRTIM_TIM_IT_DLYPRT HRTIM_TIMDIER_DLYPRTIE /*!< Timer delay protection interrupt flag */
MartinJohnson 0:404f5a4f1385 2307
MartinJohnson 0:404f5a4f1385 2308 #define IS_HRTIM_TIM_IT(IT)\
MartinJohnson 0:404f5a4f1385 2309 (((IT) == HRTIM_TIMDIER_CMP1IE) || \
MartinJohnson 0:404f5a4f1385 2310 ((IT) == HRTIM_TIMDIER_CMP2IE) || \
MartinJohnson 0:404f5a4f1385 2311 ((IT) == HRTIM_TIMDIER_CMP3IE) || \
MartinJohnson 0:404f5a4f1385 2312 ((IT) == HRTIM_TIMDIER_CMP4IE) || \
MartinJohnson 0:404f5a4f1385 2313 ((IT) == HRTIM_TIMDIER_REPIE) || \
MartinJohnson 0:404f5a4f1385 2314 ((IT) == HRTIM_TIMDIER_UPDIE) || \
MartinJohnson 0:404f5a4f1385 2315 ((IT) == HRTIM_TIMDIER_CPT1IE) || \
MartinJohnson 0:404f5a4f1385 2316 ((IT) == HRTIM_TIMDIER_CPT2IE) || \
MartinJohnson 0:404f5a4f1385 2317 ((IT) == HRTIM_TIMDIER_SET1IE) || \
MartinJohnson 0:404f5a4f1385 2318 ((IT) == HRTIM_TIMDIER_RST1IE) || \
MartinJohnson 0:404f5a4f1385 2319 ((IT) == HRTIM_TIMDIER_SET2IE) || \
MartinJohnson 0:404f5a4f1385 2320 ((IT) == HRTIM_TIMDIER_RST2IE) || \
MartinJohnson 0:404f5a4f1385 2321 ((IT) == HRTIM_TIMDIER_RSTIE) || \
MartinJohnson 0:404f5a4f1385 2322 ((IT) == HRTIM_TIMDIER_DLYPRTIE))
MartinJohnson 0:404f5a4f1385 2323
MartinJohnson 0:404f5a4f1385 2324 /**
MartinJohnson 0:404f5a4f1385 2325 * @}
MartinJohnson 0:404f5a4f1385 2326 */
MartinJohnson 0:404f5a4f1385 2327
MartinJohnson 0:404f5a4f1385 2328 /** @defgroup HRTIM_TimingUnitFlag
MartinJohnson 0:404f5a4f1385 2329 * @{
MartinJohnson 0:404f5a4f1385 2330 */
MartinJohnson 0:404f5a4f1385 2331 #define HRTIM_TIM_FLAG_CMP1 HRTIM_TIMISR_CMP1 /*!< Timer compare 1 interrupt flag */
MartinJohnson 0:404f5a4f1385 2332 #define HRTIM_TIM_FLAG_CMP2 HRTIM_TIMISR_CMP2 /*!< Timer compare 2 interrupt flag */
MartinJohnson 0:404f5a4f1385 2333 #define HRTIM_TIM_FLAG_CMP3 HRTIM_TIMISR_CMP3 /*!< Timer compare 3 interrupt flag */
MartinJohnson 0:404f5a4f1385 2334 #define HRTIM_TIM_FLAG_CMP4 HRTIM_TIMISR_CMP4 /*!< Timer compare 4 interrupt flag */
MartinJohnson 0:404f5a4f1385 2335 #define HRTIM_TIM_FLAG_REP HRTIM_TIMISR_REP /*!< Timer repetition interrupt flag */
MartinJohnson 0:404f5a4f1385 2336 #define HRTIM_TIM_FLAG_UPD HRTIM_TIMISR_UPD /*!< Timer update interrupt flag */
MartinJohnson 0:404f5a4f1385 2337 #define HRTIM_TIM_FLAG_CPT1 HRTIM_TIMISR_CPT1 /*!< Timer capture 1 interrupt flag */
MartinJohnson 0:404f5a4f1385 2338 #define HRTIM_TIM_FLAG_CPT2 HRTIM_TIMISR_CPT2 /*!< Timer capture 2 interrupt flag */
MartinJohnson 0:404f5a4f1385 2339 #define HRTIM_TIM_FLAG_SET1 HRTIM_TIMISR_SET1 /*!< Timer output 1 set interrupt flag */
MartinJohnson 0:404f5a4f1385 2340 #define HRTIM_TIM_FLAG_RST1 HRTIM_TIMISR_RST1 /*!< Timer output 1 reset interrupt flag */
MartinJohnson 0:404f5a4f1385 2341 #define HRTIM_TIM_FLAG_SET2 HRTIM_TIMISR_SET2 /*!< Timer output 2 set interrupt flag */
MartinJohnson 0:404f5a4f1385 2342 #define HRTIM_TIM_FLAG_RST2 HRTIM_TIMISR_RST2 /*!< Timer output 2 reset interrupt flag */
MartinJohnson 0:404f5a4f1385 2343 #define HRTIM_TIM_FLAG_RST HRTIM_TIMDIER_RSTIE /*!< Timer reset interrupt flag */
MartinJohnson 0:404f5a4f1385 2344 #define HRTIM_TIM_FLAG_DLYPRT1 HRTIM_TIMISR_DLYPRT /*!< Timer delay protection interrupt flag */
MartinJohnson 0:404f5a4f1385 2345
MartinJohnson 0:404f5a4f1385 2346 #define IS_HRTIM_TIM_FLAG(FLAG)\
MartinJohnson 0:404f5a4f1385 2347 (((FLAG) == HRTIM_TIM_FLAG_CMP1) || \
MartinJohnson 0:404f5a4f1385 2348 ((FLAG) == HRTIM_TIM_FLAG_CMP2) || \
MartinJohnson 0:404f5a4f1385 2349 ((FLAG) == HRTIM_TIM_FLAG_CMP3) || \
MartinJohnson 0:404f5a4f1385 2350 ((FLAG) == HRTIM_TIM_FLAG_CMP4) || \
MartinJohnson 0:404f5a4f1385 2351 ((FLAG) == HRTIM_TIM_FLAG_REP) || \
MartinJohnson 0:404f5a4f1385 2352 ((FLAG) == HRTIM_TIM_FLAG_UPD) || \
MartinJohnson 0:404f5a4f1385 2353 ((FLAG) == HRTIM_TIM_FLAG_CPT1) || \
MartinJohnson 0:404f5a4f1385 2354 ((FLAG) == HRTIM_TIM_FLAG_CPT2) || \
MartinJohnson 0:404f5a4f1385 2355 ((FLAG) == HRTIM_TIM_FLAG_SET1) || \
MartinJohnson 0:404f5a4f1385 2356 ((FLAG) == HRTIM_TIM_FLAG_RST1) || \
MartinJohnson 0:404f5a4f1385 2357 ((FLAG) == HRTIM_TIM_FLAG_SET2) || \
MartinJohnson 0:404f5a4f1385 2358 ((FLAG) == HRTIM_TIM_FLAG_RST2) || \
MartinJohnson 0:404f5a4f1385 2359 ((FLAG) == HRTIM_TIM_FLAG_RST) || \
MartinJohnson 0:404f5a4f1385 2360 ((FLAG) == HRTIM_TIM_FLAG_DLYPRT1))
MartinJohnson 0:404f5a4f1385 2361
MartinJohnson 0:404f5a4f1385 2362 /**
MartinJohnson 0:404f5a4f1385 2363 * @}
MartinJohnson 0:404f5a4f1385 2364 */
MartinJohnson 0:404f5a4f1385 2365
MartinJohnson 0:404f5a4f1385 2366 /** @defgroup HRTIM_MasterDMARequest
MartinJohnson 0:404f5a4f1385 2367 * @{
MartinJohnson 0:404f5a4f1385 2368 */
MartinJohnson 0:404f5a4f1385 2369 #define HRTIM_MASTER_DMA_MCMP1 HRTIM_MDIER_MCMP1DE /*!< Master compare 1 DMA request flag */
MartinJohnson 0:404f5a4f1385 2370 #define HRTIM_MASTER_DMA_MCMP2 HRTIM_MDIER_MCMP2DE /*!< Master compare 2 DMA request flag */
MartinJohnson 0:404f5a4f1385 2371 #define HRTIM_MASTER_DMA_MCMP3 HRTIM_MDIER_MCMP3DE /*!< Master compare 3 DMA request flag */
MartinJohnson 0:404f5a4f1385 2372 #define HRTIM_MASTER_DMA_MCMP4 HRTIM_MDIER_MCMP4DE /*!< Master compare 4 DMA request flag */
MartinJohnson 0:404f5a4f1385 2373 #define HRTIM_MASTER_DMA_MREP HRTIM_MDIER_MREPDE /*!< Master Repetition DMA request flag */
MartinJohnson 0:404f5a4f1385 2374 #define HRTIM_MASTER_DMA_SYNC HRTIM_MDIER_SYNCDE /*!< Synchronization input DMA request flag */
MartinJohnson 0:404f5a4f1385 2375 #define HRTIM_MASTER_DMA_MUPD HRTIM_MDIER_MUPDDE /*!< Master update DMA request flag */
MartinJohnson 0:404f5a4f1385 2376
MartinJohnson 0:404f5a4f1385 2377 #define IS_HRTIM_MASTER_DMA(DMA)\
MartinJohnson 0:404f5a4f1385 2378 (((DMA) == HRTIM_MDIER_MCMP1DE) || \
MartinJohnson 0:404f5a4f1385 2379 ((DMA) == HRTIM_MDIER_MCMP2DE) || \
MartinJohnson 0:404f5a4f1385 2380 ((DMA) == HRTIM_MDIER_MCMP3DE) || \
MartinJohnson 0:404f5a4f1385 2381 ((DMA) == HRTIM_MDIER_MCMP4DE) || \
MartinJohnson 0:404f5a4f1385 2382 ((DMA) == HRTIM_MDIER_MREPDE) || \
MartinJohnson 0:404f5a4f1385 2383 ((DMA) == HRTIM_MDIER_SYNCDE) || \
MartinJohnson 0:404f5a4f1385 2384 ((DMA) == HRTIM_MDIER_MUPDDE))
MartinJohnson 0:404f5a4f1385 2385 /**
MartinJohnson 0:404f5a4f1385 2386 * @}
MartinJohnson 0:404f5a4f1385 2387 */
MartinJohnson 0:404f5a4f1385 2388
MartinJohnson 0:404f5a4f1385 2389 /** @defgroup HRTIM_TimingUnitDMARequest
MartinJohnson 0:404f5a4f1385 2390 * @{
MartinJohnson 0:404f5a4f1385 2391 */
MartinJohnson 0:404f5a4f1385 2392 #define HRTIM_TIM_DMA_CMP1 HRTIM_TIMDIER_CMP1DE /*!< Timer compare 1 interrupt flag */
MartinJohnson 0:404f5a4f1385 2393 #define HRTIM_TIM_DMA_CMP2 HRTIM_TIMDIER_CMP2DE /*!< Timer compare 2 interrupt flag */
MartinJohnson 0:404f5a4f1385 2394 #define HRTIM_TIM_DMA_CMP3 HRTIM_TIMDIER_CMP3DE /*!< Timer compare 3 interrupt flag */
MartinJohnson 0:404f5a4f1385 2395 #define HRTIM_TIM_DMA_CMP4 HRTIM_TIMDIER_CMP4DE /*!< Timer compare 4 interrupt flag */
MartinJohnson 0:404f5a4f1385 2396 #define HRTIM_TIM_DMA_REP HRTIM_TIMDIER_REPDE /*!< Timer repetition interrupt flag */
MartinJohnson 0:404f5a4f1385 2397 #define HRTIM_TIM_DMA_UPD HRTIM_TIMDIER_UPDDE /*!< Timer update interrupt flag */
MartinJohnson 0:404f5a4f1385 2398 #define HRTIM_TIM_DMA_CPT1 HRTIM_TIMDIER_CPT1DE /*!< Timer capture 1 interrupt flag */
MartinJohnson 0:404f5a4f1385 2399 #define HRTIM_TIM_DMA_CPT2 HRTIM_TIMDIER_CPT2DE /*!< Timer capture 2 interrupt flag */
MartinJohnson 0:404f5a4f1385 2400 #define HRTIM_TIM_DMA_SET1 HRTIM_TIMDIER_SET1DE /*!< Timer output 1 set interrupt flag */
MartinJohnson 0:404f5a4f1385 2401 #define HRTIM_TIM_DMA_RST1 HRTIM_TIMDIER_RST1DE /*!< Timer output 1 reset interrupt flag */
MartinJohnson 0:404f5a4f1385 2402 #define HRTIM_TIM_DMA_SET2 HRTIM_TIMDIER_SET2DE /*!< Timer output 2 set interrupt flag */
MartinJohnson 0:404f5a4f1385 2403 #define HRTIM_TIM_DMA_RST2 HRTIM_TIMDIER_RST2DE /*!< Timer output 2 reset interrupt flag */
MartinJohnson 0:404f5a4f1385 2404 #define HRTIM_TIM_DMA_RST HRTIM_TIMDIER_RSTDE /*!< Timer reset interrupt flag */
MartinJohnson 0:404f5a4f1385 2405 #define HRTIM_TIM_DMA_DLYPRT HRTIM_TIMDIER_DLYPRTDE /*!< Timer delay protection interrupt flag */
MartinJohnson 0:404f5a4f1385 2406
MartinJohnson 0:404f5a4f1385 2407 #define IS_HRTIM_TIM_DMA(DMA)\
MartinJohnson 0:404f5a4f1385 2408 (((DMA) == HRTIM_TIMDIER_CMP1DE) || \
MartinJohnson 0:404f5a4f1385 2409 ((DMA) == HRTIM_TIMDIER_CMP2DE) || \
MartinJohnson 0:404f5a4f1385 2410 ((DMA) == HRTIM_TIMDIER_CMP3DE) || \
MartinJohnson 0:404f5a4f1385 2411 ((DMA) == HRTIM_TIMDIER_CMP4DE) || \
MartinJohnson 0:404f5a4f1385 2412 ((DMA) == HRTIM_TIMDIER_REPDE) || \
MartinJohnson 0:404f5a4f1385 2413 ((DMA) == HRTIM_TIMDIER_UPDDE) || \
MartinJohnson 0:404f5a4f1385 2414 ((DMA) == HRTIM_TIMDIER_CPT1DE) || \
MartinJohnson 0:404f5a4f1385 2415 ((DMA) == HRTIM_TIMDIER_CPT2DE) || \
MartinJohnson 0:404f5a4f1385 2416 ((DMA) == HRTIM_TIMDIER_SET1DE) || \
MartinJohnson 0:404f5a4f1385 2417 ((DMA) == HRTIM_TIMDIER_RST1DE) || \
MartinJohnson 0:404f5a4f1385 2418 ((DMA) == HRTIM_TIMDIER_SET2DE) || \
MartinJohnson 0:404f5a4f1385 2419 ((DMA) == HRTIM_TIMDIER_RST2DE) || \
MartinJohnson 0:404f5a4f1385 2420 ((DMA) == HRTIM_TIMDIER_RSTDE) || \
MartinJohnson 0:404f5a4f1385 2421 ((DMA) == HRTIM_TIMDIER_DLYPRTDE))
MartinJohnson 0:404f5a4f1385 2422
MartinJohnson 0:404f5a4f1385 2423 /**
MartinJohnson 0:404f5a4f1385 2424 * @}
MartinJohnson 0:404f5a4f1385 2425 */
MartinJohnson 0:404f5a4f1385 2426
MartinJohnson 0:404f5a4f1385 2427 /**
MartinJohnson 0:404f5a4f1385 2428 * @}
MartinJohnson 0:404f5a4f1385 2429 */
MartinJohnson 0:404f5a4f1385 2430
MartinJohnson 0:404f5a4f1385 2431 /** @defgroup HRTIM_Instancedefinition
MartinJohnson 0:404f5a4f1385 2432 * @{
MartinJohnson 0:404f5a4f1385 2433 */
MartinJohnson 0:404f5a4f1385 2434 #define IS_HRTIM_INSTANCE(INSTANCE) (INSTANCE) == HRTIM1)
MartinJohnson 0:404f5a4f1385 2435 /**
MartinJohnson 0:404f5a4f1385 2436 * @}
MartinJohnson 0:404f5a4f1385 2437 */
MartinJohnson 0:404f5a4f1385 2438
MartinJohnson 0:404f5a4f1385 2439 /**
MartinJohnson 0:404f5a4f1385 2440 * @}
MartinJohnson 0:404f5a4f1385 2441 */
MartinJohnson 0:404f5a4f1385 2442
MartinJohnson 0:404f5a4f1385 2443 /* Exported macro ------------------------------------------------------------*/
MartinJohnson 0:404f5a4f1385 2444
MartinJohnson 0:404f5a4f1385 2445
MartinJohnson 0:404f5a4f1385 2446 /** @brief Enables or disables the timer counter(s)
MartinJohnson 0:404f5a4f1385 2447 * @param __HANDLE__: specifies the HRTIM Handle.
MartinJohnson 0:404f5a4f1385 2448 * @param __TIMERS__: timers to enable/disable
MartinJohnson 0:404f5a4f1385 2449 * This parameter can be any combinations of the following values:
MartinJohnson 0:404f5a4f1385 2450 * @arg HRTIM_TIMERID_MASTER: Master timer identifier
MartinJohnson 0:404f5a4f1385 2451 * @arg HRTIM_TIMERID_TIMER_A: Timer A identifier
MartinJohnson 0:404f5a4f1385 2452 * @arg HRTIM_TIMERID_TIMER_B: Timer B identifier
MartinJohnson 0:404f5a4f1385 2453 * @arg HRTIM_TIMERID_TIMER_C: Timer C identifier
MartinJohnson 0:404f5a4f1385 2454 * @arg HRTIM_TIMERID_TIMER_D: Timer D identifier
MartinJohnson 0:404f5a4f1385 2455 * @arg HRTIM_TIMERID_TIMER_E: Timer E identifier
MartinJohnson 0:404f5a4f1385 2456 * @retval None
MartinJohnson 0:404f5a4f1385 2457 */
MartinJohnson 0:404f5a4f1385 2458 #define __HRTIM_ENABLE(__HANDLE__, __TIMERS__) ((__HANDLE__)->HRTIM_MASTER.MCR |= (__TIMERS__))
MartinJohnson 0:404f5a4f1385 2459
MartinJohnson 0:404f5a4f1385 2460 /* The counter of a timing unit is disabled only if all the timer outputs */
MartinJohnson 0:404f5a4f1385 2461 /* are disabled and no capture is configured */
MartinJohnson 0:404f5a4f1385 2462 #define HRTIM_TAOEN_MASK (HRTIM_OENR_TA2OEN | HRTIM_OENR_TA1OEN)
MartinJohnson 0:404f5a4f1385 2463 #define HRTIM_TBOEN_MASK (HRTIM_OENR_TB2OEN | HRTIM_OENR_TB1OEN)
MartinJohnson 0:404f5a4f1385 2464 #define HRTIM_TCOEN_MASK (HRTIM_OENR_TC2OEN | HRTIM_OENR_TC1OEN)
MartinJohnson 0:404f5a4f1385 2465 #define HRTIM_TDOEN_MASK (HRTIM_OENR_TD2OEN | HRTIM_OENR_TD1OEN)
MartinJohnson 0:404f5a4f1385 2466 #define HRTIM_TEOEN_MASK (HRTIM_OENR_TE2OEN | HRTIM_OENR_TE1OEN)
MartinJohnson 0:404f5a4f1385 2467 #define __HRTIM_DISABLE(__HANDLE__, __TIMERS__)\
MartinJohnson 0:404f5a4f1385 2468 do {\
MartinJohnson 0:404f5a4f1385 2469 if (((__TIMERS__) & HRTIM_TIMERID_MASTER) == HRTIM_TIMERID_MASTER)\
MartinJohnson 0:404f5a4f1385 2470 {\
MartinJohnson 0:404f5a4f1385 2471 ((__HANDLE__)->HRTIM_MASTER.MCR &= ~HRTIM_TIMERID_MASTER);\
MartinJohnson 0:404f5a4f1385 2472 }\
MartinJohnson 0:404f5a4f1385 2473 if (((__TIMERS__) & HRTIM_TIMERID_TIMER_A) == HRTIM_TIMERID_TIMER_A)\
MartinJohnson 0:404f5a4f1385 2474 {\
MartinJohnson 0:404f5a4f1385 2475 if (((__HANDLE__)->HRTIM_COMMON.OENR & HRTIM_TAOEN_MASK) == RESET)\
MartinJohnson 0:404f5a4f1385 2476 {\
MartinJohnson 0:404f5a4f1385 2477 ((__HANDLE__)->HRTIM_MASTER.MCR &= ~HRTIM_TIMERID_TIMER_A);\
MartinJohnson 0:404f5a4f1385 2478 }\
MartinJohnson 0:404f5a4f1385 2479 }\
MartinJohnson 0:404f5a4f1385 2480 if (((__TIMERS__) & HRTIM_TIMERID_TIMER_B) == HRTIM_TIMERID_TIMER_B)\
MartinJohnson 0:404f5a4f1385 2481 {\
MartinJohnson 0:404f5a4f1385 2482 if (((__HANDLE__)->HRTIM_COMMON.OENR & HRTIM_TBOEN_MASK) == RESET)\
MartinJohnson 0:404f5a4f1385 2483 {\
MartinJohnson 0:404f5a4f1385 2484 ((__HANDLE__)->HRTIM_MASTER.MCR &= ~HRTIM_TIMERID_TIMER_B);\
MartinJohnson 0:404f5a4f1385 2485 }\
MartinJohnson 0:404f5a4f1385 2486 }\
MartinJohnson 0:404f5a4f1385 2487 if (((__TIMERS__) & HRTIM_TIMERID_TIMER_C) == HRTIM_TIMERID_TIMER_C)\
MartinJohnson 0:404f5a4f1385 2488 {\
MartinJohnson 0:404f5a4f1385 2489 if (((__HANDLE__)->HRTIM_COMMON.OENR & HRTIM_TCOEN_MASK) == RESET)\
MartinJohnson 0:404f5a4f1385 2490 {\
MartinJohnson 0:404f5a4f1385 2491 ((__HANDLE__)->HRTIM_MASTER.MCR &= ~HRTIM_TIMERID_TIMER_C);\
MartinJohnson 0:404f5a4f1385 2492 }\
MartinJohnson 0:404f5a4f1385 2493 }\
MartinJohnson 0:404f5a4f1385 2494 if (((__TIMERS__) & HRTIM_TIMERID_TIMER_D) == HRTIM_TIMERID_TIMER_D)\
MartinJohnson 0:404f5a4f1385 2495 {\
MartinJohnson 0:404f5a4f1385 2496 if (((__HANDLE__)->HRTIM_COMMON.OENR & HRTIM_TDOEN_MASK) == RESET)\
MartinJohnson 0:404f5a4f1385 2497 {\
MartinJohnson 0:404f5a4f1385 2498 ((__HANDLE__)->HRTIM_MASTER.MCR &= ~HRTIM_TIMERID_TIMER_D);\
MartinJohnson 0:404f5a4f1385 2499 }\
MartinJohnson 0:404f5a4f1385 2500 }\
MartinJohnson 0:404f5a4f1385 2501 if (((__TIMERS__) & HRTIM_TIMERID_TIMER_E) == HRTIM_TIMERID_TIMER_E)\
MartinJohnson 0:404f5a4f1385 2502 {\
MartinJohnson 0:404f5a4f1385 2503 if (((__HANDLE__)->HRTIM_COMMON.OENR & HRTIM_TEOEN_MASK) == RESET)\
MartinJohnson 0:404f5a4f1385 2504 {\
MartinJohnson 0:404f5a4f1385 2505 ((__HANDLE__)->HRTIM_MASTER.MCR &= ~HRTIM_TIMERID_TIMER_E);\
MartinJohnson 0:404f5a4f1385 2506 }\
MartinJohnson 0:404f5a4f1385 2507 }\
MartinJohnson 0:404f5a4f1385 2508 } while(0)
MartinJohnson 0:404f5a4f1385 2509
MartinJohnson 0:404f5a4f1385 2510 /* Exported functions --------------------------------------------------------*/
MartinJohnson 0:404f5a4f1385 2511
MartinJohnson 0:404f5a4f1385 2512 /* Simple time base related functions *****************************************/
MartinJohnson 0:404f5a4f1385 2513 void HRTIM_SimpleBase_Init(HRTIM_TypeDef* HRTIMx, uint32_t TimerIdx, HRTIM_BaseInitTypeDef* HRTIM_BaseInitStruct);
MartinJohnson 0:404f5a4f1385 2514
MartinJohnson 0:404f5a4f1385 2515 void HRTIM_DeInit(HRTIM_TypeDef* HRTIMx);
MartinJohnson 0:404f5a4f1385 2516
MartinJohnson 0:404f5a4f1385 2517 void HRTIM_SimpleBaseStart(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx);
MartinJohnson 0:404f5a4f1385 2518 void HRTIM_SimpleBaseStop(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx);
MartinJohnson 0:404f5a4f1385 2519
MartinJohnson 0:404f5a4f1385 2520 /* Simple output compare related functions ************************************/
MartinJohnson 0:404f5a4f1385 2521 void HRTIM_SimpleOC_Init(HRTIM_TypeDef * HRTIMx, uint32_t TimerIdx, HRTIM_BaseInitTypeDef* HRTIM_BaseInitStruct);
MartinJohnson 0:404f5a4f1385 2522
MartinJohnson 0:404f5a4f1385 2523 void HRTIM_SimpleOCChannelConfig(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2524 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2525 uint32_t OCChannel,
MartinJohnson 0:404f5a4f1385 2526 HRTIM_BasicOCChannelCfgTypeDef* pBasicOCChannelCfg);
MartinJohnson 0:404f5a4f1385 2527
MartinJohnson 0:404f5a4f1385 2528 void HRTIM_SimpleOCStart(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2529 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2530 uint32_t OCChannel);
MartinJohnson 0:404f5a4f1385 2531 void HRTIM_SimpleOCStop(HRTIM_TypeDef * HRTIMx,
MartinJohnson 0:404f5a4f1385 2532 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2533 uint32_t OCChannel);
MartinJohnson 0:404f5a4f1385 2534 /* Simple PWM output related functions ****************************************/
MartinJohnson 0:404f5a4f1385 2535 void HRTIM_SimplePWM_Init(HRTIM_TypeDef * HRTIMx, uint32_t TimerIdx, HRTIM_BaseInitTypeDef* HRTIM_BaseInitStruct);
MartinJohnson 0:404f5a4f1385 2536
MartinJohnson 0:404f5a4f1385 2537 void HRTIM_SimplePWMChannelConfig(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2538 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2539 uint32_t PWMChannel,
MartinJohnson 0:404f5a4f1385 2540 HRTIM_BasicPWMChannelCfgTypeDef* pBasicPWMChannelCfg);
MartinJohnson 0:404f5a4f1385 2541
MartinJohnson 0:404f5a4f1385 2542 void HRTIM_SimplePWMStart(HRTIM_TypeDef * HRTIMx,
MartinJohnson 0:404f5a4f1385 2543 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2544 uint32_t PWMChannel);
MartinJohnson 0:404f5a4f1385 2545 void HRTIM_SimplePWMStop(HRTIM_TypeDef * HRTIMx,
MartinJohnson 0:404f5a4f1385 2546 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2547 uint32_t PWMChannel);
MartinJohnson 0:404f5a4f1385 2548 /* Simple capture related functions *******************************************/
MartinJohnson 0:404f5a4f1385 2549 void HRTIM_SimpleCapture_Init(HRTIM_TypeDef * HRTIMx, uint32_t TimerIdx, HRTIM_BaseInitTypeDef* HRTIM_BaseInitStruct);
MartinJohnson 0:404f5a4f1385 2550
MartinJohnson 0:404f5a4f1385 2551 void HRTIM_SimpleCaptureChannelConfig(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2552 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2553 uint32_t CaptureChannel,
MartinJohnson 0:404f5a4f1385 2554 HRTIM_BasicCaptureChannelCfgTypeDef* pBasicCaptureChannelCfg);
MartinJohnson 0:404f5a4f1385 2555
MartinJohnson 0:404f5a4f1385 2556 void HRTIM_SimpleCaptureStart(HRTIM_TypeDef * HRTIMx,
MartinJohnson 0:404f5a4f1385 2557 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2558 uint32_t CaptureChannel);
MartinJohnson 0:404f5a4f1385 2559 void HRTIM_SimpleCaptureStop(HRTIM_TypeDef * HRTIMx,
MartinJohnson 0:404f5a4f1385 2560 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2561 uint32_t CaptureChannel);
MartinJohnson 0:404f5a4f1385 2562 /* SImple one pulse related functions *****************************************/
MartinJohnson 0:404f5a4f1385 2563 void HRTIM_SimpleOnePulse_Init(HRTIM_TypeDef * HRTIMx, uint32_t TimerIdx, HRTIM_BaseInitTypeDef* HRTIM_BaseInitStruct);
MartinJohnson 0:404f5a4f1385 2564
MartinJohnson 0:404f5a4f1385 2565 void HRTIM_SimpleOnePulseChannelConfig(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2566 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2567 uint32_t OnePulseChannel,
MartinJohnson 0:404f5a4f1385 2568 HRTIM_BasicOnePulseChannelCfgTypeDef* pBasicOnePulseChannelCfg);
MartinJohnson 0:404f5a4f1385 2569
MartinJohnson 0:404f5a4f1385 2570 void HRTIM_SimpleOnePulseStart(HRTIM_TypeDef * HRTIMx,
MartinJohnson 0:404f5a4f1385 2571 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2572 uint32_t OnePulseChannel);
MartinJohnson 0:404f5a4f1385 2573 void HRTIM_SimpleOnePulseStop(HRTIM_TypeDef * HRTIM_,
MartinJohnson 0:404f5a4f1385 2574 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2575 uint32_t OnePulseChannel);
MartinJohnson 0:404f5a4f1385 2576 /* Waveform related functions *************************************************/
MartinJohnson 0:404f5a4f1385 2577 void HRTIM_Waveform_Init(HRTIM_TypeDef * HRTIMx,
MartinJohnson 0:404f5a4f1385 2578 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2579 HRTIM_BaseInitTypeDef* HRTIM_BaseInitStruct,
MartinJohnson 0:404f5a4f1385 2580 HRTIM_TimerInitTypeDef* HRTIM_TimerInitStruct);
MartinJohnson 0:404f5a4f1385 2581
MartinJohnson 0:404f5a4f1385 2582 void HRTIM_WaveformTimerConfig(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2583 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2584 HRTIM_TimerCfgTypeDef * HRTIM_TimerCfgStruct);
MartinJohnson 0:404f5a4f1385 2585
MartinJohnson 0:404f5a4f1385 2586 void HRTIM_WaveformCompareConfig(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2587 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2588 uint32_t CompareUnit,
MartinJohnson 0:404f5a4f1385 2589 HRTIM_CompareCfgTypeDef* pCompareCfg);
MartinJohnson 0:404f5a4f1385 2590
MartinJohnson 0:404f5a4f1385 2591 void HRTIM_SlaveSetCompare(HRTIM_TypeDef * HRTIMx,
MartinJohnson 0:404f5a4f1385 2592 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2593 uint32_t CompareUnit,
MartinJohnson 0:404f5a4f1385 2594 uint32_t Compare);
MartinJohnson 0:404f5a4f1385 2595
MartinJohnson 0:404f5a4f1385 2596 void HRTIM_MasterSetCompare(HRTIM_TypeDef * HRTIMx,
MartinJohnson 0:404f5a4f1385 2597 uint32_t CompareUnit,
MartinJohnson 0:404f5a4f1385 2598 uint32_t Compare);
MartinJohnson 0:404f5a4f1385 2599
MartinJohnson 0:404f5a4f1385 2600 void HRTIM_WaveformCaptureConfig(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2601 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2602 uint32_t CaptureUnit,
MartinJohnson 0:404f5a4f1385 2603 HRTIM_CaptureCfgTypeDef* pCaptureCfg);
MartinJohnson 0:404f5a4f1385 2604
MartinJohnson 0:404f5a4f1385 2605 void HRTIM_TimerEventFilteringConfig(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2606 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2607 uint32_t Event,
MartinJohnson 0:404f5a4f1385 2608 HRTIM_TimerEventFilteringCfgTypeDef * pTimerEventFilteringCfg);
MartinJohnson 0:404f5a4f1385 2609
MartinJohnson 0:404f5a4f1385 2610 void HRTIM_DeadTimeConfig(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2611 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2612 HRTIM_DeadTimeCfgTypeDef* pDeadTimeCfg);
MartinJohnson 0:404f5a4f1385 2613
MartinJohnson 0:404f5a4f1385 2614 void HRTIM_ChopperModeConfig(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2615 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2616 HRTIM_ChopperModeCfgTypeDef* pChopperModeCfg);
MartinJohnson 0:404f5a4f1385 2617
MartinJohnson 0:404f5a4f1385 2618 void HRTIM_BurstDMAConfig(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2619 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2620 uint32_t RegistersToUpdate);
MartinJohnson 0:404f5a4f1385 2621
MartinJohnson 0:404f5a4f1385 2622 void HRTIM_SynchronizationConfig(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2623 HRTIM_SynchroCfgTypeDef * pSynchroCfg);
MartinJohnson 0:404f5a4f1385 2624
MartinJohnson 0:404f5a4f1385 2625 void HRTIM_BurstModeConfig(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2626 HRTIM_BurstModeCfgTypeDef* pBurstModeCfg);
MartinJohnson 0:404f5a4f1385 2627
MartinJohnson 0:404f5a4f1385 2628 void HRTIM_EventConfig(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2629 uint32_t Event,
MartinJohnson 0:404f5a4f1385 2630 HRTIM_EventCfgTypeDef* pEventCfg);
MartinJohnson 0:404f5a4f1385 2631
MartinJohnson 0:404f5a4f1385 2632 void HRTIM_EventPrescalerConfig(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2633 uint32_t Prescaler);
MartinJohnson 0:404f5a4f1385 2634
MartinJohnson 0:404f5a4f1385 2635 void HRTIM_FaultConfig(HRTIM_TypeDef *hrtim,
MartinJohnson 0:404f5a4f1385 2636 HRTIM_FaultCfgTypeDef* pFaultCfg,
MartinJohnson 0:404f5a4f1385 2637 uint32_t Fault);
MartinJohnson 0:404f5a4f1385 2638
MartinJohnson 0:404f5a4f1385 2639 void HRTIM_FaultPrescalerConfig(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2640 uint32_t Prescaler);
MartinJohnson 0:404f5a4f1385 2641 void HRTIM_FaultModeCtl(HRTIM_TypeDef * HRTIMx, uint32_t Fault, uint32_t Enable);
MartinJohnson 0:404f5a4f1385 2642
MartinJohnson 0:404f5a4f1385 2643 void HRTIM_ADCTriggerConfig(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2644 uint32_t ADCTrigger,
MartinJohnson 0:404f5a4f1385 2645 HRTIM_ADCTriggerCfgTypeDef* pADCTriggerCfg);
MartinJohnson 0:404f5a4f1385 2646
MartinJohnson 0:404f5a4f1385 2647 void HRTIM_WaveformCounterStart(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2648 uint32_t TimersToStart);
MartinJohnson 0:404f5a4f1385 2649
MartinJohnson 0:404f5a4f1385 2650 void HRTIM_WaveformCounterStop(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2651 uint32_t TimersToStop);
MartinJohnson 0:404f5a4f1385 2652
MartinJohnson 0:404f5a4f1385 2653 void HRTIM_WaveformOutputStart(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2654 uint32_t OutputsToStart);
MartinJohnson 0:404f5a4f1385 2655 void HRTIM_WaveformOutputStop(HRTIM_TypeDef * HRTIM_,
MartinJohnson 0:404f5a4f1385 2656 uint32_t OutputsToStop);
MartinJohnson 0:404f5a4f1385 2657
MartinJohnson 0:404f5a4f1385 2658 void HRTIM_DLLCalibrationStart(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2659 uint32_t CalibrationRate);
MartinJohnson 0:404f5a4f1385 2660
MartinJohnson 0:404f5a4f1385 2661 /* Interrupt/flags and DMA management */
MartinJohnson 0:404f5a4f1385 2662 void HRTIM_ITConfig(HRTIM_TypeDef * HRTIMx, uint32_t TimerIdx, uint32_t HRTIM_TIM_IT, FunctionalState NewState);
MartinJohnson 0:404f5a4f1385 2663 void HRTIM_ITCommonConfig(HRTIM_TypeDef * HRTIMx, uint32_t HRTIM_CommonIT, FunctionalState NewState);
MartinJohnson 0:404f5a4f1385 2664
MartinJohnson 0:404f5a4f1385 2665 void HRTIM_ClearFlag(HRTIM_TypeDef * HRTIMx, uint32_t TimerIdx, uint32_t HRTIM_FLAG);
MartinJohnson 0:404f5a4f1385 2666 void HRTIM_ClearCommonFlag(HRTIM_TypeDef * HRTIMx, uint32_t HRTIM_CommonFLAG);
MartinJohnson 0:404f5a4f1385 2667
MartinJohnson 0:404f5a4f1385 2668 void HRTIM_ClearITPendingBit(HRTIM_TypeDef * HRTIMx, uint32_t TimerIdx, uint32_t HRTIM_IT);
MartinJohnson 0:404f5a4f1385 2669 void HRTIM_ClearCommonITPendingBit(HRTIM_TypeDef * HRTIMx, uint32_t HRTIM_CommonIT);
MartinJohnson 0:404f5a4f1385 2670
MartinJohnson 0:404f5a4f1385 2671 FlagStatus HRTIM_GetFlagStatus(HRTIM_TypeDef * HRTIMx, uint32_t TimerIdx, uint32_t HRTIM_FLAG);
MartinJohnson 0:404f5a4f1385 2672 FlagStatus HRTIM_GetCommonFlagStatus(HRTIM_TypeDef * HRTIMx, uint32_t HRTIM_CommonFLAG);
MartinJohnson 0:404f5a4f1385 2673
MartinJohnson 0:404f5a4f1385 2674 ITStatus HRTIM_GetITStatus(HRTIM_TypeDef * HRTIMx, uint32_t TimerIdx, uint32_t HRTIM_IT);
MartinJohnson 0:404f5a4f1385 2675 ITStatus HRTIM_GetCommonITStatus(HRTIM_TypeDef * HRTIMx, uint32_t HRTIM_CommonIT);
MartinJohnson 0:404f5a4f1385 2676
MartinJohnson 0:404f5a4f1385 2677
MartinJohnson 0:404f5a4f1385 2678 void HRTIM_DMACmd(HRTIM_TypeDef* HRTIMx, uint32_t TimerIdx, uint32_t HRTIM_DMA, FunctionalState NewState);
MartinJohnson 0:404f5a4f1385 2679
MartinJohnson 0:404f5a4f1385 2680 void HRTIM_BurstModeCtl(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2681 uint32_t Enable);
MartinJohnson 0:404f5a4f1385 2682
MartinJohnson 0:404f5a4f1385 2683 void HRTIM_SoftwareCapture(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2684 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2685 uint32_t CaptureUnit);
MartinJohnson 0:404f5a4f1385 2686
MartinJohnson 0:404f5a4f1385 2687 void HRTIM_SoftwareUpdate(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2688 uint32_t TimersToUpdate);
MartinJohnson 0:404f5a4f1385 2689
MartinJohnson 0:404f5a4f1385 2690 void HRTIM_SoftwareReset(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2691 uint32_t TimersToReset);
MartinJohnson 0:404f5a4f1385 2692
MartinJohnson 0:404f5a4f1385 2693
MartinJohnson 0:404f5a4f1385 2694 uint32_t HRTIM_GetCapturedValue(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2695 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2696 uint32_t CaptureUnit);
MartinJohnson 0:404f5a4f1385 2697
MartinJohnson 0:404f5a4f1385 2698 void HRTIM_WaveformOutputConfig(HRTIM_TypeDef * HRTIMx,
MartinJohnson 0:404f5a4f1385 2699 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2700 uint32_t Output,
MartinJohnson 0:404f5a4f1385 2701 HRTIM_OutputCfgTypeDef * pOutputCfg);
MartinJohnson 0:404f5a4f1385 2702
MartinJohnson 0:404f5a4f1385 2703 void HRTIM_WaveformSetOutputLevel(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2704 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2705 uint32_t Output,
MartinJohnson 0:404f5a4f1385 2706 uint32_t OutputLevel);
MartinJohnson 0:404f5a4f1385 2707
MartinJohnson 0:404f5a4f1385 2708 uint32_t HRTIM_WaveformGetOutputLevel(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2709 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2710 uint32_t Output);
MartinJohnson 0:404f5a4f1385 2711
MartinJohnson 0:404f5a4f1385 2712 uint32_t HRTIM_WaveformGetOutputState(HRTIM_TypeDef * HRTIMx,
MartinJohnson 0:404f5a4f1385 2713 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2714 uint32_t Output);
MartinJohnson 0:404f5a4f1385 2715
MartinJohnson 0:404f5a4f1385 2716 uint32_t HRTIM_GetDelayedProtectionStatus(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2717 uint32_t TimerIdx,
MartinJohnson 0:404f5a4f1385 2718 uint32_t Output);
MartinJohnson 0:404f5a4f1385 2719
MartinJohnson 0:404f5a4f1385 2720 uint32_t HRTIM_GetBurstStatus(HRTIM_TypeDef *HRTIMx);
MartinJohnson 0:404f5a4f1385 2721
MartinJohnson 0:404f5a4f1385 2722 uint32_t HRTIM_GetCurrentPushPullStatus(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2723 uint32_t TimerIdx);
MartinJohnson 0:404f5a4f1385 2724
MartinJohnson 0:404f5a4f1385 2725 uint32_t HRTIM_GetIdlePushPullStatus(HRTIM_TypeDef *HRTIMx,
MartinJohnson 0:404f5a4f1385 2726 uint32_t TimerIdx);
MartinJohnson 0:404f5a4f1385 2727 /**
MartinJohnson 0:404f5a4f1385 2728 * @}
MartinJohnson 0:404f5a4f1385 2729 */
MartinJohnson 0:404f5a4f1385 2730
MartinJohnson 0:404f5a4f1385 2731 /**
MartinJohnson 0:404f5a4f1385 2732 * @}
MartinJohnson 0:404f5a4f1385 2733 */
MartinJohnson 0:404f5a4f1385 2734
MartinJohnson 0:404f5a4f1385 2735 #ifdef __cplusplus
MartinJohnson 0:404f5a4f1385 2736 }
MartinJohnson 0:404f5a4f1385 2737 #endif
MartinJohnson 0:404f5a4f1385 2738
MartinJohnson 0:404f5a4f1385 2739 #endif /* __STM32F30x_HRTIM_H */
MartinJohnson 0:404f5a4f1385 2740
MartinJohnson 0:404f5a4f1385 2741 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/