微電腦 - iRiver Dicple D88 - 如何關閉背光



main.c

#include <stdio.h>
#include <stdint.h>
#include <sys/fcntl.h> 
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
#include <linux/ioctl.h>
 
#define PM_POWER_DOWN           0xfacf
#define PM_SLEEP_DOWN           0xfbcf
#define PM_SLEEP_FLAG_CLR       0xfbdf
#define PM_GET_PIN_STATUS       0xfccf
#define PM_SLEEP_SET_ALARM      0xfdcf
#define PM_GET_PWR_PROC_FLAG    0xfecf
#define PM_GET_BRIGHTNESS       0xfeff
#define FBIODISPOFF             0x468a
#define FBIODISPON              0x4689
#define FBIOSETBACKLIGHT        0x4688
#define FBIODISPDIS             0x468d
#define FBIODISPENA             0x468e
#define FBIODISP_IPUENA         0x468f

int main(int argc, char **argv)
{
    int fd = -1;
  
    fd = open("/dev/fb0", O_RDWR);
    if (fd > 0) {
        ioctl(fd, FBIODISPOFF, 0);
        usleep(3000000);
        ioctl(fd, FBIODISP_IPUENA, 0);
        close(fd);
    }
    return;
}