Merge pull request #16 from FoamyGuy/pin_configs

Adding common pin configs
This commit is contained in:
Liz 2025-07-18 16:03:21 -04:00 committed by GitHub
commit e7d5cebb90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 47 additions and 3 deletions

View file

@ -2,9 +2,21 @@
#include <Adafruit_dvhstx.h>
#if defined(ADAFRUIT_FEATHER_RP2350_HSTX)
DVHSTXPinout pinConfig = ADAFRUIT_FEATHER_RP2350_CFG;
#elif defined(ADAFRUIT_METRO_RP2350)
DVHSTXPinout pinConfig = ADAFRUIT_METRO_RP2350_CFG;
#elif (defined(ARDUINO_RASPBERRY_PI_PICO_2) || defined(ARDUINO_RASPBERRY_PI_PICO_2W))
DVHSTXPinout pinConfig = ADAFRUIT_HSTXDVIBELL_CFG;
#else
// If your board definition has PIN_CKP and related defines,
// DVHSTX_PINOUT_DEFAULT is available
DVHSTX16 display(DVHSTX_PINOUT_DEFAULT, DVHSTX_RESOLUTION_320x240);
DVHSTXPinout pinConfig = DVHSTX_PINOUT_DEFAULT;
#endif
DVHSTX16 display(pinConfig, DVHSTX_RESOLUTION_320x240);
// If you get the message "error: 'DVHSTX_PINOUT_DEFAULTx' was not declared"
// then you need to give the pins numbers explicitly, like the example below.
// The order is: {CKP, D0P, D1P, D2P} DVHSTX16 display({12, 14, 16, 18},

View file

@ -2,9 +2,20 @@
#include <Adafruit_dvhstx.h>
#if defined(ADAFRUIT_FEATHER_RP2350_HSTX)
DVHSTXPinout pinConfig = ADAFRUIT_FEATHER_RP2350_CFG;
#elif defined(ADAFRUIT_METRO_RP2350)
DVHSTXPinout pinConfig = ADAFRUIT_METRO_RP2350_CFG;
#elif (defined(ARDUINO_RASPBERRY_PI_PICO_2) || defined(ARDUINO_RASPBERRY_PI_PICO_2W))
DVHSTXPinout pinConfig = ADAFRUIT_HSTXDVIBELL_CFG;
#else
// If your board definition has PIN_CKP and related defines,
// DVHSTX_PINOUT_DEFAULT is available
DVHSTX8 display(DVHSTX_PINOUT_DEFAULT, DVHSTX_RESOLUTION_640x360);
DVHSTXPinout pinConfig = DVHSTX_PINOUT_DEFAULT;
#endif
DVHSTX8 display(pinConfig, DVHSTX_RESOLUTION_320x240);
// If you get the message "error: 'DVHSTX_PINOUT_DEFAULTx' was not declared"
// then you need to give the pins numbers explicitly, like the example below.
// The order is: {CKP, D0P, D1P, D2P} DVHSTX8 display({12, 14, 16, 18},

View file

@ -2,9 +2,20 @@
// With apologies to Stanley Kubrick et al
#include <Adafruit_dvhstx.h>
#if defined(ADAFRUIT_FEATHER_RP2350_HSTX)
DVHSTXPinout pinConfig = ADAFRUIT_FEATHER_RP2350_CFG;
#elif defined(ADAFRUIT_METRO_RP2350)
DVHSTXPinout pinConfig = ADAFRUIT_METRO_RP2350_CFG;
#elif (defined(ARDUINO_RASPBERRY_PI_PICO_2) || defined(ARDUINO_RASPBERRY_PI_PICO_2W))
DVHSTXPinout pinConfig = ADAFRUIT_HSTXDVIBELL_CFG;
#else
// If your board definition has PIN_CKP and related defines,
// DVHSTX_PINOUT_DEFAULT is available
DVHSTXText display(DVHSTX_PINOUT_DEFAULT);
DVHSTXPinout pinConfig = DVHSTX_PINOUT_DEFAULT;
#endif
DVHSTXText display(pinConfig);
// If you get the message "error: 'DVHSTX_PINOUT_DEFAULTx' was not declared"
// then you need to give the pins numbers explicitly, like the example below.
// The order is: {CKP, D0P, D1P, D2P}.

View file

@ -97,6 +97,16 @@ using pimoroni::DVHSTXPinout;
{ 12, 14, 16, 18 }
#endif
// Other common HSTX pin configurations
#define ADAFRUIT_HSTXDVIBELL_CFG \
{ 14, 12, 18, 16 }
#define ADAFRUIT_METRO_RP2350_CFG \
{ 14, 18, 16, 12 }
#define ADAFRUIT_FEATHER_RP2350_CFG \
{ 14, 18, 16, 12 }
#define ADAFRUIT_FRUIT_JAM_CFG \
{ 13, 15, 17, 19 }
int16_t dvhstx_width(DVHSTXResolution r);
int16_t dvhstx_height(DVHSTXResolution r);