STM32L4xx_HAL_Driver  1.14.0
Channel operation functions

Channel operation functions. More...

Functions

HAL_StatusTypeDef HAL_DFSDM_ChannelCkabStart (DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
 This function allows to start clock absence detection in polling mode. More...
 
HAL_StatusTypeDef HAL_DFSDM_ChannelCkabStart_IT (DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
 This function allows to start clock absence detection in interrupt mode. More...
 
HAL_StatusTypeDef HAL_DFSDM_ChannelCkabStop (DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
 This function allows to stop clock absence detection in polling mode. More...
 
HAL_StatusTypeDef HAL_DFSDM_ChannelCkabStop_IT (DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
 This function allows to stop clock absence detection in interrupt mode. More...
 
HAL_StatusTypeDef HAL_DFSDM_ChannelScdStart (DFSDM_Channel_HandleTypeDef *hdfsdm_channel, uint32_t Threshold, uint32_t BreakSignal)
 This function allows to start short circuit detection in polling mode. More...
 
HAL_StatusTypeDef HAL_DFSDM_ChannelScdStart_IT (DFSDM_Channel_HandleTypeDef *hdfsdm_channel, uint32_t Threshold, uint32_t BreakSignal)
 This function allows to start short circuit detection in interrupt mode. More...
 
HAL_StatusTypeDef HAL_DFSDM_ChannelScdStop (DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
 This function allows to stop short circuit detection in polling mode. More...
 
HAL_StatusTypeDef HAL_DFSDM_ChannelScdStop_IT (DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
 This function allows to stop short circuit detection in interrupt mode. More...
 
int16_t HAL_DFSDM_ChannelGetAwdValue (DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
 This function allows to get channel analog watchdog value. More...
 
HAL_StatusTypeDef HAL_DFSDM_ChannelModifyOffset (DFSDM_Channel_HandleTypeDef *hdfsdm_channel, int32_t Offset)
 This function allows to modify channel offset value. More...
 
HAL_StatusTypeDef HAL_DFSDM_ChannelPollForCkab (DFSDM_Channel_HandleTypeDef *hdfsdm_channel, uint32_t Timeout)
 This function allows to poll for the clock absence detection. More...
 
HAL_StatusTypeDef HAL_DFSDM_ChannelPollForScd (DFSDM_Channel_HandleTypeDef *hdfsdm_channel, uint32_t Timeout)
 This function allows to poll for the short circuit detection. More...
 
void HAL_DFSDM_ChannelCkabCallback (DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
 Clock absence detection callback. More...
 
void HAL_DFSDM_ChannelScdCallback (DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
 Short circuit detection callback. More...
 

Detailed Description

Channel operation functions.

  ==============================================================================
                   ##### Channel operation functions #####
  ==============================================================================
    [..]  This section provides functions allowing to:
      (+) Manage clock absence detector feature.
      (+) Manage short circuit detector feature.
      (+) Get analog watchdog value.
      (+) Modify offset value.

Function Documentation

◆ HAL_DFSDM_ChannelCkabCallback()

__weak void HAL_DFSDM_ChannelCkabCallback ( DFSDM_Channel_HandleTypeDef hdfsdm_channel)

Clock absence detection callback.

Parameters
hdfsdm_channelDFSDM channel handle.
Return values
None

Definition at line 905 of file stm32l4xx_hal_dfsdm.c.

906 {
907  /* Prevent unused argument(s) compilation warning */
908  UNUSED(hdfsdm_channel);
909 
910  /* NOTE : This function should not be modified, when the callback is needed,
911  the HAL_DFSDM_ChannelCkabCallback could be implemented in the user file
912  */
913 }

◆ HAL_DFSDM_ChannelCkabStart()

HAL_StatusTypeDef HAL_DFSDM_ChannelCkabStart ( DFSDM_Channel_HandleTypeDef hdfsdm_channel)

This function allows to start clock absence detection in polling mode.

Note
Same mode has to be used for all channels.
If clock is not available on this channel during 5 seconds, clock absence detection will not be activated and function will return HAL_TIMEOUT error.
Parameters
hdfsdm_channelDFSDM channel handle.
Return values
HALstatus

Definition at line 711 of file stm32l4xx_hal_dfsdm.c.

712 {
713  HAL_StatusTypeDef status = HAL_OK;
714  uint32_t channel;
715  uint32_t tickstart;
716 
717  /* Check parameters */
718  assert_param(IS_DFSDM_CHANNEL_ALL_INSTANCE(hdfsdm_channel->Instance));
719 
720  /* Check DFSDM channel state */
721  if (hdfsdm_channel->State != HAL_DFSDM_CHANNEL_STATE_READY)
722  {
723  /* Return error status */
724  status = HAL_ERROR;
725  }
726  else
727  {
728  /* Get channel number from channel instance */
729  channel = DFSDM_GetChannelFromInstance(hdfsdm_channel->Instance);
730 
731  /* Get timeout */
732  tickstart = HAL_GetTick();
733 
734  /* Clear clock absence flag */
735  while ((((DFSDM1_Filter0->FLTISR & DFSDM_FLTISR_CKABF) >> (DFSDM_FLTISR_CKABF_Pos + channel)) & 1U) != 0U)
736  {
737  DFSDM1_Filter0->FLTICR = (1UL << (DFSDM_FLTICR_CLRCKABF_Pos + channel));
738 
739  /* Check the Timeout */
740  if ((HAL_GetTick() - tickstart) > DFSDM_CKAB_TIMEOUT)
741  {
742  /* Set timeout status */
743  status = HAL_TIMEOUT;
744  break;
745  }
746  }
747 
748  if (status == HAL_OK)
749  {
750  /* Start clock absence detection */
751  hdfsdm_channel->Instance->CHCFGR1 |= DFSDM_CHCFGR1_CKABEN;
752  }
753  }
754  /* Return function status */
755  return status;
756 }
uint32_t HAL_GetTick(void)
Provide a tick value in millisecond.
return HAL_OK
static uint32_t DFSDM_GetChannelFromInstance(const DFSDM_Channel_TypeDef *Instance)
This function allows to get the channel number from channel instance.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_DFSDM_ChannelCkabStart_IT()

HAL_StatusTypeDef HAL_DFSDM_ChannelCkabStart_IT ( DFSDM_Channel_HandleTypeDef hdfsdm_channel)

This function allows to start clock absence detection in interrupt mode.

Note
Same mode has to be used for all channels.
If clock is not available on this channel during 5 seconds, clock absence detection will not be activated and function will return HAL_TIMEOUT error.
Parameters
hdfsdm_channelDFSDM channel handle.
Return values
HALstatus

Definition at line 850 of file stm32l4xx_hal_dfsdm.c.

851 {
852  HAL_StatusTypeDef status = HAL_OK;
853  uint32_t channel;
854  uint32_t tickstart;
855 
856  /* Check parameters */
857  assert_param(IS_DFSDM_CHANNEL_ALL_INSTANCE(hdfsdm_channel->Instance));
858 
859  /* Check DFSDM channel state */
860  if (hdfsdm_channel->State != HAL_DFSDM_CHANNEL_STATE_READY)
861  {
862  /* Return error status */
863  status = HAL_ERROR;
864  }
865  else
866  {
867  /* Get channel number from channel instance */
868  channel = DFSDM_GetChannelFromInstance(hdfsdm_channel->Instance);
869 
870  /* Get timeout */
871  tickstart = HAL_GetTick();
872 
873  /* Clear clock absence flag */
874  while ((((DFSDM1_Filter0->FLTISR & DFSDM_FLTISR_CKABF) >> (DFSDM_FLTISR_CKABF_Pos + channel)) & 1U) != 0U)
875  {
876  DFSDM1_Filter0->FLTICR = (1UL << (DFSDM_FLTICR_CLRCKABF_Pos + channel));
877 
878  /* Check the Timeout */
879  if ((HAL_GetTick() - tickstart) > DFSDM_CKAB_TIMEOUT)
880  {
881  /* Set timeout status */
882  status = HAL_TIMEOUT;
883  break;
884  }
885  }
886 
887  if (status == HAL_OK)
888  {
889  /* Activate clock absence detection interrupt */
890  DFSDM1_Filter0->FLTCR2 |= DFSDM_FLTCR2_CKABIE;
891 
892  /* Start clock absence detection */
893  hdfsdm_channel->Instance->CHCFGR1 |= DFSDM_CHCFGR1_CKABEN;
894  }
895  }
896  /* Return function status */
897  return status;
898 }
uint32_t HAL_GetTick(void)
Provide a tick value in millisecond.
return HAL_OK
static uint32_t DFSDM_GetChannelFromInstance(const DFSDM_Channel_TypeDef *Instance)
This function allows to get the channel number from channel instance.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_DFSDM_ChannelCkabStop()

HAL_StatusTypeDef HAL_DFSDM_ChannelCkabStop ( DFSDM_Channel_HandleTypeDef hdfsdm_channel)

This function allows to stop clock absence detection in polling mode.

Parameters
hdfsdm_channelDFSDM channel handle.
Return values
HALstatus

Definition at line 814 of file stm32l4xx_hal_dfsdm.c.

815 {
816  HAL_StatusTypeDef status = HAL_OK;
817  uint32_t channel;
818 
819  /* Check parameters */
820  assert_param(IS_DFSDM_CHANNEL_ALL_INSTANCE(hdfsdm_channel->Instance));
821 
822  /* Check DFSDM channel state */
823  if (hdfsdm_channel->State != HAL_DFSDM_CHANNEL_STATE_READY)
824  {
825  /* Return error status */
826  status = HAL_ERROR;
827  }
828  else
829  {
830  /* Stop clock absence detection */
831  hdfsdm_channel->Instance->CHCFGR1 &= ~(DFSDM_CHCFGR1_CKABEN);
832 
833  /* Clear clock absence flag */
834  channel = DFSDM_GetChannelFromInstance(hdfsdm_channel->Instance);
835  DFSDM1_Filter0->FLTICR = (1UL << (DFSDM_FLTICR_CLRCKABF_Pos + channel));
836  }
837  /* Return function status */
838  return status;
839 }
return HAL_OK
static uint32_t DFSDM_GetChannelFromInstance(const DFSDM_Channel_TypeDef *Instance)
This function allows to get the channel number from channel instance.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_DFSDM_ChannelCkabStop_IT()

HAL_StatusTypeDef HAL_DFSDM_ChannelCkabStop_IT ( DFSDM_Channel_HandleTypeDef hdfsdm_channel)

This function allows to stop clock absence detection in interrupt mode.

Note
Interrupt will be disabled for all channels
Parameters
hdfsdm_channelDFSDM channel handle.
Return values
HALstatus

Definition at line 921 of file stm32l4xx_hal_dfsdm.c.

922 {
923  HAL_StatusTypeDef status = HAL_OK;
924  uint32_t channel;
925 
926  /* Check parameters */
927  assert_param(IS_DFSDM_CHANNEL_ALL_INSTANCE(hdfsdm_channel->Instance));
928 
929  /* Check DFSDM channel state */
930  if (hdfsdm_channel->State != HAL_DFSDM_CHANNEL_STATE_READY)
931  {
932  /* Return error status */
933  status = HAL_ERROR;
934  }
935  else
936  {
937  /* Stop clock absence detection */
938  hdfsdm_channel->Instance->CHCFGR1 &= ~(DFSDM_CHCFGR1_CKABEN);
939 
940  /* Clear clock absence flag */
941  channel = DFSDM_GetChannelFromInstance(hdfsdm_channel->Instance);
942  DFSDM1_Filter0->FLTICR = (1UL << (DFSDM_FLTICR_CLRCKABF_Pos + channel));
943 
944  /* Disable clock absence detection interrupt */
945  DFSDM1_Filter0->FLTCR2 &= ~(DFSDM_FLTCR2_CKABIE);
946  }
947  /* Return function status */
948  return status;
949 }
return HAL_OK
static uint32_t DFSDM_GetChannelFromInstance(const DFSDM_Channel_TypeDef *Instance)
This function allows to get the channel number from channel instance.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_DFSDM_ChannelGetAwdValue()

int16_t HAL_DFSDM_ChannelGetAwdValue ( DFSDM_Channel_HandleTypeDef hdfsdm_channel)

This function allows to get channel analog watchdog value.

Parameters
hdfsdm_channelDFSDM channel handle.
Return values
Channelanalog watchdog value.

Definition at line 1175 of file stm32l4xx_hal_dfsdm.c.

1176 {
1177  return (int16_t) hdfsdm_channel->Instance->CHWDATAR;
1178 }

◆ HAL_DFSDM_ChannelModifyOffset()

HAL_StatusTypeDef HAL_DFSDM_ChannelModifyOffset ( DFSDM_Channel_HandleTypeDef hdfsdm_channel,
int32_t  Offset 
)

This function allows to modify channel offset value.

Parameters
hdfsdm_channelDFSDM channel handle.
OffsetDFSDM channel offset. This parameter must be a number between Min_Data = -8388608 and Max_Data = 8388607.
Return values
HALstatus.

Definition at line 1187 of file stm32l4xx_hal_dfsdm.c.

1189 {
1190  HAL_StatusTypeDef status = HAL_OK;
1191 
1192  /* Check parameters */
1193  assert_param(IS_DFSDM_CHANNEL_ALL_INSTANCE(hdfsdm_channel->Instance));
1194  assert_param(IS_DFSDM_CHANNEL_OFFSET(Offset));
1195 
1196  /* Check DFSDM channel state */
1197  if (hdfsdm_channel->State != HAL_DFSDM_CHANNEL_STATE_READY)
1198  {
1199  /* Return error status */
1200  status = HAL_ERROR;
1201  }
1202  else
1203  {
1204  /* Modify channel offset */
1205  hdfsdm_channel->Instance->CHCFGR2 &= ~(DFSDM_CHCFGR2_OFFSET);
1206  hdfsdm_channel->Instance->CHCFGR2 |= ((uint32_t) Offset << DFSDM_CHCFGR2_OFFSET_Pos);
1207  }
1208  /* Return function status */
1209  return status;
1210 }
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_DFSDM_ChannelPollForCkab()

HAL_StatusTypeDef HAL_DFSDM_ChannelPollForCkab ( DFSDM_Channel_HandleTypeDef hdfsdm_channel,
uint32_t  Timeout 
)

This function allows to poll for the clock absence detection.

Parameters
hdfsdm_channelDFSDM channel handle.
TimeoutTimeout value in milliseconds.
Return values
HALstatus

Definition at line 764 of file stm32l4xx_hal_dfsdm.c.

766 {
767  uint32_t tickstart;
768  uint32_t channel;
769 
770  /* Check parameters */
771  assert_param(IS_DFSDM_CHANNEL_ALL_INSTANCE(hdfsdm_channel->Instance));
772 
773  /* Check DFSDM channel state */
774  if (hdfsdm_channel->State != HAL_DFSDM_CHANNEL_STATE_READY)
775  {
776  /* Return error status */
777  return HAL_ERROR;
778  }
779  else
780  {
781  /* Get channel number from channel instance */
782  channel = DFSDM_GetChannelFromInstance(hdfsdm_channel->Instance);
783 
784  /* Get timeout */
785  tickstart = HAL_GetTick();
786 
787  /* Wait clock absence detection */
788  while ((((DFSDM1_Filter0->FLTISR & DFSDM_FLTISR_CKABF) >> (DFSDM_FLTISR_CKABF_Pos + channel)) & 1U) == 0U)
789  {
790  /* Check the Timeout */
791  if (Timeout != HAL_MAX_DELAY)
792  {
793  if (((HAL_GetTick() - tickstart) > Timeout) || (Timeout == 0U))
794  {
795  /* Return timeout status */
796  return HAL_TIMEOUT;
797  }
798  }
799  }
800 
801  /* Clear clock absence detection flag */
802  DFSDM1_Filter0->FLTICR = (1UL << (DFSDM_FLTICR_CLRCKABF_Pos + channel));
803 
804  /* Return function status */
805  return HAL_OK;
806  }
807 }
uint32_t HAL_GetTick(void)
Provide a tick value in millisecond.
return HAL_OK
static uint32_t DFSDM_GetChannelFromInstance(const DFSDM_Channel_TypeDef *Instance)
This function allows to get the channel number from channel instance.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_DFSDM_ChannelPollForScd()

HAL_StatusTypeDef HAL_DFSDM_ChannelPollForScd ( DFSDM_Channel_HandleTypeDef hdfsdm_channel,
uint32_t  Timeout 
)

This function allows to poll for the short circuit detection.

Parameters
hdfsdm_channelDFSDM channel handle.
TimeoutTimeout value in milliseconds.
Return values
HALstatus

Definition at line 998 of file stm32l4xx_hal_dfsdm.c.

1000 {
1001  uint32_t tickstart;
1002  uint32_t channel;
1003 
1004  /* Check parameters */
1005  assert_param(IS_DFSDM_CHANNEL_ALL_INSTANCE(hdfsdm_channel->Instance));
1006 
1007  /* Check DFSDM channel state */
1008  if (hdfsdm_channel->State != HAL_DFSDM_CHANNEL_STATE_READY)
1009  {
1010  /* Return error status */
1011  return HAL_ERROR;
1012  }
1013  else
1014  {
1015  /* Get channel number from channel instance */
1016  channel = DFSDM_GetChannelFromInstance(hdfsdm_channel->Instance);
1017 
1018  /* Get timeout */
1019  tickstart = HAL_GetTick();
1020 
1021  /* Wait short circuit detection */
1022  while (((DFSDM1_Filter0->FLTISR & DFSDM_FLTISR_SCDF) >> (DFSDM_FLTISR_SCDF_Pos + channel)) == 0U)
1023  {
1024  /* Check the Timeout */
1025  if (Timeout != HAL_MAX_DELAY)
1026  {
1027  if (((HAL_GetTick() - tickstart) > Timeout) || (Timeout == 0U))
1028  {
1029  /* Return timeout status */
1030  return HAL_TIMEOUT;
1031  }
1032  }
1033  }
1034 
1035  /* Clear short circuit detection flag */
1036  DFSDM1_Filter0->FLTICR = (1UL << (DFSDM_FLTICR_CLRSCDF_Pos + channel));
1037 
1038  /* Return function status */
1039  return HAL_OK;
1040  }
1041 }
uint32_t HAL_GetTick(void)
Provide a tick value in millisecond.
return HAL_OK
static uint32_t DFSDM_GetChannelFromInstance(const DFSDM_Channel_TypeDef *Instance)
This function allows to get the channel number from channel instance.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_DFSDM_ChannelScdCallback()

__weak void HAL_DFSDM_ChannelScdCallback ( DFSDM_Channel_HandleTypeDef hdfsdm_channel)

Short circuit detection callback.

Parameters
hdfsdm_channelDFSDM channel handle.
Return values
None

Definition at line 1124 of file stm32l4xx_hal_dfsdm.c.

1125 {
1126  /* Prevent unused argument(s) compilation warning */
1127  UNUSED(hdfsdm_channel);
1128 
1129  /* NOTE : This function should not be modified, when the callback is needed,
1130  the HAL_DFSDM_ChannelScdCallback could be implemented in the user file
1131  */
1132 }

◆ HAL_DFSDM_ChannelScdStart()

HAL_StatusTypeDef HAL_DFSDM_ChannelScdStart ( DFSDM_Channel_HandleTypeDef hdfsdm_channel,
uint32_t  Threshold,
uint32_t  BreakSignal 
)

This function allows to start short circuit detection in polling mode.

Note
Same mode has to be used for all channels
Parameters
hdfsdm_channelDFSDM channel handle.
ThresholdShort circuit detector threshold. This parameter must be a number between Min_Data = 0 and Max_Data = 255.
BreakSignalBreak signals assigned to short circuit event. This parameter can be a values combination of DFSDM break signals.
Return values
HALstatus

Definition at line 961 of file stm32l4xx_hal_dfsdm.c.

964 {
965  HAL_StatusTypeDef status = HAL_OK;
966 
967  /* Check parameters */
968  assert_param(IS_DFSDM_CHANNEL_ALL_INSTANCE(hdfsdm_channel->Instance));
969  assert_param(IS_DFSDM_CHANNEL_SCD_THRESHOLD(Threshold));
970  assert_param(IS_DFSDM_BREAK_SIGNALS(BreakSignal));
971 
972  /* Check DFSDM channel state */
973  if (hdfsdm_channel->State != HAL_DFSDM_CHANNEL_STATE_READY)
974  {
975  /* Return error status */
976  status = HAL_ERROR;
977  }
978  else
979  {
980  /* Configure threshold and break signals */
981  hdfsdm_channel->Instance->CHAWSCDR &= ~(DFSDM_CHAWSCDR_BKSCD | DFSDM_CHAWSCDR_SCDT);
982  hdfsdm_channel->Instance->CHAWSCDR |= ((BreakSignal << DFSDM_CHAWSCDR_BKSCD_Pos) | \
983  Threshold);
984 
985  /* Start short circuit detection */
986  hdfsdm_channel->Instance->CHCFGR1 |= DFSDM_CHCFGR1_SCDEN;
987  }
988  /* Return function status */
989  return status;
990 }
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_DFSDM_ChannelScdStart_IT()

HAL_StatusTypeDef HAL_DFSDM_ChannelScdStart_IT ( DFSDM_Channel_HandleTypeDef hdfsdm_channel,
uint32_t  Threshold,
uint32_t  BreakSignal 
)

This function allows to start short circuit detection in interrupt mode.

Note
Same mode has to be used for all channels
Parameters
hdfsdm_channelDFSDM channel handle.
ThresholdShort circuit detector threshold. This parameter must be a number between Min_Data = 0 and Max_Data = 255.
BreakSignalBreak signals assigned to short circuit event. This parameter can be a values combination of DFSDM break signals.
Return values
HALstatus

Definition at line 1085 of file stm32l4xx_hal_dfsdm.c.

1088 {
1089  HAL_StatusTypeDef status = HAL_OK;
1090 
1091  /* Check parameters */
1092  assert_param(IS_DFSDM_CHANNEL_ALL_INSTANCE(hdfsdm_channel->Instance));
1093  assert_param(IS_DFSDM_CHANNEL_SCD_THRESHOLD(Threshold));
1094  assert_param(IS_DFSDM_BREAK_SIGNALS(BreakSignal));
1095 
1096  /* Check DFSDM channel state */
1097  if (hdfsdm_channel->State != HAL_DFSDM_CHANNEL_STATE_READY)
1098  {
1099  /* Return error status */
1100  status = HAL_ERROR;
1101  }
1102  else
1103  {
1104  /* Activate short circuit detection interrupt */
1105  DFSDM1_Filter0->FLTCR2 |= DFSDM_FLTCR2_SCDIE;
1106 
1107  /* Configure threshold and break signals */
1108  hdfsdm_channel->Instance->CHAWSCDR &= ~(DFSDM_CHAWSCDR_BKSCD | DFSDM_CHAWSCDR_SCDT);
1109  hdfsdm_channel->Instance->CHAWSCDR |= ((BreakSignal << DFSDM_CHAWSCDR_BKSCD_Pos) | \
1110  Threshold);
1111 
1112  /* Start short circuit detection */
1113  hdfsdm_channel->Instance->CHCFGR1 |= DFSDM_CHCFGR1_SCDEN;
1114  }
1115  /* Return function status */
1116  return status;
1117 }
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_DFSDM_ChannelScdStop()

HAL_StatusTypeDef HAL_DFSDM_ChannelScdStop ( DFSDM_Channel_HandleTypeDef hdfsdm_channel)

This function allows to stop short circuit detection in polling mode.

Parameters
hdfsdm_channelDFSDM channel handle.
Return values
HALstatus

Definition at line 1048 of file stm32l4xx_hal_dfsdm.c.

1049 {
1050  HAL_StatusTypeDef status = HAL_OK;
1051  uint32_t channel;
1052 
1053  /* Check parameters */
1054  assert_param(IS_DFSDM_CHANNEL_ALL_INSTANCE(hdfsdm_channel->Instance));
1055 
1056  /* Check DFSDM channel state */
1057  if (hdfsdm_channel->State != HAL_DFSDM_CHANNEL_STATE_READY)
1058  {
1059  /* Return error status */
1060  status = HAL_ERROR;
1061  }
1062  else
1063  {
1064  /* Stop short circuit detection */
1065  hdfsdm_channel->Instance->CHCFGR1 &= ~(DFSDM_CHCFGR1_SCDEN);
1066 
1067  /* Clear short circuit detection flag */
1068  channel = DFSDM_GetChannelFromInstance(hdfsdm_channel->Instance);
1069  DFSDM1_Filter0->FLTICR = (1UL << (DFSDM_FLTICR_CLRSCDF_Pos + channel));
1070  }
1071  /* Return function status */
1072  return status;
1073 }
return HAL_OK
static uint32_t DFSDM_GetChannelFromInstance(const DFSDM_Channel_TypeDef *Instance)
This function allows to get the channel number from channel instance.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_DFSDM_ChannelScdStop_IT()

HAL_StatusTypeDef HAL_DFSDM_ChannelScdStop_IT ( DFSDM_Channel_HandleTypeDef hdfsdm_channel)

This function allows to stop short circuit detection in interrupt mode.

Note
Interrupt will be disabled for all channels
Parameters
hdfsdm_channelDFSDM channel handle.
Return values
HALstatus

Definition at line 1140 of file stm32l4xx_hal_dfsdm.c.

1141 {
1142  HAL_StatusTypeDef status = HAL_OK;
1143  uint32_t channel;
1144 
1145  /* Check parameters */
1146  assert_param(IS_DFSDM_CHANNEL_ALL_INSTANCE(hdfsdm_channel->Instance));
1147 
1148  /* Check DFSDM channel state */
1149  if (hdfsdm_channel->State != HAL_DFSDM_CHANNEL_STATE_READY)
1150  {
1151  /* Return error status */
1152  status = HAL_ERROR;
1153  }
1154  else
1155  {
1156  /* Stop short circuit detection */
1157  hdfsdm_channel->Instance->CHCFGR1 &= ~(DFSDM_CHCFGR1_SCDEN);
1158 
1159  /* Clear short circuit detection flag */
1160  channel = DFSDM_GetChannelFromInstance(hdfsdm_channel->Instance);
1161  DFSDM1_Filter0->FLTICR = (1UL << (DFSDM_FLTICR_CLRSCDF_Pos + channel));
1162 
1163  /* Disable short circuit detection interrupt */
1164  DFSDM1_Filter0->FLTCR2 &= ~(DFSDM_FLTCR2_SCDIE);
1165  }
1166  /* Return function status */
1167  return status;
1168 }
return HAL_OK
static uint32_t DFSDM_GetChannelFromInstance(const DFSDM_Channel_TypeDef *Instance)
This function allows to get the channel number from channel instance.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))