update: upgrade CX926A C++ API to v1.10 and RISC-V firmware to v1.8

- Updated C++ library wrapper to support latest library features in v1.10
- Synchronized with RISC-V firmware update to v1.8 for compatibility
This commit is contained in:
Gatsby
2024-11-01 11:11:37 +08:00
parent d4159ec998
commit 12457af536
5 changed files with 61 additions and 14 deletions
+9 -12
View File
@@ -1,8 +1,4 @@
// ReSharper disable CppCompileTimeConstantCanBeReplacedWithBooleanConstant
// ReSharper disable CppUseRangeAlgorithm
// ReSharper disable CppUseStructuredBinding
// ReSharper disable CppTooWideScopeInitStatement
#include "cx9261adriver.h"
#include "cx9261adriver.h"
#include "utils.h"
#ifdef __cplusplus
@@ -1061,15 +1057,15 @@ void rxCalib(const CX9261AConfiguration& config, const RxChannel chan)
{
LOGGING(toString(chan) + "校准");
if (config.calib.rxMethod == CalibMethod::TST) {
if (chan == RxChannel::Rx1 && config.pllSource.rx1Source == LoSource::Off) {
if (chan == RxChannel::Rx1 && config.pllSource.rx1Source == LoSource::Off && !config.pllSource.rxUseExt) {
LOGGING(toString(chan) + " OFF")
return;
}
if (chan == RxChannel::Rx2 && config.pllSource.rx2Source == LoSource::Off) {
if (chan == RxChannel::Rx2 && config.pllSource.rx2Source == LoSource::Off && !config.pllSource.rxUseExt) {
LOGGING(toString(chan) + " OFF")
return;
}
if (chan == RxChannel::Rx3 && config.pllSource.rx3Source == LoSource::Off) {
if (chan == RxChannel::Rx3 && config.pllSource.rx3Source == LoSource::Off && !config.pllSource.rxUseExt) {
LOGGING(toString(chan) + " OFF")
return;
}
@@ -1443,7 +1439,7 @@ void configQecCalib(const CX9261AConfiguration& config)
configCalibMethod(config.calib);
// Rx校准只在有任意Rx通道不是Off时发生
const bool calibRx = config.pllSource.rx1Source != LoSource::Off || config.pllSource.rx2Source != LoSource::Off
|| config.pllSource.rx3Source != LoSource::Off;
|| config.pllSource.rx3Source != LoSource::Off || config.pllSource.rxUseExt;
if (calibRx) {
rxCalib(config, RxChannel::Rx1);
rxCalib(config, RxChannel::Rx2);
@@ -1504,7 +1500,8 @@ void configQecCalib(const CX9261AConfiguration& config)
}
}
// Tx校准只在任意Tx通道不是Off时发生
const bool calibTx = config.pllSource.tx1Source != LoSource::Off || config.pllSource.tx2Source != LoSource::Off;
const bool calibTx = config.pllSource.tx1Source != LoSource::Off || config.pllSource.tx2Source != LoSource::Off
|| config.pllSource.txUseExt;
if (calibTx) {
txCalib(config);
restoreQecState(regsState);
@@ -1656,7 +1653,7 @@ void configInterface(const Interface& interface)
if (interface.workMode == WorkMode::FDD)
writeSpi(0x201, 0x00);
else if (interface.portMode == PortMode::Single && interface.trMode == TrMode::R2T2)
writeSpi(0x201, 0x3F);
writeSpi(0x201, 0x3D);
else
writeSpi(0x201, 0x15);
// 0x202
@@ -2081,7 +2078,7 @@ void configFPGA(const Interface& interface)
setPin(40, 1);
setPin(32, 1);
setPin(7, interface.ioMode == IOMode::CMOS ? 0 : 1);
setPin(7, interface.ioMode == IOMode::LVDS_E ? 0 : 1);
setPin(34, 1);
setPin(34, 0);