mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
add heltec meshpocket board.
This commit is contained in:
parent
88fbb41016
commit
c9671d7d8d
12 changed files with 560 additions and 19 deletions
72
variants/mesh_pocket/target.cpp
Normal file
72
variants/mesh_pocket/target.cpp
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
#include <Arduino.h>
|
||||
#include "target.h"
|
||||
#include <helpers/ArduinoHelpers.h>
|
||||
#include <helpers/sensors/MicroNMEALocationProvider.h>
|
||||
|
||||
HeltecMeshPocket board;
|
||||
|
||||
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI);
|
||||
|
||||
WRAPPER_CLASS radio_driver(radio, board);
|
||||
|
||||
MeshPocketSensorManager sensors = MeshPocketSensorManager();
|
||||
|
||||
VolatileRTCClock fallback_clock;
|
||||
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display;
|
||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||
#endif
|
||||
|
||||
bool radio_init() {
|
||||
return radio.std_init(&SPI);
|
||||
}
|
||||
|
||||
uint32_t radio_get_rng_seed() {
|
||||
return radio.random(0x7FFFFFFF);
|
||||
}
|
||||
|
||||
void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) {
|
||||
radio.setFrequency(freq);
|
||||
radio.setSpreadingFactor(sf);
|
||||
radio.setBandwidth(bw);
|
||||
radio.setCodingRate(cr);
|
||||
}
|
||||
|
||||
void radio_set_tx_power(uint8_t dbm) {
|
||||
radio.setOutputPower(dbm);
|
||||
}
|
||||
|
||||
mesh::LocalIdentity radio_new_identity() {
|
||||
RadioNoiseListener rng(radio);
|
||||
return mesh::LocalIdentity(&rng); // create new random identity
|
||||
}
|
||||
|
||||
bool MeshPocketSensorManager::begin() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void MeshPocketSensorManager::loop() {
|
||||
|
||||
}
|
||||
|
||||
bool MeshPocketSensorManager::querySensors(uint8_t requester_permission, CayenneLPP& telemetry) {
|
||||
return true;
|
||||
}
|
||||
|
||||
int MeshPocketSensorManager::getNumSettings() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char* MeshPocketSensorManager::getSettingName(int i) const {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char* MeshPocketSensorManager::getSettingValue(int i) const {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool MeshPocketSensorManager::setSettingValue(const char* name, const char* value) {
|
||||
return false;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue