NuttX:如何为STM32F7板添加PWM支持?(未找到stm32_pwm.h)

NuttX:如何为STM32F7板添加PWM支持?(未找到stm32_pwm.h),stm32,pwm,stm32f7,nuttx,Stm32,Pwm,Stm32f7,Nuttx,我想将PWM支持添加到我的nuttx板配置中。 我使用的是STM32F765VGT6单片机 我开始在STM32F4Discovery配置目录中实现它: 在configs//src/.h中添加stm32\U pwm\U设置 添加configs//src/stm32_pwm.c: 在Makefile configs//src/Makefile中追加stm32_pwm.c 但是,我总是得到一个编译错误,没有找到stm32_pwm.h。 此外,我无法在configs//src/stm32\u boot.

我想将PWM支持添加到我的nuttx板配置中。 我使用的是STM32F765VGT6单片机

我开始在STM32F4Discovery配置目录中实现它:

在configs//src/.h中添加stm32\U pwm\U设置 添加configs//src/stm32_pwm.c: 在Makefile configs//src/Makefile中追加stm32_pwm.c 但是,我总是得到一个编译错误,没有找到stm32_pwm.h。 此外,我无法在configs//src/stm32\u boot.c中调用stm32\u pwm\u initialize


是否有人已经在STM32F7上实现了NuttX PWM支持,或者可以给我一个失败的提示?

stm32\u PWM.h不能被应用程序包含,包含路径故意不支持。如果您将初始化代码移动到configs/stm32f4discovery/src/stm32_bringup.c,它应该可以正常编译

STM32F7?STM32F7没有stm32_pwm.h。没有人提供PWM驱动器。这次编译器是对的,头文件在arch/arm/src/stm32f7中不存在。解决方案是从类似的STM32体系结构移植PWM驱动器。这些选择包括:

arch/arm/src/stm32-包括L1、F0、F2、F3和F4,以及
arch/arm/src/stm32l4-这只是stm32l4

我正在编写一个板支持包,而不是一个应用程序。我用相应的目录名更新了我的问题。感谢您指向arch/arm/src/stm32。实际上,最近才为STM32F7实现了PWM驱动程序:我确认STM32F7上的PWM正在工作:
#include <nuttx/config.h>

#include <errno.h>
#include <debug.h>

#include <nuttx/board.h>
#include <nuttx/drivers/pwm.h>

#include <arch/board/board.h>

#include "chip.h"
#include "up_arch.h"
#include "stm32_pwm.h"

#include "board_name.h"

#ifdef CONFIG_PWM

int stm32_pwm_setup(void) {
    static bool initialized = false;
    struct pwm_lowerhalf_s *pwm;
    int ret;

    /* Have we already initialized? */

    if (!initialized) {

#if defined(CONFIG_STM32F7_TIM1_PWM)
#if defined(CONFIG_STM32F7_TIM1_CH1OUT)
        pwm = stm32_pwminitialize(1);
        if (!pwm) {
            aerr("ERROR: Failed to get the STM32F7 PWM lower half\n");
            return -ENODEV;
        }

        ret = pwm_register(DEV_PWM3, pwm);
        if (ret < 0) {
            aerr("ERROR: pwm_register failed: %d\n", ret);
            return ret;
        }
#endif

/* ... */
/* other timers and channels */
/* ... */

        initialized = true;
    }

    return OK;
}

#endif /* CONFIG_PWM */