Skip to content
Permalink
Browse files

Add modulation type to flags

Supports 2GFSK, 2FSK, and CW
  • Loading branch information...
iracigt committed Jan 30, 2019
1 parent 05c4766 commit f48af999be239465e0347e20a834f4d3d0bb8e01
Showing with 39 additions and 3 deletions.
  1. +17 −1 cmd_handler.c
  2. +14 −0 lfr.c
  3. +1 −1 settings.c
  4. +7 −1 settings.h
@@ -110,7 +110,23 @@ void cmd_abort_tx()
void cmd_tx_psr()
{
int err;
err = si446x_set_mod_type(&dev, MOD_SRC_RAND | MOD_TYPE_2GFSK);

if ((settings.flags & FLAG_MOD_MASK) == FLAG_MOD_CW) {
err = si446x_set_mod_type(&dev, MOD_SRC_RAND | MOD_TYPE_CW);
} else if ((settings.flags & FLAG_MOD_MASK) == FLAG_MOD_FSK) {
err = si446x_set_mod_type(&dev, MOD_SRC_RAND | MOD_TYPE_2FSK);
} else if ((settings.flags & FLAG_MOD_MASK) == FLAG_MOD_GFSK) {
err = si446x_set_mod_type(&dev, MOD_SRC_RAND | MOD_TYPE_2GFSK);
} else {
err = si446x_set_mod_type(&dev, MOD_SRC_RAND | MOD_TYPE_2GFSK);
}

if (err) {
reply_error(sys_stat, (uint8_t) -err);
return;
}

err = pre_transmit();
if (err) {
reply_error(sys_stat, (uint8_t) -err);
return;
14 lfr.c
@@ -164,6 +164,20 @@ int reload_config()
return err;
}

if ((settings.flags & FLAG_MOD_MASK) == FLAG_MOD_CW) {
err = si446x_set_mod_type(&dev, MOD_TYPE_CW);
} else if ((settings.flags & FLAG_MOD_MASK) == FLAG_MOD_FSK) {
err = si446x_set_mod_type(&dev, MOD_TYPE_2FSK);
} else if ((settings.flags & FLAG_MOD_MASK) == FLAG_MOD_GFSK) {
err = si446x_set_mod_type(&dev, MOD_TYPE_2GFSK);
} else {
err = si446x_set_mod_type(&dev, MOD_TYPE_2GFSK);
}

if (err) {
return err;
}

return 0;
}

@@ -30,7 +30,7 @@
.tx_vdd = 5000, /* 5V will wake the PA up, but dissipate little heat even with a lot of gate bias */ \
.pa_ilimit = 1000, /* 1A is a bit more than the RA07H4047M draws at Vdd=5V, Vgg=3.5V, Pin=13dBm */ \
.tx_vdd_delay = 2000, /* 2ms is plenty for the example 5V/1A values */ \
.flags = FLAG_CRC_CHECK,\
.flags = FLAG_MOD_GFSK | FLAG_CRC_CHECK,\
.callsign = "NOCALL "\
};

@@ -24,7 +24,13 @@

#define SETTINGS_VER 0x02

#define FLAG_CRC_CHECK 0x0001
#define FLAG_CRC_CHECK 0x0001

#define FLAG_MOD_MASK 0x000C
#define FLAG_MOD_GFSK 0x0000
#define FLAG_MOD_FSK 0x0004
#define FLAG_MOD_CW 0x0008


struct lfr_settings {
uint32_t freq;

0 comments on commit f48af99

Please sign in to comment.
You can’t perform that action at this time.