Added ability to send a command to the IOP, specifically a mode change

command (to SSB, DIGI, or CW; although DIGI is currently not actually
possible).
This commit is contained in:
Rob French 2020-05-03 23:30:44 -05:00
parent 1aa9ce1bd6
commit 7ba147b06d
2 changed files with 28 additions and 0 deletions

View File

@ -54,6 +54,32 @@
#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
/*
* KC4UPR - IOP update, 2020-05-03
*
* Send the current mode to the I/O Processor.
*
* NOTE: This all needs to be expanded to include digital...
*
* NOTE: Not yet called from CAT, only from menu...
*/
void iopSendMode(char is_cw, char is_usb)
{
byte mode;
Serial.write(IOP_PREFIX | 2);
Serial.write(IOP_MODE_COMMAND);
if (is_cw)
mode = IOP_MODE_CW;
else
mode = IOP_MODE_SSB;
}
unsigned int skipTimeCount = 0; unsigned int skipTimeCount = 0;
byte CAT_BUFF[5]; byte CAT_BUFF[5];
byte CAT_SNDBUFF[5]; byte CAT_SNDBUFF[5];

View File

@ -960,6 +960,8 @@ void menuSelectMode(int btn){
else if (selectModeType == 3) { else if (selectModeType == 3) {
cwMode = 2; cwMode = 2;
} }
// KC4UPR: sending mode to IOP
iopSendMode(cwMode, isUSB);
FrequencyToVFO(1); FrequencyToVFO(1);
} }