firmware, lib: update comments, doc
This commit is contained in:
@ -512,16 +512,10 @@ uint32_t rffc5071_config_synth_int(uint16_t lo) {
|
||||
return tune_freq_hz;
|
||||
}
|
||||
|
||||
/* !!!!!!!!!!! hz is currently ignored !!!!!!!!!!!
|
||||
*
|
||||
* Tuning is rounded down to the nearest 25MHz or 50MHz depending on
|
||||
* frequency requsted. Actual tuned value in MHz is returned. */
|
||||
uint32_t rffc5071_set_frequency(uint16_t mhz, uint32_t hz) {
|
||||
/* !!!!!!!!!!! hz is currently ignored !!!!!!!!!!! */
|
||||
uint32_t rffc5071_set_frequency(uint16_t mhz) {
|
||||
uint32_t tune_freq;
|
||||
|
||||
// Fractional tuning unimplemented, 'hz' ignored
|
||||
hz=hz;
|
||||
|
||||
rffc5071_disable();
|
||||
tune_freq = rffc5071_config_synth_int(mhz);
|
||||
rffc5071_enable();
|
||||
|
@ -67,11 +67,8 @@ extern void rffc5071_reg_write(uint8_t r, uint16_t v);
|
||||
* provided routines for those operations. */
|
||||
extern void rffc5071_regs_commit(void);
|
||||
|
||||
/* Set frequency (MHz). The 'hz' field is currently ignored. Actual
|
||||
* tune frequency (MHz) is returned. Expect requested freq to be
|
||||
* rounded down to the nearest multiple of 25MHz or 50MHz, depending
|
||||
* internal calculations. */
|
||||
extern uint32_t rffc5071_set_frequency(uint16_t mhz, uint32_t hz);
|
||||
/* Set frequency (MHz). */
|
||||
extern uint32_t rffc5071_set_frequency(uint16_t mhz);
|
||||
|
||||
/* Set up rx only, tx only, or full duplex. Chip should be disabled
|
||||
* before _tx, _rx, or _rxtx are called. */
|
||||
|
@ -124,7 +124,7 @@ bool set_freq(uint32_t freq_mhz, uint32_t freq_hz)
|
||||
|
||||
RFFC5071_freq_mhz = MAX2837_FREQ_NOMINAL_MHZ - freq_mhz;
|
||||
/* Set Freq and read real freq */
|
||||
real_RFFC5071_freq_hz = rffc5071_set_frequency(RFFC5071_freq_mhz, 0);
|
||||
real_RFFC5071_freq_hz = rffc5071_set_frequency(RFFC5071_freq_mhz);
|
||||
if(real_RFFC5071_freq_hz < RFFC5071_freq_mhz * FREQ_ONE_MHZ)
|
||||
{
|
||||
tmp_hz = -(RFFC5071_freq_mhz * FREQ_ONE_MHZ - real_RFFC5071_freq_hz);
|
||||
@ -150,7 +150,7 @@ bool set_freq(uint32_t freq_mhz, uint32_t freq_hz)
|
||||
|
||||
RFFC5071_freq_mhz = freq_mhz - MAX2837_FREQ_NOMINAL_MHZ;
|
||||
/* Set Freq and read real freq */
|
||||
real_RFFC5071_freq_hz = rffc5071_set_frequency(RFFC5071_freq_mhz, 0);
|
||||
real_RFFC5071_freq_hz = rffc5071_set_frequency(RFFC5071_freq_mhz);
|
||||
if(real_RFFC5071_freq_hz < RFFC5071_freq_mhz * FREQ_ONE_MHZ)
|
||||
{
|
||||
tmp_hz = (RFFC5071_freq_mhz * FREQ_ONE_MHZ - real_RFFC5071_freq_hz);
|
||||
|
@ -104,7 +104,7 @@ int main(void) {
|
||||
switchctrl = (SWITCHCTRL_AMP_BYPASS | SWITCHCTRL_HP);
|
||||
#endif
|
||||
rffc5071_rx(switchctrl);
|
||||
rffc5071_set_frequency(500, 0); // 500 MHz, 0 Hz (Hz ignored)
|
||||
rffc5071_set_frequency(500); // 500 MHz
|
||||
|
||||
max2837_set_frequency(freq);
|
||||
max2837_start();
|
||||
|
@ -128,6 +128,8 @@ extern ADDAPI int ADDCALL hackrf_board_id_read(hackrf_device* device, uint8_t* v
|
||||
extern ADDAPI int ADDCALL hackrf_version_string_read(hackrf_device* device, char* version, uint8_t length);
|
||||
|
||||
extern ADDAPI int ADDCALL hackrf_set_freq(hackrf_device* device, const uint64_t freq_hz);
|
||||
|
||||
/* range 2300-2700 Mhz */
|
||||
extern ADDAPI int ADDCALL hackrf_set_if_freq(hackrf_device* device, const uint32_t freq_mhz);
|
||||
|
||||
/* currently 8-20Mhz - either as a fraction, i.e. freq 20000000hz divider 2 -> 10Mhz or as plain old 10000000hz (double)
|
||||
|
Reference in New Issue
Block a user