WFLY RF: WIP protocol

This commit is contained in:
Pascal Langer
2020-12-10 16:51:55 +01:00
parent 956e632392
commit 2b0f663482
6 changed files with 215 additions and 108 deletions

View File

@@ -107,7 +107,7 @@ void A7105_WriteID(uint32_t ida)
{
A7105_CSN_off;
SPI_Write(A7105_06_ID_DATA); //ex id=0x5475c52a ;txid3txid2txid1txid0
SPI_Write((ida>>24)&0xff); //53
SPI_Write((ida>>24)&0xff); //54
SPI_Write((ida>>16)&0xff); //75
SPI_Write((ida>>8)&0xff); //c5
SPI_Write((ida>>0)&0xff); //2a
@@ -207,6 +207,11 @@ void A7105_AdjustLOBaseFreq(uint8_t cmd)
offset=(int16_t)FORCE_KYOSHO_TUNING;
#endif
break;
case PROTO_WFLYRF:
#ifdef FORCE_WFLYRF_TUNING
offset=(int16_t)FORCE_WFLYRF_TUNING;
#endif
break;
case PROTO_AFHDS2A:
case PROTO_AFHDS2A_RX:
#ifdef FORCE_AFHDS2A_TUNING
@@ -325,11 +330,11 @@ const uint8_t PROGMEM KYOSHO_HYPE_A7105_regs[] = {
0x01, 0x0f // 30 - 31
};
#endif
#ifdef WFLYRF_A7105_INO
#ifdef WFLYRF_A7105_INO //A7106 values
const uint8_t PROGMEM WFLYRF_A7105_regs[] = {
0xff, 0x42, 0xff, 0x25, 0x00, 0xff, 0xff ,0x00, 0x00, 0x00, 0x00, 0x01, 0x21, 0x05, 0x00, 0x50, // 00 - 0f
0x9e, 0x4b, 0x00, 0x02, 0x16, 0x2b, 0x12, 0x40, 0x62, 0x80, 0x80, 0x00, 0x0a, 0x32, 0x03, 0x1f, // 10 - 1f
0x1e, 0x00, 0x00, 0xff, 0x00, 0x00, 0x23, 0x70, 0x1F, 0x47, 0x80, 0x57, 0x01, 0x45, 0x19, 0x00, // 20 - 2f
0xff, 0x62, 0xff, 0x1F, 0x40, 0xff, 0xff ,0x00, 0x00, 0x00, 0x00, 0x33, 0x33, 0x05, 0x00, 0x64, // 00 - 0f Change: 0B&0C=0x33
0x9e, 0x4b, 0x00, 0x02, 0x16, 0x2b, 0x12, 0x40, 0x62, 0x80, 0x80, 0x00, 0x0a, 0x32, 0x03, 0x0f, // 10 - 1f 1C=0x0A
0x12, 0x00, 0x00, 0xff, 0x00, 0x00, 0x23, 0x70, 0x15, 0x47, 0x80, 0x03, 0x01, 0x45, 0x18, 0x00, // 20 - 2f 2B=03, 2E=0x18
0x01, 0x0f // 30 - 31
};
#endif
@@ -341,6 +346,13 @@ void A7105_Init(void)
uint8_t *A7105_Regs=0;
uint8_t vco_calibration0, vco_calibration1;
#ifdef WFLYRF_A7105_INO
if(protocol==PROTO_WFLYRF)
{
A7105_Regs=(uint8_t*)WFLYRF_A7105_regs;
}
else
#endif
#ifdef HEIGHT_A7105_INO
if(protocol==PROTO_HEIGHT)
{
@@ -389,10 +401,6 @@ void A7105_Init(void)
A7105_Regs=(uint8_t*)KYOSHO_HYPE_A7105_regs;
}
#endif
#ifdef WFLYRF_A7105_INO
if(protocol==PROTO_WFLYRF)
A7105_Regs=(uint8_t*)WFLYRF_A7105_regs;
#endif
}
for (uint8_t i = 0; i < 0x32; i++)
@@ -410,7 +418,7 @@ void A7105_Init(void)
if(protocol==PROTO_HEIGHT && sub_protocol==HEIGHT_8CH)
if(i==0x03) val=0x0A;
#endif
if( val != 0xFF)
if( val != 0xff)
A7105_WriteReg(i, val);
}
A7105_Strobe(A7105_STANDBY);
@@ -454,7 +462,7 @@ void A7105_Init(void)
while(A7105_ReadReg(A7105_02_CALC)); // Wait for calibration to end
vco_calibration1 = A7105_ReadReg(A7105_25_VCO_SBCAL_I);
if(protocol==PROTO_BUGS)
if(protocol==PROTO_BUGS || protocol==PROTO_WFLYRF)
A7105_SetVCOBand(vco_calibration0 & 0x07, vco_calibration1 & 0x07); // Set calibration band value to best match
else
if(protocol!=PROTO_HUBSAN)