Wessel Nieboer
3 months ago
No known key found for this signature in database
GPG Key ID: 929C8E45E33B5FD2
2 changed files with
0 additions and
15 deletions
-
variants/rak11200/RAK11200Board.cpp
-
variants/rak11200/RAK11200Board.h
|
|
|
@ -18,19 +18,6 @@ void RAK11200Board::begin() { |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
uint16_t RAK11200Board::getBattMilliVolts() { |
|
|
|
analogReadResolution(12); |
|
|
|
|
|
|
|
uint32_t raw = 0; |
|
|
|
const int BATTERY_SAMPLES = 8; |
|
|
|
for (int i = 0; i < BATTERY_SAMPLES; i++) { |
|
|
|
raw += analogRead(PIN_VBAT_READ); |
|
|
|
} |
|
|
|
raw = raw / BATTERY_SAMPLES; |
|
|
|
|
|
|
|
return (ADC_MULTIPLIER * raw) / 4096; |
|
|
|
} |
|
|
|
|
|
|
|
const char* RAK11200Board::getManufacturerName() const { |
|
|
|
return "RAK 11200"; |
|
|
|
} |
|
|
|
|
|
|
|
@ -13,13 +13,11 @@ |
|
|
|
#define P_LORA_MOSI 25 // GPIO25 (ESP32 pin 10 -> SPI_MOSI)
|
|
|
|
#define SX126X_POWER_EN 27 // GPIO27 (ESP32 pin 12 -> IO2)
|
|
|
|
#define PIN_VBAT_READ 36 // WB_A0 for battery reading
|
|
|
|
#define ADC_MULTIPLIER (3 * 1.73 * 1.110 * 1000) |
|
|
|
|
|
|
|
class RAK11200Board : public ESP32Board { |
|
|
|
|
|
|
|
public: |
|
|
|
void begin(); |
|
|
|
uint16_t getBattMilliVolts() override; |
|
|
|
const char* getManufacturerName() const override; |
|
|
|
|
|
|
|
}; |
|
|
|
|