Skip to content
Open
Prev Previous commit
Next Next commit
Missing added user button.
  • Loading branch information
SFE-Brudnerd committed Mar 20, 2024
commit c1979cb8a5188618dee86dd4fe91ee40f506e9ee
33 changes: 18 additions & 15 deletions variants/THINGPLUS_RA6M5/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ static const uint8_t D6 = PIN_D6;
#define LED_BUILTIN PIN_LED
#define LED_RGB (13u)

/****** BUTTON DEFINES *******/
#define USR_BTN (31u)


/****** RTC CORE DEFINES *******/
#define RTC_HOWMANY 1
Expand All @@ -77,10 +80,10 @@ static const uint8_t D6 = PIN_D6;
#define SERIAL_HOWMANY 2
#define UART1_TX_PIN 20
#define UART1_RX_PIN 21
#define UART2_TX_PIN 31
#define UART2_RX_PIN 32
#define UART2_RTS_PIN 33
#define UART2_CTS_PIN 34
#define UART2_TX_PIN 32
#define UART2_RX_PIN 33
#define UART2_RTS_PIN 34
#define UART2_CTS_PIN 35

/****** WIRE CORE DEFINES ******/

Expand Down Expand Up @@ -141,12 +144,12 @@ static const uint8_t PICO = PIN_SPI_MOSI;

/****** QSPI CORE DEFINES ******/

#define PIN_QSPI_CLK (40)
#define PIN_QSPI_SS (41)
#define PIN_QSPI_D0 (42)
#define PIN_QSPI_D1 (43)
#define PIN_QSPI_D2 (44)
#define PIN_QSPI_D3 (45)
#define PIN_QSPI_CLK (41)
#define PIN_QSPI_SS (42)
#define PIN_QSPI_D0 (43)
#define PIN_QSPI_D1 (44)
#define PIN_QSPI_D2 (45)
#define PIN_QSPI_D3 (46)

#define HAS_QSPI

Expand All @@ -156,12 +159,12 @@ static const uint8_t PICO = PIN_SPI_MOSI;
#define QSPI_WRITE_BLOCK_SIZE (0x1)

/****** MISC GPIO CORE DEFINES ******/
#define EXT_INTERRUPTS_HOWMANY 14
#define EXT_INTERRUPTS_HOWMANY 15

#define SD_NEN (35)
#define BLE_NRST (36)
#define VREF_EN (37)
#define PWR_STAT (38)
#define SD_NEN (36)
#define BLE_NRST (37)
#define VREF_EN (38)
#define PWR_STAT (39)

#define HAS_SDHI

Expand Down
34 changes: 19 additions & 15 deletions variants/THINGPLUS_RA6M5/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,31 +49,32 @@ extern "C" const PinMuxCfg_t g_pin_cfg[] = {

// Other GPIO
{ BSP_IO_PORT_03_PIN_04, P304 }, /* D30 | FREE/IRQ */
{ BSP_IO_PORT_04_PIN_15, P415 }, /* D31 | !USRBTN/IRQ */

/// ###### FROM HERE, INTERNAL STUFF ONLY

// DA14531 BLE UART
{ BSP_IO_PORT_06_PIN_02, P602 }, /* D31 | TX1 */
{ BSP_IO_PORT_06_PIN_01, P601 }, /* D32 | RX1 */
{ BSP_IO_PORT_03_PIN_01, P301 }, /* D33 | RTS1 */
{ BSP_IO_PORT_03_PIN_03, P303 }, /* D34 | CTS1 */
{ BSP_IO_PORT_06_PIN_02, P602 }, /* D32 | TX1 */
{ BSP_IO_PORT_06_PIN_01, P601 }, /* D33 | RX1 */
{ BSP_IO_PORT_03_PIN_01, P301 }, /* D34 | RTS1 */
{ BSP_IO_PORT_03_PIN_03, P303 }, /* D35 | CTS1 */

// Dedicated GPIO pins
{ BSP_IO_PORT_07_PIN_08, P708 }, /* D35 | !SDEN */
{ BSP_IO_PORT_01_PIN_15, P115 }, /* D36 | BLE !RESET */
{ BSP_IO_PORT_05_PIN_00, P500 }, /* D37 | VREF_EN */
{ BSP_IO_PORT_00_PIN_01, P001 }, /* D38 | PWR_STATUS */
{ BSP_IO_PORT_07_PIN_08, P708 }, /* D36 | !SDEN */
{ BSP_IO_PORT_01_PIN_15, P115 }, /* D37 | BLE !RESET */
{ BSP_IO_PORT_05_PIN_00, P500 }, /* D38 | VREF_EN */
{ BSP_IO_PORT_00_PIN_01, P001 }, /* D39 | PWR_STATUS */

// Onboard Interrupts
{ BSP_IO_PORT_00_PIN_00, P000 }, /* D39 | !FUEL_GAUGE/IRQ */
{ BSP_IO_PORT_00_PIN_00, P000 }, /* D40 | !FUEL_GAUGE/IRQ */

// QSPI
{ BSP_IO_PORT_01_PIN_00, P100 }, /* D40 | QSPI CLK */
{ BSP_IO_PORT_05_PIN_01, P501 }, /* D41 | QSPI SS */
{ BSP_IO_PORT_01_PIN_02, P102 }, /* D42 | QSPI IO0 */
{ BSP_IO_PORT_01_PIN_01, P101 }, /* D43 | QSPI IO1 */
{ BSP_IO_PORT_01_PIN_04, P104 }, /* D44 | QSPI IO2 */
{ BSP_IO_PORT_01_PIN_03, P103 }, /* D45 | QSPI IO3 */
{ BSP_IO_PORT_01_PIN_00, P100 }, /* D41 | QSPI CLK */
{ BSP_IO_PORT_05_PIN_01, P501 }, /* D42 | QSPI SS */
{ BSP_IO_PORT_01_PIN_02, P102 }, /* D43 | QSPI IO0 */
{ BSP_IO_PORT_01_PIN_01, P101 }, /* D44 | QSPI IO1 */
{ BSP_IO_PORT_01_PIN_04, P104 }, /* D45 | QSPI IO2 */
{ BSP_IO_PORT_01_PIN_03, P103 }, /* D46 | QSPI IO3 */
};

extern "C" {
Expand All @@ -99,6 +100,9 @@ void initVariant() {
// bootloader configures LED_BUILTIN as PWM output, deconfigure it to avoid spurious signals
pinMode(LED_BUILTIN, INPUT);

// Setup user button
pinMode(USER_BTN, INPUT_PULLUP);

// Set internal gpio pins.
// Enable SD Card Power
pinMode(SD_NEN, OUTPUT_OPENDRAIN);
Expand Down