2020-05-02 01:54:58 -04:00
|
|
|
//======================================================================
|
|
|
|
// ubitx_iop.h
|
|
|
|
//======================================================================
|
|
|
|
|
|
|
|
#ifndef __ubitx_iop_h__
|
|
|
|
#define __ubitx_iop_h__
|
|
|
|
|
2020-05-03 01:37:21 -04:00
|
|
|
#include "config.h"
|
2020-05-02 01:54:58 -04:00
|
|
|
#include "audio.h"
|
|
|
|
#include "cat.h"
|
|
|
|
#include "eeprom.h"
|
2020-05-14 21:49:54 -04:00
|
|
|
#include "keyer.h"
|
2020-05-01 12:04:26 -04:00
|
|
|
|
2020-05-26 00:08:55 -04:00
|
|
|
#define PTT_KEY_OUT_PIN 2
|
2020-06-06 01:06:45 -04:00
|
|
|
#define ENCODER_A_PIN 5
|
|
|
|
#define ENCODER_B_PIN 4
|
|
|
|
#define ENCODER_SW_PIN 3
|
2020-05-26 00:08:55 -04:00
|
|
|
|
2020-05-01 12:04:26 -04:00
|
|
|
// comment this out to disable debugging code
|
2020-06-06 01:06:45 -04:00
|
|
|
#define DEBUG
|
2020-05-01 12:04:26 -04:00
|
|
|
|
2020-05-17 00:48:39 -04:00
|
|
|
#if defined(DEBUG)
|
|
|
|
#define USBDEBUG(x) USBSERIAL.print("IOP: "); USBSERIAL.println(x);
|
|
|
|
#else
|
|
|
|
#define USBDEBUG(x)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//enum RigMode {
|
|
|
|
// MODE_SSB = 0,
|
|
|
|
// MODE_DIGI = 1,
|
|
|
|
// MODE_CW = 2,
|
|
|
|
//};
|
2020-05-02 01:54:58 -04:00
|
|
|
|
2020-05-08 01:19:07 -04:00
|
|
|
enum TxState {
|
|
|
|
TX_OFF = 0,
|
|
|
|
TX_MIC,
|
|
|
|
TX_LINE,
|
|
|
|
TX_CAT,
|
|
|
|
TX_KEYER,
|
|
|
|
};
|
|
|
|
|
2020-05-26 00:08:55 -04:00
|
|
|
//extern RigMode rigMode;
|
2020-05-01 12:04:26 -04:00
|
|
|
|
2020-05-14 21:49:54 -04:00
|
|
|
extern bool keyerKeyDown;
|
|
|
|
|
2020-05-26 00:08:55 -04:00
|
|
|
//======================================================================
|
|
|
|
// Keying functions.
|
|
|
|
//
|
|
|
|
// These are simple functions to assert the key line from the IOP to the
|
|
|
|
// Raduino.
|
|
|
|
//======================================================================
|
|
|
|
|
|
|
|
inline void initKeyLine()
|
|
|
|
{
|
|
|
|
pinMode(PTT_KEY_OUT_PIN, OUTPUT);
|
|
|
|
digitalWrite(PTT_KEY_OUT_PIN, HIGH);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void setKeyDown()
|
|
|
|
{
|
|
|
|
digitalWrite(PTT_KEY_OUT_PIN, LOW);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void setKeyUp()
|
|
|
|
{
|
|
|
|
digitalWrite(PTT_KEY_OUT_PIN, HIGH);
|
|
|
|
}
|
|
|
|
|
|
|
|
//======================================================================
|
|
|
|
|
2020-05-01 12:04:26 -04:00
|
|
|
#endif
|
2020-05-02 01:54:58 -04:00
|
|
|
|
|
|
|
//======================================================================
|
|
|
|
// EOF
|
|
|
|
//======================================================================
|