2020-05-03 02:00:20 -04:00
|
|
|
//======================================================================
|
|
|
|
// config.h
|
2020-05-26 00:08:55 -04:00
|
|
|
//
|
|
|
|
// NOTE: Let's change the name of this file to RigConfig.h.
|
2020-05-03 02:00:20 -04:00
|
|
|
//======================================================================
|
|
|
|
|
|
|
|
#ifndef __iop_config_h__
|
|
|
|
#define __iop_config_h__
|
|
|
|
|
2020-05-17 00:48:39 -04:00
|
|
|
#include <iopcomm.h>
|
2020-05-26 00:08:55 -04:00
|
|
|
//#include "rig.h"
|
2020-05-17 00:48:39 -04:00
|
|
|
|
2020-05-14 21:49:54 -04:00
|
|
|
#define KEYER_LEFT_PADDLE_PIN 16
|
|
|
|
#define KEYER_RIGHT_PADDLE_PIN 17
|
|
|
|
|
2020-05-03 02:00:20 -04:00
|
|
|
// Uncomment to use the "factory" calibration mode. This is intended to
|
|
|
|
// allow calibration of IOP settings, separately from the uBITX/Raduino.
|
|
|
|
// There will be no pass-thru of any CAT.
|
2020-05-18 09:16:54 -04:00
|
|
|
//#define FACTORY_CALIBRATION
|
2020-05-03 02:00:20 -04:00
|
|
|
|
2020-05-26 00:08:55 -04:00
|
|
|
//======================================================================
|
|
|
|
// AudioConfig
|
|
|
|
//======================================================================
|
|
|
|
|
|
|
|
class AudioConfig {
|
|
|
|
public:
|
2020-05-03 02:00:20 -04:00
|
|
|
|
2020-05-26 00:08:55 -04:00
|
|
|
//--------------------------------------------------------------------
|
2020-05-03 02:00:20 -04:00
|
|
|
// RECEIVE PARAMETERS
|
2020-05-26 00:08:55 -04:00
|
|
|
//--------------------------------------------------------------------
|
2020-05-03 02:00:20 -04:00
|
|
|
|
|
|
|
// rig-in parameters (RX)
|
|
|
|
uint8_t rxRigInLevel = 5;
|
2020-05-17 00:48:39 -04:00
|
|
|
float rxRigInVol = 1.0; //0.7;
|
2020-05-03 02:00:20 -04:00
|
|
|
float rxRigInCal = 1.0;
|
|
|
|
// USB-in parameters (RX) - debug/monitor use only
|
|
|
|
bool rxUSBInEnable = false;
|
|
|
|
float rxUSBInVol = 1.0;
|
|
|
|
float rxUSBInCal = 1.0;
|
|
|
|
// speaker-out (DAC) parameters (RX)
|
|
|
|
float rxSpkrOutCal = 1.0;
|
|
|
|
// line-out parameters (RX)
|
|
|
|
uint8_t rxLineOutLevel = 29;
|
|
|
|
float rxLineOutCal = 1.0;
|
|
|
|
// USB-out parameters (RX)
|
|
|
|
float rxUSBOutCal = 1.0;
|
|
|
|
|
2020-05-26 00:08:55 -04:00
|
|
|
//--------------------------------------------------------------------
|
2020-05-03 02:00:20 -04:00
|
|
|
// TRANSMIT PARAMETERS
|
2020-05-26 00:08:55 -04:00
|
|
|
//--------------------------------------------------------------------
|
2020-05-03 02:00:20 -04:00
|
|
|
|
2020-05-26 00:08:55 -04:00
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// NOTE: Default rig-out parameters are based on trying to hit a
|
|
|
|
// 25mVrms output to the rig. This is based on some discussion at the
|
|
|
|
// following URL:
|
2020-05-03 02:00:20 -04:00
|
|
|
//
|
|
|
|
// https://groups.io/g/BITX20/message/58951
|
|
|
|
//
|
2020-05-26 00:08:55 -04:00
|
|
|
// This may or may not be totally applicable. I believe it was for
|
|
|
|
// IMD/spurs on a pre-V5 version of the uBITX. So it may be OBE for
|
|
|
|
// my V5. It also alludes to modifications to the transmit audio
|
|
|
|
// chain, which may be something I need to look into (i.e. increasing
|
2020-05-03 02:00:20 -04:00
|
|
|
// the gain on the initial mic pre-amp).
|
|
|
|
//
|
|
|
|
// Specifically, for the rig-out parameters:
|
|
|
|
// line out level 31 = 1.16 V p-p
|
|
|
|
// = 0.58 V peak
|
|
|
|
// = 0.41 V rms = 410 mV rms
|
2020-05-26 00:08:55 -04:00
|
|
|
// so output calibration needs to reduce that to 17.5 mV rms (70%
|
|
|
|
// of 25 mV rms)
|
2020-05-03 02:00:20 -04:00
|
|
|
// txMicInCal = 0.043 ... seems pretty low...
|
|
|
|
//
|
2020-05-26 00:08:55 -04:00
|
|
|
// Likewise, default line-in (TX) parameters assume consumer line
|
|
|
|
// level input, but with the default audio adaptor line-in level
|
|
|
|
// setting (5 = 1.33V p-p).
|
2020-05-03 02:00:20 -04:00
|
|
|
// line in level 5 = 1.33 V p-p
|
|
|
|
// signal in = 0.894 V p-p
|
|
|
|
// = 0.447 V peak
|
|
|
|
// = 0.316 V rms = 316 mV rms
|
2020-05-26 00:08:55 -04:00
|
|
|
// so input calibration needs to convert that to the 410 mV noted
|
|
|
|
// above (equivalent for the microphone), so that when that signal
|
|
|
|
// gets to the rig-out, it gets treated the same as the mic input.
|
2020-05-03 02:00:20 -04:00
|
|
|
// txLineInCal = 1.30
|
2020-05-26 00:08:55 -04:00
|
|
|
//--------------------------------------------------------------------
|
2020-05-03 02:00:20 -04:00
|
|
|
|
|
|
|
// microphone-in parameters (TX)
|
|
|
|
uint8_t txMicInGain = 12;
|
2020-05-17 00:48:39 -04:00
|
|
|
float txMicInVol = 1.0; //0.7;
|
2020-05-03 02:00:20 -04:00
|
|
|
float txMicInCal = 1.0;
|
|
|
|
// line-in parameters (TX)
|
|
|
|
uint8_t txLineInLevel = 5;
|
2020-05-17 00:48:39 -04:00
|
|
|
float txLineInVol = 1.0; //0.7;
|
2020-05-03 02:00:20 -04:00
|
|
|
float txLineInCal = 1.30;
|
|
|
|
// USB-in parameters (TX)
|
2020-05-17 00:48:39 -04:00
|
|
|
float txUSBInVol = 1.0; //0.7;
|
2020-05-03 02:00:20 -04:00
|
|
|
float txUSBInCal = 1.0;
|
2020-05-17 00:48:39 -04:00
|
|
|
// two-tone parameters (TX)
|
|
|
|
float txSine1Vol = 1.0;
|
|
|
|
float txSine2Vol = 1.0;
|
2020-05-03 02:00:20 -04:00
|
|
|
// rig-out parameters (TX) - default settings are based on hitting 70% of 25mVrms w/ mic
|
2020-05-03 02:27:54 -04:00
|
|
|
uint8_t txRigOutLevel = 31;
|
2020-05-18 09:16:54 -04:00
|
|
|
float txRigOutCal = 0.1; // 0.061;
|
2020-05-03 02:00:20 -04:00
|
|
|
// USB-out parameters (TX)- debug/monitor use only
|
|
|
|
bool txUSBOutEnable = true;
|
|
|
|
float txUSBOutCal = 1.0;
|
2020-05-26 00:08:55 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
//======================================================================
|
|
|
|
// RigConfig
|
|
|
|
// Used to store configuration parameters during runtime, as well as to
|
|
|
|
// save them to EEPROM.
|
|
|
|
//======================================================================
|
2020-05-17 00:48:39 -04:00
|
|
|
|
2020-05-26 00:08:55 -04:00
|
|
|
class RigConfig {
|
|
|
|
public:
|
|
|
|
// audio configuration
|
|
|
|
AudioConfig audio;
|
|
|
|
|
2020-05-18 09:16:54 -04:00
|
|
|
// SSB configuration
|
2020-05-26 00:08:55 -04:00
|
|
|
SSBConfig lsb{RX_FILTER_WIDE};
|
|
|
|
SSBConfig usb{RX_FILTER_WIDE};
|
2020-05-18 09:16:54 -04:00
|
|
|
|
2020-05-26 00:08:55 -04:00
|
|
|
// DGT configuration
|
|
|
|
DGTConfig dgl{RX_FILTER_WIDE};
|
|
|
|
DGTConfig dgu{RX_FILTER_WIDE};
|
2020-05-18 09:16:54 -04:00
|
|
|
|
2020-05-17 00:48:39 -04:00
|
|
|
// CW configuration
|
2020-05-26 00:08:55 -04:00
|
|
|
CWConfig cwl{
|
|
|
|
KEYER_MODE_IAMBIC_A,
|
|
|
|
false,
|
|
|
|
15,
|
|
|
|
3.0,
|
|
|
|
700,
|
|
|
|
RX_FILTER_WIDE,
|
|
|
|
};
|
|
|
|
CWConfig cwu{
|
|
|
|
KEYER_MODE_IAMBIC_A,
|
|
|
|
false,
|
|
|
|
15,
|
|
|
|
3.0,
|
|
|
|
700,
|
|
|
|
RX_FILTER_WIDE,
|
|
|
|
};
|
|
|
|
|
|
|
|
// TT configuration
|
|
|
|
TTConfig ttl{RX_FILTER_WIDE};
|
|
|
|
TTConfig ttu{RX_FILTER_WIDE};
|
|
|
|
|
|
|
|
// General rig configuration entries.
|
|
|
|
RigMode mode = RIG_MODE_LSB;
|
2020-05-03 02:00:20 -04:00
|
|
|
};
|
|
|
|
|
2020-05-26 00:08:55 -04:00
|
|
|
extern RigConfig rigConfig;
|
2020-05-03 02:00:20 -04:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//======================================================================
|
|
|
|
// EOF
|
|
|
|
//======================================================================
|