Updated to allow receiving (via serial) a mode command from the Raduino,

and then using that to set rigMode.  Note that it doesn't actually do
anything beyond that, at the moment, but I *think* this will allow PTT
events to be pressed in CW mode (as CW key down).
This commit is contained in:
Rob French 2020-05-03 23:29:31 -05:00
parent 211d9ff9b4
commit f35653987f
4 changed files with 49 additions and 1 deletions

View File

@ -76,6 +76,8 @@ void audioInit()
//audioCtrl.dacVolume(1.0, 0.0); // we're going to mute TX audio via the DAC unless we're transmitting //audioCtrl.dacVolume(1.0, 0.0); // we're going to mute TX audio via the DAC unless we're transmitting
audioSelectTxInput(TX_MIC_IN); // superfluous I think audioSelectTxInput(TX_MIC_IN); // superfluous I think
audioCWFilterNarrow(); // test
} }
inline void updateRxRigIn() inline void updateRxRigIn()
@ -538,6 +540,17 @@ void audioCalibrate(IOPConfig* c, char cmd, char subcmd, char parm, float value,
} }
} }
int updateFilter[5];
void audioCWFilterNarrow()
{
audioCtrl.audioPreProcessorEnable();
// calcBiquad(FilterType,FrequencyC,dBgain,Q,QuantizationUnit,SampleRate,int*);
calcBiquad(FILTER_BANDPASS, 700, 0, 2, 524288, 44100, updateFilter);
audioCtrl.eqFilter(0, updateFilter);
audioCtrl.eqFilter(1, updateFilter);
}
//====================================================================== //======================================================================
// EOF // EOF
//====================================================================== //======================================================================

16
cat.ino
View File

@ -10,6 +10,11 @@
#define EEPROM_READ_PREFIX 0xE0 #define EEPROM_READ_PREFIX 0xE0
#define EEPROM_WRITE_PREFIX 0xF0 #define EEPROM_WRITE_PREFIX 0xF0
#define IOP_MODE_COMMAND 0x00
#define IOP_MODE_SSB 0x01
#define IOP_MODE_DIGI 0x02
#define IOP_MODE_CW 0x03
//====================================================================== //======================================================================
// CAT from PC-to-IOP // CAT from PC-to-IOP
// //
@ -44,6 +49,17 @@ void initCAT(long baud, int portConfig)
void processIOPCommand(const byte* buf, int len) void processIOPCommand(const byte* buf, int len)
{ {
if (len > 0) {
switch(buf[0]) {
case IOP_MODE_COMMAND:
if (len < 2) {
return;
} else {
rigMode = RigMode(buf[1]);
}
break;
}
}
} }
//====================================================================== //======================================================================

View File

@ -8,7 +8,7 @@
// Uncomment to use the "factory" calibration mode. This is intended to // Uncomment to use the "factory" calibration mode. This is intended to
// allow calibration of IOP settings, separately from the uBITX/Raduino. // allow calibration of IOP settings, separately from the uBITX/Raduino.
// There will be no pass-thru of any CAT. // There will be no pass-thru of any CAT.
#define FACTORY_CALIBRATION //#define FACTORY_CALIBRATION
// IOPConfig // IOPConfig
// Used to store configuration parameters during runtime, as well as to // Used to store configuration parameters during runtime, as well as to

View File

@ -87,6 +87,25 @@ void setup() {
audioInit(); audioInit();
} }
//======================================================================
void setRigMode(RigMode m)
{
rigMode = m;
switch(rigMode) {
case MODE_SSB:
break;
case MODE_DIGI:
break;
case MODE_CW:
break;
}
}
//======================================================================
void loop() { void loop() {
elapsedMillis frame_timer = 0; elapsedMillis frame_timer = 0;