Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为stm32的PWM驱动添加对STM32H7的支持、添加互补PWM功能的支持,补全pwm_get命令等 #4250

Merged
merged 5 commits into from
Jan 21, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
修改无意义代码
  • Loading branch information
Hotakus committed Jan 20, 2021
commit 63239801d9a2abe1b210faf6cd9f3b126924f7e0
4 changes: 0 additions & 4 deletions bsp/stm32/libraries/HAL_Drivers/drv_pwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,6 @@ static rt_err_t drv_pwm_get(TIM_HandleTypeDef *htim, struct rt_pwm_configuration
{
#if !defined(SOC_SERIES_STM32F0) && !defined(SOC_SERIES_STM32G0)
tim_clock = HAL_RCC_GetPCLK2Freq() * 2;
#else
tim_clock = HAL_RCC_GetPCLK2Freq();
#endif
}
else
Expand Down Expand Up @@ -262,8 +260,6 @@ static rt_err_t drv_pwm_set(TIM_HandleTypeDef *htim, struct rt_pwm_configuration
{
#if !defined(SOC_SERIES_STM32F0) && !defined(SOC_SERIES_STM32G0)
tim_clock = HAL_RCC_GetPCLK2Freq() * 2;
#else
tim_clock = HAL_RCC_GetPCLK2Freq();
#endif
}
else
Expand Down
6 changes: 3 additions & 3 deletions components/drivers/include/drivers/rt_drv_pwm.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

struct rt_pwm_configuration
{
rt_uint32_t channel; /* 0-n */
rt_uint32_t period; /* unit:ns 1ns~4.29s:1Ghz~0.23hz */
rt_uint32_t pulse; /* unit:ns (pulse<=period) */
rt_uint32_t channel; /* 0-n */
rt_uint32_t period; /* unit:ns 1ns~4.29s:1Ghz~0.23hz */
rt_uint32_t pulse; /* unit:ns (pulse<=period) */

/*
* RT_TRUE : The channel of pwm is complememtary.
Expand Down