Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    能在uboot阶段初始化pwm么?

    其它全志芯片讨论区
    4
    8
    3649
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      cruise33 LV 6 last edited by

      目的:设备快速亮灯。 LED灯后续要通过pwm控制,但又需要设备开机时快速亮灯。
      请问可以在uboot阶段,初始化pwm的周期,占空比和使能么?

      通过fdt的接口可以操作么?

      1 Reply Last reply Reply Quote Share 0
      • C
        chengwei_peng LV 6 last edited by

        肯定可以的,硬件没有限制,只是需要软件这边你要搞好

        C 1 Reply Last reply Reply Quote Share 0
        • xiaowenge
          DOT小文哥 LV 8 last edited by

          uboot可以理解为一个小系统,在这个系统里干啥都行,写好代码就行

          1 Reply Last reply Reply Quote Share 0
          • C
            cruise33 LV 6 @chengwei_peng last edited by

            @chengwei_peng 感谢回复🤝 ,我再研究一下

            1 Reply Last reply Reply Quote Share 0
            • C
              cruise33 LV 6 last edited by

              @xiaowenge 感谢指导👍 uboot里也有驱动,调用pwm驱动的接口就实现了

              L 1 Reply Last reply Reply Quote Share 0
              • C
                cruise33 LV 6 last edited by

                再请教大家个问题,能在设备启动期间,有规律地控制LED灯闪烁么?uboot阶段只有几百ms可以控制,uboot结束到应用起来期间又没有代码控制

                1 Reply Last reply Reply Quote Share 0
                • L
                  one001 LV 4 @cruise33 last edited by

                  @cruise33 请问你的uboot的dts关于pwm如何配置的呢,我有一个问题,我使用的T113-S3,我要配置PE13引脚功能为pwm5输出,但是驱动文件在下图位置就出错了,我查看sun8iw20p1-soc-system.dts文件里面是存在pwm这个节点的,请教这个uboot开启PE13引脚的pwm5功能改如何配置呢
                  984f42bd-0693-42b2-955f-c836bcabb7e5-image.png

                  C 1 Reply Last reply Reply Quote Share 0
                  • C
                    cruise33 LV 6 @lijinlin001 last edited by

                    @lijinlin001 uboot的dts当时没太留意,功能开启是在uboot/common/main.c里配置的,大概是这样:

                    #include <pwm.h>
                    
                    void pwm_init(void)
                    {
                    	int pwm1;
                    	pwm1 = pwm_request(1, "pwm1");
                        	pwm_config(pwm1, 500000, 500000);
                        	pwm_set_polarity(pwm1, PWM_POLARITY_INVERSED);
                        	pwm_enable(pwm1);
                    }
                    

                    具体的接口函数用法看uboot的pwm.h

                    1 Reply Last reply Reply Quote Share 1
                    • 1 / 1
                    • First post
                      Last post

                    Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

                    行为准则 | 用户协议 | 隐私权政策