f1c100s tina pwm背光亮度调整
-
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"); }
-
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
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号