kopia lustrzana https://github.com/bristol-seds/pico-tracker
Added write to the si modem DSM_CTRL register, allow even deviation values (potentially could lead to spurs but probs not)
rodzic
f1babfd5a8
commit
a518ed92f9
|
@ -235,6 +235,11 @@ enum {
|
||||||
SI_MODEM_MOD_GPIO_3 = (0x03 << 5),
|
SI_MODEM_MOD_GPIO_3 = (0x03 << 5),
|
||||||
SI_MODEM_MOD_DIRECT_MODE_SYNC = (0x00 << 7), /* default */
|
SI_MODEM_MOD_DIRECT_MODE_SYNC = (0x00 << 7), /* default */
|
||||||
SI_MODEM_MOD_DIRECT_MODE_ASYNC = (0x01 << 7),
|
SI_MODEM_MOD_DIRECT_MODE_ASYNC = (0x01 << 7),
|
||||||
|
SI_MODEM_MAP_CONTROL = 0x01,
|
||||||
|
SI_MODEM_DSM_CTRL = 0x02,
|
||||||
|
SI_MODEM_DSM_CTRL_NOFORCE_DSM_LSB = (0x00 << 2),
|
||||||
|
SI_MODEM_DSM_CTRL_FORCE_DSM_LSB = (0x01 << 2), /* default */
|
||||||
|
SI_MODEM_DSM_CTRL_MASH_1_1_1 = (0x03 << 0), /* default */
|
||||||
SI_MODEM_DATA_RATE = 0x03,
|
SI_MODEM_DATA_RATE = 0x03,
|
||||||
SI_MODEM_TX_NCO_MODE = 0x06,
|
SI_MODEM_TX_NCO_MODE = 0x06,
|
||||||
SI_MODEM_TX_NCO_TXOSR_10X = (0x00 << 26),
|
SI_MODEM_TX_NCO_TXOSR_10X = (0x00 << 26),
|
||||||
|
|
|
@ -243,6 +243,16 @@ static void si_trx_frequency_control_set_band(uint8_t band, uint8_t sy_sel)
|
||||||
SI_MODEM_CLKGEN_BAND,
|
SI_MODEM_CLKGEN_BAND,
|
||||||
sy_sel | (band & 0x7));
|
sy_sel | (band & 0x7));
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Set the control word of the modem delta-sigma modulator
|
||||||
|
*/
|
||||||
|
static void si_trx_modem_set_dsm_ctrl(uint8_t ctrl_word)
|
||||||
|
{
|
||||||
|
_si_trx_set_property_8(SI_PROPERTY_GROUP_MODEM,
|
||||||
|
SI_MODEM_DSM_CTRL,
|
||||||
|
ctrl_word);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the modem frequency deviation. This is how much the external
|
* Sets the modem frequency deviation. This is how much the external
|
||||||
* pin deviates the synthesiser from the centre frequency. In units of
|
* pin deviates the synthesiser from the centre frequency. In units of
|
||||||
|
@ -346,9 +356,6 @@ static void si_trx_set_tx_pa_duty_cycle(uint8_t pa_duty_cycle)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the synthesiser to the given frequency.
|
* Set the synthesiser to the given frequency.
|
||||||
*
|
*
|
||||||
|
@ -402,11 +409,14 @@ static float si_trx_set_frequency(uint32_t frequency, uint16_t deviation)
|
||||||
si_trx_frequency_control_set_band(band, SI_MODEM_CLKGEN_SY_SEL_1);
|
si_trx_frequency_control_set_band(band, SI_MODEM_CLKGEN_SY_SEL_1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Set the frac-n PLL divisior */
|
/* Set the frac-n PLL divisior */
|
||||||
si_trx_frequency_control_set_divider(n, m);
|
si_trx_frequency_control_set_divider(n, m);
|
||||||
|
|
||||||
/* Set the external pin frequency deviation to the LSB tuning resoultion */
|
/* Set the modem dsm control word. Allow even deviation values */
|
||||||
|
si_trx_modem_set_dsm_ctrl(SI_MODEM_DSM_CTRL_NOFORCE_DSM_LSB |
|
||||||
|
SI_MODEM_DSM_CTRL_MASH_1_1_1);
|
||||||
|
|
||||||
|
/* Set the modem frequency deviation (for the external pin)*/
|
||||||
si_trx_modem_set_deviation(deviation);
|
si_trx_modem_set_deviation(deviation);
|
||||||
|
|
||||||
/* Return the LSB tuning resolution of the frac-n pll synthesiser. */
|
/* Return the LSB tuning resolution of the frac-n pll synthesiser. */
|
||||||
|
|
Ładowanie…
Reference in New Issue