mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Fri Aug 14 13:15:17 2015 +0100
Revision:
610:813dcc80987e
Parent:
573:ad23fe03a082
Synchronized with git revision 6d84db41c6833e0b9b024741eb0616a5f62d5599

Full URL: https://github.com/mbedmicro/mbed/commit/6d84db41c6833e0b9b024741eb0616a5f62d5599/

DISCO_F746NG - Improvements

Who changed what in which revision?

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