From 778200162ffd1bdb6182f4df921647215ff11fd9 Mon Sep 17 00:00:00 2001 From: Nivek-domo <123359286+Nivek-domo@users.noreply.github.com> Date: Fri, 18 Apr 2025 09:26:39 +0200 Subject: [PATCH 1/2] Create pins_arduino.h in France we make with our community Gaulix base on your project our harrdware https://gaulix.fr/carte-gaulix-low-cost-30dbm/ --- variants/GaulixLCrp2040V1b/pins_arduino.h | 68 +++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 variants/GaulixLCrp2040V1b/pins_arduino.h diff --git a/variants/GaulixLCrp2040V1b/pins_arduino.h b/variants/GaulixLCrp2040V1b/pins_arduino.h new file mode 100644 index 000000000..fb27010c0 --- /dev/null +++ b/variants/GaulixLCrp2040V1b/pins_arduino.h @@ -0,0 +1,68 @@ +#pragma once + +// Pin definitions taken from: +// https://datasheets.raspberrypi.org/pico/pico-datasheet.pdf + +static const uint8_t WB_IO1 = 22; // SLOT_A SLOT_B +static const uint8_t WB_IO2 = 28; // SLOT_A SLOT_B +static const uint8_t WB_IO3 = 10; // SLOT_C +static const uint8_t WB_IO4 = 11; // SLOT_C +static const uint8_t WB_IO5 = 7; // SLOT_D +static const uint8_t WB_IO6 = 6; // SLOT_D +static const uint8_t WB_A0 = 26; // IO_SLOT +static const uint8_t WB_A1 = 27; // IO_SLOT + +#define PIN_A0 (26u) +#define PIN_A1 (27u) +#define PIN_A2 (28u) +#define PIN_A3 (29u) + +static const uint8_t A0 = PIN_A0; +static const uint8_t A1 = PIN_A1; +static const uint8_t A2 = PIN_A2; +static const uint8_t A3 = PIN_A3; + +// LEDs +#define PIN_LED (25u) +#define PIN_LED1 PIN_LED +#define PIN_LED2 (19u) +#define LED_BUILTIN PIN_LED + +#define ADC_RESOLUTION 12 + +// Serial +#define PIN_SERIAL1_TX (0ul) +#define PIN_SERIAL1_RX (1ul) + +#define PIN_SERIAL2_TX (8ul) +#define PIN_SERIAL2_RX (9ul) + +// SPI +#define PIN_SPI1_MISO (24u) +#define PIN_SPI1_MOSI (15u) +#define PIN_SPI1_SCK (14u) +#define PIN_SPI1_SS (13u) + +#define PIN_SPI0_MISO (4u) +#define PIN_SPI0_MOSI (3u) +#define PIN_SPI0_SCK (2u) +#define PIN_SPI0_SS (5u) + +// Wire +#define PIN_WIRE0_SDA (20u) +#define PIN_WIRE0_SCL (21u) + +#define PIN_WIRE1_SDA (10u) +#define PIN_WIRE1_SCL (11u) + +#define SERIAL_HOWMANY (3u) +#define SPI_HOWMANY (2u) +#define WIRE_HOWMANY (2u) + +static const uint8_t SS = PIN_SPI0_SS; +static const uint8_t MOSI = PIN_SPI0_MOSI; +static const uint8_t MISO = PIN_SPI0_MISO; +static const uint8_t SCK = PIN_SPI0_SCK; + +static const uint8_t SDA = PIN_WIRE0_SDA; +static const uint8_t SCL = PIN_WIRE0_SCL; From edce85a767b17ecc43f6bdec37619039fca8e9f0 Mon Sep 17 00:00:00 2001 From: Nivek-domo <123359286+Nivek-domo@users.noreply.github.com> Date: Fri, 18 Apr 2025 09:26:39 +0200 Subject: [PATCH 2/2] New variant GaulixLCrp2040V1b in France we make with our community Gaulix base on your project our harrdware https://gaulix.fr/carte-gaulix-low-cost-30dbm/ --- variants/GaulixLCrp2040V1b/pins_arduino.h | 4 +- variants/GaulixLCrp2040V1b/platformio.ini | 22 ++++++++ variants/GaulixLCrp2040V1b/variant.h | 68 +++++++++++++++++++++++ 3 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 variants/GaulixLCrp2040V1b/platformio.ini create mode 100644 variants/GaulixLCrp2040V1b/variant.h diff --git a/variants/GaulixLCrp2040V1b/pins_arduino.h b/variants/GaulixLCrp2040V1b/pins_arduino.h index fb27010c0..02849e335 100644 --- a/variants/GaulixLCrp2040V1b/pins_arduino.h +++ b/variants/GaulixLCrp2040V1b/pins_arduino.h @@ -3,9 +3,9 @@ // Pin definitions taken from: // https://datasheets.raspberrypi.org/pico/pico-datasheet.pdf -static const uint8_t WB_IO1 = 22; // SLOT_A SLOT_B +static const uint8_t WB_IO1 = 22; // SLOT_A SLOT_B static const uint8_t WB_IO2 = 28; // SLOT_A SLOT_B -static const uint8_t WB_IO3 = 10; // SLOT_C +static const uint8_t WB_IO3 = 10; // SLOT_C static const uint8_t WB_IO4 = 11; // SLOT_C static const uint8_t WB_IO5 = 7; // SLOT_D static const uint8_t WB_IO6 = 6; // SLOT_D diff --git a/variants/GaulixLCrp2040V1b/platformio.ini b/variants/GaulixLCrp2040V1b/platformio.ini new file mode 100644 index 000000000..ff62c9c13 --- /dev/null +++ b/variants/GaulixLCrp2040V1b/platformio.ini @@ -0,0 +1,22 @@ +[env:GaulixLCrp2040V1b] +extends = rp2040_base +board = rakwireless_rak11300 +upload_protocol = picotool + +# add our variants files to the include and src paths +build_flags = ${rp2040_base.build_flags} + -DRAK11310 + -Ivariants/rak11310 + -DDEBUG_RP2040_PORT=Serial + -DRV3028_RTC=0x52 + -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus" + #autorise le hardware remote + -DMESHTASTIC_EXCLUDE_REMOTEHARDWARE=0 +build_src_filter = ${rp2040_base.build_src_filter} +<../variants/rak11310> + + + +lib_deps = + ${rp2040_base.lib_deps} + ${networking_base.lib_deps} + melopero/Melopero RV3028@^1.1.0 + https://github.com/RAKWireless/RAK13800-W5100S.git#1.0.2 +debug_build_flags = ${rp2040_base.build_flags}, -g +debug_tool = cmsis-dap ; for e.g. Picotool diff --git a/variants/GaulixLCrp2040V1b/variant.h b/variants/GaulixLCrp2040V1b/variant.h new file mode 100644 index 000000000..5dbe800dc --- /dev/null +++ b/variants/GaulixLCrp2040V1b/variant.h @@ -0,0 +1,68 @@ +#define ARDUINO_ARCH_AVR + +// Define I2C pins to ensure correct usage of both ports +#define I2C_SDA 20 +#define I2C_SCL 21 +#define I2C_SDA1 10 +#define I2C_SCL1 11 + +#define LED_CONN PIN_LED2 +#define LED_PIN LED_BUILTIN +#define ledOff(pin) pinMode(pin, INPUT) + +#define BUTTON_PIN 12 +#define BUTTON_NEED_PULLUP +#define EXT_NOTIFY_OUT 22 + +#define BATTERY_PIN PIN_A0 // 3 //29 0 //26 +// ratio of voltage divider = 3.0 (R17=200k, R18=100k) +#define ADC_MULTIPLIER 3.05 // 3.065 //3.33 //1.84 +#define BATTERY_SENSE_RESOLUTION_BITS ADC_RESOLUTION + +#define DETECTION_SENSOR_EN 28 + +#define USE_SX1262 + +#undef LORA_SCK +#undef LORA_MISO +#undef LORA_MOSI +#undef LORA_CS + +// RAK BSP somehow uses SPI1 instead of SPI0 +#define HW_SPI1_DEVICE +#define LORA_SCK (14u) +#define LORA_MOSI (15u) +#define LORA_MISO (24u) +#define LORA_CS (13u) + +#define LORA_DIO0 RADIOLIB_NC // No GPIO connection +#define LORA_RESET 23 // GPIO23 +#define LORA_BUSY 18 // GPIO18 +#define LORA_DIO1 16 // GPIO16 +#define LORA_DIO2 RADIOLIB_NC // Antenna switching, no GPIO connection +#define LORA_DIO3 RADIOLIB_NC // No GPIO connection +#define LORA_DIO4 17 // GPIO17 + +// On rp2040-lora board the antenna switch is wired and works with complementary-pin control logic. +// See PE4259 datasheet page 4 + +#ifdef USE_SX1262 +#define SX126X_CS LORA_CS +#define SX126X_DIO1 LORA_DIO1 +#define SX126X_BUSY LORA_BUSY +#define SX126X_RESET LORA_RESET +#define SX126X_DIO2_AS_RF_SWITCH // Antenna switch CTRL +#define SX126X_RXEN LORA_DIO4 // Antenna switch !CTRL via GPIO17 +// #define SX126X_TXEN 19 +#define SX126X_DIO3_TCXO_VOLTAGE 1.8 +#endif + +#define HAS_ETHERNET 1 +#define PIN_ETHERNET_RESET 7 // IO3 +#define PIN_ETHERNET_SS 5 +#define ETH_SPI_PORT SPI + +#define PIN_ETH_POWER_EN 6 + +#define MAX_NUM_NODES 500 +#define MAX_NUM_NODES_FS 500