8
8
#define SFR_P3 0xB0
9
9
10
10
// Pin map:
11
- SBIT (ACTIVE_N , SFR_P3 , 2 ); // ACTIVE_N P3.2 Status LED output (active low)
11
+ SBIT (OE_N , SFR_P1 , 0 ); // OE_N P1.0 Enable USB switch output (active low)
12
12
SBIT (REBOOT_N , SFR_P1 , 5 ); // REBOOT_N P1.5 Reboot button input (low when pressed)
13
13
SBIT (POWER_EN , SFR_P1 , 6 ); // POWER_EN P1.6 Enable power to DUT (active high)
14
- SBIT (OE_N , SFR_P1 , 0 ); // OE_N P1.0 Enable USB switch output (active low)
15
- SBIT (BOOT_EN_N , SFR_P3 , 1 ); // BOOT_EN_N P3.1 Enable DUT boot resistor (active low)
16
14
SBIT (SEL , SFR_P3 , 0 ); // SEL P3.0 Select USB switch output (keep low)
15
+ SBIT (BOOT_EN_N , SFR_P3 , 1 ); // BOOT_EN_N P3.1 Enable DUT boot resistor (active low)
16
+ SBIT (ACTIVE_N , SFR_P3 , 2 ); // ACTIVE_N P3.2 Status LED output (active low)
17
17
18
18
void hw_init () {
19
19
// REBOOT is an input
@@ -31,8 +31,10 @@ void hw_init() {
31
31
// Output mode: Pn_MOD_OC = 0, Pn_DIR_PU = 1
32
32
P1_MOD_OC = P1_MOD_OC & ~((1 <<0 ) | (1 <<6 ));
33
33
P1_DIR_PU = P1_DIR_PU | ((1 <<0 ) | (1 <<6 ));
34
- P3_MOD_OC = P3_MOD_OC & ~((1 <<0 ) | (1 <<1 ));
35
- P3_DIR_PU = P3_DIR_PU | ((1 <<0 ) | (1 <<1 ));
34
+ P3_MOD_OC = P3_MOD_OC & ~((1 <<2 ) | (1 <<0 ) | (1 <<1 ));
35
+ P3_DIR_PU = P3_DIR_PU | ((1 <<2 ) | (1 <<0 ) | (1 <<1 ));
36
+
37
+ ACTIVE_N = 0 ; // Turn on status LED
36
38
}
37
39
38
40
void reboot_sequence () {
0 commit comments