diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | front-light.c | 19 | ||||
-rw-r--r-- | led.c | 38 |
3 files changed, 58 insertions, 1 deletions
@@ -1,4 +1,4 @@ -PROGS= eink_disable_autoupdate eink_enable_autoupdate eink_full_monochrome eink_full_update +PROGS= eink_disable_autoupdate eink_enable_autoupdate eink_full_monochrome eink_full_update front-light led all: ${PROGS} diff --git a/front-light.c b/front-light.c new file mode 100644 index 0000000..e331a26 --- /dev/null +++ b/front-light.c @@ -0,0 +1,19 @@ +#include <fcntl.h> +#include <sys/ioctl.h> +#include <stdio.h> +#include <stdlib.h> + +#define CM_FRONT_LIGHT_SET 241 + +main (int argc, char *argv[]) +{ + int fd; + fd = open ("/dev/ntx_io", O_RDWR); + + if (argc != 2) { + printf ("Usage:\n%s {0-100}\n", argv[0]); + exit (1); + } + + return ioctl (fd, CM_FRONT_LIGHT_SET, atoi (argv[1])); +} @@ -0,0 +1,38 @@ +#include <fcntl.h> +#include <sys/ioctl.h> +#include <stdio.h> +#include <stdlib.h> + +#define CM_LED_BLINK 127 +#define CM_nLED 101 + +main (int argc, char *argv[]) +{ + int fd; + fd = open ("/dev/ntx_io", O_RDWR); + + if (argc != 2) { + printf ("Usage:\n%s {0|1}\n", argv[0]); + exit (1); + } + + switch (atoi (argv[1])) { + case 0: + ioctl (fd, CM_LED_BLINK, 0); + ioctl (fd, CM_nLED, 0); + break; + case 1: + ioctl (fd, CM_LED_BLINK, 0); + sleep (1); + ioctl (fd, CM_nLED, 1); + break; + case 2: + ioctl (fd, CM_LED_BLINK, 1); + break; + case 3: + ioctl (fd, CM_LED_BLINK, 2); + break; + } + exit (0); + +} |