Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

Committer:
sahilmgandhi
Date:
Sun May 14 23:18:57 2017 +0000
Revision:
18:6a4db94011d3
Publishing again

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sahilmgandhi 18:6a4db94011d3 1 /**
sahilmgandhi 18:6a4db94011d3 2 ******************************************************************************
sahilmgandhi 18:6a4db94011d3 3 * @file stm32f4xx_hal_lptim.h
sahilmgandhi 18:6a4db94011d3 4 * @author MCD Application Team
sahilmgandhi 18:6a4db94011d3 5 * @version V1.5.0
sahilmgandhi 18:6a4db94011d3 6 * @date 06-May-2016
sahilmgandhi 18:6a4db94011d3 7 * @brief Header file of LPTIM HAL module.
sahilmgandhi 18:6a4db94011d3 8 ******************************************************************************
sahilmgandhi 18:6a4db94011d3 9 * @attention
sahilmgandhi 18:6a4db94011d3 10 *
sahilmgandhi 18:6a4db94011d3 11 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
sahilmgandhi 18:6a4db94011d3 12 *
sahilmgandhi 18:6a4db94011d3 13 * Redistribution and use in source and binary forms, with or without modification,
sahilmgandhi 18:6a4db94011d3 14 * are permitted provided that the following conditions are met:
sahilmgandhi 18:6a4db94011d3 15 * 1. Redistributions of source code must retain the above copyright notice,
sahilmgandhi 18:6a4db94011d3 16 * this list of conditions and the following disclaimer.
sahilmgandhi 18:6a4db94011d3 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
sahilmgandhi 18:6a4db94011d3 18 * this list of conditions and the following disclaimer in the documentation
sahilmgandhi 18:6a4db94011d3 19 * and/or other materials provided with the distribution.
sahilmgandhi 18:6a4db94011d3 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
sahilmgandhi 18:6a4db94011d3 21 * may be used to endorse or promote products derived from this software
sahilmgandhi 18:6a4db94011d3 22 * without specific prior written permission.
sahilmgandhi 18:6a4db94011d3 23 *
sahilmgandhi 18:6a4db94011d3 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
sahilmgandhi 18:6a4db94011d3 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
sahilmgandhi 18:6a4db94011d3 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
sahilmgandhi 18:6a4db94011d3 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
sahilmgandhi 18:6a4db94011d3 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
sahilmgandhi 18:6a4db94011d3 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
sahilmgandhi 18:6a4db94011d3 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
sahilmgandhi 18:6a4db94011d3 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
sahilmgandhi 18:6a4db94011d3 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
sahilmgandhi 18:6a4db94011d3 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
sahilmgandhi 18:6a4db94011d3 34 *
sahilmgandhi 18:6a4db94011d3 35 ******************************************************************************
sahilmgandhi 18:6a4db94011d3 36 */
sahilmgandhi 18:6a4db94011d3 37
sahilmgandhi 18:6a4db94011d3 38 /* Define to prevent recursive inclusion -------------------------------------*/
sahilmgandhi 18:6a4db94011d3 39 #ifndef __STM32F4xx_HAL_LPTIM_H
sahilmgandhi 18:6a4db94011d3 40 #define __STM32F4xx_HAL_LPTIM_H
sahilmgandhi 18:6a4db94011d3 41
sahilmgandhi 18:6a4db94011d3 42 #ifdef __cplusplus
sahilmgandhi 18:6a4db94011d3 43 extern "C" {
sahilmgandhi 18:6a4db94011d3 44 #endif
sahilmgandhi 18:6a4db94011d3 45
sahilmgandhi 18:6a4db94011d3 46 #if defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx)
sahilmgandhi 18:6a4db94011d3 47 /* Includes ------------------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 48 #include "stm32f4xx_hal_def.h"
sahilmgandhi 18:6a4db94011d3 49
sahilmgandhi 18:6a4db94011d3 50 /** @addtogroup STM32F4xx_HAL_Driver
sahilmgandhi 18:6a4db94011d3 51 * @{
sahilmgandhi 18:6a4db94011d3 52 */
sahilmgandhi 18:6a4db94011d3 53
sahilmgandhi 18:6a4db94011d3 54 /** @defgroup LPTIM LPTIM
sahilmgandhi 18:6a4db94011d3 55 * @brief LPTIM HAL module driver
sahilmgandhi 18:6a4db94011d3 56 * @{
sahilmgandhi 18:6a4db94011d3 57 */
sahilmgandhi 18:6a4db94011d3 58
sahilmgandhi 18:6a4db94011d3 59 /* Exported types ------------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 60 /** @defgroup LPTIM_Exported_Types LPTIM Exported Types
sahilmgandhi 18:6a4db94011d3 61 * @{
sahilmgandhi 18:6a4db94011d3 62 */
sahilmgandhi 18:6a4db94011d3 63
sahilmgandhi 18:6a4db94011d3 64 /** @defgroup LPTIM_WAKEUPTIMER_EXTILINE LPTIM WAKEUP Timer EXTI Line
sahilmgandhi 18:6a4db94011d3 65 * @{
sahilmgandhi 18:6a4db94011d3 66 */
sahilmgandhi 18:6a4db94011d3 67 #define LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT ((uint32_t)EXTI_IMR_MR23) /*!< External interrupt line 23 Connected to the LPTIM EXTI Line */
sahilmgandhi 18:6a4db94011d3 68 /**
sahilmgandhi 18:6a4db94011d3 69 * @}
sahilmgandhi 18:6a4db94011d3 70 */
sahilmgandhi 18:6a4db94011d3 71
sahilmgandhi 18:6a4db94011d3 72 /**
sahilmgandhi 18:6a4db94011d3 73 * @brief LPTIM Clock configuration definition
sahilmgandhi 18:6a4db94011d3 74 */
sahilmgandhi 18:6a4db94011d3 75 typedef struct
sahilmgandhi 18:6a4db94011d3 76 {
sahilmgandhi 18:6a4db94011d3 77 uint32_t Source; /*!< Selects the clock source.
sahilmgandhi 18:6a4db94011d3 78 This parameter can be a value of @ref LPTIM_Clock_Source */
sahilmgandhi 18:6a4db94011d3 79
sahilmgandhi 18:6a4db94011d3 80 uint32_t Prescaler; /*!< Specifies the counter clock Prescaler.
sahilmgandhi 18:6a4db94011d3 81 This parameter can be a value of @ref LPTIM_Clock_Prescaler */
sahilmgandhi 18:6a4db94011d3 82
sahilmgandhi 18:6a4db94011d3 83 }LPTIM_ClockConfigTypeDef;
sahilmgandhi 18:6a4db94011d3 84
sahilmgandhi 18:6a4db94011d3 85 /**
sahilmgandhi 18:6a4db94011d3 86 * @brief LPTIM Clock configuration definition
sahilmgandhi 18:6a4db94011d3 87 */
sahilmgandhi 18:6a4db94011d3 88 typedef struct
sahilmgandhi 18:6a4db94011d3 89 {
sahilmgandhi 18:6a4db94011d3 90 uint32_t Polarity; /*!< Selects the polarity of the active edge for the counter unit
sahilmgandhi 18:6a4db94011d3 91 if the ULPTIM input is selected.
sahilmgandhi 18:6a4db94011d3 92 Note: This parameter is used only when Ultra low power clock source is used.
sahilmgandhi 18:6a4db94011d3 93 Note: If the polarity is configured on 'both edges', an auxiliary clock
sahilmgandhi 18:6a4db94011d3 94 (one of the Low power oscillator) must be active.
sahilmgandhi 18:6a4db94011d3 95 This parameter can be a value of @ref LPTIM_Clock_Polarity */
sahilmgandhi 18:6a4db94011d3 96
sahilmgandhi 18:6a4db94011d3 97 uint32_t SampleTime; /*!< Selects the clock sampling time to configure the clock glitch filter.
sahilmgandhi 18:6a4db94011d3 98 Note: This parameter is used only when Ultra low power clock source is used.
sahilmgandhi 18:6a4db94011d3 99 This parameter can be a value of @ref LPTIM_Clock_Sample_Time */
sahilmgandhi 18:6a4db94011d3 100
sahilmgandhi 18:6a4db94011d3 101 }LPTIM_ULPClockConfigTypeDef;
sahilmgandhi 18:6a4db94011d3 102
sahilmgandhi 18:6a4db94011d3 103 /**
sahilmgandhi 18:6a4db94011d3 104 * @brief LPTIM Trigger configuration definition
sahilmgandhi 18:6a4db94011d3 105 */
sahilmgandhi 18:6a4db94011d3 106 typedef struct
sahilmgandhi 18:6a4db94011d3 107 {
sahilmgandhi 18:6a4db94011d3 108 uint32_t Source; /*!< Selects the Trigger source.
sahilmgandhi 18:6a4db94011d3 109 This parameter can be a value of @ref LPTIM_Trigger_Source */
sahilmgandhi 18:6a4db94011d3 110
sahilmgandhi 18:6a4db94011d3 111 uint32_t ActiveEdge; /*!< Selects the Trigger active edge.
sahilmgandhi 18:6a4db94011d3 112 Note: This parameter is used only when an external trigger is used.
sahilmgandhi 18:6a4db94011d3 113 This parameter can be a value of @ref LPTIM_External_Trigger_Polarity */
sahilmgandhi 18:6a4db94011d3 114
sahilmgandhi 18:6a4db94011d3 115 uint32_t SampleTime; /*!< Selects the trigger sampling time to configure the clock glitch filter.
sahilmgandhi 18:6a4db94011d3 116 Note: This parameter is used only when an external trigger is used.
sahilmgandhi 18:6a4db94011d3 117 This parameter can be a value of @ref LPTIM_Trigger_Sample_Time */
sahilmgandhi 18:6a4db94011d3 118 }LPTIM_TriggerConfigTypeDef;
sahilmgandhi 18:6a4db94011d3 119
sahilmgandhi 18:6a4db94011d3 120 /**
sahilmgandhi 18:6a4db94011d3 121 * @brief LPTIM Initialization Structure definition
sahilmgandhi 18:6a4db94011d3 122 */
sahilmgandhi 18:6a4db94011d3 123 typedef struct
sahilmgandhi 18:6a4db94011d3 124 {
sahilmgandhi 18:6a4db94011d3 125 LPTIM_ClockConfigTypeDef Clock; /*!< Specifies the clock parameters */
sahilmgandhi 18:6a4db94011d3 126
sahilmgandhi 18:6a4db94011d3 127 LPTIM_ULPClockConfigTypeDef UltraLowPowerClock; /*!< Specifies the Ultra Low Power clock parameters */
sahilmgandhi 18:6a4db94011d3 128
sahilmgandhi 18:6a4db94011d3 129 LPTIM_TriggerConfigTypeDef Trigger; /*!< Specifies the Trigger parameters */
sahilmgandhi 18:6a4db94011d3 130
sahilmgandhi 18:6a4db94011d3 131 uint32_t OutputPolarity; /*!< Specifies the Output polarity.
sahilmgandhi 18:6a4db94011d3 132 This parameter can be a value of @ref LPTIM_Output_Polarity */
sahilmgandhi 18:6a4db94011d3 133
sahilmgandhi 18:6a4db94011d3 134 uint32_t UpdateMode; /*!< Specifies whether the update of the autorelaod and the compare
sahilmgandhi 18:6a4db94011d3 135 values is done immediately or after the end of current period.
sahilmgandhi 18:6a4db94011d3 136 This parameter can be a value of @ref LPTIM_Updating_Mode */
sahilmgandhi 18:6a4db94011d3 137
sahilmgandhi 18:6a4db94011d3 138 uint32_t CounterSource; /*!< Specifies whether the counter is incremented each internal event
sahilmgandhi 18:6a4db94011d3 139 or each external event.
sahilmgandhi 18:6a4db94011d3 140 This parameter can be a value of @ref LPTIM_Counter_Source */
sahilmgandhi 18:6a4db94011d3 141
sahilmgandhi 18:6a4db94011d3 142 }LPTIM_InitTypeDef;
sahilmgandhi 18:6a4db94011d3 143
sahilmgandhi 18:6a4db94011d3 144 /**
sahilmgandhi 18:6a4db94011d3 145 * @brief HAL LPTIM State structure definition
sahilmgandhi 18:6a4db94011d3 146 */
sahilmgandhi 18:6a4db94011d3 147 typedef enum __HAL_LPTIM_StateTypeDef
sahilmgandhi 18:6a4db94011d3 148 {
sahilmgandhi 18:6a4db94011d3 149 HAL_LPTIM_STATE_RESET = 0x00U, /*!< Peripheral not yet initialized or disabled */
sahilmgandhi 18:6a4db94011d3 150 HAL_LPTIM_STATE_READY = 0x01U, /*!< Peripheral Initialized and ready for use */
sahilmgandhi 18:6a4db94011d3 151 HAL_LPTIM_STATE_BUSY = 0x02U, /*!< An internal process is ongoing */
sahilmgandhi 18:6a4db94011d3 152 HAL_LPTIM_STATE_TIMEOUT = 0x03U, /*!< Timeout state */
sahilmgandhi 18:6a4db94011d3 153 HAL_LPTIM_STATE_ERROR = 0x04U /*!< Internal Process is ongoing */
sahilmgandhi 18:6a4db94011d3 154 }HAL_LPTIM_StateTypeDef;
sahilmgandhi 18:6a4db94011d3 155
sahilmgandhi 18:6a4db94011d3 156 /**
sahilmgandhi 18:6a4db94011d3 157 * @brief LPTIM handle Structure definition
sahilmgandhi 18:6a4db94011d3 158 */
sahilmgandhi 18:6a4db94011d3 159 typedef struct
sahilmgandhi 18:6a4db94011d3 160 {
sahilmgandhi 18:6a4db94011d3 161 LPTIM_TypeDef *Instance; /*!< Register base address */
sahilmgandhi 18:6a4db94011d3 162
sahilmgandhi 18:6a4db94011d3 163 LPTIM_InitTypeDef Init; /*!< LPTIM required parameters */
sahilmgandhi 18:6a4db94011d3 164
sahilmgandhi 18:6a4db94011d3 165 HAL_StatusTypeDef Status; /*!< LPTIM peripheral status */
sahilmgandhi 18:6a4db94011d3 166
sahilmgandhi 18:6a4db94011d3 167 HAL_LockTypeDef Lock; /*!< LPTIM locking object */
sahilmgandhi 18:6a4db94011d3 168
sahilmgandhi 18:6a4db94011d3 169 __IO HAL_LPTIM_StateTypeDef State; /*!< LPTIM peripheral state */
sahilmgandhi 18:6a4db94011d3 170
sahilmgandhi 18:6a4db94011d3 171 }LPTIM_HandleTypeDef;
sahilmgandhi 18:6a4db94011d3 172
sahilmgandhi 18:6a4db94011d3 173 /**
sahilmgandhi 18:6a4db94011d3 174 * @}
sahilmgandhi 18:6a4db94011d3 175 */
sahilmgandhi 18:6a4db94011d3 176
sahilmgandhi 18:6a4db94011d3 177 /* Exported constants --------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 178 /** @defgroup LPTIM_Exported_Constants LPTIM Exported Constants
sahilmgandhi 18:6a4db94011d3 179 * @{
sahilmgandhi 18:6a4db94011d3 180 */
sahilmgandhi 18:6a4db94011d3 181
sahilmgandhi 18:6a4db94011d3 182 /** @defgroup LPTIM_Clock_Source LPTIM Clock Source
sahilmgandhi 18:6a4db94011d3 183 * @{
sahilmgandhi 18:6a4db94011d3 184 */
sahilmgandhi 18:6a4db94011d3 185 #define LPTIM_CLOCKSOURCE_APBCLOCK_LPOSC ((uint32_t)0x00U)
sahilmgandhi 18:6a4db94011d3 186 #define LPTIM_CLOCKSOURCE_ULPTIM LPTIM_CFGR_CKSEL
sahilmgandhi 18:6a4db94011d3 187 /**
sahilmgandhi 18:6a4db94011d3 188 * @}
sahilmgandhi 18:6a4db94011d3 189 */
sahilmgandhi 18:6a4db94011d3 190
sahilmgandhi 18:6a4db94011d3 191 /** @defgroup LPTIM_Clock_Prescaler LPTIM Clock Prescaler
sahilmgandhi 18:6a4db94011d3 192 * @{
sahilmgandhi 18:6a4db94011d3 193 */
sahilmgandhi 18:6a4db94011d3 194 #define LPTIM_PRESCALER_DIV1 ((uint32_t)0x00000000U)
sahilmgandhi 18:6a4db94011d3 195 #define LPTIM_PRESCALER_DIV2 LPTIM_CFGR_PRESC_0
sahilmgandhi 18:6a4db94011d3 196 #define LPTIM_PRESCALER_DIV4 LPTIM_CFGR_PRESC_1
sahilmgandhi 18:6a4db94011d3 197 #define LPTIM_PRESCALER_DIV8 ((uint32_t)(LPTIM_CFGR_PRESC_0 | LPTIM_CFGR_PRESC_1))
sahilmgandhi 18:6a4db94011d3 198 #define LPTIM_PRESCALER_DIV16 LPTIM_CFGR_PRESC_2
sahilmgandhi 18:6a4db94011d3 199 #define LPTIM_PRESCALER_DIV32 ((uint32_t)(LPTIM_CFGR_PRESC_0 | LPTIM_CFGR_PRESC_2))
sahilmgandhi 18:6a4db94011d3 200 #define LPTIM_PRESCALER_DIV64 ((uint32_t)(LPTIM_CFGR_PRESC_1 | LPTIM_CFGR_PRESC_2))
sahilmgandhi 18:6a4db94011d3 201 #define LPTIM_PRESCALER_DIV128 ((uint32_t)LPTIM_CFGR_PRESC)
sahilmgandhi 18:6a4db94011d3 202 /**
sahilmgandhi 18:6a4db94011d3 203 * @}
sahilmgandhi 18:6a4db94011d3 204 */
sahilmgandhi 18:6a4db94011d3 205
sahilmgandhi 18:6a4db94011d3 206 /** @defgroup LPTIM_Output_Polarity LPTIM Output Polarity
sahilmgandhi 18:6a4db94011d3 207 * @{
sahilmgandhi 18:6a4db94011d3 208 */
sahilmgandhi 18:6a4db94011d3 209
sahilmgandhi 18:6a4db94011d3 210 #define LPTIM_OUTPUTPOLARITY_HIGH ((uint32_t)0x00000000U)
sahilmgandhi 18:6a4db94011d3 211 #define LPTIM_OUTPUTPOLARITY_LOW (LPTIM_CFGR_WAVPOL)
sahilmgandhi 18:6a4db94011d3 212 /**
sahilmgandhi 18:6a4db94011d3 213 * @}
sahilmgandhi 18:6a4db94011d3 214 */
sahilmgandhi 18:6a4db94011d3 215
sahilmgandhi 18:6a4db94011d3 216 /** @defgroup LPTIM_Clock_Sample_Time LPTIM Clock Sample Time
sahilmgandhi 18:6a4db94011d3 217 * @{
sahilmgandhi 18:6a4db94011d3 218 */
sahilmgandhi 18:6a4db94011d3 219 #define LPTIM_CLOCKSAMPLETIME_DIRECTTRANSITION ((uint32_t)0x00000000U)
sahilmgandhi 18:6a4db94011d3 220 #define LPTIM_CLOCKSAMPLETIME_2TRANSITIONS LPTIM_CFGR_CKFLT_0
sahilmgandhi 18:6a4db94011d3 221 #define LPTIM_CLOCKSAMPLETIME_4TRANSITIONS LPTIM_CFGR_CKFLT_1
sahilmgandhi 18:6a4db94011d3 222 #define LPTIM_CLOCKSAMPLETIME_8TRANSITIONS LPTIM_CFGR_CKFLT
sahilmgandhi 18:6a4db94011d3 223 /**
sahilmgandhi 18:6a4db94011d3 224 * @}
sahilmgandhi 18:6a4db94011d3 225 */
sahilmgandhi 18:6a4db94011d3 226
sahilmgandhi 18:6a4db94011d3 227 /** @defgroup LPTIM_Clock_Polarity LPTIM Clock Polarity
sahilmgandhi 18:6a4db94011d3 228 * @{
sahilmgandhi 18:6a4db94011d3 229 */
sahilmgandhi 18:6a4db94011d3 230
sahilmgandhi 18:6a4db94011d3 231 #define LPTIM_CLOCKPOLARITY_RISING ((uint32_t)0x00000000U)
sahilmgandhi 18:6a4db94011d3 232 #define LPTIM_CLOCKPOLARITY_FALLING LPTIM_CFGR_CKPOL_0
sahilmgandhi 18:6a4db94011d3 233 #define LPTIM_CLOCKPOLARITY_RISING_FALLING LPTIM_CFGR_CKPOL_1
sahilmgandhi 18:6a4db94011d3 234 /**
sahilmgandhi 18:6a4db94011d3 235 * @}
sahilmgandhi 18:6a4db94011d3 236 */
sahilmgandhi 18:6a4db94011d3 237
sahilmgandhi 18:6a4db94011d3 238 /** @defgroup LPTIM_Trigger_Source LPTIM Trigger Source
sahilmgandhi 18:6a4db94011d3 239 * @{
sahilmgandhi 18:6a4db94011d3 240 */
sahilmgandhi 18:6a4db94011d3 241 #define LPTIM_TRIGSOURCE_SOFTWARE ((uint32_t)0x0000FFFFU)
sahilmgandhi 18:6a4db94011d3 242 #define LPTIM_TRIGSOURCE_0 ((uint32_t)0x00000000U)
sahilmgandhi 18:6a4db94011d3 243 #define LPTIM_TRIGSOURCE_1 ((uint32_t)LPTIM_CFGR_TRIGSEL_0)
sahilmgandhi 18:6a4db94011d3 244 #define LPTIM_TRIGSOURCE_2 LPTIM_CFGR_TRIGSEL_1
sahilmgandhi 18:6a4db94011d3 245 #define LPTIM_TRIGSOURCE_3 ((uint32_t)LPTIM_CFGR_TRIGSEL_0 | LPTIM_CFGR_TRIGSEL_1)
sahilmgandhi 18:6a4db94011d3 246 #define LPTIM_TRIGSOURCE_4 LPTIM_CFGR_TRIGSEL_2
sahilmgandhi 18:6a4db94011d3 247 #define LPTIM_TRIGSOURCE_5 ((uint32_t)LPTIM_CFGR_TRIGSEL_0 | LPTIM_CFGR_TRIGSEL_2)
sahilmgandhi 18:6a4db94011d3 248 /**
sahilmgandhi 18:6a4db94011d3 249 * @}
sahilmgandhi 18:6a4db94011d3 250 */
sahilmgandhi 18:6a4db94011d3 251
sahilmgandhi 18:6a4db94011d3 252 /** @defgroup LPTIM_External_Trigger_Polarity LPTIM External Trigger Polarity
sahilmgandhi 18:6a4db94011d3 253 * @{
sahilmgandhi 18:6a4db94011d3 254 */
sahilmgandhi 18:6a4db94011d3 255 #define LPTIM_ACTIVEEDGE_RISING LPTIM_CFGR_TRIGEN_0
sahilmgandhi 18:6a4db94011d3 256 #define LPTIM_ACTIVEEDGE_FALLING LPTIM_CFGR_TRIGEN_1
sahilmgandhi 18:6a4db94011d3 257 #define LPTIM_ACTIVEEDGE_RISING_FALLING LPTIM_CFGR_TRIGEN
sahilmgandhi 18:6a4db94011d3 258 /**
sahilmgandhi 18:6a4db94011d3 259 * @}
sahilmgandhi 18:6a4db94011d3 260 */
sahilmgandhi 18:6a4db94011d3 261
sahilmgandhi 18:6a4db94011d3 262 /** @defgroup LPTIM_Trigger_Sample_Time LPTIM Trigger Sample Time
sahilmgandhi 18:6a4db94011d3 263 * @{
sahilmgandhi 18:6a4db94011d3 264 */
sahilmgandhi 18:6a4db94011d3 265 #define LPTIM_TRIGSAMPLETIME_DIRECTTRANSITION ((uint32_t)0x00000000U)
sahilmgandhi 18:6a4db94011d3 266 #define LPTIM_TRIGSAMPLETIME_2TRANSITIONS LPTIM_CFGR_TRGFLT_0
sahilmgandhi 18:6a4db94011d3 267 #define LPTIM_TRIGSAMPLETIME_4TRANSITIONS LPTIM_CFGR_TRGFLT_1
sahilmgandhi 18:6a4db94011d3 268 #define LPTIM_TRIGSAMPLETIME_8TRANSITIONS LPTIM_CFGR_TRGFLT
sahilmgandhi 18:6a4db94011d3 269 /**
sahilmgandhi 18:6a4db94011d3 270 * @}
sahilmgandhi 18:6a4db94011d3 271 */
sahilmgandhi 18:6a4db94011d3 272
sahilmgandhi 18:6a4db94011d3 273 /** @defgroup LPTIM_Updating_Mode LPTIM Updating Mode
sahilmgandhi 18:6a4db94011d3 274 * @{
sahilmgandhi 18:6a4db94011d3 275 */
sahilmgandhi 18:6a4db94011d3 276
sahilmgandhi 18:6a4db94011d3 277 #define LPTIM_UPDATE_IMMEDIATE ((uint32_t)0x00000000U)
sahilmgandhi 18:6a4db94011d3 278 #define LPTIM_UPDATE_ENDOFPERIOD LPTIM_CFGR_PRELOAD
sahilmgandhi 18:6a4db94011d3 279 /**
sahilmgandhi 18:6a4db94011d3 280 * @}
sahilmgandhi 18:6a4db94011d3 281 */
sahilmgandhi 18:6a4db94011d3 282
sahilmgandhi 18:6a4db94011d3 283 /** @defgroup LPTIM_Counter_Source LPTIM Counter Source
sahilmgandhi 18:6a4db94011d3 284 * @{
sahilmgandhi 18:6a4db94011d3 285 */
sahilmgandhi 18:6a4db94011d3 286
sahilmgandhi 18:6a4db94011d3 287 #define LPTIM_COUNTERSOURCE_INTERNAL ((uint32_t)0x00000000U)
sahilmgandhi 18:6a4db94011d3 288 #define LPTIM_COUNTERSOURCE_EXTERNAL LPTIM_CFGR_COUNTMODE
sahilmgandhi 18:6a4db94011d3 289 /**
sahilmgandhi 18:6a4db94011d3 290 * @}
sahilmgandhi 18:6a4db94011d3 291 */
sahilmgandhi 18:6a4db94011d3 292
sahilmgandhi 18:6a4db94011d3 293 /** @defgroup LPTIM_Flag_Definition LPTIM Flag Definition
sahilmgandhi 18:6a4db94011d3 294 * @{
sahilmgandhi 18:6a4db94011d3 295 */
sahilmgandhi 18:6a4db94011d3 296
sahilmgandhi 18:6a4db94011d3 297 #define LPTIM_FLAG_DOWN LPTIM_ISR_DOWN
sahilmgandhi 18:6a4db94011d3 298 #define LPTIM_FLAG_UP LPTIM_ISR_UP
sahilmgandhi 18:6a4db94011d3 299 #define LPTIM_FLAG_ARROK LPTIM_ISR_ARROK
sahilmgandhi 18:6a4db94011d3 300 #define LPTIM_FLAG_CMPOK LPTIM_ISR_CMPOK
sahilmgandhi 18:6a4db94011d3 301 #define LPTIM_FLAG_EXTTRIG LPTIM_ISR_EXTTRIG
sahilmgandhi 18:6a4db94011d3 302 #define LPTIM_FLAG_ARRM LPTIM_ISR_ARRM
sahilmgandhi 18:6a4db94011d3 303 #define LPTIM_FLAG_CMPM LPTIM_ISR_CMPM
sahilmgandhi 18:6a4db94011d3 304 /**
sahilmgandhi 18:6a4db94011d3 305 * @}
sahilmgandhi 18:6a4db94011d3 306 */
sahilmgandhi 18:6a4db94011d3 307
sahilmgandhi 18:6a4db94011d3 308 /** @defgroup LPTIM_Interrupts_Definition LPTIM Interrupts Definition
sahilmgandhi 18:6a4db94011d3 309 * @{
sahilmgandhi 18:6a4db94011d3 310 */
sahilmgandhi 18:6a4db94011d3 311
sahilmgandhi 18:6a4db94011d3 312 #define LPTIM_IT_DOWN LPTIM_IER_DOWNIE
sahilmgandhi 18:6a4db94011d3 313 #define LPTIM_IT_UP LPTIM_IER_UPIE
sahilmgandhi 18:6a4db94011d3 314 #define LPTIM_IT_ARROK LPTIM_IER_ARROKIE
sahilmgandhi 18:6a4db94011d3 315 #define LPTIM_IT_CMPOK LPTIM_IER_CMPOKIE
sahilmgandhi 18:6a4db94011d3 316 #define LPTIM_IT_EXTTRIG LPTIM_IER_EXTTRIGIE
sahilmgandhi 18:6a4db94011d3 317 #define LPTIM_IT_ARRM LPTIM_IER_ARRMIE
sahilmgandhi 18:6a4db94011d3 318 #define LPTIM_IT_CMPM LPTIM_IER_CMPMIE
sahilmgandhi 18:6a4db94011d3 319 /**
sahilmgandhi 18:6a4db94011d3 320 * @}
sahilmgandhi 18:6a4db94011d3 321 */
sahilmgandhi 18:6a4db94011d3 322
sahilmgandhi 18:6a4db94011d3 323 /** @defgroup LPTIM_Option Register Definition
sahilmgandhi 18:6a4db94011d3 324 * @{
sahilmgandhi 18:6a4db94011d3 325 */
sahilmgandhi 18:6a4db94011d3 326 #define LPTIM_OP_PAD_AF ((uint32_t)0x00000000U)
sahilmgandhi 18:6a4db94011d3 327 #define LPTIM_OP_PAD_PA4 LPTIM_OR_OR_0
sahilmgandhi 18:6a4db94011d3 328 #define LPTIM_OP_PAD_PB9 LPTIM_OR_OR_1
sahilmgandhi 18:6a4db94011d3 329 #define LPTIM_OP_TIM_DAC LPTIM_OR_OR
sahilmgandhi 18:6a4db94011d3 330
sahilmgandhi 18:6a4db94011d3 331 /**
sahilmgandhi 18:6a4db94011d3 332 * @}
sahilmgandhi 18:6a4db94011d3 333 */
sahilmgandhi 18:6a4db94011d3 334
sahilmgandhi 18:6a4db94011d3 335 /**
sahilmgandhi 18:6a4db94011d3 336 * @}
sahilmgandhi 18:6a4db94011d3 337 */
sahilmgandhi 18:6a4db94011d3 338
sahilmgandhi 18:6a4db94011d3 339 /* Exported macro ------------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 340 /** @defgroup LPTIM_Exported_Macros LPTIM Exported Macros
sahilmgandhi 18:6a4db94011d3 341 * @{
sahilmgandhi 18:6a4db94011d3 342 */
sahilmgandhi 18:6a4db94011d3 343
sahilmgandhi 18:6a4db94011d3 344 /** @brief Reset LPTIM handle state
sahilmgandhi 18:6a4db94011d3 345 * @param __HANDLE__: LPTIM handle
sahilmgandhi 18:6a4db94011d3 346 * @retval None
sahilmgandhi 18:6a4db94011d3 347 */
sahilmgandhi 18:6a4db94011d3 348 #define __HAL_LPTIM_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_LPTIM_STATE_RESET)
sahilmgandhi 18:6a4db94011d3 349
sahilmgandhi 18:6a4db94011d3 350 /**
sahilmgandhi 18:6a4db94011d3 351 * @brief Enable/Disable the LPTIM peripheral.
sahilmgandhi 18:6a4db94011d3 352 * @param __HANDLE__: LPTIM handle
sahilmgandhi 18:6a4db94011d3 353 * @retval None
sahilmgandhi 18:6a4db94011d3 354 */
sahilmgandhi 18:6a4db94011d3 355 #define __HAL_LPTIM_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (LPTIM_CR_ENABLE))
sahilmgandhi 18:6a4db94011d3 356 #define __HAL_LPTIM_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(LPTIM_CR_ENABLE))
sahilmgandhi 18:6a4db94011d3 357
sahilmgandhi 18:6a4db94011d3 358 /**
sahilmgandhi 18:6a4db94011d3 359 * @brief Starts the LPTIM peripheral in Continuous or in single mode.
sahilmgandhi 18:6a4db94011d3 360 * @param __HANDLE__: DMA handle
sahilmgandhi 18:6a4db94011d3 361 * @retval None
sahilmgandhi 18:6a4db94011d3 362 */
sahilmgandhi 18:6a4db94011d3 363 #define __HAL_LPTIM_START_CONTINUOUS(__HANDLE__) ((__HANDLE__)->Instance->CR |= LPTIM_CR_CNTSTRT)
sahilmgandhi 18:6a4db94011d3 364 #define __HAL_LPTIM_START_SINGLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= LPTIM_CR_SNGSTRT)
sahilmgandhi 18:6a4db94011d3 365
sahilmgandhi 18:6a4db94011d3 366
sahilmgandhi 18:6a4db94011d3 367 /**
sahilmgandhi 18:6a4db94011d3 368 * @brief Writes the passed parameter in the Autoreload register.
sahilmgandhi 18:6a4db94011d3 369 * @param __HANDLE__: LPTIM handle
sahilmgandhi 18:6a4db94011d3 370 * @param __VALUE__ : Autoreload value
sahilmgandhi 18:6a4db94011d3 371 * @retval None
sahilmgandhi 18:6a4db94011d3 372 */
sahilmgandhi 18:6a4db94011d3 373 #define __HAL_LPTIM_AUTORELOAD_SET(__HANDLE__ , __VALUE__) ((__HANDLE__)->Instance->ARR = (__VALUE__))
sahilmgandhi 18:6a4db94011d3 374
sahilmgandhi 18:6a4db94011d3 375 /**
sahilmgandhi 18:6a4db94011d3 376 * @brief Writes the passed parameter in the Compare register.
sahilmgandhi 18:6a4db94011d3 377 * @param __HANDLE__: LPTIM handle
sahilmgandhi 18:6a4db94011d3 378 * @param __VALUE__ : Compare value
sahilmgandhi 18:6a4db94011d3 379 * @retval None
sahilmgandhi 18:6a4db94011d3 380 */
sahilmgandhi 18:6a4db94011d3 381 #define __HAL_LPTIM_COMPARE_SET(__HANDLE__ , __VALUE__) ((__HANDLE__)->Instance->CMP = (__VALUE__))
sahilmgandhi 18:6a4db94011d3 382
sahilmgandhi 18:6a4db94011d3 383 /**
sahilmgandhi 18:6a4db94011d3 384 * @brief Checks whether the specified LPTIM flag is set or not.
sahilmgandhi 18:6a4db94011d3 385 * @param __HANDLE__: LPTIM handle
sahilmgandhi 18:6a4db94011d3 386 * @param __FLAG__ : LPTIM flag to check
sahilmgandhi 18:6a4db94011d3 387 * This parameter can be a value of:
sahilmgandhi 18:6a4db94011d3 388 * @arg LPTIM_FLAG_DOWN : Counter direction change up Flag.
sahilmgandhi 18:6a4db94011d3 389 * @arg LPTIM_FLAG_UP : Counter direction change down to up Flag.
sahilmgandhi 18:6a4db94011d3 390 * @arg LPTIM_FLAG_ARROK : Autoreload register update OK Flag.
sahilmgandhi 18:6a4db94011d3 391 * @arg LPTIM_FLAG_CMPOK : Compare register update OK Flag.
sahilmgandhi 18:6a4db94011d3 392 * @arg LPTIM_FLAG_EXTTRIG : External trigger edge event Flag.
sahilmgandhi 18:6a4db94011d3 393 * @arg LPTIM_FLAG_ARRM : Autoreload match Flag.
sahilmgandhi 18:6a4db94011d3 394 * @arg LPTIM_FLAG_CMPM : Compare match Flag.
sahilmgandhi 18:6a4db94011d3 395 * @retval The state of the specified flag (SET or RESET).
sahilmgandhi 18:6a4db94011d3 396 */
sahilmgandhi 18:6a4db94011d3 397 #define __HAL_LPTIM_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->ISR &(__FLAG__)) == (__FLAG__))
sahilmgandhi 18:6a4db94011d3 398
sahilmgandhi 18:6a4db94011d3 399 /**
sahilmgandhi 18:6a4db94011d3 400 * @brief Clears the specified LPTIM flag.
sahilmgandhi 18:6a4db94011d3 401 * @param __HANDLE__: LPTIM handle.
sahilmgandhi 18:6a4db94011d3 402 * @param __FLAG__ : LPTIM flag to clear.
sahilmgandhi 18:6a4db94011d3 403 * This parameter can be a value of:
sahilmgandhi 18:6a4db94011d3 404 * @arg LPTIM_FLAG_DOWN : Counter direction change up Flag.
sahilmgandhi 18:6a4db94011d3 405 * @arg LPTIM_FLAG_UP : Counter direction change down to up Flag.
sahilmgandhi 18:6a4db94011d3 406 * @arg LPTIM_FLAG_ARROK : Autoreload register update OK Flag.
sahilmgandhi 18:6a4db94011d3 407 * @arg LPTIM_FLAG_CMPOK : Compare register update OK Flag.
sahilmgandhi 18:6a4db94011d3 408 * @arg LPTIM_FLAG_EXTTRIG : External trigger edge event Flag.
sahilmgandhi 18:6a4db94011d3 409 * @arg LPTIM_FLAG_ARRM : Autoreload match Flag.
sahilmgandhi 18:6a4db94011d3 410 * @arg LPTIM_FLAG_CMPM : Compare match Flag.
sahilmgandhi 18:6a4db94011d3 411 * @retval None.
sahilmgandhi 18:6a4db94011d3 412 */
sahilmgandhi 18:6a4db94011d3 413 #define __HAL_LPTIM_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ICR = (__FLAG__))
sahilmgandhi 18:6a4db94011d3 414
sahilmgandhi 18:6a4db94011d3 415 /**
sahilmgandhi 18:6a4db94011d3 416 * @brief Enable the specified LPTIM interrupt.
sahilmgandhi 18:6a4db94011d3 417 * @param __HANDLE__ : LPTIM handle.
sahilmgandhi 18:6a4db94011d3 418 * @param __INTERRUPT__ : LPTIM interrupt to set.
sahilmgandhi 18:6a4db94011d3 419 * This parameter can be a value of:
sahilmgandhi 18:6a4db94011d3 420 * @arg LPTIM_IT_DOWN : Counter direction change up Interrupt.
sahilmgandhi 18:6a4db94011d3 421 * @arg LPTIM_IT_UP : Counter direction change down to up Interrupt.
sahilmgandhi 18:6a4db94011d3 422 * @arg LPTIM_IT_ARROK : Autoreload register update OK Interrupt.
sahilmgandhi 18:6a4db94011d3 423 * @arg LPTIM_IT_CMPOK : Compare register update OK Interrupt.
sahilmgandhi 18:6a4db94011d3 424 * @arg LPTIM_IT_EXTTRIG : External trigger edge event Interrupt.
sahilmgandhi 18:6a4db94011d3 425 * @arg LPTIM_IT_ARRM : Autoreload match Interrupt.
sahilmgandhi 18:6a4db94011d3 426 * @arg LPTIM_IT_CMPM : Compare match Interrupt.
sahilmgandhi 18:6a4db94011d3 427 * @retval None.
sahilmgandhi 18:6a4db94011d3 428 */
sahilmgandhi 18:6a4db94011d3 429 #define __HAL_LPTIM_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER |= (__INTERRUPT__))
sahilmgandhi 18:6a4db94011d3 430
sahilmgandhi 18:6a4db94011d3 431 /**
sahilmgandhi 18:6a4db94011d3 432 * @brief Disable the specified LPTIM interrupt.
sahilmgandhi 18:6a4db94011d3 433 * @param __HANDLE__ : LPTIM handle.
sahilmgandhi 18:6a4db94011d3 434 * @param __INTERRUPT__ : LPTIM interrupt to set.
sahilmgandhi 18:6a4db94011d3 435 * This parameter can be a value of:
sahilmgandhi 18:6a4db94011d3 436 * @arg LPTIM_IT_DOWN : Counter direction change up Interrupt.
sahilmgandhi 18:6a4db94011d3 437 * @arg LPTIM_IT_UP : Counter direction change down to up Interrupt.
sahilmgandhi 18:6a4db94011d3 438 * @arg LPTIM_IT_ARROK : Autoreload register update OK Interrupt.
sahilmgandhi 18:6a4db94011d3 439 * @arg LPTIM_IT_CMPOK : Compare register update OK Interrupt.
sahilmgandhi 18:6a4db94011d3 440 * @arg LPTIM_IT_EXTTRIG : External trigger edge event Interrupt.
sahilmgandhi 18:6a4db94011d3 441 * @arg LPTIM_IT_ARRM : Autoreload match Interrupt.
sahilmgandhi 18:6a4db94011d3 442 * @arg LPTIM_IT_CMPM : Compare match Interrupt.
sahilmgandhi 18:6a4db94011d3 443 * @retval None.
sahilmgandhi 18:6a4db94011d3 444 */
sahilmgandhi 18:6a4db94011d3 445 #define __HAL_LPTIM_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER &= (~(__INTERRUPT__)))
sahilmgandhi 18:6a4db94011d3 446
sahilmgandhi 18:6a4db94011d3 447 /**
sahilmgandhi 18:6a4db94011d3 448 * @brief Checks whether the specified LPTIM interrupt is set or not.
sahilmgandhi 18:6a4db94011d3 449 * @param __HANDLE__ : LPTIM handle.
sahilmgandhi 18:6a4db94011d3 450 * @param __INTERRUPT__ : LPTIM interrupt to check.
sahilmgandhi 18:6a4db94011d3 451 * This parameter can be a value of:
sahilmgandhi 18:6a4db94011d3 452 * @arg LPTIM_IT_DOWN : Counter direction change up Interrupt.
sahilmgandhi 18:6a4db94011d3 453 * @arg LPTIM_IT_UP : Counter direction change down to up Interrupt.
sahilmgandhi 18:6a4db94011d3 454 * @arg LPTIM_IT_ARROK : Autoreload register update OK Interrupt.
sahilmgandhi 18:6a4db94011d3 455 * @arg LPTIM_IT_CMPOK : Compare register update OK Interrupt.
sahilmgandhi 18:6a4db94011d3 456 * @arg LPTIM_IT_EXTTRIG : External trigger edge event Interrupt.
sahilmgandhi 18:6a4db94011d3 457 * @arg LPTIM_IT_ARRM : Autoreload match Interrupt.
sahilmgandhi 18:6a4db94011d3 458 * @arg LPTIM_IT_CMPM : Compare match Interrupt.
sahilmgandhi 18:6a4db94011d3 459 * @retval Interrupt status.
sahilmgandhi 18:6a4db94011d3 460 */
sahilmgandhi 18:6a4db94011d3 461
sahilmgandhi 18:6a4db94011d3 462 #define __HAL_LPTIM_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->IER & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
sahilmgandhi 18:6a4db94011d3 463
sahilmgandhi 18:6a4db94011d3 464 /** @brief LPTIM Option Register
sahilmgandhi 18:6a4db94011d3 465 * @param __HANDLE__: LPTIM handle
sahilmgandhi 18:6a4db94011d3 466 * @param __VALUE__: This parameter can be a value of :
sahilmgandhi 18:6a4db94011d3 467 * @arg LPTIM_OP_PAD_AF
sahilmgandhi 18:6a4db94011d3 468 * @arg LPTIM_OP_PAD_PA4
sahilmgandhi 18:6a4db94011d3 469 * @arg LPTIM_OP_PAD_PB9
sahilmgandhi 18:6a4db94011d3 470 * @arg LPTIM_OP_TIM_DAC
sahilmgandhi 18:6a4db94011d3 471 * @retval None
sahilmgandhi 18:6a4db94011d3 472 */
sahilmgandhi 18:6a4db94011d3 473 #define __HAL_LPTIM_OPTR_CONFIG(__HANDLE__ , __VALUE__) ((__HANDLE__)->Instance->OR = (__VALUE__))
sahilmgandhi 18:6a4db94011d3 474
sahilmgandhi 18:6a4db94011d3 475 /**
sahilmgandhi 18:6a4db94011d3 476 * @brief Enable interrupt on the LPTIM Wake-up Timer associated Exti line.
sahilmgandhi 18:6a4db94011d3 477 * @retval None
sahilmgandhi 18:6a4db94011d3 478 */
sahilmgandhi 18:6a4db94011d3 479 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_ENABLE_IT() (EXTI->IMR |= LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT)
sahilmgandhi 18:6a4db94011d3 480
sahilmgandhi 18:6a4db94011d3 481 /**
sahilmgandhi 18:6a4db94011d3 482 * @brief Disable interrupt on the LPTIM Wake-up Timer associated Exti line.
sahilmgandhi 18:6a4db94011d3 483 * @retval None
sahilmgandhi 18:6a4db94011d3 484 */
sahilmgandhi 18:6a4db94011d3 485 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_DISABLE_IT() (EXTI->IMR &= ~(LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT))
sahilmgandhi 18:6a4db94011d3 486
sahilmgandhi 18:6a4db94011d3 487 /**
sahilmgandhi 18:6a4db94011d3 488 * @brief Enable event on the LPTIM Wake-up Timer associated Exti line.
sahilmgandhi 18:6a4db94011d3 489 * @retval None.
sahilmgandhi 18:6a4db94011d3 490 */
sahilmgandhi 18:6a4db94011d3 491 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_ENABLE_EVENT() (EXTI->EMR |= LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT)
sahilmgandhi 18:6a4db94011d3 492
sahilmgandhi 18:6a4db94011d3 493 /**
sahilmgandhi 18:6a4db94011d3 494 * @brief Disable event on the LPTIM Wake-up Timer associated Exti line.
sahilmgandhi 18:6a4db94011d3 495 * @retval None.
sahilmgandhi 18:6a4db94011d3 496 */
sahilmgandhi 18:6a4db94011d3 497 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT))
sahilmgandhi 18:6a4db94011d3 498
sahilmgandhi 18:6a4db94011d3 499 /**
sahilmgandhi 18:6a4db94011d3 500 * @brief Enable falling edge trigger on the LPTIM Wake-up Timer associated Exti line.
sahilmgandhi 18:6a4db94011d3 501 * @retval None.
sahilmgandhi 18:6a4db94011d3 502 */
sahilmgandhi 18:6a4db94011d3 503 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT)
sahilmgandhi 18:6a4db94011d3 504
sahilmgandhi 18:6a4db94011d3 505 /**
sahilmgandhi 18:6a4db94011d3 506 * @brief Disable falling edge trigger on the LPTIM Wake-up Timer associated Exti line.
sahilmgandhi 18:6a4db94011d3 507 * @retval None.
sahilmgandhi 18:6a4db94011d3 508 */
sahilmgandhi 18:6a4db94011d3 509 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT))
sahilmgandhi 18:6a4db94011d3 510
sahilmgandhi 18:6a4db94011d3 511 /**
sahilmgandhi 18:6a4db94011d3 512 * @brief Enable rising edge trigger on the LPTIM Wake-up Timer associated Exti line.
sahilmgandhi 18:6a4db94011d3 513 * @retval None.
sahilmgandhi 18:6a4db94011d3 514 */
sahilmgandhi 18:6a4db94011d3 515 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT)
sahilmgandhi 18:6a4db94011d3 516
sahilmgandhi 18:6a4db94011d3 517 /**
sahilmgandhi 18:6a4db94011d3 518 * @brief Disable rising edge trigger on the LPTIM Wake-up Timer associated Exti line.
sahilmgandhi 18:6a4db94011d3 519 * @retval None.
sahilmgandhi 18:6a4db94011d3 520 */
sahilmgandhi 18:6a4db94011d3 521 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT))
sahilmgandhi 18:6a4db94011d3 522
sahilmgandhi 18:6a4db94011d3 523 /**
sahilmgandhi 18:6a4db94011d3 524 * @brief Enable rising & falling edge trigger on the LPTIM Wake-up Timer associated Exti line.
sahilmgandhi 18:6a4db94011d3 525 * @retval None.
sahilmgandhi 18:6a4db94011d3 526 */
sahilmgandhi 18:6a4db94011d3 527 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_ENABLE_RISING_FALLING_EDGE() do{__HAL_LPTIM_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE();\
sahilmgandhi 18:6a4db94011d3 528 __HAL_LPTIM_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE();\
sahilmgandhi 18:6a4db94011d3 529 }while(0)
sahilmgandhi 18:6a4db94011d3 530
sahilmgandhi 18:6a4db94011d3 531 /**
sahilmgandhi 18:6a4db94011d3 532 * @brief Disable rising & falling edge trigger on the LPTIM Wake-up Timer associated Exti line.
sahilmgandhi 18:6a4db94011d3 533 * This parameter can be:
sahilmgandhi 18:6a4db94011d3 534 * @retval None.
sahilmgandhi 18:6a4db94011d3 535 */
sahilmgandhi 18:6a4db94011d3 536 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_DISABLE_RISING_FALLING_EDGE() do{__HAL_LPTIM_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE();\
sahilmgandhi 18:6a4db94011d3 537 __HAL_LPTIM_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE();\
sahilmgandhi 18:6a4db94011d3 538 }while(0)
sahilmgandhi 18:6a4db94011d3 539
sahilmgandhi 18:6a4db94011d3 540 /**
sahilmgandhi 18:6a4db94011d3 541 * @brief Check whether the LPTIM Wake-up Timer associated Exti line interrupt flag is set or not.
sahilmgandhi 18:6a4db94011d3 542 * @retval Line Status.
sahilmgandhi 18:6a4db94011d3 543 */
sahilmgandhi 18:6a4db94011d3 544 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_GET_FLAG() (EXTI->PR & LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT)
sahilmgandhi 18:6a4db94011d3 545
sahilmgandhi 18:6a4db94011d3 546 /**
sahilmgandhi 18:6a4db94011d3 547 * @brief Clear the LPTIM Wake-up Timer associated Exti line flag.
sahilmgandhi 18:6a4db94011d3 548 * @retval None.
sahilmgandhi 18:6a4db94011d3 549 */
sahilmgandhi 18:6a4db94011d3 550 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_CLEAR_FLAG() (EXTI->PR = LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT)
sahilmgandhi 18:6a4db94011d3 551
sahilmgandhi 18:6a4db94011d3 552 /**
sahilmgandhi 18:6a4db94011d3 553 * @brief Generate a Software interrupt on the LPTIM Wake-up Timer associated Exti line.
sahilmgandhi 18:6a4db94011d3 554 * @retval None.
sahilmgandhi 18:6a4db94011d3 555 */
sahilmgandhi 18:6a4db94011d3 556 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_GENERATE_SWIT() (EXTI->SWIER |= LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT)
sahilmgandhi 18:6a4db94011d3 557
sahilmgandhi 18:6a4db94011d3 558 /**
sahilmgandhi 18:6a4db94011d3 559 * @}
sahilmgandhi 18:6a4db94011d3 560 */
sahilmgandhi 18:6a4db94011d3 561 /* Exported functions --------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 562 /** @defgroup LPTIM_Exported_Functions LPTIM Exported Functions
sahilmgandhi 18:6a4db94011d3 563 * @{
sahilmgandhi 18:6a4db94011d3 564 */
sahilmgandhi 18:6a4db94011d3 565
sahilmgandhi 18:6a4db94011d3 566 /* Initialization/de-initialization functions ********************************/
sahilmgandhi 18:6a4db94011d3 567 HAL_StatusTypeDef HAL_LPTIM_Init(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 568 HAL_StatusTypeDef HAL_LPTIM_DeInit(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 569
sahilmgandhi 18:6a4db94011d3 570 /* MSP functions *************************************************************/
sahilmgandhi 18:6a4db94011d3 571 void HAL_LPTIM_MspInit(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 572 void HAL_LPTIM_MspDeInit(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 573
sahilmgandhi 18:6a4db94011d3 574 /* Start/Stop operation functions *********************************************/
sahilmgandhi 18:6a4db94011d3 575 /* ################################# PWM Mode ################################*/
sahilmgandhi 18:6a4db94011d3 576 /* Blocking mode: Polling */
sahilmgandhi 18:6a4db94011d3 577 HAL_StatusTypeDef HAL_LPTIM_PWM_Start(LPTIM_HandleTypeDef *hlptim, uint32_t Period, uint32_t Pulse);
sahilmgandhi 18:6a4db94011d3 578 HAL_StatusTypeDef HAL_LPTIM_PWM_Stop(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 579 /* Non-Blocking mode: Interrupt */
sahilmgandhi 18:6a4db94011d3 580 HAL_StatusTypeDef HAL_LPTIM_PWM_Start_IT(LPTIM_HandleTypeDef *hlptim, uint32_t Period, uint32_t Pulse);
sahilmgandhi 18:6a4db94011d3 581 HAL_StatusTypeDef HAL_LPTIM_PWM_Stop_IT(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 582
sahilmgandhi 18:6a4db94011d3 583 /* ############################# One Pulse Mode ##############################*/
sahilmgandhi 18:6a4db94011d3 584 /* Blocking mode: Polling */
sahilmgandhi 18:6a4db94011d3 585 HAL_StatusTypeDef HAL_LPTIM_OnePulse_Start(LPTIM_HandleTypeDef *hlptim, uint32_t Period, uint32_t Pulse);
sahilmgandhi 18:6a4db94011d3 586 HAL_StatusTypeDef HAL_LPTIM_OnePulse_Stop(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 587 /* Non-Blocking mode: Interrupt */
sahilmgandhi 18:6a4db94011d3 588 HAL_StatusTypeDef HAL_LPTIM_OnePulse_Start_IT(LPTIM_HandleTypeDef *hlptim, uint32_t Period, uint32_t Pulse);
sahilmgandhi 18:6a4db94011d3 589 HAL_StatusTypeDef HAL_LPTIM_OnePulse_Stop_IT(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 590
sahilmgandhi 18:6a4db94011d3 591 /* ############################## Set once Mode ##############################*/
sahilmgandhi 18:6a4db94011d3 592 /* Blocking mode: Polling */
sahilmgandhi 18:6a4db94011d3 593 HAL_StatusTypeDef HAL_LPTIM_SetOnce_Start(LPTIM_HandleTypeDef *hlptim, uint32_t Period, uint32_t Pulse);
sahilmgandhi 18:6a4db94011d3 594 HAL_StatusTypeDef HAL_LPTIM_SetOnce_Stop(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 595 /* Non-Blocking mode: Interrupt */
sahilmgandhi 18:6a4db94011d3 596 HAL_StatusTypeDef HAL_LPTIM_SetOnce_Start_IT(LPTIM_HandleTypeDef *hlptim, uint32_t Period, uint32_t Pulse);
sahilmgandhi 18:6a4db94011d3 597 HAL_StatusTypeDef HAL_LPTIM_SetOnce_Stop_IT(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 598
sahilmgandhi 18:6a4db94011d3 599 /* ############################### Encoder Mode ##############################*/
sahilmgandhi 18:6a4db94011d3 600 /* Blocking mode: Polling */
sahilmgandhi 18:6a4db94011d3 601 HAL_StatusTypeDef HAL_LPTIM_Encoder_Start(LPTIM_HandleTypeDef *hlptim, uint32_t Period);
sahilmgandhi 18:6a4db94011d3 602 HAL_StatusTypeDef HAL_LPTIM_Encoder_Stop(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 603 /* Non-Blocking mode: Interrupt */
sahilmgandhi 18:6a4db94011d3 604 HAL_StatusTypeDef HAL_LPTIM_Encoder_Start_IT(LPTIM_HandleTypeDef *hlptim, uint32_t Period);
sahilmgandhi 18:6a4db94011d3 605 HAL_StatusTypeDef HAL_LPTIM_Encoder_Stop_IT(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 606
sahilmgandhi 18:6a4db94011d3 607 /* ############################# Time out Mode ##############################*/
sahilmgandhi 18:6a4db94011d3 608 /* Blocking mode: Polling */
sahilmgandhi 18:6a4db94011d3 609 HAL_StatusTypeDef HAL_LPTIM_TimeOut_Start(LPTIM_HandleTypeDef *hlptim, uint32_t Period, uint32_t Timeout);
sahilmgandhi 18:6a4db94011d3 610 HAL_StatusTypeDef HAL_LPTIM_TimeOut_Stop(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 611 /* Non-Blocking mode: Interrupt */
sahilmgandhi 18:6a4db94011d3 612 HAL_StatusTypeDef HAL_LPTIM_TimeOut_Start_IT(LPTIM_HandleTypeDef *hlptim, uint32_t Period, uint32_t Timeout);
sahilmgandhi 18:6a4db94011d3 613 HAL_StatusTypeDef HAL_LPTIM_TimeOut_Stop_IT(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 614
sahilmgandhi 18:6a4db94011d3 615 /* ############################## Counter Mode ###############################*/
sahilmgandhi 18:6a4db94011d3 616 /* Blocking mode: Polling */
sahilmgandhi 18:6a4db94011d3 617 HAL_StatusTypeDef HAL_LPTIM_Counter_Start(LPTIM_HandleTypeDef *hlptim, uint32_t Period);
sahilmgandhi 18:6a4db94011d3 618 HAL_StatusTypeDef HAL_LPTIM_Counter_Stop(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 619 /* Non-Blocking mode: Interrupt */
sahilmgandhi 18:6a4db94011d3 620 HAL_StatusTypeDef HAL_LPTIM_Counter_Start_IT(LPTIM_HandleTypeDef *hlptim, uint32_t Period);
sahilmgandhi 18:6a4db94011d3 621 HAL_StatusTypeDef HAL_LPTIM_Counter_Stop_IT(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 622
sahilmgandhi 18:6a4db94011d3 623 /* Reading operation functions ************************************************/
sahilmgandhi 18:6a4db94011d3 624 uint32_t HAL_LPTIM_ReadCounter(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 625 uint32_t HAL_LPTIM_ReadAutoReload(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 626 uint32_t HAL_LPTIM_ReadCompare(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 627
sahilmgandhi 18:6a4db94011d3 628 /* LPTIM IRQ functions *******************************************************/
sahilmgandhi 18:6a4db94011d3 629 void HAL_LPTIM_IRQHandler(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 630
sahilmgandhi 18:6a4db94011d3 631 /* CallBack functions ********************************************************/
sahilmgandhi 18:6a4db94011d3 632 void HAL_LPTIM_CompareMatchCallback(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 633 void HAL_LPTIM_AutoReloadMatchCallback(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 634 void HAL_LPTIM_TriggerCallback(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 635 void HAL_LPTIM_CompareWriteCallback(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 636 void HAL_LPTIM_AutoReloadWriteCallback(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 637 void HAL_LPTIM_DirectionUpCallback(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 638 void HAL_LPTIM_DirectionDownCallback(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 639
sahilmgandhi 18:6a4db94011d3 640 /* Peripheral State functions ************************************************/
sahilmgandhi 18:6a4db94011d3 641 HAL_LPTIM_StateTypeDef HAL_LPTIM_GetState(LPTIM_HandleTypeDef *hlptim);
sahilmgandhi 18:6a4db94011d3 642
sahilmgandhi 18:6a4db94011d3 643 /**
sahilmgandhi 18:6a4db94011d3 644 * @}
sahilmgandhi 18:6a4db94011d3 645 */
sahilmgandhi 18:6a4db94011d3 646
sahilmgandhi 18:6a4db94011d3 647 /* Private types -------------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 648 /** @defgroup LPTIM_Private_Types LPTIM Private Types
sahilmgandhi 18:6a4db94011d3 649 * @{
sahilmgandhi 18:6a4db94011d3 650 */
sahilmgandhi 18:6a4db94011d3 651
sahilmgandhi 18:6a4db94011d3 652 /**
sahilmgandhi 18:6a4db94011d3 653 * @}
sahilmgandhi 18:6a4db94011d3 654 */
sahilmgandhi 18:6a4db94011d3 655
sahilmgandhi 18:6a4db94011d3 656 /* Private variables ---------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 657 /** @defgroup LPTIM_Private_Variables LPTIM Private Variables
sahilmgandhi 18:6a4db94011d3 658 * @{
sahilmgandhi 18:6a4db94011d3 659 */
sahilmgandhi 18:6a4db94011d3 660
sahilmgandhi 18:6a4db94011d3 661 /**
sahilmgandhi 18:6a4db94011d3 662 * @}
sahilmgandhi 18:6a4db94011d3 663 */
sahilmgandhi 18:6a4db94011d3 664
sahilmgandhi 18:6a4db94011d3 665 /* Private constants ---------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 666 /** @defgroup LPTIM_Private_Constants LPTIM Private Constants
sahilmgandhi 18:6a4db94011d3 667 * @{
sahilmgandhi 18:6a4db94011d3 668 */
sahilmgandhi 18:6a4db94011d3 669
sahilmgandhi 18:6a4db94011d3 670 /**
sahilmgandhi 18:6a4db94011d3 671 * @}
sahilmgandhi 18:6a4db94011d3 672 */
sahilmgandhi 18:6a4db94011d3 673
sahilmgandhi 18:6a4db94011d3 674 /* Private macros ------------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 675 /** @defgroup LPTIM_Private_Macros LPTIM Private Macros
sahilmgandhi 18:6a4db94011d3 676 * @{
sahilmgandhi 18:6a4db94011d3 677 */
sahilmgandhi 18:6a4db94011d3 678
sahilmgandhi 18:6a4db94011d3 679 #define IS_LPTIM_CLOCK_SOURCE(__SOURCE__) (((__SOURCE__) == LPTIM_CLOCKSOURCE_ULPTIM) || \
sahilmgandhi 18:6a4db94011d3 680 ((__SOURCE__) == LPTIM_CLOCKSOURCE_APBCLOCK_LPOSC))
sahilmgandhi 18:6a4db94011d3 681
sahilmgandhi 18:6a4db94011d3 682 #define IS_LPTIM_CLOCK_PRESCALER(__PRESCALER__) (((__PRESCALER__) == LPTIM_PRESCALER_DIV1 ) || \
sahilmgandhi 18:6a4db94011d3 683 ((__PRESCALER__) == LPTIM_PRESCALER_DIV2 ) || \
sahilmgandhi 18:6a4db94011d3 684 ((__PRESCALER__) == LPTIM_PRESCALER_DIV4 ) || \
sahilmgandhi 18:6a4db94011d3 685 ((__PRESCALER__) == LPTIM_PRESCALER_DIV8 ) || \
sahilmgandhi 18:6a4db94011d3 686 ((__PRESCALER__) == LPTIM_PRESCALER_DIV16 ) || \
sahilmgandhi 18:6a4db94011d3 687 ((__PRESCALER__) == LPTIM_PRESCALER_DIV32 ) || \
sahilmgandhi 18:6a4db94011d3 688 ((__PRESCALER__) == LPTIM_PRESCALER_DIV64 ) || \
sahilmgandhi 18:6a4db94011d3 689 ((__PRESCALER__) == LPTIM_PRESCALER_DIV128))
sahilmgandhi 18:6a4db94011d3 690 #define IS_LPTIM_CLOCK_PRESCALERDIV1(__PRESCALER__) ((__PRESCALER__) == LPTIM_PRESCALER_DIV1)
sahilmgandhi 18:6a4db94011d3 691
sahilmgandhi 18:6a4db94011d3 692 #define IS_LPTIM_OUTPUT_POLARITY(__POLARITY__) (((__POLARITY__) == LPTIM_OUTPUTPOLARITY_LOW ) || \
sahilmgandhi 18:6a4db94011d3 693 ((__POLARITY__) == LPTIM_OUTPUTPOLARITY_HIGH))
sahilmgandhi 18:6a4db94011d3 694
sahilmgandhi 18:6a4db94011d3 695 #define IS_LPTIM_CLOCK_SAMPLE_TIME(__SAMPLETIME__) (((__SAMPLETIME__) == LPTIM_CLOCKSAMPLETIME_DIRECTTRANSITION) || \
sahilmgandhi 18:6a4db94011d3 696 ((__SAMPLETIME__) == LPTIM_CLOCKSAMPLETIME_2TRANSITIONS) || \
sahilmgandhi 18:6a4db94011d3 697 ((__SAMPLETIME__) == LPTIM_CLOCKSAMPLETIME_4TRANSITIONS) || \
sahilmgandhi 18:6a4db94011d3 698 ((__SAMPLETIME__) == LPTIM_CLOCKSAMPLETIME_8TRANSITIONS))
sahilmgandhi 18:6a4db94011d3 699
sahilmgandhi 18:6a4db94011d3 700 #define IS_LPTIM_CLOCK_POLARITY(__POLARITY__) (((__POLARITY__) == LPTIM_CLOCKPOLARITY_RISING) || \
sahilmgandhi 18:6a4db94011d3 701 ((__POLARITY__) == LPTIM_CLOCKPOLARITY_FALLING) || \
sahilmgandhi 18:6a4db94011d3 702 ((__POLARITY__) == LPTIM_CLOCKPOLARITY_RISING_FALLING))
sahilmgandhi 18:6a4db94011d3 703
sahilmgandhi 18:6a4db94011d3 704 #define IS_LPTIM_TRG_SOURCE(__TRIG__) (((__TRIG__) == LPTIM_TRIGSOURCE_SOFTWARE) || \
sahilmgandhi 18:6a4db94011d3 705 ((__TRIG__) == LPTIM_TRIGSOURCE_0) || \
sahilmgandhi 18:6a4db94011d3 706 ((__TRIG__) == LPTIM_TRIGSOURCE_1) || \
sahilmgandhi 18:6a4db94011d3 707 ((__TRIG__) == LPTIM_TRIGSOURCE_2) || \
sahilmgandhi 18:6a4db94011d3 708 ((__TRIG__) == LPTIM_TRIGSOURCE_3) || \
sahilmgandhi 18:6a4db94011d3 709 ((__TRIG__) == LPTIM_TRIGSOURCE_4) || \
sahilmgandhi 18:6a4db94011d3 710 ((__TRIG__) == LPTIM_TRIGSOURCE_5))
sahilmgandhi 18:6a4db94011d3 711
sahilmgandhi 18:6a4db94011d3 712 #define IS_LPTIM_EXT_TRG_POLARITY(__POLAR__) (((__POLAR__) == LPTIM_ACTIVEEDGE_RISING ) || \
sahilmgandhi 18:6a4db94011d3 713 ((__POLAR__) == LPTIM_ACTIVEEDGE_FALLING ) || \
sahilmgandhi 18:6a4db94011d3 714 ((__POLAR__) == LPTIM_ACTIVEEDGE_RISING_FALLING ))
sahilmgandhi 18:6a4db94011d3 715
sahilmgandhi 18:6a4db94011d3 716 #define IS_LPTIM_TRIG_SAMPLE_TIME(__SAMPLETIME__) (((__SAMPLETIME__) == LPTIM_TRIGSAMPLETIME_DIRECTTRANSITION) || \
sahilmgandhi 18:6a4db94011d3 717 ((__SAMPLETIME__) == LPTIM_TRIGSAMPLETIME_2TRANSITIONS ) || \
sahilmgandhi 18:6a4db94011d3 718 ((__SAMPLETIME__) == LPTIM_TRIGSAMPLETIME_4TRANSITIONS ) || \
sahilmgandhi 18:6a4db94011d3 719 ((__SAMPLETIME__) == LPTIM_TRIGSAMPLETIME_8TRANSITIONS ))
sahilmgandhi 18:6a4db94011d3 720
sahilmgandhi 18:6a4db94011d3 721 #define IS_LPTIM_UPDATE_MODE(__MODE__) (((__MODE__) == LPTIM_UPDATE_IMMEDIATE) || \
sahilmgandhi 18:6a4db94011d3 722 ((__MODE__) == LPTIM_UPDATE_ENDOFPERIOD))
sahilmgandhi 18:6a4db94011d3 723
sahilmgandhi 18:6a4db94011d3 724 #define IS_LPTIM_COUNTER_SOURCE(__SOURCE__) (((__SOURCE__) == LPTIM_COUNTERSOURCE_INTERNAL) || \
sahilmgandhi 18:6a4db94011d3 725 ((__SOURCE__) == LPTIM_COUNTERSOURCE_EXTERNAL))
sahilmgandhi 18:6a4db94011d3 726
sahilmgandhi 18:6a4db94011d3 727 #define IS_LPTIM_AUTORELOAD(__AUTORELOAD__) ((__AUTORELOAD__) <= 0x0000FFFFU)
sahilmgandhi 18:6a4db94011d3 728
sahilmgandhi 18:6a4db94011d3 729 #define IS_LPTIM_COMPARE(__COMPARE__) ((__COMPARE__) <= 0x0000FFFFU)
sahilmgandhi 18:6a4db94011d3 730
sahilmgandhi 18:6a4db94011d3 731 #define IS_LPTIM_PERIOD(PERIOD) ((PERIOD) <= 0x0000FFFFU)
sahilmgandhi 18:6a4db94011d3 732
sahilmgandhi 18:6a4db94011d3 733 #define IS_LPTIM_PULSE(PULSE) ((PULSE) <= 0x0000FFFFU)
sahilmgandhi 18:6a4db94011d3 734
sahilmgandhi 18:6a4db94011d3 735 /**
sahilmgandhi 18:6a4db94011d3 736 * @}
sahilmgandhi 18:6a4db94011d3 737 */
sahilmgandhi 18:6a4db94011d3 738
sahilmgandhi 18:6a4db94011d3 739 /* Private functions ---------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 740 /** @defgroup LPTIM_Private_Functions LPTIM Private Functions
sahilmgandhi 18:6a4db94011d3 741 * @{
sahilmgandhi 18:6a4db94011d3 742 */
sahilmgandhi 18:6a4db94011d3 743
sahilmgandhi 18:6a4db94011d3 744 /**
sahilmgandhi 18:6a4db94011d3 745 * @}
sahilmgandhi 18:6a4db94011d3 746 */
sahilmgandhi 18:6a4db94011d3 747
sahilmgandhi 18:6a4db94011d3 748 /**
sahilmgandhi 18:6a4db94011d3 749 * @}
sahilmgandhi 18:6a4db94011d3 750 */
sahilmgandhi 18:6a4db94011d3 751
sahilmgandhi 18:6a4db94011d3 752 /**
sahilmgandhi 18:6a4db94011d3 753 * @}
sahilmgandhi 18:6a4db94011d3 754 */
sahilmgandhi 18:6a4db94011d3 755
sahilmgandhi 18:6a4db94011d3 756 #endif /* STM32F410Tx || STM32F410Cx || STM32F410Rx */
sahilmgandhi 18:6a4db94011d3 757 #ifdef __cplusplus
sahilmgandhi 18:6a4db94011d3 758 }
sahilmgandhi 18:6a4db94011d3 759 #endif
sahilmgandhi 18:6a4db94011d3 760
sahilmgandhi 18:6a4db94011d3 761 #endif /* __STM32F4xx_HAL_LPTIM_H */
sahilmgandhi 18:6a4db94011d3 762
sahilmgandhi 18:6a4db94011d3 763 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/