stm32f4xx_hal_lptim.h
Go to the documentation of this file.
1 
20 /* Define to prevent recursive inclusion -------------------------------------*/
21 #ifndef STM32F4xx_HAL_LPTIM_H
22 #define STM32F4xx_HAL_LPTIM_H
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 /* Includes ------------------------------------------------------------------*/
29 #include "stm32f4xx_hal_def.h"
30 
35 #if defined (LPTIM1)
36 
41 /* Exported types ------------------------------------------------------------*/
45 #define LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT EXTI_IMR_MR23
50 typedef struct
51 {
52  uint32_t Source;
55  uint32_t Prescaler;
58 } LPTIM_ClockConfigTypeDef;
59 
63 typedef struct
64 {
65  uint32_t Polarity;
72  uint32_t SampleTime;
76 } LPTIM_ULPClockConfigTypeDef;
77 
81 typedef struct
82 {
83  uint32_t Source;
86  uint32_t ActiveEdge;
90  uint32_t SampleTime;
93 } LPTIM_TriggerConfigTypeDef;
94 
98 typedef struct
99 {
100  LPTIM_ClockConfigTypeDef Clock;
102  LPTIM_ULPClockConfigTypeDef UltraLowPowerClock;
104  LPTIM_TriggerConfigTypeDef Trigger;
106  uint32_t OutputPolarity;
109  uint32_t UpdateMode;
113  uint32_t CounterSource;
116 } LPTIM_InitTypeDef;
117 
121 typedef enum
122 {
123  HAL_LPTIM_STATE_RESET = 0x00U,
124  HAL_LPTIM_STATE_READY = 0x01U,
125  HAL_LPTIM_STATE_BUSY = 0x02U,
126  HAL_LPTIM_STATE_TIMEOUT = 0x03U,
127  HAL_LPTIM_STATE_ERROR = 0x04U
128 } HAL_LPTIM_StateTypeDef;
129 
133 #if (USE_HAL_LPTIM_REGISTER_CALLBACKS == 1)
134 typedef struct __LPTIM_HandleTypeDef
135 #else
136 typedef struct
137 #endif /* USE_HAL_LPTIM_REGISTER_CALLBACKS */
138 {
139  LPTIM_TypeDef *Instance;
141  LPTIM_InitTypeDef Init;
143  HAL_StatusTypeDef Status;
145  HAL_LockTypeDef Lock;
147  __IO HAL_LPTIM_StateTypeDef State;
149 #if (USE_HAL_LPTIM_REGISTER_CALLBACKS == 1)
150  void (* MspInitCallback)(struct __LPTIM_HandleTypeDef *hlptim);
151  void (* MspDeInitCallback)(struct __LPTIM_HandleTypeDef *hlptim);
152  void (* CompareMatchCallback)(struct __LPTIM_HandleTypeDef *hlptim);
153  void (* AutoReloadMatchCallback)(struct __LPTIM_HandleTypeDef *hlptim);
154  void (* TriggerCallback)(struct __LPTIM_HandleTypeDef *hlptim);
155  void (* CompareWriteCallback)(struct __LPTIM_HandleTypeDef *hlptim);
156  void (* AutoReloadWriteCallback)(struct __LPTIM_HandleTypeDef *hlptim);
157  void (* DirectionUpCallback)(struct __LPTIM_HandleTypeDef *hlptim);
158  void (* DirectionDownCallback)(struct __LPTIM_HandleTypeDef *hlptim);
159 #endif /* USE_HAL_LPTIM_REGISTER_CALLBACKS */
160 } LPTIM_HandleTypeDef;
161 
162 #if (USE_HAL_LPTIM_REGISTER_CALLBACKS == 1)
163 
166 typedef enum
167 {
168  HAL_LPTIM_MSPINIT_CB_ID = 0x00U,
169  HAL_LPTIM_MSPDEINIT_CB_ID = 0x01U,
170  HAL_LPTIM_COMPARE_MATCH_CB_ID = 0x02U,
171  HAL_LPTIM_AUTORELOAD_MATCH_CB_ID = 0x03U,
172  HAL_LPTIM_TRIGGER_CB_ID = 0x04U,
173  HAL_LPTIM_COMPARE_WRITE_CB_ID = 0x05U,
174  HAL_LPTIM_AUTORELOAD_WRITE_CB_ID = 0x06U,
175  HAL_LPTIM_DIRECTION_UP_CB_ID = 0x07U,
176  HAL_LPTIM_DIRECTION_DOWN_CB_ID = 0x08U,
177 } HAL_LPTIM_CallbackIDTypeDef;
178 
182 typedef void (*pLPTIM_CallbackTypeDef)(LPTIM_HandleTypeDef *hlptim);
184 #endif /* USE_HAL_LPTIM_REGISTER_CALLBACKS */
185 
189 /* Exported constants --------------------------------------------------------*/
197 #define LPTIM_CLOCKSOURCE_APBCLOCK_LPOSC 0x00000000U
198 #define LPTIM_CLOCKSOURCE_ULPTIM LPTIM_CFGR_CKSEL
199 
206 #define LPTIM_PRESCALER_DIV1 0x00000000U
207 #define LPTIM_PRESCALER_DIV2 LPTIM_CFGR_PRESC_0
208 #define LPTIM_PRESCALER_DIV4 LPTIM_CFGR_PRESC_1
209 #define LPTIM_PRESCALER_DIV8 (LPTIM_CFGR_PRESC_0 | LPTIM_CFGR_PRESC_1)
210 #define LPTIM_PRESCALER_DIV16 LPTIM_CFGR_PRESC_2
211 #define LPTIM_PRESCALER_DIV32 (LPTIM_CFGR_PRESC_0 | LPTIM_CFGR_PRESC_2)
212 #define LPTIM_PRESCALER_DIV64 (LPTIM_CFGR_PRESC_1 | LPTIM_CFGR_PRESC_2)
213 #define LPTIM_PRESCALER_DIV128 LPTIM_CFGR_PRESC
214 
222 #define LPTIM_OUTPUTPOLARITY_HIGH 0x00000000U
223 #define LPTIM_OUTPUTPOLARITY_LOW LPTIM_CFGR_WAVPOL
224 
231 #define LPTIM_CLOCKSAMPLETIME_DIRECTTRANSITION 0x00000000U
232 #define LPTIM_CLOCKSAMPLETIME_2TRANSITIONS LPTIM_CFGR_CKFLT_0
233 #define LPTIM_CLOCKSAMPLETIME_4TRANSITIONS LPTIM_CFGR_CKFLT_1
234 #define LPTIM_CLOCKSAMPLETIME_8TRANSITIONS LPTIM_CFGR_CKFLT
235 
242 #define LPTIM_CLOCKPOLARITY_RISING 0x00000000U
243 #define LPTIM_CLOCKPOLARITY_FALLING LPTIM_CFGR_CKPOL_0
244 #define LPTIM_CLOCKPOLARITY_RISING_FALLING LPTIM_CFGR_CKPOL_1
245 
252 #define LPTIM_TRIGSOURCE_SOFTWARE 0x0000FFFFU
253 #define LPTIM_TRIGSOURCE_0 0x00000000U
254 #define LPTIM_TRIGSOURCE_1 LPTIM_CFGR_TRIGSEL_0
255 #define LPTIM_TRIGSOURCE_2 LPTIM_CFGR_TRIGSEL_1
256 #define LPTIM_TRIGSOURCE_3 (LPTIM_CFGR_TRIGSEL_0 | LPTIM_CFGR_TRIGSEL_1)
257 #define LPTIM_TRIGSOURCE_4 LPTIM_CFGR_TRIGSEL_2
258 #define LPTIM_TRIGSOURCE_5 (LPTIM_CFGR_TRIGSEL_0 | LPTIM_CFGR_TRIGSEL_2)
259 
266 #define LPTIM_ACTIVEEDGE_RISING LPTIM_CFGR_TRIGEN_0
267 #define LPTIM_ACTIVEEDGE_FALLING LPTIM_CFGR_TRIGEN_1
268 #define LPTIM_ACTIVEEDGE_RISING_FALLING LPTIM_CFGR_TRIGEN
269 
276 #define LPTIM_TRIGSAMPLETIME_DIRECTTRANSITION 0x00000000U
277 #define LPTIM_TRIGSAMPLETIME_2TRANSITIONS LPTIM_CFGR_TRGFLT_0
278 #define LPTIM_TRIGSAMPLETIME_4TRANSITIONS LPTIM_CFGR_TRGFLT_1
279 #define LPTIM_TRIGSAMPLETIME_8TRANSITIONS LPTIM_CFGR_TRGFLT
280 
288 #define LPTIM_UPDATE_IMMEDIATE 0x00000000U
289 #define LPTIM_UPDATE_ENDOFPERIOD LPTIM_CFGR_PRELOAD
290 
298 #define LPTIM_COUNTERSOURCE_INTERNAL 0x00000000U
299 #define LPTIM_COUNTERSOURCE_EXTERNAL LPTIM_CFGR_COUNTMODE
300 
308 #define LPTIM_FLAG_DOWN LPTIM_ISR_DOWN
309 #define LPTIM_FLAG_UP LPTIM_ISR_UP
310 #define LPTIM_FLAG_ARROK LPTIM_ISR_ARROK
311 #define LPTIM_FLAG_CMPOK LPTIM_ISR_CMPOK
312 #define LPTIM_FLAG_EXTTRIG LPTIM_ISR_EXTTRIG
313 #define LPTIM_FLAG_ARRM LPTIM_ISR_ARRM
314 #define LPTIM_FLAG_CMPM LPTIM_ISR_CMPM
315 
322 #define LPTIM_IT_DOWN LPTIM_IER_DOWNIE
323 #define LPTIM_IT_UP LPTIM_IER_UPIE
324 #define LPTIM_IT_ARROK LPTIM_IER_ARROKIE
325 #define LPTIM_IT_CMPOK LPTIM_IER_CMPOKIE
326 #define LPTIM_IT_EXTTRIG LPTIM_IER_EXTTRIGIE
327 #define LPTIM_IT_ARRM LPTIM_IER_ARRMIE
328 #define LPTIM_IT_CMPM LPTIM_IER_CMPMIE
329 
336 #define LPTIM_OP_PAD_AF 0x00000000U
337 #define LPTIM_OP_PAD_PA4 LPTIM_OR_LPT_IN1_RMP_0
338 #define LPTIM_OP_PAD_PB9 LPTIM_OR_LPT_IN1_RMP_1
339 #define LPTIM_OP_TIM_DAC LPTIM_OR_LPT_IN1_RMP
340 
348 /* Exported macros -----------------------------------------------------------*/
357 #if (USE_HAL_LPTIM_REGISTER_CALLBACKS == 1)
358 #define __HAL_LPTIM_RESET_HANDLE_STATE(__HANDLE__) do { \
359  (__HANDLE__)->State = HAL_LPTIM_STATE_RESET; \
360  (__HANDLE__)->MspInitCallback = NULL; \
361  (__HANDLE__)->MspDeInitCallback = NULL; \
362  } while(0)
363 #else
364 #define __HAL_LPTIM_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_LPTIM_STATE_RESET)
365 #endif /* USE_HAL_LPTIM_REGISTER_CALLBACKS */
366 
372 #define __HAL_LPTIM_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (LPTIM_CR_ENABLE))
373 
384 #define __HAL_LPTIM_DISABLE(__HANDLE__) LPTIM_Disable(__HANDLE__)
385 
391 #define __HAL_LPTIM_START_CONTINUOUS(__HANDLE__) ((__HANDLE__)->Instance->CR |= LPTIM_CR_CNTSTRT)
392 
397 #define __HAL_LPTIM_START_SINGLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= LPTIM_CR_SNGSTRT)
398 
406 #define __HAL_LPTIM_AUTORELOAD_SET(__HANDLE__ , __VALUE__) ((__HANDLE__)->Instance->ARR = (__VALUE__))
407 
415 #define __HAL_LPTIM_COMPARE_SET(__HANDLE__ , __VALUE__) ((__HANDLE__)->Instance->CMP = (__VALUE__))
416 
431 #define __HAL_LPTIM_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->ISR &(__FLAG__)) == (__FLAG__))
432 
447 #define __HAL_LPTIM_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ICR = (__FLAG__))
448 
464 #define __HAL_LPTIM_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER |= (__INTERRUPT__))
465 
481 #define __HAL_LPTIM_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER &= (~(__INTERRUPT__)))
482 
498 #define __HAL_LPTIM_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->IER & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
499 
509 #define __HAL_LPTIM_OPTR_CONFIG(__HANDLE__ , __VALUE__) ((__HANDLE__)->Instance->OR = (__VALUE__))
510 
511 
516 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_ENABLE_IT() (EXTI->IMR |= LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT)
517 
522 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_DISABLE_IT() (EXTI->IMR &= ~(LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT))
523 
528 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_ENABLE_EVENT() (EXTI->EMR |= LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT)
529 
534 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT))
535 #if defined(EXTI_IMR_MR23)
536 
541 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT)
542 
547 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT))
548 
553 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT)
554 
559 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT))
560 
565 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_ENABLE_RISING_FALLING_EDGE() do{__HAL_LPTIM_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE();\
566  __HAL_LPTIM_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE();\
567  }while(0)
568 
573 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_DISABLE_RISING_FALLING_EDGE() do{__HAL_LPTIM_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE();\
574  __HAL_LPTIM_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE();\
575  }while(0)
576 
581 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_GET_FLAG() (EXTI->PR & LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT)
582 
587 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_CLEAR_FLAG() (EXTI->PR = LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT)
588 
593 #define __HAL_LPTIM_WAKEUPTIMER_EXTI_GENERATE_SWIT() (EXTI->SWIER |= LPTIM_EXTI_LINE_WAKEUPTIMER_EVENT)
594 #endif /* EXTI_IMR_MR23 */
595 
600 /* Exported functions --------------------------------------------------------*/
609 /* Initialization/de-initialization functions ********************************/
610 HAL_StatusTypeDef HAL_LPTIM_Init(LPTIM_HandleTypeDef *hlptim);
611 HAL_StatusTypeDef HAL_LPTIM_DeInit(LPTIM_HandleTypeDef *hlptim);
612 
613 /* MSP functions *************************************************************/
614 void HAL_LPTIM_MspInit(LPTIM_HandleTypeDef *hlptim);
615 void HAL_LPTIM_MspDeInit(LPTIM_HandleTypeDef *hlptim);
624 /* Start/Stop operation functions *********************************************/
625 /* ################################# PWM Mode ################################*/
626 /* Blocking mode: Polling */
627 HAL_StatusTypeDef HAL_LPTIM_PWM_Start(LPTIM_HandleTypeDef *hlptim, uint32_t Period, uint32_t Pulse);
628 HAL_StatusTypeDef HAL_LPTIM_PWM_Stop(LPTIM_HandleTypeDef *hlptim);
629 /* Non-Blocking mode: Interrupt */
630 HAL_StatusTypeDef HAL_LPTIM_PWM_Start_IT(LPTIM_HandleTypeDef *hlptim, uint32_t Period, uint32_t Pulse);
631 HAL_StatusTypeDef HAL_LPTIM_PWM_Stop_IT(LPTIM_HandleTypeDef *hlptim);
632 
633 /* ############################# One Pulse Mode ##############################*/
634 /* Blocking mode: Polling */
635 HAL_StatusTypeDef HAL_LPTIM_OnePulse_Start(LPTIM_HandleTypeDef *hlptim, uint32_t Period, uint32_t Pulse);
636 HAL_StatusTypeDef HAL_LPTIM_OnePulse_Stop(LPTIM_HandleTypeDef *hlptim);
637 /* Non-Blocking mode: Interrupt */
638 HAL_StatusTypeDef HAL_LPTIM_OnePulse_Start_IT(LPTIM_HandleTypeDef *hlptim, uint32_t Period, uint32_t Pulse);
639 HAL_StatusTypeDef HAL_LPTIM_OnePulse_Stop_IT(LPTIM_HandleTypeDef *hlptim);
640 
641 /* ############################## Set once Mode ##############################*/
642 /* Blocking mode: Polling */
643 HAL_StatusTypeDef HAL_LPTIM_SetOnce_Start(LPTIM_HandleTypeDef *hlptim, uint32_t Period, uint32_t Pulse);
644 HAL_StatusTypeDef HAL_LPTIM_SetOnce_Stop(LPTIM_HandleTypeDef *hlptim);
645 /* Non-Blocking mode: Interrupt */
646 HAL_StatusTypeDef HAL_LPTIM_SetOnce_Start_IT(LPTIM_HandleTypeDef *hlptim, uint32_t Period, uint32_t Pulse);
647 HAL_StatusTypeDef HAL_LPTIM_SetOnce_Stop_IT(LPTIM_HandleTypeDef *hlptim);
648 
649 /* ############################### Encoder Mode ##############################*/
650 /* Blocking mode: Polling */
651 HAL_StatusTypeDef HAL_LPTIM_Encoder_Start(LPTIM_HandleTypeDef *hlptim, uint32_t Period);
652 HAL_StatusTypeDef HAL_LPTIM_Encoder_Stop(LPTIM_HandleTypeDef *hlptim);
653 /* Non-Blocking mode: Interrupt */
654 HAL_StatusTypeDef HAL_LPTIM_Encoder_Start_IT(LPTIM_HandleTypeDef *hlptim, uint32_t Period);
655 HAL_StatusTypeDef HAL_LPTIM_Encoder_Stop_IT(LPTIM_HandleTypeDef *hlptim);
656 
657 /* ############################# Time out Mode ##############################*/
658 /* Blocking mode: Polling */
659 HAL_StatusTypeDef HAL_LPTIM_TimeOut_Start(LPTIM_HandleTypeDef *hlptim, uint32_t Period, uint32_t Timeout);
660 HAL_StatusTypeDef HAL_LPTIM_TimeOut_Stop(LPTIM_HandleTypeDef *hlptim);
661 /* Non-Blocking mode: Interrupt */
662 HAL_StatusTypeDef HAL_LPTIM_TimeOut_Start_IT(LPTIM_HandleTypeDef *hlptim, uint32_t Period, uint32_t Timeout);
663 HAL_StatusTypeDef HAL_LPTIM_TimeOut_Stop_IT(LPTIM_HandleTypeDef *hlptim);
664 
665 /* ############################## Counter Mode ###############################*/
666 /* Blocking mode: Polling */
667 HAL_StatusTypeDef HAL_LPTIM_Counter_Start(LPTIM_HandleTypeDef *hlptim, uint32_t Period);
668 HAL_StatusTypeDef HAL_LPTIM_Counter_Stop(LPTIM_HandleTypeDef *hlptim);
669 /* Non-Blocking mode: Interrupt */
670 HAL_StatusTypeDef HAL_LPTIM_Counter_Start_IT(LPTIM_HandleTypeDef *hlptim, uint32_t Period);
671 HAL_StatusTypeDef HAL_LPTIM_Counter_Stop_IT(LPTIM_HandleTypeDef *hlptim);
680 /* Reading operation functions ************************************************/
681 uint32_t HAL_LPTIM_ReadCounter(LPTIM_HandleTypeDef *hlptim);
682 uint32_t HAL_LPTIM_ReadAutoReload(LPTIM_HandleTypeDef *hlptim);
683 uint32_t HAL_LPTIM_ReadCompare(LPTIM_HandleTypeDef *hlptim);
692 /* LPTIM IRQ functions *******************************************************/
693 void HAL_LPTIM_IRQHandler(LPTIM_HandleTypeDef *hlptim);
694 
695 /* CallBack functions ********************************************************/
696 void HAL_LPTIM_CompareMatchCallback(LPTIM_HandleTypeDef *hlptim);
697 void HAL_LPTIM_AutoReloadMatchCallback(LPTIM_HandleTypeDef *hlptim);
698 void HAL_LPTIM_TriggerCallback(LPTIM_HandleTypeDef *hlptim);
699 void HAL_LPTIM_CompareWriteCallback(LPTIM_HandleTypeDef *hlptim);
700 void HAL_LPTIM_AutoReloadWriteCallback(LPTIM_HandleTypeDef *hlptim);
701 void HAL_LPTIM_DirectionUpCallback(LPTIM_HandleTypeDef *hlptim);
702 void HAL_LPTIM_DirectionDownCallback(LPTIM_HandleTypeDef *hlptim);
703 
704 /* Callbacks Register/UnRegister functions ***********************************/
705 #if (USE_HAL_LPTIM_REGISTER_CALLBACKS == 1)
706 HAL_StatusTypeDef HAL_LPTIM_RegisterCallback(LPTIM_HandleTypeDef *lphtim, HAL_LPTIM_CallbackIDTypeDef CallbackID, pLPTIM_CallbackTypeDef pCallback);
707 HAL_StatusTypeDef HAL_LPTIM_UnRegisterCallback(LPTIM_HandleTypeDef *lphtim, HAL_LPTIM_CallbackIDTypeDef CallbackID);
708 #endif /* USE_HAL_LPTIM_REGISTER_CALLBACKS */
709 
717 /* Peripheral State functions ************************************************/
718 HAL_LPTIM_StateTypeDef HAL_LPTIM_GetState(LPTIM_HandleTypeDef *hlptim);
727 /* Private types -------------------------------------------------------------*/
736 /* Private variables ---------------------------------------------------------*/
745 /* Private constants ---------------------------------------------------------*/
754 /* Private macros ------------------------------------------------------------*/
759 #define IS_LPTIM_CLOCK_SOURCE(__SOURCE__) (((__SOURCE__) == LPTIM_CLOCKSOURCE_ULPTIM) || \
760  ((__SOURCE__) == LPTIM_CLOCKSOURCE_APBCLOCK_LPOSC))
761 
762 
763 #define IS_LPTIM_CLOCK_PRESCALER(__PRESCALER__) (((__PRESCALER__) == LPTIM_PRESCALER_DIV1 ) || \
764  ((__PRESCALER__) == LPTIM_PRESCALER_DIV2 ) || \
765  ((__PRESCALER__) == LPTIM_PRESCALER_DIV4 ) || \
766  ((__PRESCALER__) == LPTIM_PRESCALER_DIV8 ) || \
767  ((__PRESCALER__) == LPTIM_PRESCALER_DIV16 ) || \
768  ((__PRESCALER__) == LPTIM_PRESCALER_DIV32 ) || \
769  ((__PRESCALER__) == LPTIM_PRESCALER_DIV64 ) || \
770  ((__PRESCALER__) == LPTIM_PRESCALER_DIV128))
771 
772 #define IS_LPTIM_CLOCK_PRESCALERDIV1(__PRESCALER__) ((__PRESCALER__) == LPTIM_PRESCALER_DIV1)
773 
774 #define IS_LPTIM_OUTPUT_POLARITY(__POLARITY__) (((__POLARITY__) == LPTIM_OUTPUTPOLARITY_LOW ) || \
775  ((__POLARITY__) == LPTIM_OUTPUTPOLARITY_HIGH))
776 
777 #define IS_LPTIM_CLOCK_SAMPLE_TIME(__SAMPLETIME__) (((__SAMPLETIME__) == LPTIM_CLOCKSAMPLETIME_DIRECTTRANSITION) || \
778  ((__SAMPLETIME__) == LPTIM_CLOCKSAMPLETIME_2TRANSITIONS) || \
779  ((__SAMPLETIME__) == LPTIM_CLOCKSAMPLETIME_4TRANSITIONS) || \
780  ((__SAMPLETIME__) == LPTIM_CLOCKSAMPLETIME_8TRANSITIONS))
781 
782 #define IS_LPTIM_CLOCK_POLARITY(__POLARITY__) (((__POLARITY__) == LPTIM_CLOCKPOLARITY_RISING) || \
783  ((__POLARITY__) == LPTIM_CLOCKPOLARITY_FALLING) || \
784  ((__POLARITY__) == LPTIM_CLOCKPOLARITY_RISING_FALLING))
785 
786 #define IS_LPTIM_TRG_SOURCE(__TRIG__) (((__TRIG__) == LPTIM_TRIGSOURCE_SOFTWARE) || \
787  ((__TRIG__) == LPTIM_TRIGSOURCE_0) || \
788  ((__TRIG__) == LPTIM_TRIGSOURCE_1) || \
789  ((__TRIG__) == LPTIM_TRIGSOURCE_2) || \
790  ((__TRIG__) == LPTIM_TRIGSOURCE_3) || \
791  ((__TRIG__) == LPTIM_TRIGSOURCE_4) || \
792  ((__TRIG__) == LPTIM_TRIGSOURCE_5))
793 
794 #define IS_LPTIM_EXT_TRG_POLARITY(__POLARITY__) (((__POLARITY__) == LPTIM_ACTIVEEDGE_RISING ) || \
795  ((__POLARITY__) == LPTIM_ACTIVEEDGE_FALLING ) || \
796  ((__POLARITY__) == LPTIM_ACTIVEEDGE_RISING_FALLING ))
797 
798 #define IS_LPTIM_TRIG_SAMPLE_TIME(__SAMPLETIME__) (((__SAMPLETIME__) == LPTIM_TRIGSAMPLETIME_DIRECTTRANSITION) || \
799  ((__SAMPLETIME__) == LPTIM_TRIGSAMPLETIME_2TRANSITIONS ) || \
800  ((__SAMPLETIME__) == LPTIM_TRIGSAMPLETIME_4TRANSITIONS ) || \
801  ((__SAMPLETIME__) == LPTIM_TRIGSAMPLETIME_8TRANSITIONS ))
802 
803 #define IS_LPTIM_UPDATE_MODE(__MODE__) (((__MODE__) == LPTIM_UPDATE_IMMEDIATE) || \
804  ((__MODE__) == LPTIM_UPDATE_ENDOFPERIOD))
805 
806 #define IS_LPTIM_COUNTER_SOURCE(__SOURCE__) (((__SOURCE__) == LPTIM_COUNTERSOURCE_INTERNAL) || \
807  ((__SOURCE__) == LPTIM_COUNTERSOURCE_EXTERNAL))
808 
809 #define IS_LPTIM_AUTORELOAD(__AUTORELOAD__) ((__AUTORELOAD__) <= 0x0000FFFFUL)
810 
811 #define IS_LPTIM_COMPARE(__COMPARE__) ((__COMPARE__) <= 0x0000FFFFUL)
812 
813 #define IS_LPTIM_PERIOD(__PERIOD__) ((__PERIOD__) <= 0x0000FFFFUL)
814 
815 #define IS_LPTIM_PULSE(__PULSE__) ((__PULSE__) <= 0x0000FFFFUL)
816 
821 /* Private functions ---------------------------------------------------------*/
825 void LPTIM_Disable(LPTIM_HandleTypeDef *hlptim);
834 #endif /* LPTIM1 */
835 
839 #ifdef __cplusplus
840 }
841 #endif
842 
843 #endif /* STM32F4xx_HAL_LPTIM_H */
844 
845 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
__IO
#define __IO
Definition: imxrt1050/imxrt1050-evkb/CMSIS/core_cm7.h:237
Init
napi_value Init(napi_env env, napi_value exports)
Definition: porcupine/demo/c/pvrecorder/node/pv_recorder_napi.c:197
HAL_StatusTypeDef
HAL_StatusTypeDef
HAL Status structures definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:40
HAL_LockTypeDef
HAL_LockTypeDef
HAL Lock structures definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:51
stm32f4xx_hal_def.h
This file contains HAL common defines, enumeration, macros and structures definitions.
LPTIM_TypeDef
LPTIMIMER.
Definition: stm32f769xx.h:989


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:52