|
|
|
@ -157,20 +157,135 @@ typedef struct { |
|
|
|
|
* @{ |
|
|
|
|
*/ |
|
|
|
|
/* Timer Hall Sensor functions **********************************************/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Initializes the TIM Hall Sensor Interface and create the associated handle. |
|
|
|
|
* @param htim : TIM Encoder Interface handle |
|
|
|
|
* @param sConfig : TIM Hall Sensor configuration structure |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Init(TIM_HandleTypeDef *htim, TIM_HallSensor_InitTypeDef* sConfig); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief DeInitializes the TIM Hall Sensor interface |
|
|
|
|
* @param htim : TIM Hall Sensor handle |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_HallSensor_DeInit(TIM_HandleTypeDef *htim); |
|
|
|
|
|
|
|
|
|
void HAL_TIMEx_HallSensor_MspInit(TIM_HandleTypeDef *htim); |
|
|
|
|
void HAL_TIMEx_HallSensor_MspDeInit(TIM_HandleTypeDef *htim); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Initializes the TIM Hall Sensor MSP. |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @retval None |
|
|
|
|
*/ |
|
|
|
|
__weak void HAL_TIMEx_HallSensor_MspInit(TIM_HandleTypeDef *htim); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief DeInitializes TIM Hall Sensor MSP. |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @retval None |
|
|
|
|
*/ |
|
|
|
|
__weak void HAL_TIMEx_HallSensor_MspDeInit(TIM_HandleTypeDef *htim); |
|
|
|
|
|
|
|
|
|
/* Blocking mode: Polling */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Starts the TIM Hall Sensor Interface. |
|
|
|
|
* @param htim : TIM Hall Sensor handle |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start(TIM_HandleTypeDef *htim); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Stops the TIM Hall sensor Interface. |
|
|
|
|
* @param htim : TIM Hall Sensor handle |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop(TIM_HandleTypeDef *htim); |
|
|
|
|
/* Non-Blocking mode: Interrupt */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Starts the TIM Hall Sensor Interface. |
|
|
|
|
* @param htim : TIM Hall Sensor handle |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Starts the TIM Hall Sensor Interface in interrupt mode. |
|
|
|
|
* @param htim : TIM Hall Sensor handle |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_IT(TIM_HandleTypeDef *htim); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Stops the TIM Hall sensor Interface. |
|
|
|
|
* @param htim : TIM Hall Sensor handle |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Stops the TIM Hall Sensor Interface in interrupt mode. |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_IT(TIM_HandleTypeDef *htim); |
|
|
|
|
/* Non-Blocking mode: DMA */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Starts the TIM Hall Sensor Interface. |
|
|
|
|
* @param htim : TIM Hall Sensor handle |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Starts the TIM Hall Sensor Interface in DMA mode. |
|
|
|
|
* @param htim : TIM Hall Sensor handle |
|
|
|
|
* @param pData : The destination Buffer address. |
|
|
|
|
* @param Length : The length of data to be transferred from TIM peripheral to memory. |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_DMA(TIM_HandleTypeDef *htim, uint32_t *pData, uint16_t Length); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Stops the TIM Hall sensor Interface. |
|
|
|
|
* @param htim : TIM Hall Sensor handle |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Stops the TIM Hall Sensor Interface in DMA mode. |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_DMA(TIM_HandleTypeDef *htim); |
|
|
|
|
/**
|
|
|
|
|
* @} |
|
|
|
@ -185,15 +300,167 @@ HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_DMA(TIM_HandleTypeDef *htim); |
|
|
|
|
*/ |
|
|
|
|
/* Timer Complementary Output Compare functions *****************************/ |
|
|
|
|
/* Blocking mode: Polling */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Starts the TIM Output Compare signal generation on the complementary |
|
|
|
|
* output. |
|
|
|
|
* @param htim : TIM Output Compare handle |
|
|
|
|
* @param Channel : TIM Channel to be enabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @arg TIM_CHANNEL_3: TIM Channel 3 selected |
|
|
|
|
* @arg TIM_CHANNEL_4: TIM Channel 4 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_OCN_Start(TIM_HandleTypeDef *htim, uint32_t Channel); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Stops the TIM Output Compare signal generation on the complementary |
|
|
|
|
* output. |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @param Channel : TIM Channel to be disabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @arg TIM_CHANNEL_3: TIM Channel 3 selected |
|
|
|
|
* @arg TIM_CHANNEL_4: TIM Channel 4 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_OCN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel); |
|
|
|
|
|
|
|
|
|
/* Non-Blocking mode: Interrupt */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Starts the TIM Output Compare signal generation on the complementary |
|
|
|
|
* output. |
|
|
|
|
* @param htim : TIM Output Compare handle |
|
|
|
|
* @param Channel : TIM Channel to be enabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @arg TIM_CHANNEL_3: TIM Channel 3 selected |
|
|
|
|
* @arg TIM_CHANNEL_4: TIM Channel 4 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Starts the TIM Output Compare signal generation in interrupt mode |
|
|
|
|
* on the complementary output. |
|
|
|
|
* @param htim : TIM OC handle |
|
|
|
|
* @param Channel : TIM Channel to be enabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @arg TIM_CHANNEL_3: TIM Channel 3 selected |
|
|
|
|
* @arg TIM_CHANNEL_4: TIM Channel 4 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_OCN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Stops the TIM Output Compare signal generation on the complementary |
|
|
|
|
* output. |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @param Channel : TIM Channel to be disabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @arg TIM_CHANNEL_3: TIM Channel 3 selected |
|
|
|
|
* @arg TIM_CHANNEL_4: TIM Channel 4 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Stops the TIM Output Compare signal generation in interrupt mode |
|
|
|
|
* on the complementary output. |
|
|
|
|
* @param htim : TIM Output Compare handle |
|
|
|
|
* @param Channel : TIM Channel to be disabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @arg TIM_CHANNEL_3: TIM Channel 3 selected |
|
|
|
|
* @arg TIM_CHANNEL_4: TIM Channel 4 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel); |
|
|
|
|
|
|
|
|
|
/* Non-Blocking mode: DMA */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Starts the TIM Output Compare signal generation on the complementary |
|
|
|
|
* output. |
|
|
|
|
* @param htim : TIM Output Compare handle |
|
|
|
|
* @param Channel : TIM Channel to be enabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @arg TIM_CHANNEL_3: TIM Channel 3 selected |
|
|
|
|
* @arg TIM_CHANNEL_4: TIM Channel 4 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Starts the TIM Output Compare signal generation in DMA mode |
|
|
|
|
* on the complementary output. |
|
|
|
|
* @param htim : TIM Output Compare handle |
|
|
|
|
* @param Channel : TIM Channel to be enabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @arg TIM_CHANNEL_3: TIM Channel 3 selected |
|
|
|
|
* @arg TIM_CHANNEL_4: TIM Channel 4 selected |
|
|
|
|
* @param pData : The source Buffer address. |
|
|
|
|
* @param Length : The length of data to be transferred from memory to TIM peripheral |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Stops the TIM Output Compare signal generation on the complementary |
|
|
|
|
* output. |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @param Channel : TIM Channel to be disabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @arg TIM_CHANNEL_3: TIM Channel 3 selected |
|
|
|
|
* @arg TIM_CHANNEL_4: TIM Channel 4 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Stops the TIM Output Compare signal generation in DMA mode |
|
|
|
|
* on the complementary output. |
|
|
|
|
* @param htim : TIM Output Compare handle |
|
|
|
|
* @param Channel : TIM Channel to be disabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @arg TIM_CHANNEL_3: TIM Channel 3 selected |
|
|
|
|
* @arg TIM_CHANNEL_4: TIM Channel 4 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel); |
|
|
|
|
/**
|
|
|
|
|
* @} |
|
|
|
@ -204,14 +471,160 @@ HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Chann |
|
|
|
|
*/ |
|
|
|
|
/* Timer Complementary PWM functions ****************************************/ |
|
|
|
|
/* Blocking mode: Polling */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Starts the PWM signal generation on the complementary output. |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @param Channel : TIM Channel to be enabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @arg TIM_CHANNEL_3: TIM Channel 3 selected |
|
|
|
|
* @arg TIM_CHANNEL_4: TIM Channel 4 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_PWMN_Start(TIM_HandleTypeDef *htim, uint32_t Channel); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Stops the PWM signal generation on the complementary output. |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @param Channel : TIM Channel to be disabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @arg TIM_CHANNEL_3: TIM Channel 3 selected |
|
|
|
|
* @arg TIM_CHANNEL_4: TIM Channel 4 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel); |
|
|
|
|
|
|
|
|
|
/* Non-Blocking mode: Interrupt */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Starts the PWM signal generation on the complementary output. |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @param Channel : TIM Channel to be enabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @arg TIM_CHANNEL_3: TIM Channel 3 selected |
|
|
|
|
* @arg TIM_CHANNEL_4: TIM Channel 4 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Starts the PWM signal generation in interrupt mode on the |
|
|
|
|
* complementary output. |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @param Channel : TIM Channel to be disabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @arg TIM_CHANNEL_3: TIM Channel 3 selected |
|
|
|
|
* @arg TIM_CHANNEL_4: TIM Channel 4 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Stops the PWM signal generation on the complementary output. |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @param Channel : TIM Channel to be disabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @arg TIM_CHANNEL_3: TIM Channel 3 selected |
|
|
|
|
* @arg TIM_CHANNEL_4: TIM Channel 4 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Stops the PWM signal generation in interrupt mode on the |
|
|
|
|
* complementary output. |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @param Channel : TIM Channel to be disabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @arg TIM_CHANNEL_3: TIM Channel 3 selected |
|
|
|
|
* @arg TIM_CHANNEL_4: TIM Channel 4 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel); |
|
|
|
|
/* Non-Blocking mode: DMA */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Starts the PWM signal generation on the complementary output. |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @param Channel : TIM Channel to be enabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @arg TIM_CHANNEL_3: TIM Channel 3 selected |
|
|
|
|
* @arg TIM_CHANNEL_4: TIM Channel 4 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Starts the TIM PWM signal generation in DMA mode on the |
|
|
|
|
* complementary output |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @param Channel : TIM Channel to be enabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @arg TIM_CHANNEL_3: TIM Channel 3 selected |
|
|
|
|
* @arg TIM_CHANNEL_4: TIM Channel 4 selected |
|
|
|
|
* @param pData : The source Buffer address. |
|
|
|
|
* @param Length : The length of data to be transferred from memory to TIM peripheral |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Stops the PWM signal generation on the complementary output. |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @param Channel : TIM Channel to be disabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @arg TIM_CHANNEL_3: TIM Channel 3 selected |
|
|
|
|
* @arg TIM_CHANNEL_4: TIM Channel 4 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Stops the TIM PWM signal generation in DMA mode on the complementary |
|
|
|
|
* output |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @param Channel : TIM Channel to be disabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @arg TIM_CHANNEL_3: TIM Channel 3 selected |
|
|
|
|
* @arg TIM_CHANNEL_4: TIM Channel 4 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel); |
|
|
|
|
/**
|
|
|
|
|
* @} |
|
|
|
@ -222,11 +635,89 @@ HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Chan |
|
|
|
|
*/ |
|
|
|
|
/* Timer Complementary One Pulse functions **********************************/ |
|
|
|
|
/* Blocking mode: Polling */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Starts the TIM One Pulse signal generation on the complemetary |
|
|
|
|
* output. |
|
|
|
|
* @param htim : TIM One Pulse handle |
|
|
|
|
* @param OutputChannel : TIM Channel to be enabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start(TIM_HandleTypeDef *htim, uint32_t OutputChannel); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Stops the TIM One Pulse signal generation on the complementary |
|
|
|
|
* output. |
|
|
|
|
* @param htim : TIM One Pulse handle |
|
|
|
|
* @param OutputChannel : TIM Channel to be disabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop(TIM_HandleTypeDef *htim, uint32_t OutputChannel); |
|
|
|
|
|
|
|
|
|
/* Non-Blocking mode: Interrupt */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Starts the TIM One Pulse signal generation on the complemetary |
|
|
|
|
* output. |
|
|
|
|
* @param htim : TIM One Pulse handle |
|
|
|
|
* @param OutputChannel : TIM Channel to be enabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Starts the TIM One Pulse signal generation in interrupt mode on the |
|
|
|
|
* complementary channel. |
|
|
|
|
* @param htim : TIM One Pulse handle |
|
|
|
|
* @param OutputChannel : TIM Channel to be enabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Stops the TIM One Pulse signal generation on the complementary |
|
|
|
|
* output. |
|
|
|
|
* @param htim : TIM One Pulse handle |
|
|
|
|
* @param OutputChannel : TIM Channel to be disabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Stops the TIM One Pulse signal generation in interrupt mode on the |
|
|
|
|
* complementary channel. |
|
|
|
|
* @param htim : TIM One Pulse handle |
|
|
|
|
* @param OutputChannel : TIM Channel to be disabled |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_CHANNEL_1: TIM Channel 1 selected |
|
|
|
|
* @arg TIM_CHANNEL_2: TIM Channel 2 selected |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel); |
|
|
|
|
/**
|
|
|
|
|
* @} |
|
|
|
@ -242,13 +733,161 @@ HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t |
|
|
|
|
#if defined (STM32F100xB) || defined (STM32F100xE) || \ |
|
|
|
|
defined (STM32F103x6) || defined (STM32F103xB) || defined (STM32F103xE) || defined (STM32F103xG) || \
|
|
|
|
|
defined (STM32F105xC) || defined (STM32F107xC) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Configure the TIM commutation event sequence. |
|
|
|
|
* @note: this function is mandatory to use the commutation event in order to |
|
|
|
|
* update the configuration at each commutation detection on the TRGI input of the Timer, |
|
|
|
|
* the typical use of this feature is with the use of another Timer(interface Timer) |
|
|
|
|
* configured in Hall sensor interface, this interface Timer will generate the |
|
|
|
|
* commutation at its TRGO output (connected to Timer used in this function) each time |
|
|
|
|
* the TI1 of the Interface Timer detect a commutation at its input TI1. |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @param InputTrigger : the Internal trigger corresponding to the Timer Interfacing with the Hall sensor |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_TS_ITR0: Internal trigger 0 selected |
|
|
|
|
* @arg TIM_TS_ITR1: Internal trigger 1 selected |
|
|
|
|
* @arg TIM_TS_ITR2: Internal trigger 2 selected |
|
|
|
|
* @arg TIM_TS_ITR3: Internal trigger 3 selected |
|
|
|
|
* @arg TIM_TS_NONE: No trigger is needed |
|
|
|
|
* @param CommutationSource : the Commutation Event source |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_COMMUTATION_TRGI: Commutation source is the TRGI of the Interface Timer |
|
|
|
|
* @arg TIM_COMMUTATION_SOFTWARE: Commutation source is set by software using the COMG bit |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent(TIM_HandleTypeDef *htim, uint32_t InputTrigger, uint32_t CommutationSource); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Configure the TIM commutation event sequence. |
|
|
|
|
* @note: this function is mandatory to use the commutation event in order to |
|
|
|
|
* update the configuration at each commutation detection on the TRGI input of the Timer, |
|
|
|
|
* the typical use of this feature is with the use of another Timer(interface Timer) |
|
|
|
|
* configured in Hall sensor interface, this interface Timer will generate the |
|
|
|
|
* commutation at its TRGO output (connected to Timer used in this function) each time |
|
|
|
|
* the TI1 of the Interface Timer detect a commutation at its input TI1. |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @param InputTrigger : the Internal trigger corresponding to the Timer Interfacing with the Hall sensor |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_TS_ITR0: Internal trigger 0 selected |
|
|
|
|
* @arg TIM_TS_ITR1: Internal trigger 1 selected |
|
|
|
|
* @arg TIM_TS_ITR2: Internal trigger 2 selected |
|
|
|
|
* @arg TIM_TS_ITR3: Internal trigger 3 selected |
|
|
|
|
* @arg TIM_TS_NONE: No trigger is needed |
|
|
|
|
* @param CommutationSource : the Commutation Event source |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_COMMUTATION_TRGI: Commutation source is the TRGI of the Interface Timer |
|
|
|
|
* @arg TIM_COMMUTATION_SOFTWARE: Commutation source is set by software using the COMG bit |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Configure the TIM commutation event sequence with interrupt. |
|
|
|
|
* @note: this function is mandatory to use the commutation event in order to |
|
|
|
|
* update the configuration at each commutation detection on the TRGI input of the Timer, |
|
|
|
|
* the typical use of this feature is with the use of another Timer(interface Timer) |
|
|
|
|
* configured in Hall sensor interface, this interface Timer will generate the |
|
|
|
|
* commutation at its TRGO output (connected to Timer used in this function) each time |
|
|
|
|
* the TI1 of the Interface Timer detect a commutation at its input TI1. |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @param InputTrigger : the Internal trigger corresponding to the Timer Interfacing with the Hall sensor |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_TS_ITR0: Internal trigger 0 selected |
|
|
|
|
* @arg TIM_TS_ITR1: Internal trigger 1 selected |
|
|
|
|
* @arg TIM_TS_ITR2: Internal trigger 2 selected |
|
|
|
|
* @arg TIM_TS_ITR3: Internal trigger 3 selected |
|
|
|
|
* @arg TIM_TS_NONE: No trigger is needed |
|
|
|
|
* @param CommutationSource : the Commutation Event source |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_COMMUTATION_TRGI: Commutation source is the TRGI of the Interface Timer |
|
|
|
|
* @arg TIM_COMMUTATION_SOFTWARE: Commutation source is set by software using the COMG bit |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_IT(TIM_HandleTypeDef *htim, uint32_t InputTrigger, uint32_t CommutationSource); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Configure the TIM commutation event sequence. |
|
|
|
|
* @note: this function is mandatory to use the commutation event in order to |
|
|
|
|
* update the configuration at each commutation detection on the TRGI input of the Timer, |
|
|
|
|
* the typical use of this feature is with the use of another Timer(interface Timer) |
|
|
|
|
* configured in Hall sensor interface, this interface Timer will generate the |
|
|
|
|
* commutation at its TRGO output (connected to Timer used in this function) each time |
|
|
|
|
* the TI1 of the Interface Timer detect a commutation at its input TI1. |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @param InputTrigger : the Internal trigger corresponding to the Timer Interfacing with the Hall sensor |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_TS_ITR0: Internal trigger 0 selected |
|
|
|
|
* @arg TIM_TS_ITR1: Internal trigger 1 selected |
|
|
|
|
* @arg TIM_TS_ITR2: Internal trigger 2 selected |
|
|
|
|
* @arg TIM_TS_ITR3: Internal trigger 3 selected |
|
|
|
|
* @arg TIM_TS_NONE: No trigger is needed |
|
|
|
|
* @param CommutationSource : the Commutation Event source |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_COMMUTATION_TRGI: Commutation source is the TRGI of the Interface Timer |
|
|
|
|
* @arg TIM_COMMUTATION_SOFTWARE: Commutation source is set by software using the COMG bit |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Configure the TIM commutation event sequence with DMA. |
|
|
|
|
* @note: this function is mandatory to use the commutation event in order to |
|
|
|
|
* update the configuration at each commutation detection on the TRGI input of the Timer, |
|
|
|
|
* the typical use of this feature is with the use of another Timer(interface Timer) |
|
|
|
|
* configured in Hall sensor interface, this interface Timer will generate the |
|
|
|
|
* commutation at its TRGO output (connected to Timer used in this function) each time |
|
|
|
|
* the TI1 of the Interface Timer detect a commutation at its input TI1. |
|
|
|
|
* @note: The user should configure the DMA in his own software, in This function only the COMDE bit is set |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @param InputTrigger : the Internal trigger corresponding to the Timer Interfacing with the Hall sensor |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_TS_ITR0: Internal trigger 0 selected |
|
|
|
|
* @arg TIM_TS_ITR1: Internal trigger 1 selected |
|
|
|
|
* @arg TIM_TS_ITR2: Internal trigger 2 selected |
|
|
|
|
* @arg TIM_TS_ITR3: Internal trigger 3 selected |
|
|
|
|
* @arg TIM_TS_NONE: No trigger is needed |
|
|
|
|
* @param CommutationSource : the Commutation Event source |
|
|
|
|
* This parameter can be one of the following values: |
|
|
|
|
* @arg TIM_COMMUTATION_TRGI: Commutation source is the TRGI of the Interface Timer |
|
|
|
|
* @arg TIM_COMMUTATION_SOFTWARE: Commutation source is set by software using the COMG bit |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_DMA(TIM_HandleTypeDef *htim, uint32_t InputTrigger, uint32_t CommutationSource); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Configures the Break feature, dead time, Lock level, OSSI/OSSR State |
|
|
|
|
* and the AOE(automatic output enable). |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @param sBreakDeadTimeConfig : pointer to a TIM_ConfigBreakDeadConfigTypeDef structure that |
|
|
|
|
* contains the BDTR Register configuration information for the TIM peripheral. |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef *htim, TIM_BreakDeadTimeConfigTypeDef *sBreakDeadTimeConfig); |
|
|
|
|
#endif /* defined(STM32F100xB) || defined(STM32F100xE) || */ |
|
|
|
|
/* defined(STM32F103x6) || defined(STM32F103xB) || defined(STM32F103xE) || defined(STM32F103xG) || */ |
|
|
|
|
/* defined(STM32F105xC) || defined(STM32F107xC) */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Configures the TIM in master mode. |
|
|
|
|
* @param htim : TIM handle. |
|
|
|
|
* @param sMasterConfig : pointer to a TIM_MasterConfigTypeDef structure that |
|
|
|
|
* contains the selected trigger output (TRGO) and the Master/Slave |
|
|
|
|
* mode. |
|
|
|
|
* @retval HAL status |
|
|
|
|
*/ |
|
|
|
|
HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef *htim, TIM_MasterConfigTypeDef * sMasterConfig); |
|
|
|
|
/**
|
|
|
|
|
* @} |
|
|
|
@ -258,8 +897,24 @@ HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef *htim, |
|
|
|
|
* @{ |
|
|
|
|
*/ |
|
|
|
|
/* Extension Callback *********************************************************/ |
|
|
|
|
void HAL_TIMEx_CommutationCallback(TIM_HandleTypeDef *htim); |
|
|
|
|
void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef *htim); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Hall commutation changed callback in non blocking mode |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @retval None |
|
|
|
|
*/ |
|
|
|
|
__weak void HAL_TIMEx_CommutationCallback(TIM_HandleTypeDef *htim); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Hall Break detection callback in non blocking mode |
|
|
|
|
* @param htim : TIM handle |
|
|
|
|
* @retval None |
|
|
|
|
*/ |
|
|
|
|
__weak void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef *htim); |
|
|
|
|
/**
|
|
|
|
|
* @} |
|
|
|
|
*/ |
|
|
|
@ -271,6 +926,14 @@ void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef *htim); |
|
|
|
|
* @{ |
|
|
|
|
*/ |
|
|
|
|
/* Extension Peripheral State functions **************************************/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief Return the TIM Hall Sensor interface state |
|
|
|
|
* @param htim : TIM Hall Sensor handle |
|
|
|
|
* @retval HAL state |
|
|
|
|
*/ |
|
|
|
|
HAL_TIM_StateTypeDef HAL_TIMEx_HallSensor_GetState(TIM_HandleTypeDef *htim); |
|
|
|
|
/**
|
|
|
|
|
* @} |
|
|
|
@ -288,6 +951,14 @@ HAL_TIM_StateTypeDef HAL_TIMEx_HallSensor_GetState(TIM_HandleTypeDef *htim); |
|
|
|
|
/** @defgroup TIMEx_Private_Functions TIMEx Private Functions
|
|
|
|
|
* @{ |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*- injected dox -*/ |
|
|
|
|
/**
|
|
|
|
|
* @brief TIM DMA Commutation callback. |
|
|
|
|
* @param hdma : pointer to DMA handle. |
|
|
|
|
* @retval None |
|
|
|
|
*/ |
|
|
|
|
void TIMEx_DMACommutationCplt(DMA_HandleTypeDef *hdma); |
|
|
|
|
/**
|
|
|
|
|
* @} |
|
|
|
|