mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Read battery voltage on Minewsemi ME25LS01
This commit is contained in:
parent
70a9990f45
commit
aa3c702ffd
5 changed files with 22 additions and 73 deletions
|
|
@ -8,7 +8,6 @@ build_flags = ${nrf52_base.build_flags}
|
|||
-I lib/nrf52/s140_nrf52_7.3.0_API/include/nrf52
|
||||
lib_ignore =
|
||||
BluetoothOTA
|
||||
lvgl
|
||||
lib5b4
|
||||
lib_deps =
|
||||
${nrf52_base.lib_deps}
|
||||
|
|
@ -67,7 +66,6 @@ build_flags = ${me25ls01.build_flags}
|
|||
;-D PIN_BUZZER_EN=37
|
||||
build_src_filter = ${me25ls01.build_src_filter}
|
||||
+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||
;+<helpers/ui/buzzer.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
lib_deps = ${me25ls01.lib_deps}
|
||||
adafruit/RTClib @ ^2.1.3
|
||||
|
|
@ -92,9 +90,6 @@ build_flags = ${me25ls01.build_flags}
|
|||
-D MAX_NEIGHBOURS=8
|
||||
-D DISPLAY_CLASS=NullDisplayDriver
|
||||
build_src_filter = ${me25ls01.build_src_filter}
|
||||
;+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||
;+<helpers/ui/buzzer.cpp>
|
||||
;+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/simple_repeater>
|
||||
lib_deps = ${me25ls01.lib_deps}
|
||||
adafruit/RTClib @ ^2.1.3
|
||||
|
|
@ -121,10 +116,6 @@ build_flags = ${me25ls01.build_flags}
|
|||
-D MAX_NEIGHBOURS=8
|
||||
-D DISPLAY_CLASS=NullDisplayDriver
|
||||
build_src_filter = ${me25ls01.build_src_filter}
|
||||
;+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||
;+<helpers/ui/buzzer.cpp>
|
||||
;+<../examples/companion_radio/*.cpp>
|
||||
;+<../examples/simple_repeater>
|
||||
+<../examples/simple_room_server>
|
||||
lib_deps = ${me25ls01.lib_deps}
|
||||
adafruit/RTClib @ ^2.1.3
|
||||
|
|
@ -149,11 +140,6 @@ build_flags = ${me25ls01.build_flags}
|
|||
-D MAX_NEIGHBOURS=8
|
||||
-D DISPLAY_CLASS=NullDisplayDriver
|
||||
build_src_filter = ${me25ls01.build_src_filter}
|
||||
;+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||
;+<helpers/ui/buzzer.cpp>
|
||||
;+<../examples/companion_radio/*.cpp>
|
||||
;+<../examples/simple_repeater>
|
||||
;+<../examples/simple_room_server>
|
||||
+<../examples/simple_secure_chat/main.cpp>
|
||||
lib_deps = ${me25ls01.lib_deps}
|
||||
adafruit/RTClib @ ^2.1.3
|
||||
|
|
@ -173,11 +159,6 @@ build_flags = ${me25ls01.build_flags}
|
|||
-D DISPLAY_CLASS=NullDisplayDriver
|
||||
build_src_filter = ${me25ls01.build_src_filter}
|
||||
+<helpers/nrf52/*.cpp>
|
||||
;+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||
;+<helpers/ui/buzzer.cpp>
|
||||
;+<../examples/companion_radio/*.cpp>
|
||||
;+<../examples/simple_repeater>
|
||||
;+<../examples/simple_room_server>
|
||||
+<../examples/companion_radio>
|
||||
lib_deps = ${me25ls01.lib_deps}
|
||||
adafruit/RTClib @ ^2.1.3
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ const uint32_t g_ADigitalPinMap[PINS_COUNT + 1] =
|
|||
28, // P0.28
|
||||
29, // P0.29,
|
||||
30, // P0.30
|
||||
31, // P0.31,
|
||||
31, // P0.31, BATTERY_PIN
|
||||
32, // P1.00
|
||||
33, // P1.01, LORA_DIO_1
|
||||
34, // P1.02
|
||||
|
|
@ -60,8 +60,8 @@ void initVariant()
|
|||
pinMode(BATTERY_PIN, INPUT);
|
||||
pinMode(PIN_BUTTON1, INPUT);
|
||||
|
||||
pinMode(PIN_3V3_EN, OUTPUT);
|
||||
pinMode(PIN_3V3_ACC_EN, OUTPUT);
|
||||
// pinMode(PIN_3V3_EN, OUTPUT);
|
||||
// pinMode(PIN_3V3_ACC_EN, OUTPUT);
|
||||
pinMode(LED_PIN, OUTPUT);
|
||||
pinMode(P_LORA_TX_LED, OUTPUT);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,26 +2,19 @@
|
|||
|
||||
#include "WVariant.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Low frequency clock source
|
||||
|
||||
#define USE_LFXO // 32.768 kHz crystal oscillator
|
||||
#define VARIANT_MCK (64000000ul)
|
||||
// #define USE_LFRC // 32.768 kHz RC oscillator
|
||||
|
||||
// Power
|
||||
#define PIN_3V3_EN (32 + 5) // P1.6 Power to Sensors
|
||||
#define PIN_3V3_ACC_EN -1
|
||||
|
||||
#define BATTERY_PIN (-1) // P0.2/AIN0
|
||||
#define BATTERY_PIN (31)
|
||||
#define BATTERY_IMMUTABLE
|
||||
#define ADC_MULTIPLIER (2.0F)
|
||||
|
||||
#define ADC_RESOLUTION (14)
|
||||
#define BATTERY_SENSE_RES (12)
|
||||
|
||||
#define AREF_VOLTAGE (3.0)
|
||||
|
||||
// Number of pins
|
||||
#define PINS_COUNT (48)
|
||||
#define NUM_DIGITAL_PINS (48)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue