forked from moisutsu-playground/csjikken2-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
motor.c
35 lines (26 loc) · 682 Bytes
/
motor.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#define EXTIO_SCAN_ASCII (*(volatile unsigned int *)0x0310)
#define EXTIO_SCAN_REQ (*(volatile unsigned int *)0x030c)
#define EXTIO_SCAN_STROKE (*(volatile unsigned int *)0x0308)
#define SCAN_STRORING (unsigned int)0xffffffff
#define EXTIO_PRINT_STROKE (*(volatile unsigned int *) 0x0300)
#define EXTIO_PRINT_ASCII (*(volatile unsigned int *) 0x0304)
#define TRUE 0x1
#define FALSE 0x0
#define GPIO0 (*(volatile unsigned int *) 0x0320)
void my_motor();
void ext_out();
main() {
while(1){
my_motor();
}
}
void my_motor() {
ext_out(8);
ext_out(4);
ext_out(2);
ext_out(1);
}
void ext_out(unsigned int num) {
unsigned int i;
GPIO0 = num;
}