STM32L4xx_HAL_Driver  1.14.0
stm32l4xx_hal_dfsdm_ex.c
Go to the documentation of this file.
1 
24 /* Includes ------------------------------------------------------------------*/
25 #include "stm32l4xx_hal.h"
26 
31 #ifdef HAL_DFSDM_MODULE_ENABLED
32 
33 #if defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx)
34 
40 /* Private types -------------------------------------------------------------*/
41 /* Private variables ---------------------------------------------------------*/
42 /* Private constants ---------------------------------------------------------*/
43 /* Private macros ------------------------------------------------------------*/
44 /* Private functions ---------------------------------------------------------*/
45 /* Exported functions --------------------------------------------------------*/
46 
72 HAL_StatusTypeDef HAL_DFDSMEx_ChannelSetPulsesSkipping(DFSDM_Channel_HandleTypeDef *hdfsdm_channel, uint32_t PulsesValue)
73 {
74  HAL_StatusTypeDef status = HAL_OK;
75 
76  /* Check pulses value */
77  assert_param(IS_DFSDM_CHANNEL_SKIPPING_VALUE(PulsesValue));
78 
79  /* Check DFSDM channel state */
80  if (hdfsdm_channel->State == HAL_DFSDM_CHANNEL_STATE_READY)
81  {
82  /* Set new value of pulses skipping */
83  hdfsdm_channel->Instance->CHDLYR = (PulsesValue & DFSDM_CHDLYR_PLSSKP);
84  }
85  else
86  {
87  status = HAL_ERROR;
88  }
89  return status;
90 }
91 
98 HAL_StatusTypeDef HAL_DFDSMEx_ChannelGetPulsesSkipping(DFSDM_Channel_HandleTypeDef *hdfsdm_channel, uint32_t *PulsesValue)
99 {
100  HAL_StatusTypeDef status = HAL_OK;
101 
102  /* Check DFSDM channel state */
103  if (hdfsdm_channel->State == HAL_DFSDM_CHANNEL_STATE_READY)
104  {
105  /* Get value of remaining pulses to be skipped */
106  *PulsesValue = (hdfsdm_channel->Instance->CHDLYR & DFSDM_CHDLYR_PLSSKP);
107  }
108  else
109  {
110  status = HAL_ERROR;
111  }
112  return status;
113 }
114 
127 #endif /* STM32L4R5xx || STM32L4R7xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx */
128 
129 #endif /* HAL_DFSDM_MODULE_ENABLED */
130 
135 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
struct __DFSDM_Channel_HandleTypeDef else typedef struct endif DFSDM_Channel_HandleTypeDef
DFSDM channel handle structure definition.
This file contains all the functions prototypes for the HAL module driver.
return HAL_OK
HAL_StatusTypeDef HAL_DFDSMEx_ChannelGetPulsesSkipping(DFSDM_Channel_HandleTypeDef *hdfsdm_channel, uint32_t *PulsesValue)
Get value of pulses skipping.
HAL_StatusTypeDef HAL_DFDSMEx_ChannelSetPulsesSkipping(DFSDM_Channel_HandleTypeDef *hdfsdm_channel, uint32_t PulsesValue)
Set value of pulses skipping.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))