Implemented TX CTCSS tone for GDx devices

replace/bfc44482d0476a99f4a66793c92a273479142ae9
Silvano Seva 2021-02-03 14:03:30 +01:00
rodzic a1bd2fe22b
commit 3e2716f52c
3 zmienionych plików z 37 dodań i 7 usunięć

Wyświetl plik

@ -222,6 +222,20 @@ void AT1846S_setFuncMode(AT1846S_func_t mode)
_maskSetRegister(0x30, 0x0060, value); _maskSetRegister(0x30, 0x0060, value);
} }
void AT1846S_enableTxCtcss(tone_t freq)
{
i2c_writeReg16(0x4A, freq*10);
i2c_writeReg16(0x4B, 0x0000);
i2c_writeReg16(0x4C, 0x0000);
_maskSetRegister(0x4E, 0x0600, 0x0600);
}
void AT1846S_disableCtcss()
{
i2c_writeReg16(0x4A, 0x0000);
_maskSetRegister(0x4E, 0x0600, 0x0000); /* Disable TX CTCSS */
}
uint16_t AT1846S_readRSSI() uint16_t AT1846S_readRSSI()
{ {
return i2c_readReg16(0x1B); return i2c_readReg16(0x1B);

Wyświetl plik

@ -77,6 +77,16 @@ void AT1846S_setOpMode(AT1846S_op_t mode);
*/ */
void AT1846S_setFuncMode(AT1846S_func_t mode); void AT1846S_setFuncMode(AT1846S_func_t mode);
/**
*
*/
void AT1846S_enableTxCtcss(tone_t freq);
/**
*
*/
void AT1846S_disableCtcss();
/** /**
* *
*/ */

Wyświetl plik

@ -30,10 +30,12 @@
const gdxCalibration_t *calData; /* Pointer to calibration data */ const gdxCalibration_t *calData; /* Pointer to calibration data */
int8_t currRxBand = -1; /* Current band for RX */ int8_t currRxBand = -1; /* Current band for RX */
int8_t currTxBand = -1; /* Current band for TX */ int8_t currTxBand = -1; /* Current band for TX */
uint8_t txpwr_lo = 0; /* APC voltage for TX output power control, low power */ uint8_t txpwr_lo = 0; /* APC voltage for TX output power control, low power */
uint8_t txpwr_hi = 0; /* APC voltage for TX output power control, high power */ uint8_t txpwr_hi = 0; /* APC voltage for TX output power control, high power */
tone_t tx_tone = 0;
tone_t rx_tone = 0;
/** /**
* \internal * \internal
@ -145,8 +147,8 @@ void radio_setVcoFrequency(const freq_t frequency, const bool isTransmitting)
void radio_setCSS(const tone_t rxCss, const tone_t txCss) void radio_setCSS(const tone_t rxCss, const tone_t txCss)
{ {
(void) rxCss; rx_tone = rxCss;
(void) txCss; tx_tone = txCss;
} }
bool radio_checkRxDigitalSquelch() bool radio_checkRxDigitalSquelch()
@ -205,7 +207,10 @@ void radio_enableTx(const float txPower, const bool enableCss)
gpio_setPin(UHF_PA_EN); gpio_setPin(UHF_PA_EN);
} }
(void) enableCss; if(enableCss)
{
AT1846S_enableTxCtcss(tx_tone);
}
} }
void radio_disableRtx() void radio_disableRtx()
@ -214,6 +219,7 @@ void radio_disableRtx()
gpio_clearPin(UHF_LNA_EN); gpio_clearPin(UHF_LNA_EN);
gpio_clearPin(VHF_PA_EN); gpio_clearPin(VHF_PA_EN);
gpio_clearPin(UHF_PA_EN); gpio_clearPin(UHF_PA_EN);
AT1846S_disableCtcss();
AT1846S_setFuncMode(AT1846S_OFF); AT1846S_setFuncMode(AT1846S_OFF);
} }