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