Add some configuration for VBUS / VSYS (#1252)

The process for reading VBUS and VSYS on Pico and Pico W is different.
It's hard to write code that compiles for both devices.
Add some configuration to the board files.

Fixes #1222
This commit is contained in:
Peter Harper 2023-03-27 15:43:26 +01:00 committed by GitHub
parent a42564b4b4
commit e87f11bd2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 0 deletions

View File

@ -81,4 +81,14 @@
#define PICO_RP2040_B0_SUPPORTED 1
#endif
// Pin get VBUS
#ifndef PICO_VBUS_PIN
#define PICO_VBUS_PIN 24
#endif
// Pin used to monitor VSYS using ADC
#ifndef PICO_VSYS_PIN
#define PICO_VSYS_PIN 29
#endif
#endif

View File

@ -99,4 +99,19 @@
#define CYW43_WL_GPIO_LED_PIN 0
#endif
// CYW43 GPIO to get VBUS
#ifndef CYW43_WL_GPIO_VBUS_PIN
#define CYW43_WL_GPIO_VBUS_PIN 2
#endif
// VSYS pin is shared with CYW43
#ifndef CYW43_USES_VSYS_PIN
#define CYW43_USES_VSYS_PIN 1
#endif
// Pin used to monitor VSYS using ADC
#ifndef PICO_VSYS_PIN
#define PICO_VSYS_PIN 29
#endif
#endif