[PHY] Added method to set direct mode parameters (#177)

This commit is contained in:
jgromes 2021-02-13 15:43:16 +01:00
parent 6b46623133
commit 1a2d66305d
2 changed files with 18 additions and 1 deletions

View file

@ -167,3 +167,13 @@ int32_t PhysicalLayer::random(int32_t min, int32_t max) {
return(PhysicalLayer::random(max - min) + min); return(PhysicalLayer::random(max - min) + min);
} }
int16_t PhysicalLayer::startDirect() {
// disable encodings
int16_t state = setEncoding(0);
RADIOLIB_ASSERT(state);
// set frequency deviation to the lowest possible value
state = setFrequencyDeviation(0);
return(state);
}

View file

@ -239,7 +239,7 @@ class PhysicalLayer {
\param min The minimum value of the random number (inclusive). \param min The minimum value of the random number (inclusive).
\param max The maximum value of the random number (non-inclusive). \param max The maximum value of the random number (non-inclusive).
\returns Random number. \returns Random number.
*/ */
int32_t random(int32_t min, int32_t max); int32_t random(int32_t min, int32_t max);
@ -251,6 +251,13 @@ class PhysicalLayer {
*/ */
virtual uint8_t random() = 0; virtual uint8_t random() = 0;
/*!
\brief Configure module parameters for direct modes. Must be called prior to "ham" modes like RTTY or AX.25. Only available in FSK mode.
\returns \ref status_codes
*/
int16_t startDirect();
#ifndef RADIOLIB_GODMODE #ifndef RADIOLIB_GODMODE
private: private:
#endif #endif