Signed-off-by: 吴文峰 <kevin@lmve.net>

This commit is contained in:
2026-03-03 22:16:00 +08:00
parent 7ae6e9e999
commit 88d56e1e9e
1660 changed files with 281430 additions and 0 deletions
@@ -0,0 +1,24 @@
; Milesight GS301 Bathroom Odor Detector
; https://www.milesight.com/iot/product/lorawan-sensor/gs301
[env:milesight_gs301]
extends = stm32_base
board = wiscore_rak3172 ; Convenient choice as the same USART is used for programming/debug
board_level = extra
board_upload.maximum_size = 233472 ; reserve the last 28KB for filesystem
build_flags =
${stm32_base.build_flags}
-Ivariants/stm32/milesight_gs301
-DPRIVATE_HW
-DMESHTASTIC_EXCLUDE_GPS=1
-DMESHTASTIC_EXCLUDE_I2C=1 # Analog ADuCM355 (unsupported) so no point building support for I2C in
-DMESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1
-DMESHTASTIC_EXCLUDE_AIR_QUALITY_SENSOR=1
build_unflags =
-DDEBUG_MUTE # We have space for debug output until sensor support is added
build_src_filter =
${stm32_base.build_src_filter}
+<../variants/stm32/milesight_gs301>
lib_deps =
${stm32_base.lib_deps}
upload_port = stlink
@@ -0,0 +1,7 @@
// Seems to use the same RF switch pins as RAK3172… getting Tx/Rx SNR +11dB with a nearby node
// PB8, PC13
static const RADIOLIB_PIN_TYPE rfswitch_pins[5] = {PB8, PC13, RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC};
static const Module::RfSwitchMode_t rfswitch_table[4] = {
{STM32WLx::MODE_IDLE, {LOW, LOW}}, {STM32WLx::MODE_RX, {HIGH, LOW}}, {STM32WLx::MODE_TX_HP, {LOW, HIGH}}, END_OF_MODE_TABLE};
@@ -0,0 +1,8 @@
#include "variant.h"
#include "Arduino.h"
void earlyInitVariant()
{
pinMode(USER_LED, OUTPUT);
digitalWrite(USER_LED, HIGH ^ LED_STATE_ON);
}
@@ -0,0 +1,41 @@
#ifndef _VARIANT_MILESIGHT_GS301_
#define _VARIANT_MILESIGHT_GS301_
#define USE_STM32WLx
// I/O
#define LED_STATE_ON 1
#define PIN_LED1 PA0 // Green LED
#define LED_POWER PIN_LED1
#define PIN_LED2 PA0 // Red LED
#define USER_LED PIN_LED2
#define BUTTON_PIN PC13
#define BUTTON_ACTIVE_LOW true
#define BUTTON_ACTIVE_PULLUP false
#define PIN_BUZZER PA6
// EC Sense DGM10 Double Gas Module
// Analog ADuCM355 (unsupported); SHTC3 is connected to ADuCM355 and not directly accessible
#define PIN_WIRE_SDA PB7
#define PIN_WIRE_SCL PB8
// Commented out to keep sensor powered down due to lack of support
/*
#define VEXT_ENABLE PB12 // TI TPS61291DRV VSEL - set LOW before ENable for Vout = 3.3V
#define VEXT_ON_VALUE LOW
#define SENSOR_POWER_CTRL_PIN PB2 // TI TPS61291DRV EN pin
#define SENSOR_POWER_ON HIGH
#define HAS_SENSOR 1
*/
#define ENABLE_HWSERIAL1
#define PIN_SERIAL1_RX NC
#define PIN_SERIAL1_TX PB6
// LoRa
#define SX126X_DIO3_TCXO_VOLTAGE 3.0
// Required to avoid Serial1 conflicts due to board definition here:
// https://github.com/stm32duino/Arduino_Core_STM32/blob/main/variants/STM32WLxx/WL54CCU_WL55CCU_WLE4C(8-B-C)U_WLE5C(8-B-C)U/variant_RAK3172_MODULE.h
#define RAK3172
#endif