ubitx-v5x/TeensyDSP/Nextion.h

124 lines
3.4 KiB
C
Raw Normal View History

2021-01-27 04:22:23 +00:00
#ifndef __Nextion_h__
#define __Nextion_h__
#define SWS_HEADER_CHAR_TYPE 'c' //1Byte Protocol Prefix
#define SWS_HEADER_INT_TYPE 'v' //Numeric Protocol Prefex
#define SWS_HEADER_STR_TYPE 's' //for TEXT Line compatiable Character LCD Control
//===================================================================
//Begin of Nextion LCD Protocol
//
// v0~v9, va~vz : Numeric (Transceiver -> Nextion LCD)
// s0~s9 : String (Text) (Transceiver -> Nextion LCD)
// vlSendxxx, vloxxx: Reserve for Nextion (Nextion LCD -> Transceiver)
//
//===================================================================
#define CMD_NOW_DISP '0' //c0
char L_nowdisp = -1; //Sended nowdisp
#define CMD_VFO_TYPE 'v' //cv
char L_vfoActive; //vfoActive
#define CMD_CURR_FREQ 'c' //vc
unsigned long L_vfoCurr; //vfoA
#define CMD_CURR_MODE 'c' //cc
byte L_vfoCurr_mode; //vfoA_mode
#define CMD_VFOA_FREQ 'a' //va
unsigned long L_vfoA; //vfoA
#define CMD_VFOA_MODE 'a' //ca
byte L_vfoA_mode; //vfoA_mode
#define CMD_VFOB_FREQ 'b' //vb
unsigned long L_vfoB; //vfoB
#define CMD_VFOB_MODE 'b' //cb
byte L_vfoB_mode; //vfoB_mode
#define CMD_IS_RIT 'r' //cr
char L_ritOn;
#define CMD_RIT_FREQ 'r' //vr
unsigned long L_ritTxFrequency; //ritTxFrequency
#define CMD_IS_TX 't' //ct
char L_inTx;
#define CMD_IS_DIALLOCK 'l' //cl
byte L_isDialLock; //byte isDialLock
#define CMD_IS_SPLIT 's' //cs
byte L_Split; //isTxType
#define CMD_IS_TXSTOP 'x' //cx
byte L_TXStop; //isTxType
#define CMD_TUNEINDEX 'n' //cn
byte L_tuneStepIndex; //byte tuneStepIndex
#define CMD_SMETER 'p' //cs
byte L_scaledSMeter; //scaledSMeter
#define CMD_SIDE_TONE 't' //vt
unsigned long L_sideTone; //sideTone
#define CMD_KEY_TYPE 'k' //ck
byte L_cwKeyType; //L_cwKeyType 0: straight, 1 : iambica, 2: iambicb
#define CMD_CW_SPEED 's' //vs
unsigned int L_cwSpeed; //cwSpeed
#define CMD_CW_DELAY 'y' //vy
byte L_cwDelayTime; //cwDelayTime
#define CMD_CW_STARTDELAY 'e' //ve
byte L_delayBeforeCWStartTime; //byte delayBeforeCWStartTime
#define CMD_ATT_LEVEL 'f' //vf
byte L_attLevel;
byte L_isIFShift; //1 = ifShift, 2 extend
#define CMD_IS_IFSHIFT 'i' //ci
int L_ifShiftValue;
#define CMD_IFSHIFT_VALUE 'i' //vi
byte L_sdrModeOn;
#define CMD_SDR_MODE 'j' //cj
#define CMD_UBITX_INFO 'm' //cm Complete Send uBITX Information
//Once Send Data, When boot
//arTuneStep, When boot, once send
//long arTuneStep[5];
#define CMD_AR_TUNE1 '1' //v1
#define CMD_AR_TUNE2 '2' //v2
#define CMD_AR_TUNE3 '3' //v3
#define CMD_AR_TUNE4 '4' //v4
#define CMD_AR_TUNE5 '5' //v5
//int idleStep = 0;
byte scaledSMeter = 0;
float calcVSWR = 0.0;
float L_calcVSWR = 0.0;
byte scaledVSWR = 0;
byte L_scaledVSWR = 0;
int fwdPower = 0;
int L_fwdPower = 0;
int revPower = 0;
int L_revPower = 0;
void sendHeader(char varType, char varIndex);
void sendCommandUL(char varIndex, unsigned long sendValue);
void sendCommandL(char varIndex, long sendValue);
void sendCommandStr(char varIndex, const char* sendValue);
void sendCommand1Num(char varIndex, char sendValue);
//=======================================================
//END OF Nextion Protocol
//=======================================================
#endif