导航

    全志在线开发者论坛

    • 注册
    • 登录
    • 搜索
    • 版块
    • 话题
    • 在线文档
    • 社区主页
    1. 主页
    2. yozad
    Y
    • 资料
    • 关注 0
    • 粉丝 0
    • 我的积分 200
    • 主题 1
    • 帖子 3
    • 最佳 2
    • 群组 0

    yozadLV 3

    @yozad

    200
    积分
    2
    声望
    1
    资料浏览
    3
    帖子
    0
    粉丝
    0
    关注
    注册时间 最后登录

    yozad 取消关注 关注

    yozad 发布的最佳帖子

    • 回复: 【水经验混下载权限专用贴】如何升级LV2拉取SDK

      @xiaowenge 升级升级升级升级升级升级升级升级升级升级升级升级

      发布在 灌水区
      Y
      yozad
    • 回复: 【水经验混下载权限专用贴】如何升级LV2拉取SDK

      怎么拉取公版SDK?

      发布在 灌水区
      Y
      yozad

    yozad 发布的最新帖子

    • T507 PWM互补输出

      需求:全志T507,把PI12、PI13复用为PWM2、PWM3,想要让PWM2、3互补输出。

      T507手册上支持pwm互补输出
      2125f226-ffb3-430f-89fb-ee35982f81a1-image.png

      看源码需要在设备树里面配置"bind_pwm"和"dead_time",获取死区时间和“互补输出绑定的pwm??”,这里的bind_pwm不是很理解。

      static int sunxi_pwm_get_config(struct platform_device *pdev, struct sunxi_pwm_config *config)
      {
      	struct device_node *np = pdev->dev.of_node;
      	int ret = 0;
      
      	/* read register config */
      	pr_info("sunxi_pwm_get_config %s\n", np->name);
      
      	ret = of_property_read_u32(np, "bind_pwm", &config->bind_pwm);
      	if (ret < 0) {
      		/*if there is no bind pwm,set 255, dual pwm invalid!*/
      		config->bind_pwm = 255;
      		ret = 0;
      	}
      
      	ret = of_property_read_u32(np, "dead_time", &config->dead_time);
      	if (ret < 0) {
      		/*if there is  bind pwm, but not set dead time,set bind pwm 255,dual pwm invalid!*/
      		config->bind_pwm = 255;
      		ret = 0;
      	}
      
      	pr_info("bind_pwm=%d,dead_time=%d\n", config->bind_pwm, config->dead_time);
      	ret = of_property_read_u32(np, "clk_bypass_output", &config->clk_bypass_output);
      	if (ret < 0) {
      		/*if use pwm as the internal clock source!*/
      		config->clk_bypass_output = 0;
      		ret = 0;
      	}
      
      	of_node_put(np);
      
      	return ret;
      }
      
      static int sunxi_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
      		int duty_ns, int period_ns)
      {
      	int bind_num;
      
      	struct sunxi_pwm_chip *pc = to_sunxi_pwm_chip(chip);
      
              //这里可以根据bind_num选择是否互补输出
      	bind_num = pc->config[pwm->pwm - chip->base].bind_pwm;
      	if (bind_num == 255)
      		sunxi_pwm_config_single(chip, pwm, duty_ns, period_ns);
      	else
      		sunxi_pwm_config_dual(chip, pwm, duty_ns, period_ns, bind_num);
      
      	return 0;
      }
      

      但是按照源码里面增加“bind_pwm”和“dead_time”

      		pwm2: pwm2@0300a000 {
      			pinctrl-names = "active", "sleep";
      			pinctrl-0 = <&pwm2_pin_a>;
      			pinctrl-1 = <&pwm2_pin_b>;
      			bind_pwm = 2;
      			dead_time = 1000;
      			status = "okay";
      		};
      

      编译报错

      Error: arch/arm64/boot/dts/sunxi/CII-Common.dtsi:543.15-16 syntax error
      FATAL ERROR: Unable to parse input tree
      make[2]: *** [scripts/Makefile.lib:313: arch/arm64/boot/dts/sunxi/board.dtb] Error 1
      make[1]: *** [scripts/Makefile.build:648: arch/arm64/boot/dts/sunxi] Error 2
      make: *** [arch/arm64/Makefile:153: dtbs] Error 2
      make: *** Waiting for unfinished jobs....
        CHK     kernel/config_data.h
      ERROR: build kernel Failed
      INFO: mkkernel failed
      

      请问怎么配置才能让pwm互补输出?

      发布在 T Series
      Y
      yozad
    • 回复: 【水经验混下载权限专用贴】如何升级LV2拉取SDK

      @xiaowenge 升级升级升级升级升级升级升级升级升级升级升级升级

      发布在 灌水区
      Y
      yozad
    • 回复: 【水经验混下载权限专用贴】如何升级LV2拉取SDK

      怎么拉取公版SDK?

      发布在 灌水区
      Y
      yozad