[AFSK] Use compact Doxygen and stop using reserved format

This commit is contained in:
jgromes 2023-04-22 19:36:12 +02:00
parent 668ff4fb01
commit 255838ed44
2 changed files with 11 additions and 20 deletions

View file

@ -1,12 +1,12 @@
#include "AFSK.h"
#if !defined(RADIOLIB_EXCLUDE_AFSK)
AFSKClient::AFSKClient(PhysicalLayer* phy, uint32_t pin): _pin(pin) {
_phy = phy;
AFSKClient::AFSKClient(PhysicalLayer* phy, uint32_t pin): outPin(pin) {
phyLayer = phy;
}
int16_t AFSKClient::begin() {
return(_phy->startDirect());
return(phyLayer->startDirect());
}
int16_t AFSKClient::tone(uint16_t freq, bool autoStart) {
@ -15,23 +15,23 @@ int16_t AFSKClient::tone(uint16_t freq, bool autoStart) {
}
if(autoStart) {
int16_t state = _phy->transmitDirect();
int16_t state = phyLayer->transmitDirect();
RADIOLIB_ASSERT(state);
}
Module* mod = _phy->getMod();
mod->hal->tone(_pin, freq);
Module* mod = phyLayer->getMod();
mod->hal->tone(outPin, freq);
return(RADIOLIB_ERR_NONE);
}
int16_t AFSKClient::noTone(bool keepOn) {
Module* mod = _phy->getMod();
mod->hal->noTone(_pin);
Module* mod = phyLayer->getMod();
mod->hal->noTone(outPin);
if(keepOn) {
return(0);
}
return(_phy->standby());
return(phyLayer->standby());
}
#endif

View file

@ -11,43 +11,34 @@
/*!
\class AFSKClient
\brief Client for audio-based transmissions. Requires Arduino tone() function, and a module capable of direct mode transmission using DIO pins.
*/
class AFSKClient {
public:
/*!
\brief Default contructor.
\param phy Pointer to the wireless module providing PhysicalLayer communication.
\param pin The pin that will be used for audio output.
*/
AFSKClient(PhysicalLayer* phy, uint32_t pin);
/*!
\brief Initialization method.
\returns \ref status_codes
*/
int16_t begin();
/*!
\brief Start transmitting audio tone.
\param freq Frequency of the tone in Hz.
\param autoStart Whether to automatically enter transmission mode. Defaults to true.
\returns \ref status_codes
*/
int16_t tone(uint16_t freq, bool autoStart = true);
/*!
\brief Stops transmitting audio tone.
\param freq Keep transmitter on - this may limit noise when switching transmitter on or off.
\returns \ref status_codes
*/
int16_t noTone(bool keepOn = false);
@ -55,8 +46,8 @@ class AFSKClient {
#if !defined(RADIOLIB_GODMODE)
private:
#endif
PhysicalLayer* _phy;
uint32_t _pin;
PhysicalLayer* phyLayer;
uint32_t outPin;
// allow specific classes access the private PhysicalLayer pointer
friend class RTTYClient;