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