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

View file

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