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 mbed official

Committer:
Kojto
Date:
Tue Mar 15 14:34:00 2016 +0000
Revision:
116:c0f6e94411f5
Parent:
115:87f2f5183dfb
Release 116 of the mbed library

Changes:
- new targets - NUCLEO_L073RZ
- fixes to IOTSS BEID platform
- LPC824, LPC1549 and LPC11U68 - fix PWMOut SCT bugs
- STM32F7 - Cube driver
- STM32F4 - add RTC LSI macro, defined as 0
- STM32F3 - fix multiple ADC clock initialization
- retarget - binary mode fix for GCC

Who changed what in which revision?

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