inport from local

Dependents:   Hobbyking_Cheetah_0511

Committer:
NYX
Date:
Mon Mar 16 06:35:48 2020 +0000
Revision:
0:85b3fd62ea1a
reinport to mbed;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
NYX 0:85b3fd62ea1a 1 /**
NYX 0:85b3fd62ea1a 2 ******************************************************************************
NYX 0:85b3fd62ea1a 3 * @file stm32f4xx_ll_lptim.h
NYX 0:85b3fd62ea1a 4 * @author MCD Application Team
NYX 0:85b3fd62ea1a 5 * @version V1.7.1
NYX 0:85b3fd62ea1a 6 * @date 14-April-2017
NYX 0:85b3fd62ea1a 7 * @brief Header file of LPTIM LL module.
NYX 0:85b3fd62ea1a 8 ******************************************************************************
NYX 0:85b3fd62ea1a 9 * @attention
NYX 0:85b3fd62ea1a 10 *
NYX 0:85b3fd62ea1a 11 * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
NYX 0:85b3fd62ea1a 12 *
NYX 0:85b3fd62ea1a 13 * Redistribution and use in source and binary forms, with or without modification,
NYX 0:85b3fd62ea1a 14 * are permitted provided that the following conditions are met:
NYX 0:85b3fd62ea1a 15 * 1. Redistributions of source code must retain the above copyright notice,
NYX 0:85b3fd62ea1a 16 * this list of conditions and the following disclaimer.
NYX 0:85b3fd62ea1a 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
NYX 0:85b3fd62ea1a 18 * this list of conditions and the following disclaimer in the documentation
NYX 0:85b3fd62ea1a 19 * and/or other materials provided with the distribution.
NYX 0:85b3fd62ea1a 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
NYX 0:85b3fd62ea1a 21 * may be used to endorse or promote products derived from this software
NYX 0:85b3fd62ea1a 22 * without specific prior written permission.
NYX 0:85b3fd62ea1a 23 *
NYX 0:85b3fd62ea1a 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
NYX 0:85b3fd62ea1a 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
NYX 0:85b3fd62ea1a 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
NYX 0:85b3fd62ea1a 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
NYX 0:85b3fd62ea1a 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
NYX 0:85b3fd62ea1a 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
NYX 0:85b3fd62ea1a 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
NYX 0:85b3fd62ea1a 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
NYX 0:85b3fd62ea1a 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
NYX 0:85b3fd62ea1a 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
NYX 0:85b3fd62ea1a 34 *
NYX 0:85b3fd62ea1a 35 ******************************************************************************
NYX 0:85b3fd62ea1a 36 */
NYX 0:85b3fd62ea1a 37
NYX 0:85b3fd62ea1a 38 /* Define to prevent recursive inclusion -------------------------------------*/
NYX 0:85b3fd62ea1a 39 #ifndef __STM32F4xx_LL_LPTIM_H
NYX 0:85b3fd62ea1a 40 #define __STM32F4xx_LL_LPTIM_H
NYX 0:85b3fd62ea1a 41
NYX 0:85b3fd62ea1a 42 #ifdef __cplusplus
NYX 0:85b3fd62ea1a 43 extern "C" {
NYX 0:85b3fd62ea1a 44 #endif
NYX 0:85b3fd62ea1a 45
NYX 0:85b3fd62ea1a 46 /* Includes ------------------------------------------------------------------*/
NYX 0:85b3fd62ea1a 47 #include "stm32f4xx.h"
NYX 0:85b3fd62ea1a 48
NYX 0:85b3fd62ea1a 49 /** @addtogroup STM32F4xx_LL_Driver
NYX 0:85b3fd62ea1a 50 * @{
NYX 0:85b3fd62ea1a 51 */
NYX 0:85b3fd62ea1a 52 #if defined (LPTIM1)
NYX 0:85b3fd62ea1a 53
NYX 0:85b3fd62ea1a 54 /** @defgroup LPTIM_LL LPTIM
NYX 0:85b3fd62ea1a 55 * @{
NYX 0:85b3fd62ea1a 56 */
NYX 0:85b3fd62ea1a 57
NYX 0:85b3fd62ea1a 58 /* Private types -------------------------------------------------------------*/
NYX 0:85b3fd62ea1a 59 /* Private variables ---------------------------------------------------------*/
NYX 0:85b3fd62ea1a 60
NYX 0:85b3fd62ea1a 61 /* Private constants ---------------------------------------------------------*/
NYX 0:85b3fd62ea1a 62
NYX 0:85b3fd62ea1a 63 /* Private macros ------------------------------------------------------------*/
NYX 0:85b3fd62ea1a 64 #if defined(USE_FULL_LL_DRIVER)
NYX 0:85b3fd62ea1a 65 /** @defgroup LPTIM_LL_Private_Macros LPTIM Private Macros
NYX 0:85b3fd62ea1a 66 * @{
NYX 0:85b3fd62ea1a 67 */
NYX 0:85b3fd62ea1a 68 /**
NYX 0:85b3fd62ea1a 69 * @}
NYX 0:85b3fd62ea1a 70 */
NYX 0:85b3fd62ea1a 71 #endif /*USE_FULL_LL_DRIVER*/
NYX 0:85b3fd62ea1a 72
NYX 0:85b3fd62ea1a 73 /* Exported types ------------------------------------------------------------*/
NYX 0:85b3fd62ea1a 74 #if defined(USE_FULL_LL_DRIVER)
NYX 0:85b3fd62ea1a 75 /** @defgroup LPTIM_LL_ES_INIT LPTIM Exported Init structure
NYX 0:85b3fd62ea1a 76 * @{
NYX 0:85b3fd62ea1a 77 */
NYX 0:85b3fd62ea1a 78
NYX 0:85b3fd62ea1a 79 /**
NYX 0:85b3fd62ea1a 80 * @brief LPTIM Init structure definition
NYX 0:85b3fd62ea1a 81 */
NYX 0:85b3fd62ea1a 82 typedef struct
NYX 0:85b3fd62ea1a 83 {
NYX 0:85b3fd62ea1a 84 uint32_t ClockSource; /*!< Specifies the source of the clock used by the LPTIM instance.
NYX 0:85b3fd62ea1a 85 This parameter can be a value of @ref LPTIM_LL_EC_CLK_SOURCE.
NYX 0:85b3fd62ea1a 86
NYX 0:85b3fd62ea1a 87 This feature can be modified afterwards using unitary function @ref LL_LPTIM_SetClockSource().*/
NYX 0:85b3fd62ea1a 88
NYX 0:85b3fd62ea1a 89 uint32_t Prescaler; /*!< Specifies the prescaler division ratio.
NYX 0:85b3fd62ea1a 90 This parameter can be a value of @ref LPTIM_LL_EC_PRESCALER.
NYX 0:85b3fd62ea1a 91
NYX 0:85b3fd62ea1a 92 This feature can be modified afterwards using using unitary function @ref LL_LPTIM_SetPrescaler().*/
NYX 0:85b3fd62ea1a 93
NYX 0:85b3fd62ea1a 94 uint32_t Waveform; /*!< Specifies the waveform shape.
NYX 0:85b3fd62ea1a 95 This parameter can be a value of @ref LPTIM_LL_EC_OUTPUT_WAVEFORM.
NYX 0:85b3fd62ea1a 96
NYX 0:85b3fd62ea1a 97 This feature can be modified afterwards using unitary function @ref LL_LPTIM_ConfigOutput().*/
NYX 0:85b3fd62ea1a 98
NYX 0:85b3fd62ea1a 99 uint32_t Polarity; /*!< Specifies waveform polarity.
NYX 0:85b3fd62ea1a 100 This parameter can be a value of @ref LPTIM_LL_EC_OUTPUT_POLARITY.
NYX 0:85b3fd62ea1a 101
NYX 0:85b3fd62ea1a 102 This feature can be modified afterwards using unitary function @ref LL_LPTIM_ConfigOutput().*/
NYX 0:85b3fd62ea1a 103 } LL_LPTIM_InitTypeDef;
NYX 0:85b3fd62ea1a 104
NYX 0:85b3fd62ea1a 105 /**
NYX 0:85b3fd62ea1a 106 * @}
NYX 0:85b3fd62ea1a 107 */
NYX 0:85b3fd62ea1a 108 #endif /* USE_FULL_LL_DRIVER */
NYX 0:85b3fd62ea1a 109
NYX 0:85b3fd62ea1a 110 /* Exported constants --------------------------------------------------------*/
NYX 0:85b3fd62ea1a 111 /** @defgroup LPTIM_LL_Exported_Constants LPTIM Exported Constants
NYX 0:85b3fd62ea1a 112 * @{
NYX 0:85b3fd62ea1a 113 */
NYX 0:85b3fd62ea1a 114
NYX 0:85b3fd62ea1a 115 /** @defgroup LPTIM_LL_EC_GET_FLAG Get Flags Defines
NYX 0:85b3fd62ea1a 116 * @brief Flags defines which can be used with LL_LPTIM_ReadReg function
NYX 0:85b3fd62ea1a 117 * @{
NYX 0:85b3fd62ea1a 118 */
NYX 0:85b3fd62ea1a 119 #define LL_LPTIM_ISR_CMPM LPTIM_ISR_CMPM /*!< Compare match */
NYX 0:85b3fd62ea1a 120 #define LL_LPTIM_ISR_ARRM LPTIM_ISR_ARRM /*!< Autoreload match */
NYX 0:85b3fd62ea1a 121 #define LL_LPTIM_ISR_EXTTRIG LPTIM_ISR_EXTTRIG /*!< External trigger edge event */
NYX 0:85b3fd62ea1a 122 #define LL_LPTIM_ISR_CMPOK LPTIM_ISR_CMPOK /*!< Compare register update OK */
NYX 0:85b3fd62ea1a 123 #define LL_LPTIM_ISR_ARROK LPTIM_ISR_ARROK /*!< Autoreload register update OK */
NYX 0:85b3fd62ea1a 124 #define LL_LPTIM_ISR_UP LPTIM_ISR_UP /*!< Counter direction change down to up */
NYX 0:85b3fd62ea1a 125 #define LL_LPTIM_ISR_DOWN LPTIM_ISR_DOWN /*!< Counter direction change up to down */
NYX 0:85b3fd62ea1a 126 /**
NYX 0:85b3fd62ea1a 127 * @}
NYX 0:85b3fd62ea1a 128 */
NYX 0:85b3fd62ea1a 129
NYX 0:85b3fd62ea1a 130 /** @defgroup LPTIM_LL_EC_IT IT Defines
NYX 0:85b3fd62ea1a 131 * @brief IT defines which can be used with LL_LPTIM_ReadReg and LL_LPTIM_WriteReg functions
NYX 0:85b3fd62ea1a 132 * @{
NYX 0:85b3fd62ea1a 133 */
NYX 0:85b3fd62ea1a 134 #define LL_LPTIM_IER_CMPMIE LPTIM_IER_CMPMIE /*!< Compare match Interrupt Enable */
NYX 0:85b3fd62ea1a 135 #define LL_LPTIM_IER_ARRMIE LPTIM_IER_ARRMIE /*!< Autoreload match Interrupt Enable */
NYX 0:85b3fd62ea1a 136 #define LL_LPTIM_IER_EXTTRIGIE LPTIM_IER_EXTTRIGIE /*!< External trigger valid edge Interrupt Enable */
NYX 0:85b3fd62ea1a 137 #define LL_LPTIM_IER_CMPOKIE LPTIM_IER_CMPOKIE /*!< Compare register update OK Interrupt Enable */
NYX 0:85b3fd62ea1a 138 #define LL_LPTIM_IER_ARROKIE LPTIM_IER_ARROKIE /*!< Autoreload register update OK Interrupt Enable */
NYX 0:85b3fd62ea1a 139 #define LL_LPTIM_IER_UPIE LPTIM_IER_UPIE /*!< Direction change to UP Interrupt Enable */
NYX 0:85b3fd62ea1a 140 #define LL_LPTIM_IER_DOWNIE LPTIM_IER_DOWNIE /*!< Direction change to down Interrupt Enable */
NYX 0:85b3fd62ea1a 141 /**
NYX 0:85b3fd62ea1a 142 * @}
NYX 0:85b3fd62ea1a 143 */
NYX 0:85b3fd62ea1a 144
NYX 0:85b3fd62ea1a 145 /** @defgroup LPTIM_LL_EC_OPERATING_MODE Operating Mode
NYX 0:85b3fd62ea1a 146 * @{
NYX 0:85b3fd62ea1a 147 */
NYX 0:85b3fd62ea1a 148 #define LL_LPTIM_OPERATING_MODE_CONTINUOUS LPTIM_CR_CNTSTRT /*!<LP Timer starts in continuous mode*/
NYX 0:85b3fd62ea1a 149 #define LL_LPTIM_OPERATING_MODE_ONESHOT LPTIM_CR_SNGSTRT /*!<LP Tilmer starts in single mode*/
NYX 0:85b3fd62ea1a 150 /**
NYX 0:85b3fd62ea1a 151 * @}
NYX 0:85b3fd62ea1a 152 */
NYX 0:85b3fd62ea1a 153
NYX 0:85b3fd62ea1a 154 /** @defgroup LPTIM_LL_EC_UPDATE_MODE Update Mode
NYX 0:85b3fd62ea1a 155 * @{
NYX 0:85b3fd62ea1a 156 */
NYX 0:85b3fd62ea1a 157 #define LL_LPTIM_UPDATE_MODE_IMMEDIATE 0x00000000U /*!<Preload is disabled: registers are updated after each APB bus write access*/
NYX 0:85b3fd62ea1a 158 #define LL_LPTIM_UPDATE_MODE_ENDOFPERIOD LPTIM_CFGR_PRELOAD /*!<preload is enabled: registers are updated at the end of the current LPTIM period*/
NYX 0:85b3fd62ea1a 159 /**
NYX 0:85b3fd62ea1a 160 * @}
NYX 0:85b3fd62ea1a 161 */
NYX 0:85b3fd62ea1a 162
NYX 0:85b3fd62ea1a 163 /** @defgroup LPTIM_LL_EC_COUNTER_MODE Counter Mode
NYX 0:85b3fd62ea1a 164 * @{
NYX 0:85b3fd62ea1a 165 */
NYX 0:85b3fd62ea1a 166 #define LL_LPTIM_COUNTER_MODE_INTERNAL 0x00000000U /*!<The counter is incremented following each internal clock pulse*/
NYX 0:85b3fd62ea1a 167 #define LL_LPTIM_COUNTER_MODE_EXTERNAL LPTIM_CFGR_COUNTMODE /*!<The counter is incremented following each valid clock pulse on the LPTIM external Input1*/
NYX 0:85b3fd62ea1a 168 /**
NYX 0:85b3fd62ea1a 169 * @}
NYX 0:85b3fd62ea1a 170 */
NYX 0:85b3fd62ea1a 171
NYX 0:85b3fd62ea1a 172 /** @defgroup LPTIM_LL_EC_OUTPUT_WAVEFORM Output Waveform Type
NYX 0:85b3fd62ea1a 173 * @{
NYX 0:85b3fd62ea1a 174 */
NYX 0:85b3fd62ea1a 175 #define LL_LPTIM_OUTPUT_WAVEFORM_PWM 0x00000000U /*!<LPTIM generates either a PWM waveform or a One pulse waveform depending on chosen operating mode CONTINOUS or SINGLE*/
NYX 0:85b3fd62ea1a 176 #define LL_LPTIM_OUTPUT_WAVEFORM_SETONCE LPTIM_CFGR_WAVE /*!<LPTIM generates a Set Once waveform*/
NYX 0:85b3fd62ea1a 177 /**
NYX 0:85b3fd62ea1a 178 * @}
NYX 0:85b3fd62ea1a 179 */
NYX 0:85b3fd62ea1a 180
NYX 0:85b3fd62ea1a 181 /** @defgroup LPTIM_LL_EC_OUTPUT_POLARITY Output Polarity
NYX 0:85b3fd62ea1a 182 * @{
NYX 0:85b3fd62ea1a 183 */
NYX 0:85b3fd62ea1a 184 #define LL_LPTIM_OUTPUT_POLARITY_REGULAR 0x00000000U /*!<The LPTIM output reflects the compare results between LPTIMx_ARR and LPTIMx_CMP registers*/
NYX 0:85b3fd62ea1a 185 #define LL_LPTIM_OUTPUT_POLARITY_INVERSE LPTIM_CFGR_WAVPOL /*!<The LPTIM output reflects the inverse of the compare results between LPTIMx_ARR and LPTIMx_CMP registers*/
NYX 0:85b3fd62ea1a 186 /**
NYX 0:85b3fd62ea1a 187 * @}
NYX 0:85b3fd62ea1a 188 */
NYX 0:85b3fd62ea1a 189
NYX 0:85b3fd62ea1a 190 /** @defgroup LPTIM_LL_EC_PRESCALER Prescaler Value
NYX 0:85b3fd62ea1a 191 * @{
NYX 0:85b3fd62ea1a 192 */
NYX 0:85b3fd62ea1a 193 #define LL_LPTIM_PRESCALER_DIV1 0x00000000U /*!<Prescaler division factor is set to 1*/
NYX 0:85b3fd62ea1a 194 #define LL_LPTIM_PRESCALER_DIV2 LPTIM_CFGR_PRESC_0 /*!<Prescaler division factor is set to 2*/
NYX 0:85b3fd62ea1a 195 #define LL_LPTIM_PRESCALER_DIV4 LPTIM_CFGR_PRESC_1 /*!<Prescaler division factor is set to 4*/
NYX 0:85b3fd62ea1a 196 #define LL_LPTIM_PRESCALER_DIV8 (LPTIM_CFGR_PRESC_1 | LPTIM_CFGR_PRESC_0) /*!<Prescaler division factor is set to 8*/
NYX 0:85b3fd62ea1a 197 #define LL_LPTIM_PRESCALER_DIV16 LPTIM_CFGR_PRESC_2 /*!<Prescaler division factor is set to 16*/
NYX 0:85b3fd62ea1a 198 #define LL_LPTIM_PRESCALER_DIV32 (LPTIM_CFGR_PRESC_2 | LPTIM_CFGR_PRESC_0) /*!<Prescaler division factor is set to 32*/
NYX 0:85b3fd62ea1a 199 #define LL_LPTIM_PRESCALER_DIV64 (LPTIM_CFGR_PRESC_2 | LPTIM_CFGR_PRESC_1) /*!<Prescaler division factor is set to 64*/
NYX 0:85b3fd62ea1a 200 #define LL_LPTIM_PRESCALER_DIV128 LPTIM_CFGR_PRESC /*!<Prescaler division factor is set to 128*/
NYX 0:85b3fd62ea1a 201 /**
NYX 0:85b3fd62ea1a 202 * @}
NYX 0:85b3fd62ea1a 203 */
NYX 0:85b3fd62ea1a 204
NYX 0:85b3fd62ea1a 205 /** @defgroup LPTIM_LL_EC_TRIG_SOURCE Trigger Source
NYX 0:85b3fd62ea1a 206 * @{
NYX 0:85b3fd62ea1a 207 */
NYX 0:85b3fd62ea1a 208 #define LL_LPTIM_TRIG_SOURCE_GPIO 0x00000000U /*!<External input trigger is connected to TIMx_ETR input*/
NYX 0:85b3fd62ea1a 209 #define LL_LPTIM_TRIG_SOURCE_RTCALARMA LPTIM_CFGR_TRIGSEL_0 /*!<External input trigger is connected to RTC Alarm A*/
NYX 0:85b3fd62ea1a 210 #define LL_LPTIM_TRIG_SOURCE_RTCALARMB LPTIM_CFGR_TRIGSEL_1 /*!<External input trigger is connected to RTC Alarm B*/
NYX 0:85b3fd62ea1a 211 #define LL_LPTIM_TRIG_SOURCE_RTCTAMP1 (LPTIM_CFGR_TRIGSEL_1 | LPTIM_CFGR_TRIGSEL_0) /*!<External input trigger is connected to RTC Tamper 1*/
NYX 0:85b3fd62ea1a 212 #define LL_LPTIM_TRIG_SOURCE_TIM1_TRGO LPTIM_CFGR_TRIGSEL_2 /*!<External input trigger is connected to TIM1*/
NYX 0:85b3fd62ea1a 213 #define LL_LPTIM_TRIG_SOURCE_TIM5_TRGO (LPTIM_CFGR_TRIGSEL_2 | LPTIM_CFGR_TRIGSEL_0) /*!<External input trigger is connected to TIM5*/
NYX 0:85b3fd62ea1a 214 /**
NYX 0:85b3fd62ea1a 215 * @}
NYX 0:85b3fd62ea1a 216 */
NYX 0:85b3fd62ea1a 217
NYX 0:85b3fd62ea1a 218 /** @defgroup LPTIM_LL_EC_TRIG_FILTER Trigger Filter
NYX 0:85b3fd62ea1a 219 * @{
NYX 0:85b3fd62ea1a 220 */
NYX 0:85b3fd62ea1a 221 #define LL_LPTIM_TRIG_FILTER_NONE 0x00000000U /*!<Any trigger active level change is considered as a valid trigger*/
NYX 0:85b3fd62ea1a 222 #define LL_LPTIM_TRIG_FILTER_2 LPTIM_CFGR_TRGFLT_0 /*!<Trigger active level change must be stable for at least 2 clock periods before it is considered as valid trigger*/
NYX 0:85b3fd62ea1a 223 #define LL_LPTIM_TRIG_FILTER_4 LPTIM_CFGR_TRGFLT_1 /*!<Trigger active level change must be stable for at least 4 clock periods before it is considered as valid trigger*/
NYX 0:85b3fd62ea1a 224 #define LL_LPTIM_TRIG_FILTER_8 LPTIM_CFGR_TRGFLT /*!<Trigger active level change must be stable for at least 8 clock periods before it is considered as valid trigger*/
NYX 0:85b3fd62ea1a 225 /**
NYX 0:85b3fd62ea1a 226 * @}
NYX 0:85b3fd62ea1a 227 */
NYX 0:85b3fd62ea1a 228
NYX 0:85b3fd62ea1a 229 /** @defgroup LPTIM_LL_EC_TRIG_POLARITY Trigger Polarity
NYX 0:85b3fd62ea1a 230 * @{
NYX 0:85b3fd62ea1a 231 */
NYX 0:85b3fd62ea1a 232 #define LL_LPTIM_TRIG_POLARITY_RISING LPTIM_CFGR_TRIGEN_0 /*!<LPTIM counter starts when a rising edge is detected*/
NYX 0:85b3fd62ea1a 233 #define LL_LPTIM_TRIG_POLARITY_FALLING LPTIM_CFGR_TRIGEN_1 /*!<LPTIM counter starts when a falling edge is detected*/
NYX 0:85b3fd62ea1a 234 #define LL_LPTIM_TRIG_POLARITY_RISING_FALLING LPTIM_CFGR_TRIGEN /*!<LPTIM counter starts when a rising or a falling edge is detected*/
NYX 0:85b3fd62ea1a 235 /**
NYX 0:85b3fd62ea1a 236 * @}
NYX 0:85b3fd62ea1a 237 */
NYX 0:85b3fd62ea1a 238
NYX 0:85b3fd62ea1a 239 /** @defgroup LPTIM_LL_EC_CLK_SOURCE Clock Source
NYX 0:85b3fd62ea1a 240 * @{
NYX 0:85b3fd62ea1a 241 */
NYX 0:85b3fd62ea1a 242 #define LL_LPTIM_CLK_SOURCE_INTERNAL 0x00000000U /*!<LPTIM is clocked by internal clock source (APB clock or any of the embedded oscillators)*/
NYX 0:85b3fd62ea1a 243 #define LL_LPTIM_CLK_SOURCE_EXTERNAL LPTIM_CFGR_CKSEL /*!<LPTIM is clocked by an external clock source through the LPTIM external Input1*/
NYX 0:85b3fd62ea1a 244 /**
NYX 0:85b3fd62ea1a 245 * @}
NYX 0:85b3fd62ea1a 246 */
NYX 0:85b3fd62ea1a 247
NYX 0:85b3fd62ea1a 248 /** @defgroup LPTIM_LL_EC_CLK_FILTER Clock Filter
NYX 0:85b3fd62ea1a 249 * @{
NYX 0:85b3fd62ea1a 250 */
NYX 0:85b3fd62ea1a 251 #define LL_LPTIM_CLK_FILTER_NONE 0x00000000U /*!<Any external clock signal level change is considered as a valid transition*/
NYX 0:85b3fd62ea1a 252 #define LL_LPTIM_CLK_FILTER_2 LPTIM_CFGR_CKFLT_0 /*!<External clock signal level change must be stable for at least 2 clock periods before it is considered as valid transition*/
NYX 0:85b3fd62ea1a 253 #define LL_LPTIM_CLK_FILTER_4 LPTIM_CFGR_CKFLT_1 /*!<External clock signal level change must be stable for at least 4 clock periods before it is considered as valid transition*/
NYX 0:85b3fd62ea1a 254 #define LL_LPTIM_CLK_FILTER_8 LPTIM_CFGR_CKFLT /*!<External clock signal level change must be stable for at least 8 clock periods before it is considered as valid transition*/
NYX 0:85b3fd62ea1a 255 /**
NYX 0:85b3fd62ea1a 256 * @}
NYX 0:85b3fd62ea1a 257 */
NYX 0:85b3fd62ea1a 258
NYX 0:85b3fd62ea1a 259 /** @defgroup LPTIM_LL_EC_CLK_POLARITY Clock Polarity
NYX 0:85b3fd62ea1a 260 * @{
NYX 0:85b3fd62ea1a 261 */
NYX 0:85b3fd62ea1a 262 #define LL_LPTIM_CLK_POLARITY_RISING 0x00000000U /*!< The rising edge is the active edge used for counting*/
NYX 0:85b3fd62ea1a 263 #define LL_LPTIM_CLK_POLARITY_FALLING LPTIM_CFGR_CKPOL_0 /*!< The falling edge is the active edge used for counting*/
NYX 0:85b3fd62ea1a 264 #define LL_LPTIM_CLK_POLARITY_RISING_FALLING LPTIM_CFGR_CKPOL_1 /*!< Both edges are active edges*/
NYX 0:85b3fd62ea1a 265 /**
NYX 0:85b3fd62ea1a 266 * @}
NYX 0:85b3fd62ea1a 267 */
NYX 0:85b3fd62ea1a 268
NYX 0:85b3fd62ea1a 269 /** @defgroup LPTIM_LL_EC_ENCODER_MODE Encoder Mode
NYX 0:85b3fd62ea1a 270 * @{
NYX 0:85b3fd62ea1a 271 */
NYX 0:85b3fd62ea1a 272 #define LL_LPTIM_ENCODER_MODE_RISING 0x00000000U /*!< The rising edge is the active edge used for counting*/
NYX 0:85b3fd62ea1a 273 #define LL_LPTIM_ENCODER_MODE_FALLING LPTIM_CFGR_CKPOL_0 /*!< The falling edge is the active edge used for counting*/
NYX 0:85b3fd62ea1a 274 #define LL_LPTIM_ENCODER_MODE_RISING_FALLING LPTIM_CFGR_CKPOL_1 /*!< Both edges are active edges*/
NYX 0:85b3fd62ea1a 275 /**
NYX 0:85b3fd62ea1a 276 * @}
NYX 0:85b3fd62ea1a 277 */
NYX 0:85b3fd62ea1a 278
NYX 0:85b3fd62ea1a 279
NYX 0:85b3fd62ea1a 280 /**
NYX 0:85b3fd62ea1a 281 * @}
NYX 0:85b3fd62ea1a 282 */
NYX 0:85b3fd62ea1a 283
NYX 0:85b3fd62ea1a 284 /* Exported macro ------------------------------------------------------------*/
NYX 0:85b3fd62ea1a 285 /** @defgroup LPTIM_LL_Exported_Macros LPTIM Exported Macros
NYX 0:85b3fd62ea1a 286 * @{
NYX 0:85b3fd62ea1a 287 */
NYX 0:85b3fd62ea1a 288
NYX 0:85b3fd62ea1a 289 /** @defgroup LPTIM_LL_EM_WRITE_READ Common Write and read registers Macros
NYX 0:85b3fd62ea1a 290 * @{
NYX 0:85b3fd62ea1a 291 */
NYX 0:85b3fd62ea1a 292
NYX 0:85b3fd62ea1a 293 /**
NYX 0:85b3fd62ea1a 294 * @brief Write a value in LPTIM register
NYX 0:85b3fd62ea1a 295 * @param __INSTANCE__ LPTIM Instance
NYX 0:85b3fd62ea1a 296 * @param __REG__ Register to be written
NYX 0:85b3fd62ea1a 297 * @param __VALUE__ Value to be written in the register
NYX 0:85b3fd62ea1a 298 * @retval None
NYX 0:85b3fd62ea1a 299 */
NYX 0:85b3fd62ea1a 300 #define LL_LPTIM_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
NYX 0:85b3fd62ea1a 301
NYX 0:85b3fd62ea1a 302 /**
NYX 0:85b3fd62ea1a 303 * @brief Read a value in LPTIM register
NYX 0:85b3fd62ea1a 304 * @param __INSTANCE__ LPTIM Instance
NYX 0:85b3fd62ea1a 305 * @param __REG__ Register to be read
NYX 0:85b3fd62ea1a 306 * @retval Register value
NYX 0:85b3fd62ea1a 307 */
NYX 0:85b3fd62ea1a 308 #define LL_LPTIM_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
NYX 0:85b3fd62ea1a 309 /**
NYX 0:85b3fd62ea1a 310 * @}
NYX 0:85b3fd62ea1a 311 */
NYX 0:85b3fd62ea1a 312
NYX 0:85b3fd62ea1a 313 /**
NYX 0:85b3fd62ea1a 314 * @}
NYX 0:85b3fd62ea1a 315 */
NYX 0:85b3fd62ea1a 316
NYX 0:85b3fd62ea1a 317
NYX 0:85b3fd62ea1a 318 /* Exported functions --------------------------------------------------------*/
NYX 0:85b3fd62ea1a 319 /** @defgroup LPTIM_LL_Exported_Functions LPTIM Exported Functions
NYX 0:85b3fd62ea1a 320 * @{
NYX 0:85b3fd62ea1a 321 */
NYX 0:85b3fd62ea1a 322
NYX 0:85b3fd62ea1a 323 /** @defgroup LPTIM_LL_EF_LPTIM_Configuration LPTIM Configuration
NYX 0:85b3fd62ea1a 324 * @{
NYX 0:85b3fd62ea1a 325 */
NYX 0:85b3fd62ea1a 326
NYX 0:85b3fd62ea1a 327 /**
NYX 0:85b3fd62ea1a 328 * @brief Enable the LPTIM instance
NYX 0:85b3fd62ea1a 329 * @note After setting the ENABLE bit, a delay of two counter clock is needed
NYX 0:85b3fd62ea1a 330 * before the LPTIM instance is actually enabled.
NYX 0:85b3fd62ea1a 331 * @rmtoll CR ENABLE LL_LPTIM_Enable
NYX 0:85b3fd62ea1a 332 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 333 * @retval None
NYX 0:85b3fd62ea1a 334 */
NYX 0:85b3fd62ea1a 335 __STATIC_INLINE void LL_LPTIM_Enable(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 336 {
NYX 0:85b3fd62ea1a 337 SET_BIT(LPTIMx->CR, LPTIM_CR_ENABLE);
NYX 0:85b3fd62ea1a 338 }
NYX 0:85b3fd62ea1a 339
NYX 0:85b3fd62ea1a 340 /**
NYX 0:85b3fd62ea1a 341 * @brief Disable the LPTIM instance
NYX 0:85b3fd62ea1a 342 * @rmtoll CR ENABLE LL_LPTIM_Disable
NYX 0:85b3fd62ea1a 343 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 344 * @retval None
NYX 0:85b3fd62ea1a 345 */
NYX 0:85b3fd62ea1a 346 __STATIC_INLINE void LL_LPTIM_Disable(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 347 {
NYX 0:85b3fd62ea1a 348 CLEAR_BIT(LPTIMx->CR, LPTIM_CR_ENABLE);
NYX 0:85b3fd62ea1a 349 }
NYX 0:85b3fd62ea1a 350
NYX 0:85b3fd62ea1a 351 /**
NYX 0:85b3fd62ea1a 352 * @brief Indicates whether the LPTIM instance is enabled.
NYX 0:85b3fd62ea1a 353 * @rmtoll CR ENABLE LL_LPTIM_IsEnabled
NYX 0:85b3fd62ea1a 354 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 355 * @retval State of bit (1 or 0).
NYX 0:85b3fd62ea1a 356 */
NYX 0:85b3fd62ea1a 357 __STATIC_INLINE uint32_t LL_LPTIM_IsEnabled(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 358 {
NYX 0:85b3fd62ea1a 359 return (READ_BIT(LPTIMx->CR, LPTIM_CR_ENABLE) == (LPTIM_CR_ENABLE));
NYX 0:85b3fd62ea1a 360 }
NYX 0:85b3fd62ea1a 361
NYX 0:85b3fd62ea1a 362 /**
NYX 0:85b3fd62ea1a 363 * @brief Starts the LPTIM counter in the desired mode.
NYX 0:85b3fd62ea1a 364 * @note LPTIM instance must be enabled before starting the counter.
NYX 0:85b3fd62ea1a 365 * @note It is possible to change on the fly from One Shot mode to
NYX 0:85b3fd62ea1a 366 * Continuous mode.
NYX 0:85b3fd62ea1a 367 * @rmtoll CR CNTSTRT LL_LPTIM_StartCounter\n
NYX 0:85b3fd62ea1a 368 * CR SNGSTRT LL_LPTIM_StartCounter
NYX 0:85b3fd62ea1a 369 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 370 * @param OperatingMode This parameter can be one of the following values:
NYX 0:85b3fd62ea1a 371 * @arg @ref LL_LPTIM_OPERATING_MODE_CONTINUOUS
NYX 0:85b3fd62ea1a 372 * @arg @ref LL_LPTIM_OPERATING_MODE_ONESHOT
NYX 0:85b3fd62ea1a 373 * @retval None
NYX 0:85b3fd62ea1a 374 */
NYX 0:85b3fd62ea1a 375 __STATIC_INLINE void LL_LPTIM_StartCounter(LPTIM_TypeDef *LPTIMx, uint32_t OperatingMode)
NYX 0:85b3fd62ea1a 376 {
NYX 0:85b3fd62ea1a 377 MODIFY_REG(LPTIMx->CR, LPTIM_CR_CNTSTRT | LPTIM_CR_SNGSTRT, OperatingMode);
NYX 0:85b3fd62ea1a 378 }
NYX 0:85b3fd62ea1a 379
NYX 0:85b3fd62ea1a 380
NYX 0:85b3fd62ea1a 381 /**
NYX 0:85b3fd62ea1a 382 * @brief Set the LPTIM registers update mode (enable/disable register preload)
NYX 0:85b3fd62ea1a 383 * @note This function must be called when the LPTIM instance is disabled.
NYX 0:85b3fd62ea1a 384 * @rmtoll CFGR PRELOAD LL_LPTIM_SetUpdateMode
NYX 0:85b3fd62ea1a 385 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 386 * @param UpdateMode This parameter can be one of the following values:
NYX 0:85b3fd62ea1a 387 * @arg @ref LL_LPTIM_UPDATE_MODE_IMMEDIATE
NYX 0:85b3fd62ea1a 388 * @arg @ref LL_LPTIM_UPDATE_MODE_ENDOFPERIOD
NYX 0:85b3fd62ea1a 389 * @retval None
NYX 0:85b3fd62ea1a 390 */
NYX 0:85b3fd62ea1a 391 __STATIC_INLINE void LL_LPTIM_SetUpdateMode(LPTIM_TypeDef *LPTIMx, uint32_t UpdateMode)
NYX 0:85b3fd62ea1a 392 {
NYX 0:85b3fd62ea1a 393 MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_PRELOAD, UpdateMode);
NYX 0:85b3fd62ea1a 394 }
NYX 0:85b3fd62ea1a 395
NYX 0:85b3fd62ea1a 396 /**
NYX 0:85b3fd62ea1a 397 * @brief Get the LPTIM registers update mode
NYX 0:85b3fd62ea1a 398 * @rmtoll CFGR PRELOAD LL_LPTIM_GetUpdateMode
NYX 0:85b3fd62ea1a 399 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 400 * @retval Returned value can be one of the following values:
NYX 0:85b3fd62ea1a 401 * @arg @ref LL_LPTIM_UPDATE_MODE_IMMEDIATE
NYX 0:85b3fd62ea1a 402 * @arg @ref LL_LPTIM_UPDATE_MODE_ENDOFPERIOD
NYX 0:85b3fd62ea1a 403 */
NYX 0:85b3fd62ea1a 404 __STATIC_INLINE uint32_t LL_LPTIM_GetUpdateMode(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 405 {
NYX 0:85b3fd62ea1a 406 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_PRELOAD));
NYX 0:85b3fd62ea1a 407 }
NYX 0:85b3fd62ea1a 408
NYX 0:85b3fd62ea1a 409 /**
NYX 0:85b3fd62ea1a 410 * @brief Set the auto reload value
NYX 0:85b3fd62ea1a 411 * @note The LPTIMx_ARR register content must only be modified when the LPTIM is enabled
NYX 0:85b3fd62ea1a 412 * @note After a write to the LPTIMx_ARR register a new write operation to the
NYX 0:85b3fd62ea1a 413 * same register can only be performed when the previous write operation
NYX 0:85b3fd62ea1a 414 * is completed. Any successive write before the ARROK flag be set, will
NYX 0:85b3fd62ea1a 415 * lead to unpredictable results.
NYX 0:85b3fd62ea1a 416 * @note autoreload value be strictly greater than the compare value.
NYX 0:85b3fd62ea1a 417 * @rmtoll ARR ARR LL_LPTIM_SetAutoReload
NYX 0:85b3fd62ea1a 418 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 419 * @param AutoReload Value between Min_Data=0x00 and Max_Data=0xFFFF
NYX 0:85b3fd62ea1a 420 * @retval None
NYX 0:85b3fd62ea1a 421 */
NYX 0:85b3fd62ea1a 422 __STATIC_INLINE void LL_LPTIM_SetAutoReload(LPTIM_TypeDef *LPTIMx, uint32_t AutoReload)
NYX 0:85b3fd62ea1a 423 {
NYX 0:85b3fd62ea1a 424 MODIFY_REG(LPTIMx->ARR, LPTIM_ARR_ARR, AutoReload);
NYX 0:85b3fd62ea1a 425 }
NYX 0:85b3fd62ea1a 426
NYX 0:85b3fd62ea1a 427 /**
NYX 0:85b3fd62ea1a 428 * @brief Get actual auto reload value
NYX 0:85b3fd62ea1a 429 * @rmtoll ARR ARR LL_LPTIM_GetAutoReload
NYX 0:85b3fd62ea1a 430 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 431 * @retval AutoReload Value between Min_Data=0x00 and Max_Data=0xFFFF
NYX 0:85b3fd62ea1a 432 */
NYX 0:85b3fd62ea1a 433 __STATIC_INLINE uint32_t LL_LPTIM_GetAutoReload(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 434 {
NYX 0:85b3fd62ea1a 435 return (uint32_t)(READ_BIT(LPTIMx->ARR, LPTIM_ARR_ARR));
NYX 0:85b3fd62ea1a 436 }
NYX 0:85b3fd62ea1a 437
NYX 0:85b3fd62ea1a 438 /**
NYX 0:85b3fd62ea1a 439 * @brief Set the compare value
NYX 0:85b3fd62ea1a 440 * @note After a write to the LPTIMx_CMP register a new write operation to the
NYX 0:85b3fd62ea1a 441 * same register can only be performed when the previous write operation
NYX 0:85b3fd62ea1a 442 * is completed. Any successive write before the CMPOK flag be set, will
NYX 0:85b3fd62ea1a 443 * lead to unpredictable results.
NYX 0:85b3fd62ea1a 444 * @rmtoll CMP CMP LL_LPTIM_SetCompare
NYX 0:85b3fd62ea1a 445 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 446 * @param CompareValue Value between Min_Data=0x00 and Max_Data=0xFFFF
NYX 0:85b3fd62ea1a 447 * @retval None
NYX 0:85b3fd62ea1a 448 */
NYX 0:85b3fd62ea1a 449 __STATIC_INLINE void LL_LPTIM_SetCompare(LPTIM_TypeDef *LPTIMx, uint32_t CompareValue)
NYX 0:85b3fd62ea1a 450 {
NYX 0:85b3fd62ea1a 451 MODIFY_REG(LPTIMx->CMP, LPTIM_CMP_CMP, CompareValue);
NYX 0:85b3fd62ea1a 452 }
NYX 0:85b3fd62ea1a 453
NYX 0:85b3fd62ea1a 454 /**
NYX 0:85b3fd62ea1a 455 * @brief Get actual compare value
NYX 0:85b3fd62ea1a 456 * @rmtoll CMP CMP LL_LPTIM_GetCompare
NYX 0:85b3fd62ea1a 457 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 458 * @retval CompareValue Value between Min_Data=0x00 and Max_Data=0xFFFF
NYX 0:85b3fd62ea1a 459 */
NYX 0:85b3fd62ea1a 460 __STATIC_INLINE uint32_t LL_LPTIM_GetCompare(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 461 {
NYX 0:85b3fd62ea1a 462 return (uint32_t)(READ_BIT(LPTIMx->CMP, LPTIM_CMP_CMP));
NYX 0:85b3fd62ea1a 463 }
NYX 0:85b3fd62ea1a 464
NYX 0:85b3fd62ea1a 465 /**
NYX 0:85b3fd62ea1a 466 * @brief Get actual counter value
NYX 0:85b3fd62ea1a 467 * @note When the LPTIM instance is running with an asynchronous clock, reading
NYX 0:85b3fd62ea1a 468 * the LPTIMx_CNT register may return unreliable values. So in this case
NYX 0:85b3fd62ea1a 469 * it is necessary to perform two consecutive read accesses and verify
NYX 0:85b3fd62ea1a 470 * that the two returned values are identical.
NYX 0:85b3fd62ea1a 471 * @rmtoll CNT CNT LL_LPTIM_GetCounter
NYX 0:85b3fd62ea1a 472 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 473 * @retval Counter value
NYX 0:85b3fd62ea1a 474 */
NYX 0:85b3fd62ea1a 475 __STATIC_INLINE uint32_t LL_LPTIM_GetCounter(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 476 {
NYX 0:85b3fd62ea1a 477 return (uint32_t)(READ_BIT(LPTIMx->CNT, LPTIM_CNT_CNT));
NYX 0:85b3fd62ea1a 478 }
NYX 0:85b3fd62ea1a 479
NYX 0:85b3fd62ea1a 480 /**
NYX 0:85b3fd62ea1a 481 * @brief Set the counter mode (selection of the LPTIM counter clock source).
NYX 0:85b3fd62ea1a 482 * @note The counter mode can be set only when the LPTIM instance is disabled.
NYX 0:85b3fd62ea1a 483 * @rmtoll CFGR COUNTMODE LL_LPTIM_SetCounterMode
NYX 0:85b3fd62ea1a 484 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 485 * @param CounterMode This parameter can be one of the following values:
NYX 0:85b3fd62ea1a 486 * @arg @ref LL_LPTIM_COUNTER_MODE_INTERNAL
NYX 0:85b3fd62ea1a 487 * @arg @ref LL_LPTIM_COUNTER_MODE_EXTERNAL
NYX 0:85b3fd62ea1a 488 * @retval None
NYX 0:85b3fd62ea1a 489 */
NYX 0:85b3fd62ea1a 490 __STATIC_INLINE void LL_LPTIM_SetCounterMode(LPTIM_TypeDef *LPTIMx, uint32_t CounterMode)
NYX 0:85b3fd62ea1a 491 {
NYX 0:85b3fd62ea1a 492 MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_COUNTMODE, CounterMode);
NYX 0:85b3fd62ea1a 493 }
NYX 0:85b3fd62ea1a 494
NYX 0:85b3fd62ea1a 495 /**
NYX 0:85b3fd62ea1a 496 * @brief Get the counter mode
NYX 0:85b3fd62ea1a 497 * @rmtoll CFGR COUNTMODE LL_LPTIM_GetCounterMode
NYX 0:85b3fd62ea1a 498 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 499 * @retval Returned value can be one of the following values:
NYX 0:85b3fd62ea1a 500 * @arg @ref LL_LPTIM_COUNTER_MODE_INTERNAL
NYX 0:85b3fd62ea1a 501 * @arg @ref LL_LPTIM_COUNTER_MODE_EXTERNAL
NYX 0:85b3fd62ea1a 502 */
NYX 0:85b3fd62ea1a 503 __STATIC_INLINE uint32_t LL_LPTIM_GetCounterMode(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 504 {
NYX 0:85b3fd62ea1a 505 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_COUNTMODE));
NYX 0:85b3fd62ea1a 506 }
NYX 0:85b3fd62ea1a 507
NYX 0:85b3fd62ea1a 508 /**
NYX 0:85b3fd62ea1a 509 * @brief Configure the LPTIM instance output (LPTIMx_OUT)
NYX 0:85b3fd62ea1a 510 * @note This function must be called when the LPTIM instance is disabled.
NYX 0:85b3fd62ea1a 511 * @note Regarding the LPTIM output polarity the change takes effect
NYX 0:85b3fd62ea1a 512 * immediately, so the output default value will change immediately after
NYX 0:85b3fd62ea1a 513 * the polarity is re-configured, even before the timer is enabled.
NYX 0:85b3fd62ea1a 514 * @rmtoll CFGR WAVE LL_LPTIM_ConfigOutput\n
NYX 0:85b3fd62ea1a 515 * CFGR WAVPOL LL_LPTIM_ConfigOutput
NYX 0:85b3fd62ea1a 516 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 517 * @param Waveform This parameter can be one of the following values:
NYX 0:85b3fd62ea1a 518 * @arg @ref LL_LPTIM_OUTPUT_WAVEFORM_PWM
NYX 0:85b3fd62ea1a 519 * @arg @ref LL_LPTIM_OUTPUT_WAVEFORM_SETONCE
NYX 0:85b3fd62ea1a 520 * @param Polarity This parameter can be one of the following values:
NYX 0:85b3fd62ea1a 521 * @arg @ref LL_LPTIM_OUTPUT_POLARITY_REGULAR
NYX 0:85b3fd62ea1a 522 * @arg @ref LL_LPTIM_OUTPUT_POLARITY_INVERSE
NYX 0:85b3fd62ea1a 523 * @retval None
NYX 0:85b3fd62ea1a 524 */
NYX 0:85b3fd62ea1a 525 __STATIC_INLINE void LL_LPTIM_ConfigOutput(LPTIM_TypeDef *LPTIMx, uint32_t Waveform, uint32_t Polarity)
NYX 0:85b3fd62ea1a 526 {
NYX 0:85b3fd62ea1a 527 MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_WAVE | LPTIM_CFGR_WAVPOL, Waveform | Polarity);
NYX 0:85b3fd62ea1a 528 }
NYX 0:85b3fd62ea1a 529
NYX 0:85b3fd62ea1a 530 /**
NYX 0:85b3fd62ea1a 531 * @brief Set waveform shape
NYX 0:85b3fd62ea1a 532 * @rmtoll CFGR WAVE LL_LPTIM_SetWaveform
NYX 0:85b3fd62ea1a 533 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 534 * @param Waveform This parameter can be one of the following values:
NYX 0:85b3fd62ea1a 535 * @arg @ref LL_LPTIM_OUTPUT_WAVEFORM_PWM
NYX 0:85b3fd62ea1a 536 * @arg @ref LL_LPTIM_OUTPUT_WAVEFORM_SETONCE
NYX 0:85b3fd62ea1a 537 * @retval None
NYX 0:85b3fd62ea1a 538 */
NYX 0:85b3fd62ea1a 539 __STATIC_INLINE void LL_LPTIM_SetWaveform(LPTIM_TypeDef *LPTIMx, uint32_t Waveform)
NYX 0:85b3fd62ea1a 540 {
NYX 0:85b3fd62ea1a 541 MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_WAVE, Waveform);
NYX 0:85b3fd62ea1a 542 }
NYX 0:85b3fd62ea1a 543
NYX 0:85b3fd62ea1a 544 /**
NYX 0:85b3fd62ea1a 545 * @brief Get actual waveform shape
NYX 0:85b3fd62ea1a 546 * @rmtoll CFGR WAVE LL_LPTIM_GetWaveform
NYX 0:85b3fd62ea1a 547 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 548 * @retval Returned value can be one of the following values:
NYX 0:85b3fd62ea1a 549 * @arg @ref LL_LPTIM_OUTPUT_WAVEFORM_PWM
NYX 0:85b3fd62ea1a 550 * @arg @ref LL_LPTIM_OUTPUT_WAVEFORM_SETONCE
NYX 0:85b3fd62ea1a 551 */
NYX 0:85b3fd62ea1a 552 __STATIC_INLINE uint32_t LL_LPTIM_GetWaveform(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 553 {
NYX 0:85b3fd62ea1a 554 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_WAVE));
NYX 0:85b3fd62ea1a 555 }
NYX 0:85b3fd62ea1a 556
NYX 0:85b3fd62ea1a 557 /**
NYX 0:85b3fd62ea1a 558 * @brief Set output polarity
NYX 0:85b3fd62ea1a 559 * @rmtoll CFGR WAVPOL LL_LPTIM_SetPolarity
NYX 0:85b3fd62ea1a 560 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 561 * @param Polarity This parameter can be one of the following values:
NYX 0:85b3fd62ea1a 562 * @arg @ref LL_LPTIM_OUTPUT_POLARITY_REGULAR
NYX 0:85b3fd62ea1a 563 * @arg @ref LL_LPTIM_OUTPUT_POLARITY_INVERSE
NYX 0:85b3fd62ea1a 564 * @retval None
NYX 0:85b3fd62ea1a 565 */
NYX 0:85b3fd62ea1a 566 __STATIC_INLINE void LL_LPTIM_SetPolarity(LPTIM_TypeDef *LPTIMx, uint32_t Polarity)
NYX 0:85b3fd62ea1a 567 {
NYX 0:85b3fd62ea1a 568 MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_WAVPOL, Polarity);
NYX 0:85b3fd62ea1a 569 }
NYX 0:85b3fd62ea1a 570
NYX 0:85b3fd62ea1a 571 /**
NYX 0:85b3fd62ea1a 572 * @brief Get actual output polarity
NYX 0:85b3fd62ea1a 573 * @rmtoll CFGR WAVPOL LL_LPTIM_GetPolarity
NYX 0:85b3fd62ea1a 574 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 575 * @retval Returned value can be one of the following values:
NYX 0:85b3fd62ea1a 576 * @arg @ref LL_LPTIM_OUTPUT_POLARITY_REGULAR
NYX 0:85b3fd62ea1a 577 * @arg @ref LL_LPTIM_OUTPUT_POLARITY_INVERSE
NYX 0:85b3fd62ea1a 578 */
NYX 0:85b3fd62ea1a 579 __STATIC_INLINE uint32_t LL_LPTIM_GetPolarity(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 580 {
NYX 0:85b3fd62ea1a 581 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_WAVPOL));
NYX 0:85b3fd62ea1a 582 }
NYX 0:85b3fd62ea1a 583
NYX 0:85b3fd62ea1a 584 /**
NYX 0:85b3fd62ea1a 585 * @brief Set actual prescaler division ratio.
NYX 0:85b3fd62ea1a 586 * @note This function must be called when the LPTIM instance is disabled.
NYX 0:85b3fd62ea1a 587 * @note When the LPTIM is configured to be clocked by an internal clock source
NYX 0:85b3fd62ea1a 588 * and the LPTIM counter is configured to be updated by active edges
NYX 0:85b3fd62ea1a 589 * detected on the LPTIM external Input1, the internal clock provided to
NYX 0:85b3fd62ea1a 590 * the LPTIM must be not be prescaled.
NYX 0:85b3fd62ea1a 591 * @rmtoll CFGR PRESC LL_LPTIM_SetPrescaler
NYX 0:85b3fd62ea1a 592 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 593 * @param Prescaler This parameter can be one of the following values:
NYX 0:85b3fd62ea1a 594 * @arg @ref LL_LPTIM_PRESCALER_DIV1
NYX 0:85b3fd62ea1a 595 * @arg @ref LL_LPTIM_PRESCALER_DIV2
NYX 0:85b3fd62ea1a 596 * @arg @ref LL_LPTIM_PRESCALER_DIV4
NYX 0:85b3fd62ea1a 597 * @arg @ref LL_LPTIM_PRESCALER_DIV8
NYX 0:85b3fd62ea1a 598 * @arg @ref LL_LPTIM_PRESCALER_DIV16
NYX 0:85b3fd62ea1a 599 * @arg @ref LL_LPTIM_PRESCALER_DIV32
NYX 0:85b3fd62ea1a 600 * @arg @ref LL_LPTIM_PRESCALER_DIV64
NYX 0:85b3fd62ea1a 601 * @arg @ref LL_LPTIM_PRESCALER_DIV128
NYX 0:85b3fd62ea1a 602 * @retval None
NYX 0:85b3fd62ea1a 603 */
NYX 0:85b3fd62ea1a 604 __STATIC_INLINE void LL_LPTIM_SetPrescaler(LPTIM_TypeDef *LPTIMx, uint32_t Prescaler)
NYX 0:85b3fd62ea1a 605 {
NYX 0:85b3fd62ea1a 606 MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_PRESC, Prescaler);
NYX 0:85b3fd62ea1a 607 }
NYX 0:85b3fd62ea1a 608
NYX 0:85b3fd62ea1a 609 /**
NYX 0:85b3fd62ea1a 610 * @brief Get actual prescaler division ratio.
NYX 0:85b3fd62ea1a 611 * @rmtoll CFGR PRESC LL_LPTIM_GetPrescaler
NYX 0:85b3fd62ea1a 612 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 613 * @retval Returned value can be one of the following values:
NYX 0:85b3fd62ea1a 614 * @arg @ref LL_LPTIM_PRESCALER_DIV1
NYX 0:85b3fd62ea1a 615 * @arg @ref LL_LPTIM_PRESCALER_DIV2
NYX 0:85b3fd62ea1a 616 * @arg @ref LL_LPTIM_PRESCALER_DIV4
NYX 0:85b3fd62ea1a 617 * @arg @ref LL_LPTIM_PRESCALER_DIV8
NYX 0:85b3fd62ea1a 618 * @arg @ref LL_LPTIM_PRESCALER_DIV16
NYX 0:85b3fd62ea1a 619 * @arg @ref LL_LPTIM_PRESCALER_DIV32
NYX 0:85b3fd62ea1a 620 * @arg @ref LL_LPTIM_PRESCALER_DIV64
NYX 0:85b3fd62ea1a 621 * @arg @ref LL_LPTIM_PRESCALER_DIV128
NYX 0:85b3fd62ea1a 622 */
NYX 0:85b3fd62ea1a 623 __STATIC_INLINE uint32_t LL_LPTIM_GetPrescaler(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 624 {
NYX 0:85b3fd62ea1a 625 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_PRESC));
NYX 0:85b3fd62ea1a 626 }
NYX 0:85b3fd62ea1a 627
NYX 0:85b3fd62ea1a 628
NYX 0:85b3fd62ea1a 629 /**
NYX 0:85b3fd62ea1a 630 * @}
NYX 0:85b3fd62ea1a 631 */
NYX 0:85b3fd62ea1a 632
NYX 0:85b3fd62ea1a 633 /** @defgroup LPTIM_LL_EF_Trigger_Configuration Trigger Configuration
NYX 0:85b3fd62ea1a 634 * @{
NYX 0:85b3fd62ea1a 635 */
NYX 0:85b3fd62ea1a 636
NYX 0:85b3fd62ea1a 637 /**
NYX 0:85b3fd62ea1a 638 * @brief Enable the timeout function
NYX 0:85b3fd62ea1a 639 * @note This function must be called when the LPTIM instance is disabled.
NYX 0:85b3fd62ea1a 640 * @note The first trigger event will start the timer, any successive trigger
NYX 0:85b3fd62ea1a 641 * event will reset the counter and the timer will restart.
NYX 0:85b3fd62ea1a 642 * @note The timeout value corresponds to the compare value; if no trigger
NYX 0:85b3fd62ea1a 643 * occurs within the expected time frame, the MCU is waked-up by the
NYX 0:85b3fd62ea1a 644 * compare match event.
NYX 0:85b3fd62ea1a 645 * @rmtoll CFGR TIMOUT LL_LPTIM_EnableTimeout
NYX 0:85b3fd62ea1a 646 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 647 * @retval None
NYX 0:85b3fd62ea1a 648 */
NYX 0:85b3fd62ea1a 649 __STATIC_INLINE void LL_LPTIM_EnableTimeout(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 650 {
NYX 0:85b3fd62ea1a 651 SET_BIT(LPTIMx->CFGR, LPTIM_CFGR_TIMOUT);
NYX 0:85b3fd62ea1a 652 }
NYX 0:85b3fd62ea1a 653
NYX 0:85b3fd62ea1a 654 /**
NYX 0:85b3fd62ea1a 655 * @brief Disable the timeout function
NYX 0:85b3fd62ea1a 656 * @note This function must be called when the LPTIM instance is disabled.
NYX 0:85b3fd62ea1a 657 * @note A trigger event arriving when the timer is already started will be
NYX 0:85b3fd62ea1a 658 * ignored.
NYX 0:85b3fd62ea1a 659 * @rmtoll CFGR TIMOUT LL_LPTIM_DisableTimeout
NYX 0:85b3fd62ea1a 660 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 661 * @retval None
NYX 0:85b3fd62ea1a 662 */
NYX 0:85b3fd62ea1a 663 __STATIC_INLINE void LL_LPTIM_DisableTimeout(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 664 {
NYX 0:85b3fd62ea1a 665 CLEAR_BIT(LPTIMx->CFGR, LPTIM_CFGR_TIMOUT);
NYX 0:85b3fd62ea1a 666 }
NYX 0:85b3fd62ea1a 667
NYX 0:85b3fd62ea1a 668 /**
NYX 0:85b3fd62ea1a 669 * @brief Indicate whether the timeout function is enabled.
NYX 0:85b3fd62ea1a 670 * @rmtoll CFGR TIMOUT LL_LPTIM_IsEnabledTimeout
NYX 0:85b3fd62ea1a 671 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 672 * @retval State of bit (1 or 0).
NYX 0:85b3fd62ea1a 673 */
NYX 0:85b3fd62ea1a 674 __STATIC_INLINE uint32_t LL_LPTIM_IsEnabledTimeout(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 675 {
NYX 0:85b3fd62ea1a 676 return (READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_TIMOUT) == (LPTIM_CFGR_TIMOUT));
NYX 0:85b3fd62ea1a 677 }
NYX 0:85b3fd62ea1a 678
NYX 0:85b3fd62ea1a 679 /**
NYX 0:85b3fd62ea1a 680 * @brief Start the LPTIM counter
NYX 0:85b3fd62ea1a 681 * @note This function must be called when the LPTIM instance is disabled.
NYX 0:85b3fd62ea1a 682 * @rmtoll CFGR TRIGEN LL_LPTIM_TrigSw
NYX 0:85b3fd62ea1a 683 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 684 * @retval None
NYX 0:85b3fd62ea1a 685 */
NYX 0:85b3fd62ea1a 686 __STATIC_INLINE void LL_LPTIM_TrigSw(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 687 {
NYX 0:85b3fd62ea1a 688 CLEAR_BIT(LPTIMx->CFGR, LPTIM_CFGR_TRIGEN);
NYX 0:85b3fd62ea1a 689 }
NYX 0:85b3fd62ea1a 690
NYX 0:85b3fd62ea1a 691 /**
NYX 0:85b3fd62ea1a 692 * @brief Configure the external trigger used as a trigger event for the LPTIM.
NYX 0:85b3fd62ea1a 693 * @note This function must be called when the LPTIM instance is disabled.
NYX 0:85b3fd62ea1a 694 * @note An internal clock source must be present when a digital filter is
NYX 0:85b3fd62ea1a 695 * required for the trigger.
NYX 0:85b3fd62ea1a 696 * @rmtoll CFGR TRIGSEL LL_LPTIM_ConfigTrigger\n
NYX 0:85b3fd62ea1a 697 * CFGR TRGFLT LL_LPTIM_ConfigTrigger\n
NYX 0:85b3fd62ea1a 698 * CFGR TRIGEN LL_LPTIM_ConfigTrigger
NYX 0:85b3fd62ea1a 699 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 700 * @param Source This parameter can be one of the following values:
NYX 0:85b3fd62ea1a 701 * @arg @ref LL_LPTIM_TRIG_SOURCE_GPIO
NYX 0:85b3fd62ea1a 702 * @arg @ref LL_LPTIM_TRIG_SOURCE_RTCALARMA
NYX 0:85b3fd62ea1a 703 * @arg @ref LL_LPTIM_TRIG_SOURCE_RTCALARMB
NYX 0:85b3fd62ea1a 704 * @arg @ref LL_LPTIM_TRIG_SOURCE_RTCTAMP1
NYX 0:85b3fd62ea1a 705 * @arg @ref LL_LPTIM_TRIG_SOURCE_TIM1_TRGO
NYX 0:85b3fd62ea1a 706 * @arg @ref LL_LPTIM_TRIG_SOURCE_TIM5_TRGO
NYX 0:85b3fd62ea1a 707 * @param Filter This parameter can be one of the following values:
NYX 0:85b3fd62ea1a 708 * @arg @ref LL_LPTIM_TRIG_FILTER_NONE
NYX 0:85b3fd62ea1a 709 * @arg @ref LL_LPTIM_TRIG_FILTER_2
NYX 0:85b3fd62ea1a 710 * @arg @ref LL_LPTIM_TRIG_FILTER_4
NYX 0:85b3fd62ea1a 711 * @arg @ref LL_LPTIM_TRIG_FILTER_8
NYX 0:85b3fd62ea1a 712 * @param Polarity This parameter can be one of the following values:
NYX 0:85b3fd62ea1a 713 * @arg @ref LL_LPTIM_TRIG_POLARITY_RISING
NYX 0:85b3fd62ea1a 714 * @arg @ref LL_LPTIM_TRIG_POLARITY_FALLING
NYX 0:85b3fd62ea1a 715 * @arg @ref LL_LPTIM_TRIG_POLARITY_RISING_FALLING
NYX 0:85b3fd62ea1a 716 * (*) value not defined in all devices.
NYX 0:85b3fd62ea1a 717 * @retval None
NYX 0:85b3fd62ea1a 718 */
NYX 0:85b3fd62ea1a 719 __STATIC_INLINE void LL_LPTIM_ConfigTrigger(LPTIM_TypeDef *LPTIMx, uint32_t Source, uint32_t Filter, uint32_t Polarity)
NYX 0:85b3fd62ea1a 720 {
NYX 0:85b3fd62ea1a 721 MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_TRIGSEL | LPTIM_CFGR_TRGFLT | LPTIM_CFGR_TRIGEN, Source | Filter | Polarity);
NYX 0:85b3fd62ea1a 722 }
NYX 0:85b3fd62ea1a 723
NYX 0:85b3fd62ea1a 724 /**
NYX 0:85b3fd62ea1a 725 * @brief Get actual external trigger source.
NYX 0:85b3fd62ea1a 726 * @rmtoll CFGR TRIGSEL LL_LPTIM_GetTriggerSource
NYX 0:85b3fd62ea1a 727 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 728 * @retval Returned value can be one of the following values:
NYX 0:85b3fd62ea1a 729 * @arg @ref LL_LPTIM_TRIG_SOURCE_GPIO
NYX 0:85b3fd62ea1a 730 * @arg @ref LL_LPTIM_TRIG_SOURCE_RTCALARMA
NYX 0:85b3fd62ea1a 731 * @arg @ref LL_LPTIM_TRIG_SOURCE_RTCALARMB
NYX 0:85b3fd62ea1a 732 * @arg @ref LL_LPTIM_TRIG_SOURCE_RTCTAMP1
NYX 0:85b3fd62ea1a 733 * @arg @ref LL_LPTIM_TRIG_SOURCE_TIM1_TRGO
NYX 0:85b3fd62ea1a 734 * @arg @ref LL_LPTIM_TRIG_SOURCE_TIM5_TRGO
NYX 0:85b3fd62ea1a 735 */
NYX 0:85b3fd62ea1a 736 __STATIC_INLINE uint32_t LL_LPTIM_GetTriggerSource(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 737 {
NYX 0:85b3fd62ea1a 738 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_TRIGSEL));
NYX 0:85b3fd62ea1a 739 }
NYX 0:85b3fd62ea1a 740
NYX 0:85b3fd62ea1a 741 /**
NYX 0:85b3fd62ea1a 742 * @brief Get actual external trigger filter.
NYX 0:85b3fd62ea1a 743 * @rmtoll CFGR TRGFLT LL_LPTIM_GetTriggerFilter
NYX 0:85b3fd62ea1a 744 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 745 * @retval Returned value can be one of the following values:
NYX 0:85b3fd62ea1a 746 * @arg @ref LL_LPTIM_TRIG_FILTER_NONE
NYX 0:85b3fd62ea1a 747 * @arg @ref LL_LPTIM_TRIG_FILTER_2
NYX 0:85b3fd62ea1a 748 * @arg @ref LL_LPTIM_TRIG_FILTER_4
NYX 0:85b3fd62ea1a 749 * @arg @ref LL_LPTIM_TRIG_FILTER_8
NYX 0:85b3fd62ea1a 750 */
NYX 0:85b3fd62ea1a 751 __STATIC_INLINE uint32_t LL_LPTIM_GetTriggerFilter(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 752 {
NYX 0:85b3fd62ea1a 753 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_TRGFLT));
NYX 0:85b3fd62ea1a 754 }
NYX 0:85b3fd62ea1a 755
NYX 0:85b3fd62ea1a 756 /**
NYX 0:85b3fd62ea1a 757 * @brief Get actual external trigger polarity.
NYX 0:85b3fd62ea1a 758 * @rmtoll CFGR TRIGEN LL_LPTIM_GetTriggerPolarity
NYX 0:85b3fd62ea1a 759 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 760 * @retval Returned value can be one of the following values:
NYX 0:85b3fd62ea1a 761 * @arg @ref LL_LPTIM_TRIG_POLARITY_RISING
NYX 0:85b3fd62ea1a 762 * @arg @ref LL_LPTIM_TRIG_POLARITY_FALLING
NYX 0:85b3fd62ea1a 763 * @arg @ref LL_LPTIM_TRIG_POLARITY_RISING_FALLING
NYX 0:85b3fd62ea1a 764 */
NYX 0:85b3fd62ea1a 765 __STATIC_INLINE uint32_t LL_LPTIM_GetTriggerPolarity(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 766 {
NYX 0:85b3fd62ea1a 767 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_TRIGEN));
NYX 0:85b3fd62ea1a 768 }
NYX 0:85b3fd62ea1a 769
NYX 0:85b3fd62ea1a 770 /**
NYX 0:85b3fd62ea1a 771 * @}
NYX 0:85b3fd62ea1a 772 */
NYX 0:85b3fd62ea1a 773
NYX 0:85b3fd62ea1a 774 /** @defgroup LPTIM_LL_EF_Clock_Configuration Clock Configuration
NYX 0:85b3fd62ea1a 775 * @{
NYX 0:85b3fd62ea1a 776 */
NYX 0:85b3fd62ea1a 777
NYX 0:85b3fd62ea1a 778 /**
NYX 0:85b3fd62ea1a 779 * @brief Set the source of the clock used by the LPTIM instance.
NYX 0:85b3fd62ea1a 780 * @note This function must be called when the LPTIM instance is disabled.
NYX 0:85b3fd62ea1a 781 * @rmtoll CFGR CKSEL LL_LPTIM_SetClockSource
NYX 0:85b3fd62ea1a 782 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 783 * @param ClockSource This parameter can be one of the following values:
NYX 0:85b3fd62ea1a 784 * @arg @ref LL_LPTIM_CLK_SOURCE_INTERNAL
NYX 0:85b3fd62ea1a 785 * @arg @ref LL_LPTIM_CLK_SOURCE_EXTERNAL
NYX 0:85b3fd62ea1a 786 * @retval None
NYX 0:85b3fd62ea1a 787 */
NYX 0:85b3fd62ea1a 788 __STATIC_INLINE void LL_LPTIM_SetClockSource(LPTIM_TypeDef *LPTIMx, uint32_t ClockSource)
NYX 0:85b3fd62ea1a 789 {
NYX 0:85b3fd62ea1a 790 MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_CKSEL, ClockSource);
NYX 0:85b3fd62ea1a 791 }
NYX 0:85b3fd62ea1a 792
NYX 0:85b3fd62ea1a 793 /**
NYX 0:85b3fd62ea1a 794 * @brief Get actual LPTIM instance clock source.
NYX 0:85b3fd62ea1a 795 * @rmtoll CFGR CKSEL LL_LPTIM_GetClockSource
NYX 0:85b3fd62ea1a 796 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 797 * @retval Returned value can be one of the following values:
NYX 0:85b3fd62ea1a 798 * @arg @ref LL_LPTIM_CLK_SOURCE_INTERNAL
NYX 0:85b3fd62ea1a 799 * @arg @ref LL_LPTIM_CLK_SOURCE_EXTERNAL
NYX 0:85b3fd62ea1a 800 */
NYX 0:85b3fd62ea1a 801 __STATIC_INLINE uint32_t LL_LPTIM_GetClockSource(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 802 {
NYX 0:85b3fd62ea1a 803 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_CKSEL));
NYX 0:85b3fd62ea1a 804 }
NYX 0:85b3fd62ea1a 805
NYX 0:85b3fd62ea1a 806 /**
NYX 0:85b3fd62ea1a 807 * @brief Configure the active edge or edges used by the counter when the LPTIM is clocked by an external clock source.
NYX 0:85b3fd62ea1a 808 * @note This function must be called when the LPTIM instance is disabled.
NYX 0:85b3fd62ea1a 809 * @note When both external clock signal edges are considered active ones,
NYX 0:85b3fd62ea1a 810 * the LPTIM must also be clocked by an internal clock source with a
NYX 0:85b3fd62ea1a 811 * frequency equal to at least four times the external clock frequency.
NYX 0:85b3fd62ea1a 812 * @note An internal clock source must be present when a digital filter is
NYX 0:85b3fd62ea1a 813 * required for external clock.
NYX 0:85b3fd62ea1a 814 * @rmtoll CFGR CKFLT LL_LPTIM_ConfigClock\n
NYX 0:85b3fd62ea1a 815 * CFGR CKPOL LL_LPTIM_ConfigClock
NYX 0:85b3fd62ea1a 816 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 817 * @param ClockFilter This parameter can be one of the following values:
NYX 0:85b3fd62ea1a 818 * @arg @ref LL_LPTIM_CLK_FILTER_NONE
NYX 0:85b3fd62ea1a 819 * @arg @ref LL_LPTIM_CLK_FILTER_2
NYX 0:85b3fd62ea1a 820 * @arg @ref LL_LPTIM_CLK_FILTER_4
NYX 0:85b3fd62ea1a 821 * @arg @ref LL_LPTIM_CLK_FILTER_8
NYX 0:85b3fd62ea1a 822 * @param ClockPolarity This parameter can be one of the following values:
NYX 0:85b3fd62ea1a 823 * @arg @ref LL_LPTIM_CLK_POLARITY_RISING
NYX 0:85b3fd62ea1a 824 * @arg @ref LL_LPTIM_CLK_POLARITY_FALLING
NYX 0:85b3fd62ea1a 825 * @arg @ref LL_LPTIM_CLK_POLARITY_RISING_FALLING
NYX 0:85b3fd62ea1a 826 * @retval None
NYX 0:85b3fd62ea1a 827 */
NYX 0:85b3fd62ea1a 828 __STATIC_INLINE void LL_LPTIM_ConfigClock(LPTIM_TypeDef *LPTIMx, uint32_t ClockFilter, uint32_t ClockPolarity)
NYX 0:85b3fd62ea1a 829 {
NYX 0:85b3fd62ea1a 830 MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_CKFLT | LPTIM_CFGR_CKPOL, ClockFilter | ClockPolarity);
NYX 0:85b3fd62ea1a 831 }
NYX 0:85b3fd62ea1a 832
NYX 0:85b3fd62ea1a 833 /**
NYX 0:85b3fd62ea1a 834 * @brief Get actual clock polarity
NYX 0:85b3fd62ea1a 835 * @rmtoll CFGR CKPOL LL_LPTIM_GetClockPolarity
NYX 0:85b3fd62ea1a 836 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 837 * @retval Returned value can be one of the following values:
NYX 0:85b3fd62ea1a 838 * @arg @ref LL_LPTIM_CLK_POLARITY_RISING
NYX 0:85b3fd62ea1a 839 * @arg @ref LL_LPTIM_CLK_POLARITY_FALLING
NYX 0:85b3fd62ea1a 840 * @arg @ref LL_LPTIM_CLK_POLARITY_RISING_FALLING
NYX 0:85b3fd62ea1a 841 */
NYX 0:85b3fd62ea1a 842 __STATIC_INLINE uint32_t LL_LPTIM_GetClockPolarity(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 843 {
NYX 0:85b3fd62ea1a 844 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_CKPOL));
NYX 0:85b3fd62ea1a 845 }
NYX 0:85b3fd62ea1a 846
NYX 0:85b3fd62ea1a 847 /**
NYX 0:85b3fd62ea1a 848 * @brief Get actual clock digital filter
NYX 0:85b3fd62ea1a 849 * @rmtoll CFGR CKFLT LL_LPTIM_GetClockFilter
NYX 0:85b3fd62ea1a 850 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 851 * @retval Returned value can be one of the following values:
NYX 0:85b3fd62ea1a 852 * @arg @ref LL_LPTIM_CLK_FILTER_NONE
NYX 0:85b3fd62ea1a 853 * @arg @ref LL_LPTIM_CLK_FILTER_2
NYX 0:85b3fd62ea1a 854 * @arg @ref LL_LPTIM_CLK_FILTER_4
NYX 0:85b3fd62ea1a 855 * @arg @ref LL_LPTIM_CLK_FILTER_8
NYX 0:85b3fd62ea1a 856 */
NYX 0:85b3fd62ea1a 857 __STATIC_INLINE uint32_t LL_LPTIM_GetClockFilter(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 858 {
NYX 0:85b3fd62ea1a 859 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_CKFLT));
NYX 0:85b3fd62ea1a 860 }
NYX 0:85b3fd62ea1a 861
NYX 0:85b3fd62ea1a 862 /**
NYX 0:85b3fd62ea1a 863 * @}
NYX 0:85b3fd62ea1a 864 */
NYX 0:85b3fd62ea1a 865
NYX 0:85b3fd62ea1a 866 /** @defgroup LPTIM_LL_EF_Encoder_Mode Encoder Mode
NYX 0:85b3fd62ea1a 867 * @{
NYX 0:85b3fd62ea1a 868 */
NYX 0:85b3fd62ea1a 869
NYX 0:85b3fd62ea1a 870 /**
NYX 0:85b3fd62ea1a 871 * @brief Configure the encoder mode.
NYX 0:85b3fd62ea1a 872 * @note This function must be called when the LPTIM instance is disabled.
NYX 0:85b3fd62ea1a 873 * @rmtoll CFGR CKPOL LL_LPTIM_SetEncoderMode
NYX 0:85b3fd62ea1a 874 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 875 * @param EncoderMode This parameter can be one of the following values:
NYX 0:85b3fd62ea1a 876 * @arg @ref LL_LPTIM_ENCODER_MODE_RISING
NYX 0:85b3fd62ea1a 877 * @arg @ref LL_LPTIM_ENCODER_MODE_FALLING
NYX 0:85b3fd62ea1a 878 * @arg @ref LL_LPTIM_ENCODER_MODE_RISING_FALLING
NYX 0:85b3fd62ea1a 879 * @retval None
NYX 0:85b3fd62ea1a 880 */
NYX 0:85b3fd62ea1a 881 __STATIC_INLINE void LL_LPTIM_SetEncoderMode(LPTIM_TypeDef *LPTIMx, uint32_t EncoderMode)
NYX 0:85b3fd62ea1a 882 {
NYX 0:85b3fd62ea1a 883 MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_CKPOL, EncoderMode);
NYX 0:85b3fd62ea1a 884 }
NYX 0:85b3fd62ea1a 885
NYX 0:85b3fd62ea1a 886 /**
NYX 0:85b3fd62ea1a 887 * @brief Get actual encoder mode.
NYX 0:85b3fd62ea1a 888 * @rmtoll CFGR CKPOL LL_LPTIM_GetEncoderMode
NYX 0:85b3fd62ea1a 889 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 890 * @retval Returned value can be one of the following values:
NYX 0:85b3fd62ea1a 891 * @arg @ref LL_LPTIM_ENCODER_MODE_RISING
NYX 0:85b3fd62ea1a 892 * @arg @ref LL_LPTIM_ENCODER_MODE_FALLING
NYX 0:85b3fd62ea1a 893 * @arg @ref LL_LPTIM_ENCODER_MODE_RISING_FALLING
NYX 0:85b3fd62ea1a 894 */
NYX 0:85b3fd62ea1a 895 __STATIC_INLINE uint32_t LL_LPTIM_GetEncoderMode(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 896 {
NYX 0:85b3fd62ea1a 897 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_CKPOL));
NYX 0:85b3fd62ea1a 898 }
NYX 0:85b3fd62ea1a 899
NYX 0:85b3fd62ea1a 900 /**
NYX 0:85b3fd62ea1a 901 * @brief Enable the encoder mode
NYX 0:85b3fd62ea1a 902 * @note This function must be called when the LPTIM instance is disabled.
NYX 0:85b3fd62ea1a 903 * @note In this mode the LPTIM instance must be clocked by an internal clock
NYX 0:85b3fd62ea1a 904 * source. Also, the prescaler division ratio must be equal to 1.
NYX 0:85b3fd62ea1a 905 * @note LPTIM instance must be configured in continuous mode prior enabling
NYX 0:85b3fd62ea1a 906 * the encoder mode.
NYX 0:85b3fd62ea1a 907 * @rmtoll CFGR ENC LL_LPTIM_EnableEncoderMode
NYX 0:85b3fd62ea1a 908 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 909 * @retval None
NYX 0:85b3fd62ea1a 910 */
NYX 0:85b3fd62ea1a 911 __STATIC_INLINE void LL_LPTIM_EnableEncoderMode(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 912 {
NYX 0:85b3fd62ea1a 913 SET_BIT(LPTIMx->CFGR, LPTIM_CFGR_ENC);
NYX 0:85b3fd62ea1a 914 }
NYX 0:85b3fd62ea1a 915
NYX 0:85b3fd62ea1a 916 /**
NYX 0:85b3fd62ea1a 917 * @brief Disable the encoder mode
NYX 0:85b3fd62ea1a 918 * @note This function must be called when the LPTIM instance is disabled.
NYX 0:85b3fd62ea1a 919 * @rmtoll CFGR ENC LL_LPTIM_DisableEncoderMode
NYX 0:85b3fd62ea1a 920 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 921 * @retval None
NYX 0:85b3fd62ea1a 922 */
NYX 0:85b3fd62ea1a 923 __STATIC_INLINE void LL_LPTIM_DisableEncoderMode(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 924 {
NYX 0:85b3fd62ea1a 925 CLEAR_BIT(LPTIMx->CFGR, LPTIM_CFGR_ENC);
NYX 0:85b3fd62ea1a 926 }
NYX 0:85b3fd62ea1a 927
NYX 0:85b3fd62ea1a 928 /**
NYX 0:85b3fd62ea1a 929 * @brief Indicates whether the LPTIM operates in encoder mode.
NYX 0:85b3fd62ea1a 930 * @rmtoll CFGR ENC LL_LPTIM_IsEnabledEncoderMode
NYX 0:85b3fd62ea1a 931 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 932 * @retval State of bit (1 or 0).
NYX 0:85b3fd62ea1a 933 */
NYX 0:85b3fd62ea1a 934 __STATIC_INLINE uint32_t LL_LPTIM_IsEnabledEncoderMode(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 935 {
NYX 0:85b3fd62ea1a 936 return (READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_ENC) == (LPTIM_CFGR_ENC));
NYX 0:85b3fd62ea1a 937 }
NYX 0:85b3fd62ea1a 938
NYX 0:85b3fd62ea1a 939 /**
NYX 0:85b3fd62ea1a 940 * @}
NYX 0:85b3fd62ea1a 941 */
NYX 0:85b3fd62ea1a 942
NYX 0:85b3fd62ea1a 943 /** @defgroup LPTIM_LL_EF_FLAG_Management FLAG Management
NYX 0:85b3fd62ea1a 944 * @{
NYX 0:85b3fd62ea1a 945 */
NYX 0:85b3fd62ea1a 946
NYX 0:85b3fd62ea1a 947 /**
NYX 0:85b3fd62ea1a 948 * @brief Clear the compare match flag (CMPMCF)
NYX 0:85b3fd62ea1a 949 * @rmtoll ICR CMPMCF LL_LPTIM_ClearFLAG_CMPM
NYX 0:85b3fd62ea1a 950 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 951 * @retval None
NYX 0:85b3fd62ea1a 952 */
NYX 0:85b3fd62ea1a 953 __STATIC_INLINE void LL_LPTIM_ClearFLAG_CMPM(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 954 {
NYX 0:85b3fd62ea1a 955 SET_BIT(LPTIMx->ICR, LPTIM_ICR_CMPMCF);
NYX 0:85b3fd62ea1a 956 }
NYX 0:85b3fd62ea1a 957
NYX 0:85b3fd62ea1a 958 /**
NYX 0:85b3fd62ea1a 959 * @brief Inform application whether a compare match interrupt has occurred.
NYX 0:85b3fd62ea1a 960 * @rmtoll ISR CMPM LL_LPTIM_IsActiveFlag_CMPM
NYX 0:85b3fd62ea1a 961 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 962 * @retval State of bit (1 or 0).
NYX 0:85b3fd62ea1a 963 */
NYX 0:85b3fd62ea1a 964 __STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_CMPM(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 965 {
NYX 0:85b3fd62ea1a 966 return (READ_BIT(LPTIMx->ISR, LPTIM_ISR_CMPM) == (LPTIM_ISR_CMPM));
NYX 0:85b3fd62ea1a 967 }
NYX 0:85b3fd62ea1a 968
NYX 0:85b3fd62ea1a 969 /**
NYX 0:85b3fd62ea1a 970 * @brief Clear the autoreload match flag (ARRMCF)
NYX 0:85b3fd62ea1a 971 * @rmtoll ICR ARRMCF LL_LPTIM_ClearFLAG_ARRM
NYX 0:85b3fd62ea1a 972 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 973 * @retval None
NYX 0:85b3fd62ea1a 974 */
NYX 0:85b3fd62ea1a 975 __STATIC_INLINE void LL_LPTIM_ClearFLAG_ARRM(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 976 {
NYX 0:85b3fd62ea1a 977 SET_BIT(LPTIMx->ICR, LPTIM_ICR_ARRMCF);
NYX 0:85b3fd62ea1a 978 }
NYX 0:85b3fd62ea1a 979
NYX 0:85b3fd62ea1a 980 /**
NYX 0:85b3fd62ea1a 981 * @brief Inform application whether a autoreload match interrupt has occured.
NYX 0:85b3fd62ea1a 982 * @rmtoll ISR ARRM LL_LPTIM_IsActiveFlag_ARRM
NYX 0:85b3fd62ea1a 983 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 984 * @retval State of bit (1 or 0).
NYX 0:85b3fd62ea1a 985 */
NYX 0:85b3fd62ea1a 986 __STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_ARRM(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 987 {
NYX 0:85b3fd62ea1a 988 return (READ_BIT(LPTIMx->ISR, LPTIM_ISR_ARRM) == (LPTIM_ISR_ARRM));
NYX 0:85b3fd62ea1a 989 }
NYX 0:85b3fd62ea1a 990
NYX 0:85b3fd62ea1a 991 /**
NYX 0:85b3fd62ea1a 992 * @brief Clear the external trigger valid edge flag(EXTTRIGCF).
NYX 0:85b3fd62ea1a 993 * @rmtoll ICR EXTTRIGCF LL_LPTIM_ClearFlag_EXTTRIG
NYX 0:85b3fd62ea1a 994 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 995 * @retval None
NYX 0:85b3fd62ea1a 996 */
NYX 0:85b3fd62ea1a 997 __STATIC_INLINE void LL_LPTIM_ClearFlag_EXTTRIG(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 998 {
NYX 0:85b3fd62ea1a 999 SET_BIT(LPTIMx->ICR, LPTIM_ICR_EXTTRIGCF);
NYX 0:85b3fd62ea1a 1000 }
NYX 0:85b3fd62ea1a 1001
NYX 0:85b3fd62ea1a 1002 /**
NYX 0:85b3fd62ea1a 1003 * @brief Inform application whether a valid edge on the selected external trigger input has occurred.
NYX 0:85b3fd62ea1a 1004 * @rmtoll ISR EXTTRIG LL_LPTIM_IsActiveFlag_EXTTRIG
NYX 0:85b3fd62ea1a 1005 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1006 * @retval State of bit (1 or 0).
NYX 0:85b3fd62ea1a 1007 */
NYX 0:85b3fd62ea1a 1008 __STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_EXTTRIG(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1009 {
NYX 0:85b3fd62ea1a 1010 return (READ_BIT(LPTIMx->ISR, LPTIM_ISR_EXTTRIG) == (LPTIM_ISR_EXTTRIG));
NYX 0:85b3fd62ea1a 1011 }
NYX 0:85b3fd62ea1a 1012
NYX 0:85b3fd62ea1a 1013 /**
NYX 0:85b3fd62ea1a 1014 * @brief Clear the compare register update interrupt flag (CMPOKCF).
NYX 0:85b3fd62ea1a 1015 * @rmtoll ICR CMPOKCF LL_LPTIM_ClearFlag_CMPOK
NYX 0:85b3fd62ea1a 1016 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1017 * @retval None
NYX 0:85b3fd62ea1a 1018 */
NYX 0:85b3fd62ea1a 1019 __STATIC_INLINE void LL_LPTIM_ClearFlag_CMPOK(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1020 {
NYX 0:85b3fd62ea1a 1021 SET_BIT(LPTIMx->ICR, LPTIM_ICR_CMPOKCF);
NYX 0:85b3fd62ea1a 1022 }
NYX 0:85b3fd62ea1a 1023
NYX 0:85b3fd62ea1a 1024 /**
NYX 0:85b3fd62ea1a 1025 * @brief Informs application whether the APB bus write operation to the LPTIMx_CMP register has been successfully completed; If so, a new one can be initiated.
NYX 0:85b3fd62ea1a 1026 * @rmtoll ISR CMPOK LL_LPTIM_IsActiveFlag_CMPOK
NYX 0:85b3fd62ea1a 1027 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1028 * @retval State of bit (1 or 0).
NYX 0:85b3fd62ea1a 1029 */
NYX 0:85b3fd62ea1a 1030 __STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_CMPOK(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1031 {
NYX 0:85b3fd62ea1a 1032 return (READ_BIT(LPTIMx->ISR, LPTIM_ISR_CMPOK) == (LPTIM_ISR_CMPOK));
NYX 0:85b3fd62ea1a 1033 }
NYX 0:85b3fd62ea1a 1034
NYX 0:85b3fd62ea1a 1035 /**
NYX 0:85b3fd62ea1a 1036 * @brief Clear the autoreload register update interrupt flag (ARROKCF).
NYX 0:85b3fd62ea1a 1037 * @rmtoll ICR ARROKCF LL_LPTIM_ClearFlag_ARROK
NYX 0:85b3fd62ea1a 1038 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1039 * @retval None
NYX 0:85b3fd62ea1a 1040 */
NYX 0:85b3fd62ea1a 1041 __STATIC_INLINE void LL_LPTIM_ClearFlag_ARROK(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1042 {
NYX 0:85b3fd62ea1a 1043 SET_BIT(LPTIMx->ICR, LPTIM_ICR_ARROKCF);
NYX 0:85b3fd62ea1a 1044 }
NYX 0:85b3fd62ea1a 1045
NYX 0:85b3fd62ea1a 1046 /**
NYX 0:85b3fd62ea1a 1047 * @brief Informs application whether the APB bus write operation to the LPTIMx_ARR register has been successfully completed; If so, a new one can be initiated.
NYX 0:85b3fd62ea1a 1048 * @rmtoll ISR ARROK LL_LPTIM_IsActiveFlag_ARROK
NYX 0:85b3fd62ea1a 1049 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1050 * @retval State of bit (1 or 0).
NYX 0:85b3fd62ea1a 1051 */
NYX 0:85b3fd62ea1a 1052 __STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_ARROK(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1053 {
NYX 0:85b3fd62ea1a 1054 return (READ_BIT(LPTIMx->ISR, LPTIM_ISR_ARROK) == (LPTIM_ISR_ARROK));
NYX 0:85b3fd62ea1a 1055 }
NYX 0:85b3fd62ea1a 1056
NYX 0:85b3fd62ea1a 1057 /**
NYX 0:85b3fd62ea1a 1058 * @brief Clear the counter direction change to up interrupt flag (UPCF).
NYX 0:85b3fd62ea1a 1059 * @rmtoll ICR UPCF LL_LPTIM_ClearFlag_UP
NYX 0:85b3fd62ea1a 1060 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1061 * @retval None
NYX 0:85b3fd62ea1a 1062 */
NYX 0:85b3fd62ea1a 1063 __STATIC_INLINE void LL_LPTIM_ClearFlag_UP(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1064 {
NYX 0:85b3fd62ea1a 1065 SET_BIT(LPTIMx->ICR, LPTIM_ICR_UPCF);
NYX 0:85b3fd62ea1a 1066 }
NYX 0:85b3fd62ea1a 1067
NYX 0:85b3fd62ea1a 1068 /**
NYX 0:85b3fd62ea1a 1069 * @brief Informs the application whether the counter direction has changed from down to up (when the LPTIM instance operates in encoder mode).
NYX 0:85b3fd62ea1a 1070 * @rmtoll ISR UP LL_LPTIM_IsActiveFlag_UP
NYX 0:85b3fd62ea1a 1071 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1072 * @retval State of bit (1 or 0).
NYX 0:85b3fd62ea1a 1073 */
NYX 0:85b3fd62ea1a 1074 __STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_UP(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1075 {
NYX 0:85b3fd62ea1a 1076 return (READ_BIT(LPTIMx->ISR, LPTIM_ISR_UP) == (LPTIM_ISR_UP));
NYX 0:85b3fd62ea1a 1077 }
NYX 0:85b3fd62ea1a 1078
NYX 0:85b3fd62ea1a 1079 /**
NYX 0:85b3fd62ea1a 1080 * @brief Clear the counter direction change to down interrupt flag (DOWNCF).
NYX 0:85b3fd62ea1a 1081 * @rmtoll ICR DOWNCF LL_LPTIM_ClearFlag_DOWN
NYX 0:85b3fd62ea1a 1082 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1083 * @retval None
NYX 0:85b3fd62ea1a 1084 */
NYX 0:85b3fd62ea1a 1085 __STATIC_INLINE void LL_LPTIM_ClearFlag_DOWN(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1086 {
NYX 0:85b3fd62ea1a 1087 SET_BIT(LPTIMx->ICR, LPTIM_ICR_DOWNCF);
NYX 0:85b3fd62ea1a 1088 }
NYX 0:85b3fd62ea1a 1089
NYX 0:85b3fd62ea1a 1090 /**
NYX 0:85b3fd62ea1a 1091 * @brief Informs the application whether the counter direction has changed from up to down (when the LPTIM instance operates in encoder mode).
NYX 0:85b3fd62ea1a 1092 * @rmtoll ISR DOWN LL_LPTIM_IsActiveFlag_DOWN
NYX 0:85b3fd62ea1a 1093 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1094 * @retval State of bit (1 or 0).
NYX 0:85b3fd62ea1a 1095 */
NYX 0:85b3fd62ea1a 1096 __STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_DOWN(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1097 {
NYX 0:85b3fd62ea1a 1098 return (READ_BIT(LPTIMx->ISR, LPTIM_ISR_DOWN) == (LPTIM_ISR_DOWN));
NYX 0:85b3fd62ea1a 1099 }
NYX 0:85b3fd62ea1a 1100
NYX 0:85b3fd62ea1a 1101 /**
NYX 0:85b3fd62ea1a 1102 * @}
NYX 0:85b3fd62ea1a 1103 */
NYX 0:85b3fd62ea1a 1104
NYX 0:85b3fd62ea1a 1105 /** @defgroup LPTIM_LL_EF_IT_Management Interrupt Management
NYX 0:85b3fd62ea1a 1106 * @{
NYX 0:85b3fd62ea1a 1107 */
NYX 0:85b3fd62ea1a 1108
NYX 0:85b3fd62ea1a 1109 /**
NYX 0:85b3fd62ea1a 1110 * @brief Enable compare match interrupt (CMPMIE).
NYX 0:85b3fd62ea1a 1111 * @rmtoll IER CMPMIE LL_LPTIM_EnableIT_CMPM
NYX 0:85b3fd62ea1a 1112 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1113 * @retval None
NYX 0:85b3fd62ea1a 1114 */
NYX 0:85b3fd62ea1a 1115 __STATIC_INLINE void LL_LPTIM_EnableIT_CMPM(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1116 {
NYX 0:85b3fd62ea1a 1117 SET_BIT(LPTIMx->IER, LPTIM_IER_CMPMIE);
NYX 0:85b3fd62ea1a 1118 }
NYX 0:85b3fd62ea1a 1119
NYX 0:85b3fd62ea1a 1120 /**
NYX 0:85b3fd62ea1a 1121 * @brief Disable compare match interrupt (CMPMIE).
NYX 0:85b3fd62ea1a 1122 * @rmtoll IER CMPMIE LL_LPTIM_DisableIT_CMPM
NYX 0:85b3fd62ea1a 1123 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1124 * @retval None
NYX 0:85b3fd62ea1a 1125 */
NYX 0:85b3fd62ea1a 1126 __STATIC_INLINE void LL_LPTIM_DisableIT_CMPM(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1127 {
NYX 0:85b3fd62ea1a 1128 CLEAR_BIT(LPTIMx->IER, LPTIM_IER_CMPMIE);
NYX 0:85b3fd62ea1a 1129 }
NYX 0:85b3fd62ea1a 1130
NYX 0:85b3fd62ea1a 1131 /**
NYX 0:85b3fd62ea1a 1132 * @brief Indicates whether the compare match interrupt (CMPMIE) is enabled.
NYX 0:85b3fd62ea1a 1133 * @rmtoll IER CMPMIE LL_LPTIM_IsEnabledIT_CMPM
NYX 0:85b3fd62ea1a 1134 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1135 * @retval State of bit (1 or 0).
NYX 0:85b3fd62ea1a 1136 */
NYX 0:85b3fd62ea1a 1137 __STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_CMPM(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1138 {
NYX 0:85b3fd62ea1a 1139 return (READ_BIT(LPTIMx->IER, LPTIM_IER_CMPMIE) == (LPTIM_IER_CMPMIE));
NYX 0:85b3fd62ea1a 1140 }
NYX 0:85b3fd62ea1a 1141
NYX 0:85b3fd62ea1a 1142 /**
NYX 0:85b3fd62ea1a 1143 * @brief Enable autoreload match interrupt (ARRMIE).
NYX 0:85b3fd62ea1a 1144 * @rmtoll IER ARRMIE LL_LPTIM_EnableIT_ARRM
NYX 0:85b3fd62ea1a 1145 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1146 * @retval None
NYX 0:85b3fd62ea1a 1147 */
NYX 0:85b3fd62ea1a 1148 __STATIC_INLINE void LL_LPTIM_EnableIT_ARRM(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1149 {
NYX 0:85b3fd62ea1a 1150 SET_BIT(LPTIMx->IER, LPTIM_IER_ARRMIE);
NYX 0:85b3fd62ea1a 1151 }
NYX 0:85b3fd62ea1a 1152
NYX 0:85b3fd62ea1a 1153 /**
NYX 0:85b3fd62ea1a 1154 * @brief Disable autoreload match interrupt (ARRMIE).
NYX 0:85b3fd62ea1a 1155 * @rmtoll IER ARRMIE LL_LPTIM_DisableIT_ARRM
NYX 0:85b3fd62ea1a 1156 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1157 * @retval None
NYX 0:85b3fd62ea1a 1158 */
NYX 0:85b3fd62ea1a 1159 __STATIC_INLINE void LL_LPTIM_DisableIT_ARRM(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1160 {
NYX 0:85b3fd62ea1a 1161 CLEAR_BIT(LPTIMx->IER, LPTIM_IER_ARRMIE);
NYX 0:85b3fd62ea1a 1162 }
NYX 0:85b3fd62ea1a 1163
NYX 0:85b3fd62ea1a 1164 /**
NYX 0:85b3fd62ea1a 1165 * @brief Indicates whether the autoreload match interrupt (ARRMIE) is enabled.
NYX 0:85b3fd62ea1a 1166 * @rmtoll IER ARRMIE LL_LPTIM_IsEnabledIT_ARRM
NYX 0:85b3fd62ea1a 1167 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1168 * @retval State of bit (1 or 0).
NYX 0:85b3fd62ea1a 1169 */
NYX 0:85b3fd62ea1a 1170 __STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_ARRM(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1171 {
NYX 0:85b3fd62ea1a 1172 return (READ_BIT(LPTIMx->IER, LPTIM_IER_ARRMIE) == (LPTIM_IER_ARRMIE));
NYX 0:85b3fd62ea1a 1173 }
NYX 0:85b3fd62ea1a 1174
NYX 0:85b3fd62ea1a 1175 /**
NYX 0:85b3fd62ea1a 1176 * @brief Enable external trigger valid edge interrupt (EXTTRIGIE).
NYX 0:85b3fd62ea1a 1177 * @rmtoll IER EXTTRIGIE LL_LPTIM_EnableIT_EXTTRIG
NYX 0:85b3fd62ea1a 1178 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1179 * @retval None
NYX 0:85b3fd62ea1a 1180 */
NYX 0:85b3fd62ea1a 1181 __STATIC_INLINE void LL_LPTIM_EnableIT_EXTTRIG(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1182 {
NYX 0:85b3fd62ea1a 1183 SET_BIT(LPTIMx->IER, LPTIM_IER_EXTTRIGIE);
NYX 0:85b3fd62ea1a 1184 }
NYX 0:85b3fd62ea1a 1185
NYX 0:85b3fd62ea1a 1186 /**
NYX 0:85b3fd62ea1a 1187 * @brief Disable external trigger valid edge interrupt (EXTTRIGIE).
NYX 0:85b3fd62ea1a 1188 * @rmtoll IER EXTTRIGIE LL_LPTIM_DisableIT_EXTTRIG
NYX 0:85b3fd62ea1a 1189 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1190 * @retval None
NYX 0:85b3fd62ea1a 1191 */
NYX 0:85b3fd62ea1a 1192 __STATIC_INLINE void LL_LPTIM_DisableIT_EXTTRIG(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1193 {
NYX 0:85b3fd62ea1a 1194 CLEAR_BIT(LPTIMx->IER, LPTIM_IER_EXTTRIGIE);
NYX 0:85b3fd62ea1a 1195 }
NYX 0:85b3fd62ea1a 1196
NYX 0:85b3fd62ea1a 1197 /**
NYX 0:85b3fd62ea1a 1198 * @brief Indicates external trigger valid edge interrupt (EXTTRIGIE) is enabled.
NYX 0:85b3fd62ea1a 1199 * @rmtoll IER EXTTRIGIE LL_LPTIM_IsEnabledIT_EXTTRIG
NYX 0:85b3fd62ea1a 1200 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1201 * @retval State of bit (1 or 0).
NYX 0:85b3fd62ea1a 1202 */
NYX 0:85b3fd62ea1a 1203 __STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_EXTTRIG(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1204 {
NYX 0:85b3fd62ea1a 1205 return (READ_BIT(LPTIMx->IER, LPTIM_IER_EXTTRIGIE) == (LPTIM_IER_EXTTRIGIE));
NYX 0:85b3fd62ea1a 1206 }
NYX 0:85b3fd62ea1a 1207
NYX 0:85b3fd62ea1a 1208 /**
NYX 0:85b3fd62ea1a 1209 * @brief Enable compare register write completed interrupt (CMPOKIE).
NYX 0:85b3fd62ea1a 1210 * @rmtoll IER CMPOKIE LL_LPTIM_EnableIT_CMPOK
NYX 0:85b3fd62ea1a 1211 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1212 * @retval None
NYX 0:85b3fd62ea1a 1213 */
NYX 0:85b3fd62ea1a 1214 __STATIC_INLINE void LL_LPTIM_EnableIT_CMPOK(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1215 {
NYX 0:85b3fd62ea1a 1216 SET_BIT(LPTIMx->IER, LPTIM_IER_CMPOKIE);
NYX 0:85b3fd62ea1a 1217 }
NYX 0:85b3fd62ea1a 1218
NYX 0:85b3fd62ea1a 1219 /**
NYX 0:85b3fd62ea1a 1220 * @brief Disable compare register write completed interrupt (CMPOKIE).
NYX 0:85b3fd62ea1a 1221 * @rmtoll IER CMPOKIE LL_LPTIM_DisableIT_CMPOK
NYX 0:85b3fd62ea1a 1222 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1223 * @retval None
NYX 0:85b3fd62ea1a 1224 */
NYX 0:85b3fd62ea1a 1225 __STATIC_INLINE void LL_LPTIM_DisableIT_CMPOK(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1226 {
NYX 0:85b3fd62ea1a 1227 CLEAR_BIT(LPTIMx->IER, LPTIM_IER_CMPOKIE);
NYX 0:85b3fd62ea1a 1228 }
NYX 0:85b3fd62ea1a 1229
NYX 0:85b3fd62ea1a 1230 /**
NYX 0:85b3fd62ea1a 1231 * @brief Indicates whether the compare register write completed interrupt (CMPOKIE) is enabled.
NYX 0:85b3fd62ea1a 1232 * @rmtoll IER CMPOKIE LL_LPTIM_IsEnabledIT_CMPOK
NYX 0:85b3fd62ea1a 1233 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1234 * @retval State of bit (1 or 0).
NYX 0:85b3fd62ea1a 1235 */
NYX 0:85b3fd62ea1a 1236 __STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_CMPOK(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1237 {
NYX 0:85b3fd62ea1a 1238 return (READ_BIT(LPTIMx->IER, LPTIM_IER_CMPOKIE) == (LPTIM_IER_CMPOKIE));
NYX 0:85b3fd62ea1a 1239 }
NYX 0:85b3fd62ea1a 1240
NYX 0:85b3fd62ea1a 1241 /**
NYX 0:85b3fd62ea1a 1242 * @brief Enable autoreload register write completed interrupt (ARROKIE).
NYX 0:85b3fd62ea1a 1243 * @rmtoll IER ARROKIE LL_LPTIM_EnableIT_ARROK
NYX 0:85b3fd62ea1a 1244 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1245 * @retval None
NYX 0:85b3fd62ea1a 1246 */
NYX 0:85b3fd62ea1a 1247 __STATIC_INLINE void LL_LPTIM_EnableIT_ARROK(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1248 {
NYX 0:85b3fd62ea1a 1249 SET_BIT(LPTIMx->IER, LPTIM_IER_ARROKIE);
NYX 0:85b3fd62ea1a 1250 }
NYX 0:85b3fd62ea1a 1251
NYX 0:85b3fd62ea1a 1252 /**
NYX 0:85b3fd62ea1a 1253 * @brief Disable autoreload register write completed interrupt (ARROKIE).
NYX 0:85b3fd62ea1a 1254 * @rmtoll IER ARROKIE LL_LPTIM_DisableIT_ARROK
NYX 0:85b3fd62ea1a 1255 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1256 * @retval None
NYX 0:85b3fd62ea1a 1257 */
NYX 0:85b3fd62ea1a 1258 __STATIC_INLINE void LL_LPTIM_DisableIT_ARROK(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1259 {
NYX 0:85b3fd62ea1a 1260 CLEAR_BIT(LPTIMx->IER, LPTIM_IER_ARROKIE);
NYX 0:85b3fd62ea1a 1261 }
NYX 0:85b3fd62ea1a 1262
NYX 0:85b3fd62ea1a 1263 /**
NYX 0:85b3fd62ea1a 1264 * @brief Indicates whether the autoreload register write completed interrupt (ARROKIE) is enabled.
NYX 0:85b3fd62ea1a 1265 * @rmtoll IER ARROKIE LL_LPTIM_IsEnabledIT_ARROK
NYX 0:85b3fd62ea1a 1266 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1267 * @retval State of bit (1 or 0).
NYX 0:85b3fd62ea1a 1268 */
NYX 0:85b3fd62ea1a 1269 __STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_ARROK(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1270 {
NYX 0:85b3fd62ea1a 1271 return (READ_BIT(LPTIMx->IER, LPTIM_IER_ARROKIE) == (LPTIM_IER_ARROKIE));
NYX 0:85b3fd62ea1a 1272 }
NYX 0:85b3fd62ea1a 1273
NYX 0:85b3fd62ea1a 1274 /**
NYX 0:85b3fd62ea1a 1275 * @brief Enable direction change to up interrupt (UPIE).
NYX 0:85b3fd62ea1a 1276 * @rmtoll IER UPIE LL_LPTIM_EnableIT_UP
NYX 0:85b3fd62ea1a 1277 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1278 * @retval None
NYX 0:85b3fd62ea1a 1279 */
NYX 0:85b3fd62ea1a 1280 __STATIC_INLINE void LL_LPTIM_EnableIT_UP(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1281 {
NYX 0:85b3fd62ea1a 1282 SET_BIT(LPTIMx->IER, LPTIM_IER_UPIE);
NYX 0:85b3fd62ea1a 1283 }
NYX 0:85b3fd62ea1a 1284
NYX 0:85b3fd62ea1a 1285 /**
NYX 0:85b3fd62ea1a 1286 * @brief Disable direction change to up interrupt (UPIE).
NYX 0:85b3fd62ea1a 1287 * @rmtoll IER UPIE LL_LPTIM_DisableIT_UP
NYX 0:85b3fd62ea1a 1288 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1289 * @retval None
NYX 0:85b3fd62ea1a 1290 */
NYX 0:85b3fd62ea1a 1291 __STATIC_INLINE void LL_LPTIM_DisableIT_UP(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1292 {
NYX 0:85b3fd62ea1a 1293 CLEAR_BIT(LPTIMx->IER, LPTIM_IER_UPIE);
NYX 0:85b3fd62ea1a 1294 }
NYX 0:85b3fd62ea1a 1295
NYX 0:85b3fd62ea1a 1296 /**
NYX 0:85b3fd62ea1a 1297 * @brief Indicates whether the direction change to up interrupt (UPIE) is enabled.
NYX 0:85b3fd62ea1a 1298 * @rmtoll IER UPIE LL_LPTIM_IsEnabledIT_UP
NYX 0:85b3fd62ea1a 1299 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1300 * @retval State of bit (1 or 0).
NYX 0:85b3fd62ea1a 1301 */
NYX 0:85b3fd62ea1a 1302 __STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_UP(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1303 {
NYX 0:85b3fd62ea1a 1304 return (READ_BIT(LPTIMx->IER, LPTIM_IER_UPIE) == (LPTIM_IER_UPIE));
NYX 0:85b3fd62ea1a 1305 }
NYX 0:85b3fd62ea1a 1306
NYX 0:85b3fd62ea1a 1307 /**
NYX 0:85b3fd62ea1a 1308 * @brief Enable direction change to down interrupt (DOWNIE).
NYX 0:85b3fd62ea1a 1309 * @rmtoll IER DOWNIE LL_LPTIM_EnableIT_DOWN
NYX 0:85b3fd62ea1a 1310 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1311 * @retval None
NYX 0:85b3fd62ea1a 1312 */
NYX 0:85b3fd62ea1a 1313 __STATIC_INLINE void LL_LPTIM_EnableIT_DOWN(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1314 {
NYX 0:85b3fd62ea1a 1315 SET_BIT(LPTIMx->IER, LPTIM_IER_DOWNIE);
NYX 0:85b3fd62ea1a 1316 }
NYX 0:85b3fd62ea1a 1317
NYX 0:85b3fd62ea1a 1318 /**
NYX 0:85b3fd62ea1a 1319 * @brief Disable direction change to down interrupt (DOWNIE).
NYX 0:85b3fd62ea1a 1320 * @rmtoll IER DOWNIE LL_LPTIM_DisableIT_DOWN
NYX 0:85b3fd62ea1a 1321 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1322 * @retval None
NYX 0:85b3fd62ea1a 1323 */
NYX 0:85b3fd62ea1a 1324 __STATIC_INLINE void LL_LPTIM_DisableIT_DOWN(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1325 {
NYX 0:85b3fd62ea1a 1326 CLEAR_BIT(LPTIMx->IER, LPTIM_IER_DOWNIE);
NYX 0:85b3fd62ea1a 1327 }
NYX 0:85b3fd62ea1a 1328
NYX 0:85b3fd62ea1a 1329 /**
NYX 0:85b3fd62ea1a 1330 * @brief Indicates whether the direction change to down interrupt (DOWNIE) is enabled.
NYX 0:85b3fd62ea1a 1331 * @rmtoll IER DOWNIE LL_LPTIM_IsEnabledIT_DOWN
NYX 0:85b3fd62ea1a 1332 * @param LPTIMx Low-Power Timer instance
NYX 0:85b3fd62ea1a 1333 * @retval State of bit (1 or 0).
NYX 0:85b3fd62ea1a 1334 */
NYX 0:85b3fd62ea1a 1335 __STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_DOWN(LPTIM_TypeDef *LPTIMx)
NYX 0:85b3fd62ea1a 1336 {
NYX 0:85b3fd62ea1a 1337 return (READ_BIT(LPTIMx->IER, LPTIM_IER_DOWNIE) == (LPTIM_IER_DOWNIE));
NYX 0:85b3fd62ea1a 1338 }
NYX 0:85b3fd62ea1a 1339
NYX 0:85b3fd62ea1a 1340 /**
NYX 0:85b3fd62ea1a 1341 * @}
NYX 0:85b3fd62ea1a 1342 */
NYX 0:85b3fd62ea1a 1343
NYX 0:85b3fd62ea1a 1344 #if defined(USE_FULL_LL_DRIVER)
NYX 0:85b3fd62ea1a 1345 /** @defgroup LPTIM_LL_EF_Init Initialisation and deinitialisation functions
NYX 0:85b3fd62ea1a 1346 * @{
NYX 0:85b3fd62ea1a 1347 */
NYX 0:85b3fd62ea1a 1348
NYX 0:85b3fd62ea1a 1349 ErrorStatus LL_LPTIM_DeInit(LPTIM_TypeDef *LPTIMx);
NYX 0:85b3fd62ea1a 1350 void LL_LPTIM_StructInit(LL_LPTIM_InitTypeDef *LPTIM_InitStruct);
NYX 0:85b3fd62ea1a 1351 ErrorStatus LL_LPTIM_Init(LPTIM_TypeDef *LPTIMx, LL_LPTIM_InitTypeDef *LPTIM_InitStruct);
NYX 0:85b3fd62ea1a 1352 /**
NYX 0:85b3fd62ea1a 1353 * @}
NYX 0:85b3fd62ea1a 1354 */
NYX 0:85b3fd62ea1a 1355 #endif /* USE_FULL_LL_DRIVER */
NYX 0:85b3fd62ea1a 1356
NYX 0:85b3fd62ea1a 1357 /**
NYX 0:85b3fd62ea1a 1358 * @}
NYX 0:85b3fd62ea1a 1359 */
NYX 0:85b3fd62ea1a 1360
NYX 0:85b3fd62ea1a 1361 /**
NYX 0:85b3fd62ea1a 1362 * @}
NYX 0:85b3fd62ea1a 1363 */
NYX 0:85b3fd62ea1a 1364
NYX 0:85b3fd62ea1a 1365 #endif /* LPTIM1 */
NYX 0:85b3fd62ea1a 1366
NYX 0:85b3fd62ea1a 1367 /**
NYX 0:85b3fd62ea1a 1368 * @}
NYX 0:85b3fd62ea1a 1369 */
NYX 0:85b3fd62ea1a 1370
NYX 0:85b3fd62ea1a 1371 #ifdef __cplusplus
NYX 0:85b3fd62ea1a 1372 }
NYX 0:85b3fd62ea1a 1373 #endif
NYX 0:85b3fd62ea1a 1374
NYX 0:85b3fd62ea1a 1375 #endif /* __STM32F4xx_LL_LPTIM_H */
NYX 0:85b3fd62ea1a 1376
NYX 0:85b3fd62ea1a 1377 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/