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