Skip to content

Commit

Permalink
DBPSK_434 added
Browse files Browse the repository at this point in the history
  • Loading branch information
dbatura committed Jun 5, 2019
1 parent e4a2d44 commit 65cb40c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 9 deletions.
28 changes: 21 additions & 7 deletions NBFiLib/axradio/config_united.c
Expand Up @@ -178,6 +178,10 @@ void ax5043_set_registers(void)
default:
break;
}
if(DBPSK_BAND == DBPSK_434)
{
ax5043_spi_write(AX5043_0xF34, 0x28);
}
}

void ax5043_set_registers_tx(void)
Expand All @@ -202,9 +206,9 @@ void ax5043_set_registers_tx(void)
case UL_PSK_500:
case DL_PSK_5000:
case UL_PSK_5000:
ax5043_spi_write(AX5043_PLLLOOP , 0x07);
ax5043_spi_write(AX5043_PLLCPI , 0x12);
ax5043_spi_write(AX5043_PLLVCODIV , 0x20);
ax5043_spi_write(AX5043_PLLLOOP , 0x07);
ax5043_spi_write(AX5043_PLLCPI , 0x12);
ax5043_spi_write(AX5043_PLLVCODIV , 0x20);
break;
case DL_PSK_FASTDL:
case UL_PSK_FASTDL:
Expand All @@ -230,17 +234,27 @@ void ax5043_set_registers_tx(void)
// case UL_DBPSK_400_PROT_C:
case UL_DBPSK_400_PROT_D:
// case UL_DBPSK_400_PROT_E:
ax5043_spi_write(AX5043_PLLLOOP , 0x07);
ax5043_spi_write(AX5043_PLLCPI , 0x12);
ax5043_spi_write(AX5043_PLLVCODIV , 0x20);
if(DBPSK_BAND == DBPSK_434)
{
ax5043_spi_write(AX5043_PLLLOOP , 0x0B);
ax5043_spi_write(AX5043_PLLCPI , 0x10);
ax5043_spi_write(AX5043_PLLVCODIV , 0x24);
}
else
{
ax5043_spi_write(AX5043_PLLLOOP , 0x07);
ax5043_spi_write(AX5043_PLLCPI , 0x12);
ax5043_spi_write(AX5043_PLLVCODIV , 0x20);
}
break;
case UL_DBPSK_3200_PROT_D:
// case UL_DBPSK_3200_PROT_E:
case UL_DBPSK_25600_PROT_D:
// case UL_DBPSK_25600_PROT_E:
ax5043_spi_write(AX5043_PLLLOOP , 0x09);
ax5043_spi_write(AX5043_PLLCPI , 0x02);
ax5043_spi_write(AX5043_PLLVCODIV , 0x20);
if(DBPSK_BAND == DBPSK_434) ax5043_spi_write(AX5043_PLLVCODIV , 0x24);
else ax5043_spi_write(AX5043_PLLVCODIV , 0x20);
break;
case UL_PSK_200:
case DL_PSK_200:
Expand Down
8 changes: 6 additions & 2 deletions NBFiLib/nbfi/rf.c
Expand Up @@ -14,6 +14,7 @@ nbfi_rf_state_s rf_state = STATE_OFF;
nbfi_phy_channel_t nbfi_phy_channel;

uint8_t PSK_BAND;
uint8_t DBPSK_BAND;

NBFi_ax5043_pins_s nbfi_ax5043_pins;

Expand Down Expand Up @@ -103,9 +104,12 @@ nbfi_status_t RF_Init( nbfi_phy_channel_t phy_channel,

if(phy_channel != OSC_CAL) nbfi_phy_channel = phy_channel;

if(freq > 600000000) PSK_BAND = 1;
else PSK_BAND = 0;
if(freq > 600000000) PSK_BAND = PSK_864;
else PSK_BAND = PSK_446_DBPSK_868;

if(freq < 440000000) DBPSK_BAND = DBPSK_434;
else DBPSK_BAND = PSK_446_DBPSK_868;

ax5043_hard_reset();


Expand Down
8 changes: 8 additions & 0 deletions NBFiLib/nbfi/rf.h
Expand Up @@ -38,9 +38,17 @@ typedef struct
uint16_t txpwr;
} NBFi_ax5043_pins_s;

typedef enum
{
PSK_446_DBPSK_868 = 0,
PSK_864 = 1,
DBPSK_434 = 2
}NBFi_radio_bands_t;

extern struct axradio_address fastdladdress;
extern _Bool send_auto_corr;
extern uint8_t PSK_BAND;
extern uint8_t DBPSK_BAND;
extern nbfi_rf_state_s rf_state;
extern nbfi_phy_channel_t nbfi_phy_channel;
extern _Bool rf_busy;
Expand Down

0 comments on commit 65cb40c

Please sign in to comment.