Commit | Line | Data |
---|---|---|
3bacb654 IS |
1 | #include <stdlib.h> |
2 | #include <fcntl.h> | |
3 | #include <signal.h> | |
4 | #include <unistd.h> | |
5 | #include <string.h> | |
6 | #include <stdio.h> | |
7 | #include <stdlib.h> | |
8 | #include <time.h> | |
9 | ||
10 | #include <sys/types.h> | |
11 | #include <sys/gpio.h> | |
12 | #include <sys/ioctl.h> | |
13 | ||
14 | #include "pins.h" | |
15 | ||
16 | #define UP(N) set_pin(N, 1) | |
17 | #define DOWN(N) set_pin(N, 0) | |
18 | ||
19 | #define HI(N) set(N, 1) | |
20 | #define LO(N) set(N, 0) | |
21 | ||
22 | int main(int argc, char *argv[]) { | |
23 | pins_init(); | |
24 | config_pins(); | |
25 | pincnt(); | |
26 | ||
27 | sleep(1); | |
28 | ||
29 | pcfg(1, 6, -1, INPUT | PULLDOWN, "ser"); | |
30 | pcfg(1, 13, 0, OUTPUT, "clk"); | |
31 | pcfg(1, 15, 0, OUTPUT, "shld"); | |
32 | pcfg(0, 27, 0, OUTPUT, "clr"); | |
33 | ||
34 | for(;;) { | |
35 | HI("shld"); | |
36 | usleep(1); | |
37 | LO("shld"); | |
38 | usleep(1); | |
39 | } | |
40 | } |