-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest_c4520.c
41 lines (37 loc) · 1.2 KB
/
test_c4520.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
36
37
38
39
40
41
void test_C4520(void)
{
char i=0;
Direct_L=(BIT_L0 | BIT_L1 | BIT_L6 | BIT_L7);
Direct_H=(BIT_H7 | BIT_H6 | BIT_H1 | BIT_H0);
Port_L=(BIT_L6);
Port_H=(BIT_H1 | BIT_H0);
Port_L=0;
Port_H=(BIT_H0);
delay_ms(1);
res &= ((Pin_L==0) && (Pin_H==(BIT_H0)));
Port_L=(BIT_L1);
Port_H=(BIT_H6 | BIT_H0);
Port_L=(BIT_L0 | BIT_L1);
Port_H=(BIT_H7 | BIT_H6 | BIT_H0);
Port_L=(BIT_L1);
Port_H=(BIT_H6 | BIT_H0);
delay_ms(1);
res &= ((Pin_L==(BIT_L1 | BIT_L2)) && (Pin_H==(BIT_H6 | BIT_H5 | BIT_H0)));
Port_L=(BIT_L1);
Port_H=(BIT_H6 | BIT_H0);
Port_L=(BIT_L0 | BIT_L1);
Port_H=(BIT_H7 | BIT_H6 | BIT_H0);
Port_L=(BIT_L1);
Port_H=(BIT_H6 | BIT_H0);
delay_ms(1);
res &= ((Pin_L==(BIT_L1 | BIT_L3)) && (Pin_H==(BIT_H6 | BIT_H4 | BIT_H0)));
for (i=0;i<10;i++){
Port_L=(BIT_L1);
Port_H=(BIT_H6 | BIT_H0);
Port_L=0;
Port_H=(BIT_H0); }
delay_ms(1);
res &= ((Pin_L==(BIT_L4 | BIT_L5)) && (Pin_H==(BIT_H3 | BIT_H2 | BIT_H0)));
Port_L=0;
Port_H=0;
}