From 4367db53d0ac6951c83e438b2965921aa5c1a28d Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Tue, 31 May 2022 18:19:57 +0200 Subject: [PATCH] Added configuration of AT1846S registers for digital modes in MD-UV3x0 driver. In M17 mode handler forced signal phase inversion at demodulator side also for MD-UV3x0 devices --- openrtx/src/rtx/OpMode_M17.cpp | 4 ++-- platform/drivers/baseband/AT1846S_UV3x0.cpp | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/openrtx/src/rtx/OpMode_M17.cpp b/openrtx/src/rtx/OpMode_M17.cpp index da06ce7c..353e1332 100644 --- a/openrtx/src/rtx/OpMode_M17.cpp +++ b/openrtx/src/rtx/OpMode_M17.cpp @@ -66,8 +66,8 @@ void OpMode_M17::update(rtxStatus_t *const status, const bool newCfg) { (void) newCfg; - // Force inversion of RX phase for MD3x0 VHF radios - #ifdef PLATFORM_MD3x0 + // Force inversion of RX phase for MD-3x0 VHF and MD-UV3x0 radios + #if defined(PLATFORM_MD3x0) || defined(PLATFORM_MDUV3x0) const hwInfo_t* hwinfo = platform_getHwInfo(); status->invertRxPhase |= hwinfo->vhf_band; #endif diff --git a/platform/drivers/baseband/AT1846S_UV3x0.cpp b/platform/drivers/baseband/AT1846S_UV3x0.cpp index 6903a9fe..034631c2 100644 --- a/platform/drivers/baseband/AT1846S_UV3x0.cpp +++ b/platform/drivers/baseband/AT1846S_UV3x0.cpp @@ -159,8 +159,18 @@ void AT1846S::setOpMode(const AT1846S_OpMode mode) { if(mode == AT1846S_OpMode::DMR) { - // TODO: DMR mode - + // + // TODO: values copy-pasted from GD77 driver, they seems to work well + // at least with M17 + // + i2c_writeReg16(0x3A, 0x00C2); + i2c_writeReg16(0x33, 0x45F5); + i2c_writeReg16(0x41, 0x4731); + i2c_writeReg16(0x42, 0x1036); + i2c_writeReg16(0x43, 0x00BB); + i2c_writeReg16(0x58, 0xBCFD); + i2c_writeReg16(0x44, 0x06CC); + i2c_writeReg16(0x40, 0x0031); } else {