GFX Develop Branch
This commit is contained in:
@ -849,7 +849,7 @@ HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channe
|
||||
|
||||
/* Disable the TIM Break interrupt (only if no more channel is active) */
|
||||
tmpccer = htim->Instance->CCER;
|
||||
if ((tmpccer & (TIM_CCER_CC1NE | TIM_CCER_CC2NE | TIM_CCER_CC3NE)) == (uint32_t)RESET)
|
||||
if ((tmpccer & TIM_CCER_CCxNE_MASK) == (uint32_t)RESET)
|
||||
{
|
||||
__HAL_TIM_DISABLE_IT(htim, TIM_IT_BREAK);
|
||||
}
|
||||
@ -1095,17 +1095,6 @@ HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Chann
|
||||
(+) Stop the Complementary PWM and disable interrupts.
|
||||
(+) Start the Complementary PWM and enable DMA transfers.
|
||||
(+) Stop the Complementary PWM and disable DMA transfers.
|
||||
(+) Start the Complementary Input Capture measurement.
|
||||
(+) Stop the Complementary Input Capture.
|
||||
(+) Start the Complementary Input Capture and enable interrupts.
|
||||
(+) Stop the Complementary Input Capture and disable interrupts.
|
||||
(+) Start the Complementary Input Capture and enable DMA transfers.
|
||||
(+) Stop the Complementary Input Capture and disable DMA transfers.
|
||||
(+) Start the Complementary One Pulse generation.
|
||||
(+) Stop the Complementary One Pulse.
|
||||
(+) Start the Complementary One Pulse and enable interrupts.
|
||||
(+) Stop the Complementary One Pulse and disable interrupts.
|
||||
|
||||
@endverbatim
|
||||
* @{
|
||||
*/
|
||||
@ -1331,7 +1320,7 @@ HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Chann
|
||||
|
||||
/* Disable the TIM Break interrupt (only if no more channel is active) */
|
||||
tmpccer = htim->Instance->CCER;
|
||||
if ((tmpccer & (TIM_CCER_CC1NE | TIM_CCER_CC2NE | TIM_CCER_CC3NE)) == (uint32_t)RESET)
|
||||
if ((tmpccer & TIM_CCER_CCxNE_MASK) == (uint32_t)RESET)
|
||||
{
|
||||
__HAL_TIM_DISABLE_IT(htim, TIM_IT_BREAK);
|
||||
}
|
||||
@ -1812,6 +1801,9 @@ HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t
|
||||
* @arg TIM_TS_ITR12: Internal trigger 12 selected (*)
|
||||
* @arg TIM_TS_ITR13: Internal trigger 13 selected (*)
|
||||
* @arg TIM_TS_NONE: No trigger is needed
|
||||
*
|
||||
* (*) Value not defined in all devices.
|
||||
*
|
||||
* @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
|
||||
@ -1868,9 +1860,12 @@ HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent(TIM_HandleTypeDef *htim, uint32_t
|
||||
* @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_ITR2: Internal trigger 12 selected (*)
|
||||
* @arg TIM_TS_ITR3: Internal trigger 13 selected (*)
|
||||
* @arg TIM_TS_ITR12: Internal trigger 12 selected (*)
|
||||
* @arg TIM_TS_ITR13: Internal trigger 13 selected (*)
|
||||
* @arg TIM_TS_NONE: No trigger is needed
|
||||
*
|
||||
* (*) Value not defined in all devices.
|
||||
*
|
||||
* @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
|
||||
@ -1928,8 +1923,8 @@ HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent_IT(TIM_HandleTypeDef *htim, uint32
|
||||
* @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_ITR2: Internal trigger 12 selected (*)
|
||||
* @arg TIM_TS_ITR3: Internal trigger 13 selected (*)
|
||||
* @arg TIM_TS_ITR12: Internal trigger 12 selected (*)
|
||||
* @arg TIM_TS_ITR13: Internal trigger 13 selected (*)
|
||||
* @arg TIM_TS_NONE: No trigger is needed
|
||||
*
|
||||
* (*) Value not defined in all devices.
|
||||
@ -2079,6 +2074,9 @@ HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef *htim,
|
||||
assert_param(IS_TIM_BREAK_POLARITY(sBreakDeadTimeConfig->BreakPolarity));
|
||||
assert_param(IS_TIM_BREAK_FILTER(sBreakDeadTimeConfig->BreakFilter));
|
||||
assert_param(IS_TIM_AUTOMATIC_OUTPUT_STATE(sBreakDeadTimeConfig->AutomaticOutput));
|
||||
#if defined(TIM_BDTR_BKBID)
|
||||
assert_param(IS_TIM_BREAK_AFMODE(sBreakDeadTimeConfig->BreakAFMode));
|
||||
#endif /* TIM_BDTR_BKBID */
|
||||
|
||||
/* Check input state */
|
||||
__HAL_LOCK(htim);
|
||||
@ -2095,39 +2093,26 @@ HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef *htim,
|
||||
MODIFY_REG(tmpbdtr, TIM_BDTR_BKP, sBreakDeadTimeConfig->BreakPolarity);
|
||||
MODIFY_REG(tmpbdtr, TIM_BDTR_AOE, sBreakDeadTimeConfig->AutomaticOutput);
|
||||
MODIFY_REG(tmpbdtr, TIM_BDTR_BKF, (sBreakDeadTimeConfig->BreakFilter << TIM_BDTR_BKF_Pos));
|
||||
|
||||
#if defined(TIM_BDTR_BKBID)
|
||||
if (IS_TIM_ADVANCED_INSTANCE(htim->Instance))
|
||||
{
|
||||
/* Check the parameters */
|
||||
assert_param(IS_TIM_BREAK_AFMODE(sBreakDeadTimeConfig->BreakAFMode));
|
||||
|
||||
/* Set BREAK AF mode */
|
||||
MODIFY_REG(tmpbdtr, TIM_BDTR_BKBID, sBreakDeadTimeConfig->BreakAFMode);
|
||||
}
|
||||
|
||||
MODIFY_REG(tmpbdtr, TIM_BDTR_BKBID, sBreakDeadTimeConfig->BreakAFMode);
|
||||
#endif /* TIM_BDTR_BKBID */
|
||||
|
||||
if (IS_TIM_BKIN2_INSTANCE(htim->Instance))
|
||||
{
|
||||
/* Check the parameters */
|
||||
assert_param(IS_TIM_BREAK2_STATE(sBreakDeadTimeConfig->Break2State));
|
||||
assert_param(IS_TIM_BREAK2_POLARITY(sBreakDeadTimeConfig->Break2Polarity));
|
||||
assert_param(IS_TIM_BREAK_FILTER(sBreakDeadTimeConfig->Break2Filter));
|
||||
#if defined(TIM_BDTR_BKBID)
|
||||
assert_param(IS_TIM_BREAK2_AFMODE(sBreakDeadTimeConfig->Break2AFMode));
|
||||
#endif /* TIM_BDTR_BKBID */
|
||||
|
||||
/* Set the BREAK2 input related BDTR bits */
|
||||
MODIFY_REG(tmpbdtr, TIM_BDTR_BK2F, (sBreakDeadTimeConfig->Break2Filter << TIM_BDTR_BK2F_Pos));
|
||||
MODIFY_REG(tmpbdtr, TIM_BDTR_BK2E, sBreakDeadTimeConfig->Break2State);
|
||||
MODIFY_REG(tmpbdtr, TIM_BDTR_BK2P, sBreakDeadTimeConfig->Break2Polarity);
|
||||
#if defined(TIM_BDTR_BKBID)
|
||||
|
||||
if (IS_TIM_ADVANCED_INSTANCE(htim->Instance))
|
||||
{
|
||||
/* Check the parameters */
|
||||
assert_param(IS_TIM_BREAK2_AFMODE(sBreakDeadTimeConfig->Break2AFMode));
|
||||
|
||||
/* Set BREAK2 AF mode */
|
||||
MODIFY_REG(tmpbdtr, TIM_BDTR_BK2BID, sBreakDeadTimeConfig->Break2AFMode);
|
||||
}
|
||||
MODIFY_REG(tmpbdtr, TIM_BDTR_BK2BID, sBreakDeadTimeConfig->Break2AFMode);
|
||||
#endif /* TIM_BDTR_BKBID */
|
||||
}
|
||||
|
||||
@ -2153,7 +2138,6 @@ HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef *htim,
|
||||
HAL_StatusTypeDef HAL_TIMEx_ConfigBreakInput(TIM_HandleTypeDef *htim,
|
||||
uint32_t BreakInput,
|
||||
const TIMEx_BreakInputConfigTypeDef *sBreakInputConfig)
|
||||
|
||||
{
|
||||
HAL_StatusTypeDef status = HAL_OK;
|
||||
uint32_t tmporx;
|
||||
@ -2381,49 +2365,49 @@ HAL_StatusTypeDef HAL_TIMEx_RemapConfig(TIM_HandleTypeDef *htim, uint32_t Remap)
|
||||
* @arg TIM_TIM5_TI1_CAN_RTP: TIM5 TI1 is connected to CAN RTP
|
||||
*
|
||||
* For TIM8, the parameter is one of the following values:
|
||||
* @arg TIM_TIM8_TI1_GPIO: TIM8 TI1 is connected to GPIO
|
||||
* @arg TIM_TIM8_TI1_COMP2: TIM8 TI1 is connected to COMP2 output
|
||||
* @arg TIM_TIM8_TI1_GPIO: TIM8 TI1 is connected to GPIO
|
||||
* @arg TIM_TIM8_TI1_COMP2: TIM8 TI1 is connected to COMP2 output
|
||||
*
|
||||
* For TIM12, the parameter can have the following values: (*)
|
||||
* @arg TIM_TIM12_TI1_GPIO: TIM12 TI1 is connected to GPIO
|
||||
* @arg TIM_TIM12_TI1_SPDIF_FS: TIM12 TI1 is connected to SPDIF FS
|
||||
* @arg TIM_TIM12_TI1_GPIO: TIM12 TI1 is connected to GPIO
|
||||
* @arg TIM_TIM12_TI1_SPDIF_FS: TIM12 TI1 is connected to SPDIF FS
|
||||
*
|
||||
* For TIM15, the parameter is one of the following values:
|
||||
* @arg TIM_TIM15_TI1_GPIO: TIM15 TI1 is connected to GPIO
|
||||
* @arg TIM_TIM15_TI1_TIM2: TIM15 TI1 is connected to TIM2 CH1
|
||||
* @arg TIM_TIM15_TI1_TIM3: TIM15 TI1 is connected to TIM3 CH1
|
||||
* @arg TIM_TIM15_TI1_TIM4: TIM15 TI1 is connected to TIM4 CH1
|
||||
* @arg TIM_TIM15_TI1_LSE: TIM15 TI1 is connected to LSE
|
||||
* @arg TIM_TIM15_TI1_CSI: TIM15 TI1 is connected to CSI
|
||||
* @arg TIM_TIM15_TI1_MCO2: TIM15 TI1 is connected to MCO2
|
||||
* @arg TIM_TIM15_TI2_GPIO: TIM15 TI2 is connected to GPIO
|
||||
* @arg TIM_TIM15_TI2_TIM2: TIM15 TI2 is connected to TIM2 CH2
|
||||
* @arg TIM_TIM15_TI2_TIM3: TIM15 TI2 is connected to TIM3 CH2
|
||||
* @arg TIM_TIM15_TI2_TIM4: TIM15 TI2 is connected to TIM4 CH2
|
||||
* @arg TIM_TIM15_TI1_GPIO: TIM15 TI1 is connected to GPIO
|
||||
* @arg TIM_TIM15_TI1_TIM2_CH1: TIM15 TI1 is connected to TIM2 CH1
|
||||
* @arg TIM_TIM15_TI1_TIM3_CH1: TIM15 TI1 is connected to TIM3 CH1
|
||||
* @arg TIM_TIM15_TI1_TIM4_CH1: TIM15 TI1 is connected to TIM4 CH1
|
||||
* @arg TIM_TIM15_TI1_RCC_LSE: TIM15 TI1 is connected to LSE
|
||||
* @arg TIM_TIM15_TI1_RCC_CSI: TIM15 TI1 is connected to CSI
|
||||
* @arg TIM_TIM15_TI1_RCC_MCO2: TIM15 TI1 is connected to MCO2
|
||||
* @arg TIM_TIM15_TI2_GPIO: TIM15 TI2 is connected to GPIO
|
||||
* @arg TIM_TIM15_TI2_TIM2_CH2: TIM15 TI2 is connected to TIM2 CH2
|
||||
* @arg TIM_TIM15_TI2_TIM3_CH2: TIM15 TI2 is connected to TIM3 CH2
|
||||
* @arg TIM_TIM15_TI2_TIM4_CH2: TIM15 TI2 is connected to TIM4 CH2
|
||||
*
|
||||
* For TIM16, the parameter can have the following values:
|
||||
* @arg TIM_TIM16_TI1_GPIO: TIM16 TI1 is connected to GPIO
|
||||
* @arg TIM_TIM16_TI1_LSI: TIM16 TI1 is connected to LSI
|
||||
* @arg TIM_TIM16_TI1_LSE: TIM16 TI1 is connected to LSE
|
||||
* @arg TIM_TIM16_TI1_RTC: TIM16 TI1 is connected to RTC wakeup interrupt
|
||||
* @arg TIM_TIM16_TI1_GPIO: TIM16 TI1 is connected to GPIO
|
||||
* @arg TIM_TIM16_TI1_RCC_LSI: TIM16 TI1 is connected to LSI
|
||||
* @arg TIM_TIM16_TI1_RCC_LSE: TIM16 TI1 is connected to LSE
|
||||
* @arg TIM_TIM16_TI1_WKUP_IT: TIM16 TI1 is connected to RTC wakeup interrupt
|
||||
*
|
||||
* For TIM17, the parameter can have the following values:
|
||||
* @arg TIM_TIM17_TI1_GPIO: TIM17 TI1 is connected to GPIO
|
||||
* @arg TIM_TIM17_TI1_SPDIF_FS: TIM17 TI1 is connected to SPDIF FS (*)
|
||||
* @arg TIM_TIM17_TI1_HSE_1MHZ: TIM17 TI1 is connected to HSE 1MHz
|
||||
* @arg TIM_TIM17_TI1_MCO1: TIM17 TI1 is connected to MCO1
|
||||
* @arg TIM_TIM17_TI1_GPIO: TIM17 TI1 is connected to GPIO
|
||||
* @arg TIM_TIM17_TI1_SPDIF_FS: TIM17 TI1 is connected to SPDIF FS (*)
|
||||
* @arg TIM_TIM17_TI1_RCC_HSE1MHZ: TIM17 TI1 is connected to HSE 1MHz
|
||||
* @arg TIM_TIM17_TI1_RCC_MCO1: TIM17 TI1 is connected to MCO1
|
||||
*
|
||||
* For TIM23, the parameter can have the following values: (*)
|
||||
* @arg TIM_TIM23_TI4_GPIO TIM23_TI4 is connected to GPIO
|
||||
* @arg TIM_TIM23_TI4_COMP1 TIM23_TI4 is connected to COMP1 output
|
||||
* @arg TIM_TIM23_TI4_COMP2 TIM23_TI4 is connected to COMP2 output
|
||||
* @arg TIM_TIM23_TI4_COMP1_COMP2 TIM23_TI4 is connected to COMP2 output
|
||||
* @arg TIM_TIM23_TI4_GPIO TIM23_TI4 is connected to GPIO
|
||||
* @arg TIM_TIM23_TI4_COMP1 TIM23_TI4 is connected to COMP1 output
|
||||
* @arg TIM_TIM23_TI4_COMP2 TIM23_TI4 is connected to COMP2 output
|
||||
* @arg TIM_TIM23_TI4_COMP1_COMP2 TIM23_TI4 is connected to COMP2 output
|
||||
*
|
||||
* For TIM24, the parameter can have the following values: (*)
|
||||
* @arg TIM_TIM24_TI1_GPIO TIM24_TI1 is connected to GPIO
|
||||
* @arg TIM_TIM24_TI1_CAN_TMP TIM24_TI1 is connected to CAN_TMP
|
||||
* @arg TIM_TIM24_TI1_CAN_RTP TIM24_TI1 is connected to CAN_RTP
|
||||
* @arg TIM_TIM24_TI1_CAN_SOC TIM24_TI1 is connected to CAN_SOC
|
||||
* @arg TIM_TIM24_TI1_GPIO TIM24_TI1 is connected to GPIO
|
||||
* @arg TIM_TIM24_TI1_CAN_TMP TIM24_TI1 is connected to CAN_TMP
|
||||
* @arg TIM_TIM24_TI1_CAN_RTP TIM24_TI1 is connected to CAN_RTP
|
||||
* @arg TIM_TIM24_TI1_CAN_SOC TIM24_TI1 is connected to CAN_SOC
|
||||
*
|
||||
* (*) Value not defined in all devices. \n
|
||||
* @retval HAL status
|
||||
@ -2518,7 +2502,7 @@ HAL_StatusTypeDef HAL_TIMEx_DisarmBreakInput(TIM_HandleTypeDef *htim, uint32_t B
|
||||
uint32_t tmpbdtr;
|
||||
|
||||
/* Check the parameters */
|
||||
assert_param(IS_TIM_ADVANCED_INSTANCE(htim->Instance));
|
||||
assert_param(IS_TIM_BREAK_INSTANCE(htim->Instance));
|
||||
assert_param(IS_TIM_BREAKINPUT(BreakInput));
|
||||
|
||||
switch (BreakInput)
|
||||
@ -2535,7 +2519,6 @@ HAL_StatusTypeDef HAL_TIMEx_DisarmBreakInput(TIM_HandleTypeDef *htim, uint32_t B
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case TIM_BREAKINPUT_BRK2:
|
||||
{
|
||||
/* Check initial conditions */
|
||||
@ -2567,13 +2550,13 @@ HAL_StatusTypeDef HAL_TIMEx_DisarmBreakInput(TIM_HandleTypeDef *htim, uint32_t B
|
||||
* @note Break input is automatically armed as soon as MOE bit is set.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_TIMEx_ReArmBreakInput(TIM_HandleTypeDef *htim, uint32_t BreakInput)
|
||||
HAL_StatusTypeDef HAL_TIMEx_ReArmBreakInput(const TIM_HandleTypeDef *htim, uint32_t BreakInput)
|
||||
{
|
||||
HAL_StatusTypeDef status = HAL_OK;
|
||||
uint32_t tickstart;
|
||||
|
||||
/* Check the parameters */
|
||||
assert_param(IS_TIM_ADVANCED_INSTANCE(htim->Instance));
|
||||
assert_param(IS_TIM_BREAK_INSTANCE(htim->Instance));
|
||||
assert_param(IS_TIM_BREAKINPUT(BreakInput));
|
||||
|
||||
switch (BreakInput)
|
||||
@ -2653,7 +2636,7 @@ HAL_StatusTypeDef HAL_TIMEx_ReArmBreakInput(TIM_HandleTypeDef *htim, uint32_t Br
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Hall commutation changed callback in non-blocking mode
|
||||
* @brief Commutation callback in non-blocking mode
|
||||
* @param htim TIM handle
|
||||
* @retval None
|
||||
*/
|
||||
@ -2667,7 +2650,7 @@ __weak void HAL_TIMEx_CommutCallback(TIM_HandleTypeDef *htim)
|
||||
*/
|
||||
}
|
||||
/**
|
||||
* @brief Hall commutation changed half complete callback in non-blocking mode
|
||||
* @brief Commutation half complete callback in non-blocking mode
|
||||
* @param htim TIM handle
|
||||
* @retval None
|
||||
*/
|
||||
@ -2682,7 +2665,7 @@ __weak void HAL_TIMEx_CommutHalfCpltCallback(TIM_HandleTypeDef *htim)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Hall Break detection callback in non-blocking mode
|
||||
* @brief Break detection callback in non-blocking mode
|
||||
* @param htim TIM handle
|
||||
* @retval None
|
||||
*/
|
||||
@ -2697,7 +2680,7 @@ __weak void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef *htim)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Hall Break2 detection callback in non blocking mode
|
||||
* @brief Break2 detection callback in non blocking mode
|
||||
* @param htim: TIM handle
|
||||
* @retval None
|
||||
*/
|
||||
@ -2848,15 +2831,6 @@ static void TIM_DMADelayPulseNCplt(DMA_HandleTypeDef *hdma)
|
||||
TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_3, HAL_TIM_CHANNEL_STATE_READY);
|
||||
}
|
||||
}
|
||||
else if (hdma == htim->hdma[TIM_DMA_ID_CC4])
|
||||
{
|
||||
htim->Channel = HAL_TIM_ACTIVE_CHANNEL_4;
|
||||
|
||||
if (hdma->Init.Mode == DMA_NORMAL)
|
||||
{
|
||||
TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_4, HAL_TIM_CHANNEL_STATE_READY);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* nothing to do */
|
||||
@ -2925,13 +2899,13 @@ static void TIM_CCxNChannelCmd(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t Cha
|
||||
{
|
||||
uint32_t tmp;
|
||||
|
||||
tmp = TIM_CCER_CC1NE << (Channel & 0x1FU); /* 0x1FU = 31 bits max shift */
|
||||
tmp = TIM_CCER_CC1NE << (Channel & 0xFU); /* 0xFU = 15 bits max shift */
|
||||
|
||||
/* Reset the CCxNE Bit */
|
||||
TIMx->CCER &= ~tmp;
|
||||
|
||||
/* Set or reset the CCxNE Bit */
|
||||
TIMx->CCER |= (uint32_t)(ChannelNState << (Channel & 0x1FU)); /* 0x1FU = 31 bits max shift */
|
||||
TIMx->CCER |= (uint32_t)(ChannelNState << (Channel & 0xFU)); /* 0xFU = 15 bits max shift */
|
||||
}
|
||||
/**
|
||||
* @}
|
||||
|
||||
Reference in New Issue
Block a user