STM32L4xx_HAL_Driver  1.14.0
TIM Input Capture functions

TIM Input Capture functions. More...

Functions

HAL_StatusTypeDef HAL_TIM_IC_Init (TIM_HandleTypeDef *htim)
 Initializes the TIM Input Capture Time base according to the specified parameters in the TIM_HandleTypeDef and initializes the associated handle. More...
 
HAL_StatusTypeDef HAL_TIM_IC_DeInit (TIM_HandleTypeDef *htim)
 DeInitializes the TIM peripheral. More...
 
void HAL_TIM_IC_MspInit (TIM_HandleTypeDef *htim)
 Initializes the TIM Input Capture MSP. More...
 
void HAL_TIM_IC_MspDeInit (TIM_HandleTypeDef *htim)
 DeInitializes TIM Input Capture MSP. More...
 
HAL_StatusTypeDef HAL_TIM_IC_Start (TIM_HandleTypeDef *htim, uint32_t Channel)
 Starts the TIM Input Capture measurement. More...
 
HAL_StatusTypeDef HAL_TIM_IC_Stop (TIM_HandleTypeDef *htim, uint32_t Channel)
 Stops the TIM Input Capture measurement. More...
 
HAL_StatusTypeDef HAL_TIM_IC_Start_IT (TIM_HandleTypeDef *htim, uint32_t Channel)
 Starts the TIM Input Capture measurement in interrupt mode. More...
 
HAL_StatusTypeDef HAL_TIM_IC_Stop_IT (TIM_HandleTypeDef *htim, uint32_t Channel)
 Stops the TIM Input Capture measurement in interrupt mode. More...
 
HAL_StatusTypeDef HAL_TIM_IC_Start_DMA (TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length)
 Starts the TIM Input Capture measurement in DMA mode. More...
 
HAL_StatusTypeDef HAL_TIM_IC_Stop_DMA (TIM_HandleTypeDef *htim, uint32_t Channel)
 Stops the TIM Input Capture measurement in DMA mode. More...
 

Detailed Description

TIM Input Capture functions.

  ==============================================================================
              ##### TIM Input Capture functions #####
  ==============================================================================
 [..]
   This section provides functions allowing to:
   (+) Initialize and configure the TIM Input Capture.
   (+) De-initialize the TIM Input Capture.
   (+) Start the TIM Input Capture.
   (+) Stop the TIM Input Capture.
   (+) Start the TIM Input Capture and enable interrupt.
   (+) Stop the TIM Input Capture and disable interrupt.
   (+) Start the TIM Input Capture and enable DMA transfer.
   (+) Stop the TIM Input Capture and disable DMA transfer.

Function Documentation

◆ HAL_TIM_IC_DeInit()

HAL_StatusTypeDef HAL_TIM_IC_DeInit ( TIM_HandleTypeDef htim)

DeInitializes the TIM peripheral.

Parameters
htimTIM Input Capture handle
Return values
HALstatus

Definition at line 1807 of file stm32l4xx_hal_tim.c.

1808 {
1809  /* Check the parameters */
1810  assert_param(IS_TIM_INSTANCE(htim->Instance));
1811 
1812  htim->State = HAL_TIM_STATE_BUSY;
1813 
1814  /* Disable the TIM Peripheral Clock */
1815  __HAL_TIM_DISABLE(htim);
1816 
1817 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
1818  if (htim->IC_MspDeInitCallback == NULL)
1819  {
1820  htim->IC_MspDeInitCallback = HAL_TIM_IC_MspDeInit;
1821  }
1822  /* DeInit the low level hardware */
1823  htim->IC_MspDeInitCallback(htim);
1824 #else
1825  /* DeInit the low level hardware: GPIO, CLOCK, NVIC and DMA */
1826  HAL_TIM_IC_MspDeInit(htim);
1827 #endif /* USE_HAL_TIM_REGISTER_CALLBACKS */
1828 
1829  /* Change TIM state */
1830  htim->State = HAL_TIM_STATE_RESET;
1831 
1832  /* Release Lock */
1833  __HAL_UNLOCK(htim);
1834 
1835  return HAL_OK;
1836 }
void HAL_TIM_IC_MspDeInit(TIM_HandleTypeDef *htim)
DeInitializes TIM Input Capture MSP.
__HAL_UNLOCK(hrtc)
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_TIM_IC_Init()

HAL_StatusTypeDef HAL_TIM_IC_Init ( TIM_HandleTypeDef htim)

Initializes the TIM Input Capture Time base according to the specified parameters in the TIM_HandleTypeDef and initializes the associated handle.

Note
Switching from Center Aligned counter mode to Edge counter mode (or reverse) requires a timer reset to avoid unexpected direction due to DIR bit readonly in center aligned mode. Ex: call HAL_TIM_IC_DeInit() before HAL_TIM_IC_Init()
Parameters
htimTIM Input Capture handle
Return values
HALstatus

Definition at line 1755 of file stm32l4xx_hal_tim.c.

1756 {
1757  /* Check the TIM handle allocation */
1758  if (htim == NULL)
1759  {
1760  return HAL_ERROR;
1761  }
1762 
1763  /* Check the parameters */
1764  assert_param(IS_TIM_INSTANCE(htim->Instance));
1765  assert_param(IS_TIM_COUNTER_MODE(htim->Init.CounterMode));
1766  assert_param(IS_TIM_CLOCKDIVISION_DIV(htim->Init.ClockDivision));
1767  assert_param(IS_TIM_AUTORELOAD_PRELOAD(htim->Init.AutoReloadPreload));
1768 
1769  if (htim->State == HAL_TIM_STATE_RESET)
1770  {
1771  /* Allocate lock resource and initialize it */
1772  htim->Lock = HAL_UNLOCKED;
1773 
1774 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
1775  /* Reset interrupt callbacks to legacy weak callbacks */
1776  TIM_ResetCallback(htim);
1777 
1778  if (htim->IC_MspInitCallback == NULL)
1779  {
1780  htim->IC_MspInitCallback = HAL_TIM_IC_MspInit;
1781  }
1782  /* Init the low level hardware : GPIO, CLOCK, NVIC */
1783  htim->IC_MspInitCallback(htim);
1784 #else
1785  /* Init the low level hardware : GPIO, CLOCK, NVIC and DMA */
1786  HAL_TIM_IC_MspInit(htim);
1787 #endif /* USE_HAL_TIM_REGISTER_CALLBACKS */
1788  }
1789 
1790  /* Set the TIM state */
1791  htim->State = HAL_TIM_STATE_BUSY;
1792 
1793  /* Init the base time for the input capture */
1794  TIM_Base_SetConfig(htim->Instance, &htim->Init);
1795 
1796  /* Initialize the TIM state*/
1797  htim->State = HAL_TIM_STATE_READY;
1798 
1799  return HAL_OK;
1800 }
void TIM_Base_SetConfig(TIM_TypeDef *TIMx, TIM_Base_InitTypeDef *Structure)
Time Base configuration.
void TIM_ResetCallback(TIM_HandleTypeDef *htim)
Reset interrupt callbacks to the legacy weak callbacks.
void HAL_TIM_IC_MspInit(TIM_HandleTypeDef *htim)
Initializes the TIM Input Capture MSP.
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_TIM_IC_MspDeInit()

__weak void HAL_TIM_IC_MspDeInit ( TIM_HandleTypeDef htim)

DeInitializes TIM Input Capture MSP.

Parameters
htimTIM handle
Return values
None

Definition at line 1858 of file stm32l4xx_hal_tim.c.

1859 {
1860  /* Prevent unused argument(s) compilation warning */
1861  UNUSED(htim);
1862 
1863  /* NOTE : This function should not be modified, when the callback is needed,
1864  the HAL_TIM_IC_MspDeInit could be implemented in the user file
1865  */
1866 }

◆ HAL_TIM_IC_MspInit()

__weak void HAL_TIM_IC_MspInit ( TIM_HandleTypeDef htim)

Initializes the TIM Input Capture MSP.

Parameters
htimTIM Input Capture handle
Return values
None

Definition at line 1843 of file stm32l4xx_hal_tim.c.

1844 {
1845  /* Prevent unused argument(s) compilation warning */
1846  UNUSED(htim);
1847 
1848  /* NOTE : This function should not be modified, when the callback is needed,
1849  the HAL_TIM_IC_MspInit could be implemented in the user file
1850  */
1851 }

◆ HAL_TIM_IC_Start()

HAL_StatusTypeDef HAL_TIM_IC_Start ( TIM_HandleTypeDef htim,
uint32_t  Channel 
)

Starts the TIM Input Capture measurement.

Parameters
htimTIM Input Capture handle
ChannelTIM Channels to be enabled This parameter can be one of the following values:
  • TIM_CHANNEL_1: TIM Channel 1 selected
  • TIM_CHANNEL_2: TIM Channel 2 selected
  • TIM_CHANNEL_3: TIM Channel 3 selected
  • TIM_CHANNEL_4: TIM Channel 4 selected
Return values
HALstatus

Definition at line 1879 of file stm32l4xx_hal_tim.c.

1880 {
1881  uint32_t tmpsmcr;
1882 
1883  /* Check the parameters */
1884  assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel));
1885 
1886  /* Enable the Input Capture channel */
1887  TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_ENABLE);
1888 
1889  /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */
1890  tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS;
1891  if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr))
1892  {
1893  __HAL_TIM_ENABLE(htim);
1894  }
1895 
1896  /* Return function status */
1897  return HAL_OK;
1898 }
return HAL_OK
void TIM_CCxChannelCmd(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ChannelState)
Enables or disables the TIM Capture Compare Channel x.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_TIM_IC_Start_DMA()

HAL_StatusTypeDef HAL_TIM_IC_Start_DMA ( TIM_HandleTypeDef htim,
uint32_t  Channel,
uint32_t *  pData,
uint16_t  Length 
)

Starts the TIM Input Capture measurement in DMA mode.

Parameters
htimTIM Input Capture handle
ChannelTIM Channels to be enabled This parameter can be one of the following values:
  • TIM_CHANNEL_1: TIM Channel 1 selected
  • TIM_CHANNEL_2: TIM Channel 2 selected
  • TIM_CHANNEL_3: TIM Channel 3 selected
  • TIM_CHANNEL_4: TIM Channel 4 selected
pDataThe destination Buffer address.
LengthThe length of data to be transferred from TIM peripheral to memory.
Return values
HALstatus

Definition at line 2064 of file stm32l4xx_hal_tim.c.

2065 {
2066  uint32_t tmpsmcr;
2067 
2068  /* Check the parameters */
2069  assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel));
2070  assert_param(IS_TIM_DMA_CC_INSTANCE(htim->Instance));
2071 
2072  if ((htim->State == HAL_TIM_STATE_BUSY))
2073  {
2074  return HAL_BUSY;
2075  }
2076  else if ((htim->State == HAL_TIM_STATE_READY))
2077  {
2078  if ((pData == NULL) && (Length > 0U))
2079  {
2080  return HAL_ERROR;
2081  }
2082  else
2083  {
2084  htim->State = HAL_TIM_STATE_BUSY;
2085  }
2086  }
2087  else
2088  {
2089  /* nothing to do */
2090  }
2091 
2092  switch (Channel)
2093  {
2094  case TIM_CHANNEL_1:
2095  {
2096  /* Set the DMA capture callbacks */
2097  htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMACaptureCplt;
2098  htim->hdma[TIM_DMA_ID_CC1]->XferHalfCpltCallback = TIM_DMACaptureHalfCplt;
2099 
2100  /* Set the DMA error callback */
2101  htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = TIM_DMAError ;
2102 
2103  /* Enable the DMA channel */
2104  if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)&htim->Instance->CCR1, (uint32_t)pData, Length) != HAL_OK)
2105  {
2106  return HAL_ERROR;
2107  }
2108  /* Enable the TIM Capture/Compare 1 DMA request */
2109  __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC1);
2110  break;
2111  }
2112 
2113  case TIM_CHANNEL_2:
2114  {
2115  /* Set the DMA capture callbacks */
2116  htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = TIM_DMACaptureCplt;
2117  htim->hdma[TIM_DMA_ID_CC2]->XferHalfCpltCallback = TIM_DMACaptureHalfCplt;
2118 
2119  /* Set the DMA error callback */
2120  htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = TIM_DMAError ;
2121 
2122  /* Enable the DMA channel */
2123  if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC2], (uint32_t)&htim->Instance->CCR2, (uint32_t)pData, Length) != HAL_OK)
2124  {
2125  return HAL_ERROR;
2126  }
2127  /* Enable the TIM Capture/Compare 2 DMA request */
2128  __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC2);
2129  break;
2130  }
2131 
2132  case TIM_CHANNEL_3:
2133  {
2134  /* Set the DMA capture callbacks */
2135  htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = TIM_DMACaptureCplt;
2136  htim->hdma[TIM_DMA_ID_CC3]->XferHalfCpltCallback = TIM_DMACaptureHalfCplt;
2137 
2138  /* Set the DMA error callback */
2139  htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = TIM_DMAError ;
2140 
2141  /* Enable the DMA channel */
2142  if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC3], (uint32_t)&htim->Instance->CCR3, (uint32_t)pData, Length) != HAL_OK)
2143  {
2144  return HAL_ERROR;
2145  }
2146  /* Enable the TIM Capture/Compare 3 DMA request */
2147  __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC3);
2148  break;
2149  }
2150 
2151  case TIM_CHANNEL_4:
2152  {
2153  /* Set the DMA capture callbacks */
2154  htim->hdma[TIM_DMA_ID_CC4]->XferCpltCallback = TIM_DMACaptureCplt;
2155  htim->hdma[TIM_DMA_ID_CC4]->XferHalfCpltCallback = TIM_DMACaptureHalfCplt;
2156 
2157  /* Set the DMA error callback */
2158  htim->hdma[TIM_DMA_ID_CC4]->XferErrorCallback = TIM_DMAError ;
2159 
2160  /* Enable the DMA channel */
2161  if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC4], (uint32_t)&htim->Instance->CCR4, (uint32_t)pData, Length) != HAL_OK)
2162  {
2163  return HAL_ERROR;
2164  }
2165  /* Enable the TIM Capture/Compare 4 DMA request */
2166  __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC4);
2167  break;
2168  }
2169 
2170  default:
2171  break;
2172  }
2173 
2174  /* Enable the Input Capture channel */
2175  TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_ENABLE);
2176 
2177  /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */
2178  tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS;
2179  if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr))
2180  {
2181  __HAL_TIM_ENABLE(htim);
2182  }
2183 
2184  /* Return function status */
2185  return HAL_OK;
2186 }
HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength)
Start the DMA Transfer with interrupt enabled.
void TIM_DMAError(DMA_HandleTypeDef *hdma)
TIM DMA error callback.
return HAL_OK
void TIM_DMACaptureHalfCplt(DMA_HandleTypeDef *hdma)
TIM DMA Capture half complete callback.
void TIM_DMACaptureCplt(DMA_HandleTypeDef *hdma)
TIM DMA Capture complete callback.
void TIM_CCxChannelCmd(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ChannelState)
Enables or disables the TIM Capture Compare Channel x.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_TIM_IC_Start_IT()

HAL_StatusTypeDef HAL_TIM_IC_Start_IT ( TIM_HandleTypeDef htim,
uint32_t  Channel 
)

Starts the TIM Input Capture measurement in interrupt mode.

Parameters
htimTIM Input Capture handle
ChannelTIM Channels to be enabled This parameter can be one of the following values:
  • TIM_CHANNEL_1: TIM Channel 1 selected
  • TIM_CHANNEL_2: TIM Channel 2 selected
  • TIM_CHANNEL_3: TIM Channel 3 selected
  • TIM_CHANNEL_4: TIM Channel 4 selected
Return values
HALstatus

Definition at line 1937 of file stm32l4xx_hal_tim.c.

1938 {
1939  uint32_t tmpsmcr;
1940 
1941  /* Check the parameters */
1942  assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel));
1943 
1944  switch (Channel)
1945  {
1946  case TIM_CHANNEL_1:
1947  {
1948  /* Enable the TIM Capture/Compare 1 interrupt */
1949  __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC1);
1950  break;
1951  }
1952 
1953  case TIM_CHANNEL_2:
1954  {
1955  /* Enable the TIM Capture/Compare 2 interrupt */
1956  __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC2);
1957  break;
1958  }
1959 
1960  case TIM_CHANNEL_3:
1961  {
1962  /* Enable the TIM Capture/Compare 3 interrupt */
1963  __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC3);
1964  break;
1965  }
1966 
1967  case TIM_CHANNEL_4:
1968  {
1969  /* Enable the TIM Capture/Compare 4 interrupt */
1970  __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC4);
1971  break;
1972  }
1973 
1974  default:
1975  break;
1976  }
1977  /* Enable the Input Capture channel */
1978  TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_ENABLE);
1979 
1980  /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */
1981  tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS;
1982  if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr))
1983  {
1984  __HAL_TIM_ENABLE(htim);
1985  }
1986 
1987  /* Return function status */
1988  return HAL_OK;
1989 }
return HAL_OK
void TIM_CCxChannelCmd(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ChannelState)
Enables or disables the TIM Capture Compare Channel x.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_TIM_IC_Stop()

HAL_StatusTypeDef HAL_TIM_IC_Stop ( TIM_HandleTypeDef htim,
uint32_t  Channel 
)

Stops the TIM Input Capture measurement.

Parameters
htimTIM Input Capture handle
ChannelTIM Channels to be disabled This parameter can be one of the following values:
  • TIM_CHANNEL_1: TIM Channel 1 selected
  • TIM_CHANNEL_2: TIM Channel 2 selected
  • TIM_CHANNEL_3: TIM Channel 3 selected
  • TIM_CHANNEL_4: TIM Channel 4 selected
Return values
HALstatus

Definition at line 1911 of file stm32l4xx_hal_tim.c.

1912 {
1913  /* Check the parameters */
1914  assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel));
1915 
1916  /* Disable the Input Capture channel */
1917  TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_DISABLE);
1918 
1919  /* Disable the Peripheral */
1920  __HAL_TIM_DISABLE(htim);
1921 
1922  /* Return function status */
1923  return HAL_OK;
1924 }
return HAL_OK
void TIM_CCxChannelCmd(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ChannelState)
Enables or disables the TIM Capture Compare Channel x.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_TIM_IC_Stop_DMA()

HAL_StatusTypeDef HAL_TIM_IC_Stop_DMA ( TIM_HandleTypeDef htim,
uint32_t  Channel 
)

Stops the TIM Input Capture measurement in DMA mode.

Parameters
htimTIM Input Capture handle
ChannelTIM Channels to be disabled This parameter can be one of the following values:
  • TIM_CHANNEL_1: TIM Channel 1 selected
  • TIM_CHANNEL_2: TIM Channel 2 selected
  • TIM_CHANNEL_3: TIM Channel 3 selected
  • TIM_CHANNEL_4: TIM Channel 4 selected
Return values
HALstatus

Definition at line 2199 of file stm32l4xx_hal_tim.c.

2200 {
2201  /* Check the parameters */
2202  assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel));
2203  assert_param(IS_TIM_DMA_CC_INSTANCE(htim->Instance));
2204 
2205  switch (Channel)
2206  {
2207  case TIM_CHANNEL_1:
2208  {
2209  /* Disable the TIM Capture/Compare 1 DMA request */
2210  __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC1);
2211  (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC1]);
2212  break;
2213  }
2214 
2215  case TIM_CHANNEL_2:
2216  {
2217  /* Disable the TIM Capture/Compare 2 DMA request */
2218  __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC2);
2219  (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC2]);
2220  break;
2221  }
2222 
2223  case TIM_CHANNEL_3:
2224  {
2225  /* Disable the TIM Capture/Compare 3 DMA request */
2226  __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC3);
2227  (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC3]);
2228  break;
2229  }
2230 
2231  case TIM_CHANNEL_4:
2232  {
2233  /* Disable the TIM Capture/Compare 4 DMA request */
2234  __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC4);
2235  (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC4]);
2236  break;
2237  }
2238 
2239  default:
2240  break;
2241  }
2242 
2243  /* Disable the Input Capture channel */
2244  TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_DISABLE);
2245 
2246  /* Disable the Peripheral */
2247  __HAL_TIM_DISABLE(htim);
2248 
2249  /* Change the htim state */
2250  htim->State = HAL_TIM_STATE_READY;
2251 
2252  /* Return function status */
2253  return HAL_OK;
2254 }
HAL_StatusTypeDef HAL_DMA_Abort_IT(DMA_HandleTypeDef *hdma)
Aborts the DMA Transfer in Interrupt mode.
return HAL_OK
void TIM_CCxChannelCmd(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ChannelState)
Enables or disables the TIM Capture Compare Channel x.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_TIM_IC_Stop_IT()

HAL_StatusTypeDef HAL_TIM_IC_Stop_IT ( TIM_HandleTypeDef htim,
uint32_t  Channel 
)

Stops the TIM Input Capture measurement in interrupt mode.

Parameters
htimTIM Input Capture handle
ChannelTIM Channels to be disabled This parameter can be one of the following values:
  • TIM_CHANNEL_1: TIM Channel 1 selected
  • TIM_CHANNEL_2: TIM Channel 2 selected
  • TIM_CHANNEL_3: TIM Channel 3 selected
  • TIM_CHANNEL_4: TIM Channel 4 selected
Return values
HALstatus

Definition at line 2002 of file stm32l4xx_hal_tim.c.

2003 {
2004  /* Check the parameters */
2005  assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel));
2006 
2007  switch (Channel)
2008  {
2009  case TIM_CHANNEL_1:
2010  {
2011  /* Disable the TIM Capture/Compare 1 interrupt */
2012  __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC1);
2013  break;
2014  }
2015 
2016  case TIM_CHANNEL_2:
2017  {
2018  /* Disable the TIM Capture/Compare 2 interrupt */
2019  __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC2);
2020  break;
2021  }
2022 
2023  case TIM_CHANNEL_3:
2024  {
2025  /* Disable the TIM Capture/Compare 3 interrupt */
2026  __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC3);
2027  break;
2028  }
2029 
2030  case TIM_CHANNEL_4:
2031  {
2032  /* Disable the TIM Capture/Compare 4 interrupt */
2033  __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC4);
2034  break;
2035  }
2036 
2037  default:
2038  break;
2039  }
2040 
2041  /* Disable the Input Capture channel */
2042  TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_DISABLE);
2043 
2044  /* Disable the Peripheral */
2045  __HAL_TIM_DISABLE(htim);
2046 
2047  /* Return function status */
2048  return HAL_OK;
2049 }
return HAL_OK
void TIM_CCxChannelCmd(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ChannelState)
Enables or disables the TIM Capture Compare Channel x.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))