Navigation

    全志在线开发者论坛

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

    f1c100s tina pwm背光亮度调整

    其它全志芯片讨论区
    1
    2
    1450
    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.
    • U
      ubuntu LV 7 last edited by whycan

      sys_config.fex

      [lcd0]
      lcd_used            = 1
      ...
      lcd_pwm_used        = 1
      lcd_pwm_ch          = 1
      lcd_pwm_freq        = 50000
      lcd_pwm_pol         = 0
      lcd_pwm_max_limit   = 255
      
      [disp]
      disp_init_enable         = 1
      
      ...
      lcd0_backlight           = 255
      lcd1_backlight           = 255
      
      lcd0_bright              = 255
      lcd0_contrast            = 50
      lcd0_saturation          = 57
      lcd0_hue                 = 50
      
      lcd1_bright              = 255
      lcd1_contrast            = 50
      lcd1_saturation          = 57
      lcd1_hue                 = 50
      
      [pwm1_para]
      pwm_used            = 1
      pwm_positive        = port:PE06<3><0><default><default>
      

      用户层调整亮度:

      #include <stdio.h>
      #include <sys/types.h>
      #include <sys/stat.h>
      #include <fcntl.h>
      #include <sys/ioctl.h>
      #include <unistd.h>
      
      #define DISP_CMD_LCD_SET_BRIGHTNESS  0x102
      
      int dispfd;
      
      void main()
      {
      
              unsigned long arg[3];
              unsigned int bl = 0;
              arg[0] = 0;//显示通道0
              arg[1] = bl;
      
              dispfd                 = open("/dev/disp", O_RDWR);
      
              if(dispfd <0)
              {
                      printf("open disp error\n");
              }
      
              ioctl(dispfd, DISP_CMD_LCD_SET_BRIGHTNESS, (void*)arg);
      
              close(dispfd);
      
              printf("end\n");
      }
      
      1 Reply Last reply Reply Quote Share 0
      • U
        ubuntu LV 7 last edited by

        https://www.cnblogs.com/dakewei/p/13323567.html

        或者用pwm直接调整亮度:

        echo 1 > /sys/class/pwm/pwmchip0/export
        
        echo 10000 > /sys/class/pwm/pwmchip0/pwm1/period
        
        echo 5000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle
        
        echo 'normal' > /sys/class/pwm/pwmchip0/pwm1/polarity
        
        echo 1 > /sys/class/pwm/pwmchip0/pwm1/enable
        
        1 Reply Last reply Reply Quote Share 0
        • 1 / 1
        • First post
          Last post

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

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