1、代码备份

This commit is contained in:
2025-09-14 18:54:54 +08:00
parent a0f42649f4
commit 7dc8f7c6d7
9 changed files with 780 additions and 43 deletions
+3
View File
@@ -640,6 +640,9 @@ en_result_t Timer6_SetSpecialBuf(M4_TMR6_TypeDef *TMR6x,en_timer6_special_compar
/* Timer6 unit Set valid period Value*/
en_result_t Timer6_SetValidPeriod(M4_TMR6_TypeDef *TMR6x, const stc_timer6_validper_cfg_t* pstcTimer6ValidPerCfg);
/* Config channel mode, capture or output */
void Timer6_SetFunc(M4_TMR6_TypeDef *TMR6x, en_timer6_chx_port_t enTimer6PWMPort, en_timer6_func_mode_t enMode);
/* Config Input prot and filter function */
en_result_t Timer6_PortInputConfig(M4_TMR6_TypeDef *TMR6x, const stc_timer6_port_input_cfg_t* pstcTimer6PortInputCfg);
/* Config output prot function */
+33
View File
@@ -92,6 +92,11 @@
( (Timer6PWMA == (x)) || \
(Timer6PWMB == (x)))
/*!< Parameter valid check for timer6 port mode */
#define IS_VALID_TIMER6_PORT_MODE(x) \
( (Timer6ModeCompareOutput == (x)) || \
(Timer6ModeCaptureInput == (x)))
/*!< Parameter valid check for timer6 input port */
#define IS_VALID_TIMER6_INPUT_PORT(x) \
( (Timer6PWMA == (x)) || \
@@ -948,6 +953,34 @@ en_result_t Timer6_PortInputConfig(M4_TMR6_TypeDef *TMR6x, const stc_timer6_port
return enRet;
}
/*******************************************************************************
* \brief Set channel function
* \param [in] TMR6x Timer6 unit
* \param [in] enTimer6PWMPort Port to be configured @ref en_timer6_chx_port_t
* \param [in] enMode Channel mode @ref en_timer6_func_mode_t
* \retval None
******************************************************************************/
void Timer6_SetFunc(M4_TMR6_TypeDef *TMR6x, en_timer6_chx_port_t enTimer6PWMPort, en_timer6_func_mode_t enMode)
{
DDL_ASSERT(IS_VALID_NORMAL_TIMER6_UNIT(TMR6x));
DDL_ASSERT(IS_VALID_TIMER6_OUTPUT_PORT(enTimer6PWMPort));
DDL_ASSERT(IS_VALID_TIMER6_PORT_MODE(enMode));
switch (enTimer6PWMPort)
{
case Timer6xCHA:
TMR6x->PCONR_f.CAPMDA = enMode;
break;
case Timer6xCHB:
TMR6x->PCONR_f.CAPMDB = enMode;
break;
default:
break;
}
}
/*******************************************************************************
* \brief Timer6 Output Port config
*