Skip to content

Commit

Permalink
Power on RP2040
Browse files Browse the repository at this point in the history
  • Loading branch information
CameronRP committed Sep 15, 2023
1 parent c48851b commit b974351
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Pinout.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
#define BUTTON PIN_PA6 // Connected to the button on the case.
#define PING_PIN PIN_PB2
#define PI_SHUTDOWN PIN_PA7 // Raspberry Pi will drive this pin low when it has finished powering off.
#define EN_RP2040 PIN_PA1 // Drive low to power on rp2040.

#endif
3 changes: 3 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,16 @@ void setup() {
pinMode(LED_B, OUTPUT);
pinMode(EN_5V, OUTPUT);
digitalWrite(EN_5V, HIGH);
pinMode(EN_RP2040, OUTPUT);
pinMode(RTC_BAT_SENSE, INPUT);
pinMode(MAIN_BAT_SENSE, INPUT);
pinMode(RTC_ALARM, INPUT_PULLUP);
pinMode(BUTTON, INPUT_PULLUP);
pinMode(PI_SHUTDOWN, INPUT_PULLUP);
statusLED.writeColor(0, 0, 0);

digitalWrite(EN_RP2040, LOW);

// Check for a low battery.
checkMainBattery();

Expand Down

0 comments on commit b974351

Please sign in to comment.