STM32L4xx_HAL_Driver  1.14.0
Peripheral Control functions

Peripheral Control functions. More...

Functions

HAL_StatusTypeDef HAL_TSC_IOConfig (TSC_HandleTypeDef *htsc, TSC_IOConfigTypeDef *config)
 Configure TSC IOs. More...
 
HAL_StatusTypeDef HAL_TSC_IODischarge (TSC_HandleTypeDef *htsc, FunctionalState choice)
 Discharge TSC IOs. More...
 

Detailed Description

Peripheral Control functions.

 ===============================================================================
             ##### Peripheral Control functions #####
 ===============================================================================
    [..]  This section provides functions allowing to:
      (+) Configure TSC IOs
      (+) Discharge TSC IOs

Function Documentation

◆ HAL_TSC_IOConfig()

HAL_StatusTypeDef HAL_TSC_IOConfig ( TSC_HandleTypeDef htsc,
TSC_IOConfigTypeDef config 
)

Configure TSC IOs.

Parameters
htscPointer to a TSC_HandleTypeDef structure that contains the configuration information for the specified TSC.
configPointer to the configuration structure.
Return values
HALstatus

Definition at line 875 of file stm32l4xx_hal_tsc.c.

876 {
877  /* Check the parameters */
878  assert_param(IS_TSC_ALL_INSTANCE(htsc->Instance));
879  assert_param(IS_TSC_GROUP(config->ChannelIOs));
880  assert_param(IS_TSC_GROUP(config->ShieldIOs));
881  assert_param(IS_TSC_GROUP(config->SamplingIOs));
882 
883  /* Process locked */
884  __HAL_LOCK(htsc);
885 
886  /* Stop acquisition */
887  __HAL_TSC_STOP_ACQ(htsc);
888 
889  /* Disable Schmitt trigger hysteresis on all used TSC IOs */
890  htsc->Instance->IOHCR = (~(config->ChannelIOs | config->ShieldIOs | config->SamplingIOs));
891 
892  /* Set channel and shield IOs */
893  htsc->Instance->IOCCR = (config->ChannelIOs | config->ShieldIOs);
894 
895  /* Set sampling IOs */
896  htsc->Instance->IOSCR = config->SamplingIOs;
897 
898  /* Set groups to be acquired */
899  htsc->Instance->IOGCSR = TSC_extract_groups(config->ChannelIOs);
900 
901  /* Process unlocked */
902  __HAL_UNLOCK(htsc);
903 
904  /* Return function status */
905  return HAL_OK;
906 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
static uint32_t TSC_extract_groups(uint32_t iomask)
Utility function used to set the acquired groups mask.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_TSC_IODischarge()

HAL_StatusTypeDef HAL_TSC_IODischarge ( TSC_HandleTypeDef htsc,
FunctionalState  choice 
)

Discharge TSC IOs.

Parameters
htscPointer to a TSC_HandleTypeDef structure that contains the configuration information for the specified TSC.
choiceThis parameter can be set to ENABLE or DISABLE.
Return values
HALstatus

Definition at line 915 of file stm32l4xx_hal_tsc.c.

916 {
917  /* Check the parameters */
918  assert_param(IS_TSC_ALL_INSTANCE(htsc->Instance));
919 
920  /* Process locked */
921  __HAL_LOCK(htsc);
922 
923  if (choice == ENABLE)
924  {
925  __HAL_TSC_SET_IODEF_OUTPPLOW(htsc);
926  }
927  else
928  {
929  __HAL_TSC_SET_IODEF_INFLOAT(htsc);
930  }
931 
932  /* Process unlocked */
933  __HAL_UNLOCK(htsc);
934 
935  /* Return the group acquisition counter */
936  return HAL_OK;
937 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))