acid-drop

- Hacking the planet from a LilyGo T-Deck using custom firmware
git clone git://git.acid.vegas/acid-drop.git
Log | Files | Refs | Archive | README | LICENSE

AFSK.cpp (691B)

      1 #include "AFSK.h"
      2 #if !defined(RADIOLIB_EXCLUDE_AFSK)
      3 
      4 AFSKClient::AFSKClient(PhysicalLayer* phy, RADIOLIB_PIN_TYPE pin): _pin(pin) {
      5   _phy = phy;
      6 }
      7 
      8 int16_t AFSKClient::begin() {
      9   return(_phy->startDirect());
     10 }
     11 
     12 int16_t AFSKClient::tone(uint16_t freq, bool autoStart) {
     13   if(freq == 0) {
     14     return(RADIOLIB_ERR_INVALID_FREQUENCY);
     15   }
     16 
     17   if(autoStart) {
     18     int16_t state = _phy->transmitDirect();
     19     RADIOLIB_ASSERT(state);
     20   }
     21 
     22   Module* mod = _phy->getMod();
     23   mod->tone(_pin, freq);
     24   return(RADIOLIB_ERR_NONE);
     25 }
     26 
     27 int16_t AFSKClient::noTone(bool keepOn) {
     28   Module* mod = _phy->getMod();
     29   mod->noTone(_pin);
     30   if(keepOn) {
     31     return(0);
     32   }
     33 
     34   return(_phy->standby());
     35 }
     36 
     37 #endif