Skip to content

Commit

Permalink
Ham: APRS Tx with SA868 'Open Edition' radio
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Feb 6, 2024
1 parent 83c25ee commit 7b9a857
Showing 1 changed file with 53 additions and 7 deletions.
60 changes: 53 additions & 7 deletions software/firmware/source/SoftRF/src/driver/RF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2517,20 +2517,23 @@ static void sa8x8_setup()
switch (controller.getModel())
{
case Model::SA_868_OpenEdition:
OE.setAudio(false);
OE.init();
// OE.setTxFrequency((uint32_t) (TxF_MHz * 1000000));
// OE.setRxFrequency((uint32_t) (RxF_MHz * 1000000));
OE.setTxFrequency((uint32_t) (TxF_MHz * 1000000));
OE.setRxFrequency((uint32_t) (RxF_MHz * 1000000));
// OE.setSqlThresh(sq);

if (settings->txpower == RF_TX_POWER_FULL) {
// OE.setHighPower();
OE.setHighPower();
} else {
// OE.setLowPower();
OE.setLowPower();
}

// OE.setBandwidth(1); /* 25 KHz */
// OE.setVolume(1);
OE.setVolume(1);
OE.setAudio(true);
break;

case Model::SA_818:
case Model::SA_868_NiceRF:
default:
Expand Down Expand Up @@ -2613,7 +2616,20 @@ static bool sa8x8_receive()
return success;
}

// controller.receive();
switch (controller.getModel())
{
case Model::SA_868_OpenEdition:
if (OE.settings().mode != OpenEdition_Mode::RX) {
// OE.RxOn();
}
break;

case Model::SA_818:
case Model::SA_868_NiceRF:
default:
// controller.receive();
break;
}

uint8_t powerPin = SOC_GPIO_PIN_TWR2_RADIO_HL;
AFSK_Poll(true, LOW, powerPin);
Expand All @@ -2630,7 +2646,22 @@ static bool sa8x8_receive()

static bool sa8x8_transmit()
{
if (controller.getTxStatus()) return false;
switch (controller.getModel())
{
case Model::SA_868_OpenEdition:
if (OE.settings().mode != OpenEdition_Mode::TX) {
OE.TxOn();
} else {
return false;
}
break;

case Model::SA_818:
case Model::SA_868_NiceRF:
default:
if (controller.getTxStatus()) return false;
break;
}

uint8_t powerPin = SOC_GPIO_PIN_TWR2_RADIO_HL;
AFSK_TimerEnable(false);
Expand All @@ -2642,6 +2673,20 @@ static bool sa8x8_transmit()
AFSK_Poll(true, settings->txpower == RF_TX_POWER_FULL ? HIGH : LOW, powerPin);
} while (AFSK_modem->sending);

switch (controller.getModel())
{
case Model::SA_868_OpenEdition:
if (OE.settings().mode == OpenEdition_Mode::TX) {
OE.TxOff();
}
break;

case Model::SA_818:
case Model::SA_868_NiceRF:
default:
break;
}

if ((settings->power_save & POWER_SAVE_NORECEIVE) == 0) {
AFSK_TimerEnable(true);
}
Expand All @@ -2656,6 +2701,7 @@ static void sa8x8_shutdown()
case Model::SA_868_OpenEdition:
/* TBD */
break;

case Model::SA_818:
case Model::SA_868_NiceRF:
default:
Expand Down

0 comments on commit 7b9a857

Please sign in to comment.