ubitx-v5x/TeensyDSP/Rig.h

70 lines
2.5 KiB
C
Raw Normal View History

2021-02-07 23:12:08 +00:00
#ifndef __Rig_h__
#define __Rig_h__
#include "RigState.h"
class UBitxRig {
public:
inline void begin() {}
inline void update() {}
inline unsigned getFreqA() const { return radState.getFreqA(); }
inline unsigned getFreqB() const { return radState.getFreqB(); }
inline int getRIT() const { return radState.getRIT(); }
inline int getXIT() const { return radState.getXIT(); }
inline bool isVFOA() const { return radState.isVFOA(); }
inline bool isVFOB() const { return radState.isVFOB(); }
inline bool isSplit() const { return radState.isSplit(); }
inline bool isRITOn() const { return radState.isRITOn(); }
inline bool isXITOn() const { return radState.isXITOn(); }
inline bool isModeCW() const { return radState.isCW() && radState.isUSB(); }
inline bool isModeCWR() const { return radState.isCW() && radState.isLSB(); }
inline bool isModeUSB() const { return radState.isUSB() && !radState.isCW(); }
inline bool isModeLSB() const { return radState.isLSB() && !radState.isCW(); }
inline bool isAI() const { return autoInfo; }
inline void setFreqA(unsigned freq) { catState.setFreqA(freq); }
inline void setFreqB(unsigned freq) { catState.setFreqB(freq); }
inline void setRIT(int freq) { catState.setRIT(freq); }
inline void setXIT(int freq) { catState.setXIT(freq); }
inline void selectVFOA() { catState.selectVFOA(); }
inline void selectVFOB() { catState.selectVFOA(); }
inline void toggleVFO() { catState.toggleVFO(); }
inline void setSplitOn() { catState.setSplitOn(); }
inline void setSplitOff() { catState.setSplitOff(); }
inline void setRITOn() { catState.setRITOn(); }
inline void setRITOff() { catState.setRITOff(); }
inline void setXITOn() { catState.setXITOn(); }
inline void setXITOff() { catState.setXITOff(); }
inline void setModeCW() { catState.setUSB(); catState.setCW(); }
inline void setModeCWR() { catState.setLSB(); catState.setCW(); }
inline void setModeUSB() { catState.setUSB(); catState.setCW(); }
inline void setModeLSB() { catState.setLSB(); catState.setCW(); }
2021-02-07 23:12:08 +00:00
inline void aiOn() { autoInfo = true; }
inline void aiOff() { autoInfo = false; }
inline UBitxRigState& cat() { return catState; }
inline UBitxRigState& rad() { return radState; }
/********************************************************************/
// New functional/mode-based Rig methods
// AG
//void setVolOut(uint8_t level);
//uint8_t getVolOut();
// BD/BU
//void setBand();
//void getBand();
2021-02-07 23:12:08 +00:00
private:
UBitxRigState catState;
UBitxRigState radState;
bool autoInfo = false;
2021-02-07 23:12:08 +00:00
};
extern UBitxRig Rig;
#endif