feat: 32kHz to track satellite doppler, set BK bandwidth by api

pull/70/head
Mikhail Yudin 2023-08-13 13:36:18 +07:00
rodzic a8bb4df507
commit b56c2eb68a
3 zmienionych plików z 12 dodań i 7 usunięć

Wyświetl plik

@ -43,6 +43,9 @@ BK4819Reset = 0xa7cc + 1;
.globl IntDivide
IntDivide = 0x128 + 1;
.globl BK4819SetChannelBandwidth
BK4819SetChannelBandwidth = 0xaa48 + 1;
.globl BK4819WriteFrequency
BK4819WriteFrequency = 0xaabc + 1;

Wyświetl plik

@ -23,6 +23,7 @@ extern "C" {
void AirCopyFskSetup();
void BK4819Reset();
int IntDivide(int s32Divident, int s32Divisor);
void BK4819SetChannelBandwidth(bool narrow);
void BK4819WriteFrequency(unsigned int u32Frequency);
void BK4819SetPaGain(unsigned short u16PaBias, unsigned int u32Frequency);
void BK4819ConfigureAndStartTxFsk();

Wyświetl plik

@ -10,11 +10,11 @@ public:
static constexpr auto DrawingEndY = 42;
static constexpr auto BarPos = 5 * 128;
static constexpr u32 modeHalfSpectrumBW[6] = {50_KHz, 100_KHz, 200_KHz,
static constexpr u32 modeHalfSpectrumBW[6] = {16_KHz, 100_KHz, 200_KHz,
400_KHz, 800_KHz, 1600_KHz};
static constexpr u16 modeScanStep[6] = {1562_Hz, 6250_Hz, 12500_Hz,
25_KHz, 25_KHz, 25_KHz};
static constexpr u8 modeXdiv[6] = {1, 2, 2, 2, 1, 0};
static constexpr u16 modeScanStep[6] = {1_KHz, 6250_Hz, 12500_Hz,
25_KHz, 25_KHz, 25_KHz};
static constexpr u8 modeXdiv[6] = {2, 2, 2, 2, 1, 0};
u8 rssiHistory[128] = {};
u32 fMeasure;
@ -289,11 +289,12 @@ private:
void ResetPeak() { peakRssi = 0; }
void SetBW() {
auto Reg = BK4819Read(0x43);
/* auto Reg = BK4819Read(0x43);
Reg &= ~(0b11 << 4);
if (mode >= 3)
Reg |= 0b11 << 4;
BK4819Write(0x43, Reg);
Reg |= 0b10 << 4;
BK4819Write(0x43, Reg); */
BK4819SetChannelBandwidth(mode < 3);
}
void MuteAF() { BK4819Write(0x47, 0); }
void RestoreOldAFSettings() { BK4819Write(0x47, oldAFSettings); }