STM32F103xB HAL User Manual
stm32f1xx_hal_tim_ex.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32f1xx_hal_tim_ex.h
00004   * @author  MCD Application Team
00005   * @brief   Header file of TIM HAL Extended module.
00006   ******************************************************************************
00007   * @attention
00008   *
00009   * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
00010   * All rights reserved.</center></h2>
00011   *
00012   * This software component is licensed by ST under BSD 3-Clause license,
00013   * the "License"; You may not use this file except in compliance with the
00014   * License. You may obtain a copy of the License at:
00015   *                        opensource.org/licenses/BSD-3-Clause
00016   *
00017   ******************************************************************************
00018   */
00019 
00020 /* Define to prevent recursive inclusion -------------------------------------*/
00021 #ifndef STM32F1xx_HAL_TIM_EX_H
00022 #define STM32F1xx_HAL_TIM_EX_H
00023 
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027 
00028 /* Includes ------------------------------------------------------------------*/
00029 #include "stm32f1xx_hal_def.h"
00030 
00031 /** @addtogroup STM32F1xx_HAL_Driver
00032   * @{
00033   */
00034 
00035 /** @addtogroup TIMEx
00036   * @{
00037   */
00038 
00039 /* Exported types ------------------------------------------------------------*/
00040 /** @defgroup TIMEx_Exported_Types TIM Extended Exported Types
00041   * @{
00042   */
00043 
00044 /**
00045   * @brief  TIM Hall sensor Configuration Structure definition
00046   */
00047 
00048 typedef struct
00049 {
00050   uint32_t IC1Polarity;         /*!< Specifies the active edge of the input signal.
00051                                      This parameter can be a value of @ref TIM_Input_Capture_Polarity */
00052 
00053   uint32_t IC1Prescaler;        /*!< Specifies the Input Capture Prescaler.
00054                                      This parameter can be a value of @ref TIM_Input_Capture_Prescaler */
00055 
00056   uint32_t IC1Filter;           /*!< Specifies the input capture filter.
00057                                      This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */
00058 
00059   uint32_t Commutation_Delay;   /*!< Specifies the pulse value to be loaded into the Capture Compare Register.
00060                                      This parameter can be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */
00061 } TIM_HallSensor_InitTypeDef;
00062 /**
00063   * @}
00064   */
00065 /* End of exported types -----------------------------------------------------*/
00066 
00067 /* Exported constants --------------------------------------------------------*/
00068 /** @defgroup TIMEx_Exported_Constants TIM Extended Exported Constants
00069   * @{
00070   */
00071 
00072 /** @defgroup TIMEx_Remap TIM Extended Remapping
00073   * @{
00074   */
00075 /**
00076   * @}
00077   */
00078 
00079 /**
00080   * @}
00081   */
00082 /* End of exported constants -------------------------------------------------*/
00083 
00084 /* Exported macro ------------------------------------------------------------*/
00085 /** @defgroup TIMEx_Exported_Macros TIM Extended Exported Macros
00086   * @{
00087   */
00088 
00089 /**
00090   * @}
00091   */
00092 /* End of exported macro -----------------------------------------------------*/
00093 
00094 /* Private macro -------------------------------------------------------------*/
00095 /** @defgroup TIMEx_Private_Macros TIM Extended Private Macros
00096   * @{
00097   */
00098 
00099 /**
00100   * @}
00101   */
00102 /* End of private macro ------------------------------------------------------*/
00103 
00104 /* Exported functions --------------------------------------------------------*/
00105 /** @addtogroup TIMEx_Exported_Functions TIM Extended Exported Functions
00106   * @{
00107   */
00108 
00109 /** @addtogroup TIMEx_Exported_Functions_Group1 Extended Timer Hall Sensor functions
00110   *  @brief    Timer Hall Sensor functions
00111   * @{
00112   */
00113 /*  Timer Hall Sensor functions  **********************************************/
00114 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Init(TIM_HandleTypeDef *htim, TIM_HallSensor_InitTypeDef *sConfig);
00115 HAL_StatusTypeDef HAL_TIMEx_HallSensor_DeInit(TIM_HandleTypeDef *htim);
00116 
00117 void HAL_TIMEx_HallSensor_MspInit(TIM_HandleTypeDef *htim);
00118 void HAL_TIMEx_HallSensor_MspDeInit(TIM_HandleTypeDef *htim);
00119 
00120 /* Blocking mode: Polling */
00121 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start(TIM_HandleTypeDef *htim);
00122 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop(TIM_HandleTypeDef *htim);
00123 /* Non-Blocking mode: Interrupt */
00124 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_IT(TIM_HandleTypeDef *htim);
00125 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_IT(TIM_HandleTypeDef *htim);
00126 /* Non-Blocking mode: DMA */
00127 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_DMA(TIM_HandleTypeDef *htim, uint32_t *pData, uint16_t Length);
00128 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_DMA(TIM_HandleTypeDef *htim);
00129 /**
00130   * @}
00131   */
00132 
00133 /** @addtogroup TIMEx_Exported_Functions_Group2 Extended Timer Complementary Output Compare functions
00134   *  @brief   Timer Complementary Output Compare functions
00135   * @{
00136   */
00137 /*  Timer Complementary Output Compare functions  *****************************/
00138 /* Blocking mode: Polling */
00139 HAL_StatusTypeDef HAL_TIMEx_OCN_Start(TIM_HandleTypeDef *htim, uint32_t Channel);
00140 HAL_StatusTypeDef HAL_TIMEx_OCN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel);
00141 
00142 /* Non-Blocking mode: Interrupt */
00143 HAL_StatusTypeDef HAL_TIMEx_OCN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
00144 HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
00145 
00146 /* Non-Blocking mode: DMA */
00147 HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length);
00148 HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel);
00149 /**
00150   * @}
00151   */
00152 
00153 /** @addtogroup TIMEx_Exported_Functions_Group3 Extended Timer Complementary PWM functions
00154   *  @brief    Timer Complementary PWM functions
00155   * @{
00156   */
00157 /*  Timer Complementary PWM functions  ****************************************/
00158 /* Blocking mode: Polling */
00159 HAL_StatusTypeDef HAL_TIMEx_PWMN_Start(TIM_HandleTypeDef *htim, uint32_t Channel);
00160 HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel);
00161 
00162 /* Non-Blocking mode: Interrupt */
00163 HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
00164 HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
00165 /* Non-Blocking mode: DMA */
00166 HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length);
00167 HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel);
00168 /**
00169   * @}
00170   */
00171 
00172 /** @addtogroup TIMEx_Exported_Functions_Group4 Extended Timer Complementary One Pulse functions
00173   *  @brief    Timer Complementary One Pulse functions
00174   * @{
00175   */
00176 /*  Timer Complementary One Pulse functions  **********************************/
00177 /* Blocking mode: Polling */
00178 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
00179 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
00180 
00181 /* Non-Blocking mode: Interrupt */
00182 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
00183 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
00184 /**
00185   * @}
00186   */
00187 
00188 /** @addtogroup TIMEx_Exported_Functions_Group5 Extended Peripheral Control functions
00189   *  @brief    Peripheral Control functions
00190   * @{
00191   */
00192 /* Extended Control functions  ************************************************/
00193 HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent(TIM_HandleTypeDef *htim, uint32_t  InputTrigger,
00194                                               uint32_t  CommutationSource);
00195 HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent_IT(TIM_HandleTypeDef *htim, uint32_t  InputTrigger,
00196                                                  uint32_t  CommutationSource);
00197 HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent_DMA(TIM_HandleTypeDef *htim, uint32_t  InputTrigger,
00198                                                   uint32_t  CommutationSource);
00199 HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef *htim,
00200                                                         TIM_MasterConfigTypeDef *sMasterConfig);
00201 HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef *htim,
00202                                                 TIM_BreakDeadTimeConfigTypeDef *sBreakDeadTimeConfig);
00203 HAL_StatusTypeDef HAL_TIMEx_RemapConfig(TIM_HandleTypeDef *htim, uint32_t Remap);
00204 /**
00205   * @}
00206   */
00207 
00208 /** @addtogroup TIMEx_Exported_Functions_Group6 Extended Callbacks functions
00209   * @brief    Extended Callbacks functions
00210   * @{
00211   */
00212 /* Extended Callback **********************************************************/
00213 void HAL_TIMEx_CommutCallback(TIM_HandleTypeDef *htim);
00214 void HAL_TIMEx_CommutHalfCpltCallback(TIM_HandleTypeDef *htim);
00215 void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef *htim);
00216 /**
00217   * @}
00218   */
00219 
00220 /** @addtogroup TIMEx_Exported_Functions_Group7 Extended Peripheral State functions
00221   * @brief    Extended Peripheral State functions
00222   * @{
00223   */
00224 /* Extended Peripheral State functions  ***************************************/
00225 HAL_TIM_StateTypeDef HAL_TIMEx_HallSensor_GetState(TIM_HandleTypeDef *htim);
00226 HAL_TIM_ChannelStateTypeDef HAL_TIMEx_GetChannelNState(TIM_HandleTypeDef *htim,  uint32_t ChannelN);
00227 /**
00228   * @}
00229   */
00230 
00231 /**
00232   * @}
00233   */
00234 /* End of exported functions -------------------------------------------------*/
00235 
00236 /* Private functions----------------------------------------------------------*/
00237 /** @addtogroup TIMEx_Private_Functions TIMEx Private Functions
00238   * @{
00239   */
00240 void TIMEx_DMACommutationCplt(DMA_HandleTypeDef *hdma);
00241 void TIMEx_DMACommutationHalfCplt(DMA_HandleTypeDef *hdma);
00242 /**
00243   * @}
00244   */
00245 /* End of private functions --------------------------------------------------*/
00246 
00247 /**
00248   * @}
00249   */
00250 
00251 /**
00252   * @}
00253   */
00254 
00255 #ifdef __cplusplus
00256 }
00257 #endif
00258 
00259 
00260 #endif /* STM32F1xx_HAL_TIM_EX_H */
00261 
00262 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/