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