comparison target-utils/lunadrv/backlight.c @ 700:db9a8e88e63f

target-utils lunadrv program written, compiles
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 07 May 2020 02:19:51 +0000
parents
children
comparison
equal deleted inserted replaced
699:c354c261f635 700:db9a8e88e63f
1 #include <sys/types.h>
2 #include <strings.h>
3 #include "types.h"
4
5 #define GPIO_OUT_REG (*(volatile u16 *) 0xfffe4802)
6 #define BACKLIGHT_GPIO_MASK 0x0200
7
8 void
9 cmd_dbl(argbulk)
10 char *argbulk;
11 {
12 char *argv[2];
13
14 if (parse_args(argbulk, 1, 1, argv, 0) < 0)
15 return;
16 if (!strcmp(argv[0], "on"))
17 GPIO_OUT_REG |= BACKLIGHT_GPIO_MASK;
18 else if (!strcmp(argv[0], "off"))
19 GPIO_OUT_REG &= ~BACKLIGHT_GPIO_MASK;
20 else
21 printf("ERROR: \"on\" or \"off\" argument expected\n");
22 }