Support for muzi works R1 Neo device.
Support for R1 Neo hardware. New variant and baseboard class. * Known issues: - power management is not currently supported - power off via long button press is not implemented Add support for Epson Seiko RX8130CE I2C Real-time clock.
This commit is contained in:
55
variants/muziworks_r1_neo/R1NeoBoard.h
Normal file
55
variants/muziworks_r1_neo/R1NeoBoard.h
Normal file
@@ -0,0 +1,55 @@
|
||||
#pragma once
|
||||
|
||||
#include <MeshCore.h>
|
||||
#include <Arduino.h>
|
||||
#include <helpers/NRF52Board.h>
|
||||
#include "NullDisplayDriver.h"
|
||||
#include "MomentaryButton.h"
|
||||
|
||||
#define DISPLAY_CLASS NullDisplayDriver
|
||||
|
||||
class R1NeoBoard : public NRF52BoardDCDC {
|
||||
protected:
|
||||
#ifdef NRF52_POWER_MANAGEMENT
|
||||
void initiateShutdown(uint8_t reason) override;
|
||||
#endif
|
||||
|
||||
public:
|
||||
R1NeoBoard() : NRF52Board("R1NEO_OTA") {}
|
||||
void begin();
|
||||
|
||||
#if defined(P_LORA_TX_LED)
|
||||
void onBeforeTransmit() override {
|
||||
digitalWrite(P_LORA_TX_LED, HIGH); // turn TX LED on
|
||||
#if defined(LED_BLUE)
|
||||
// turn off that annoying blue LED before transmitting
|
||||
digitalWrite(LED_BLUE, LOW);
|
||||
#endif
|
||||
}
|
||||
void onAfterTransmit() override {
|
||||
digitalWrite(P_LORA_TX_LED, LOW); // turn TX LED off
|
||||
#if defined(LED_BLUE)
|
||||
// do it after transmitting too, just in case
|
||||
digitalWrite(LED_BLUE, LOW);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#define BATTERY_SAMPLES 8
|
||||
|
||||
uint16_t getBattMilliVolts() override {
|
||||
analogReadResolution(12);
|
||||
|
||||
uint32_t raw = 0;
|
||||
for (int i = 0; i < BATTERY_SAMPLES; i++) {
|
||||
raw += analogRead(PIN_VBAT_READ);
|
||||
}
|
||||
raw = raw / BATTERY_SAMPLES;
|
||||
|
||||
return (ADC_MULTIPLIER * raw) / 4096;
|
||||
}
|
||||
|
||||
const char* getManufacturerName() const override {
|
||||
return "muzi works R1 Neo";
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user