Add LED
This commit is contained in:
1 parent
7e8aa94647
commit
75bb7fd01a
3 files changed
+14
No files matched your search
@@ -49,6 +49,9 @@ void HeltecRC52Board::begin()
|
|||||||
#ifdef NRF52_POWER_MANAGEMENT
|
#ifdef NRF52_POWER_MANAGEMENT
|
||||||
checkBootVoltage(&power_config);
|
checkBootVoltage(&power_config);
|
||||||
#endif
|
#endif
|
||||||
|
pinMode(P_LORA_TX_LED, OUTPUT);
|
||||||
|
digitalWrite(P_LORA_TX_LED, LOW); // off by default, active high
|
||||||
|
|
||||||
periph_power.begin();
|
periph_power.begin();
|
||||||
periph_power.claim();
|
periph_power.claim();
|
||||||
}
|
}
|
||||||
@@ -59,6 +62,14 @@ void HeltecRC52Board::shutdownPeripherals()
|
|||||||
variant_shutdown();
|
variant_shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HeltecRC52Board::onBeforeTransmit() {
|
||||||
|
digitalWrite(P_LORA_TX_LED, HIGH);
|
||||||
|
}
|
||||||
|
|
||||||
|
void HeltecRC52Board::onAfterTransmit() {
|
||||||
|
digitalWrite(P_LORA_TX_LED, LOW);
|
||||||
|
}
|
||||||
|
|
||||||
uint16_t HeltecRC52Board::getBattMilliVolts()
|
uint16_t HeltecRC52Board::getBattMilliVolts()
|
||||||
{
|
{
|
||||||
analogReadResolution(12);
|
analogReadResolution(12);
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ public:
|
|||||||
HeltecRC52Board() : NRF52Board("RC52_OTA"), periph_power(SENSOR_POWER_CTRL_PIN, SENSOR_POWER_ON) {}
|
HeltecRC52Board() : NRF52Board("RC52_OTA"), periph_power(SENSOR_POWER_CTRL_PIN, SENSOR_POWER_ON) {}
|
||||||
|
|
||||||
void begin() override;
|
void begin() override;
|
||||||
|
void onBeforeTransmit() override;
|
||||||
|
void onAfterTransmit() override;
|
||||||
void shutdownPeripherals() override;
|
void shutdownPeripherals() override;
|
||||||
uint16_t getBattMilliVolts() override;
|
uint16_t getBattMilliVolts() override;
|
||||||
const char* getManufacturerName() const override;
|
const char* getManufacturerName() const override;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ build_flags = ${nrf52_base.build_flags}
|
|||||||
-D P_LORA_SCLK=25
|
-D P_LORA_SCLK=25
|
||||||
-D P_LORA_MISO=14
|
-D P_LORA_MISO=14
|
||||||
-D P_LORA_MOSI=22
|
-D P_LORA_MOSI=22
|
||||||
|
-D P_LORA_TX_LED=15
|
||||||
-D LORA_TX_POWER=22
|
-D LORA_TX_POWER=22
|
||||||
-D SX126X_CURRENT_LIMIT=140
|
-D SX126X_CURRENT_LIMIT=140
|
||||||
-D SX126X_RX_BOOSTED_GAIN=1
|
-D SX126X_RX_BOOSTED_GAIN=1
|
||||||
|
|||||||
Reference in new issue
Block a user