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

FSK4.h (1789B)

      1 #if !defined(_RADIOLIB_FSK4_H)
      2 #define _RADIOLIB_FSK4_H
      3 
      4 #include "../../TypeDef.h"
      5 
      6 #if !defined(RADIOLIB_EXCLUDE_FSK4)
      7 
      8 #include "../PhysicalLayer/PhysicalLayer.h"
      9 #include "../AFSK/AFSK.h"
     10 
     11 /*!
     12   \class FSK4Client
     13 
     14   \brief Client for FSK-4 communication. The public interface is the same as Arduino Serial.
     15 */
     16 class FSK4Client {
     17   public:
     18     /*!
     19       \brief Constructor for FSK-4 mode.
     20 
     21       \param phy Pointer to the wireless module providing PhysicalLayer communication.
     22     */
     23     explicit FSK4Client(PhysicalLayer* phy);
     24 
     25     #if !defined(RADIOLIB_EXCLUDE_AFSK)
     26     /*!
     27       \brief Constructor for AFSK mode.
     28 
     29       \param audio Pointer to the AFSK instance providing audio.
     30     */
     31     explicit FSK4Client(AFSKClient* audio);
     32     #endif
     33 
     34     // basic methods
     35 
     36     /*!
     37       \brief Initialization method.
     38 
     39       \param base Base (space) frequency to be used in MHz (in FSK-4 mode), or the space tone frequency in Hz (in AFSK mode)
     40 
     41       \param shift Frequency shift between each tone in Hz.
     42 
     43       \param rate Baud rate to be used during transmission.
     44 
     45 
     46       \returns \ref status_codes
     47     */
     48     int16_t begin(float base, uint32_t shift, uint16_t rate);
     49 
     50     /*!
     51       \brief Send out idle condition (RF tone at mark frequency).
     52     */
     53     void idle();
     54 
     55     size_t write(uint8_t* buff, size_t len);
     56     size_t write(uint8_t b);
     57 
     58 
     59 #if !defined(RADIOLIB_GODMODE)
     60   private:
     61 #endif
     62     PhysicalLayer* _phy;
     63     #if !defined(RADIOLIB_EXCLUDE_AFSK)
     64     AFSKClient* _audio;
     65     #endif
     66 
     67     uint32_t _base = 0, _baseHz = 0;
     68     uint32_t _shift = 0, _shiftHz = 0;
     69     uint32_t _bitDuration = 0;
     70     uint32_t _tones[4];
     71     uint32_t _tonesHz[4];
     72 
     73     void tone(uint8_t i);
     74 
     75     int16_t transmitDirect(uint32_t freq = 0, uint32_t freqHz = 0);
     76     int16_t standby();
     77 };
     78 
     79 #endif
     80 
     81 #endif