Move more RF path stuff (initialization and MAX5864 state management) into rf_path.c.
Changed initial RF path mode to lowest power (OFF). Remove initial MAX2837 IF setting -- it's a waste of effort when the first (and necessary) tuning operation will reset it anyway (perhaps to a different value).
This commit is contained in:
@ -22,8 +22,11 @@
|
|||||||
|
|
||||||
#include "rf_path.h"
|
#include "rf_path.h"
|
||||||
|
|
||||||
|
#include <hackrf_core.h>
|
||||||
|
|
||||||
#include <rffc5071.h>
|
#include <rffc5071.h>
|
||||||
#include <max2837.h>
|
#include <max2837.h>
|
||||||
|
#include <max5864.h>
|
||||||
|
|
||||||
#ifdef JAWBREAKER
|
#ifdef JAWBREAKER
|
||||||
/*
|
/*
|
||||||
@ -64,7 +67,14 @@
|
|||||||
uint8_t switchctrl = SWITCHCTRL_SAFE;
|
uint8_t switchctrl = SWITCHCTRL_SAFE;
|
||||||
|
|
||||||
void rf_path_init(void) {
|
void rf_path_init(void) {
|
||||||
rffc5071_set_gpo(switchctrl);
|
ssp1_set_mode_max5864();
|
||||||
|
max5864_shutdown();
|
||||||
|
|
||||||
|
ssp1_set_mode_max2837();
|
||||||
|
max2837_setup();
|
||||||
|
max2837_mode_shutdown();
|
||||||
|
|
||||||
|
rffc5071_setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void rf_path_set_direction(const rf_path_direction_t direction) {
|
void rf_path_set_direction(const rf_path_direction_t direction) {
|
||||||
@ -83,6 +93,9 @@ void rf_path_set_direction(const rf_path_direction_t direction) {
|
|||||||
} else {
|
} else {
|
||||||
rffc5071_enable();
|
rffc5071_enable();
|
||||||
}
|
}
|
||||||
|
ssp1_set_mode_max5864();
|
||||||
|
max5864_tx();
|
||||||
|
ssp1_set_mode_max2837();
|
||||||
max2837_start();
|
max2837_start();
|
||||||
max2837_tx();
|
max2837_tx();
|
||||||
break;
|
break;
|
||||||
@ -99,6 +112,9 @@ void rf_path_set_direction(const rf_path_direction_t direction) {
|
|||||||
} else {
|
} else {
|
||||||
rffc5071_enable();
|
rffc5071_enable();
|
||||||
}
|
}
|
||||||
|
ssp1_set_mode_max5864();
|
||||||
|
max5864_rx();
|
||||||
|
ssp1_set_mode_max2837();
|
||||||
max2837_start();
|
max2837_start();
|
||||||
max2837_rx();
|
max2837_rx();
|
||||||
break;
|
break;
|
||||||
@ -108,6 +124,9 @@ void rf_path_set_direction(const rf_path_direction_t direction) {
|
|||||||
/* Set RF path to receive direction when "off" */
|
/* Set RF path to receive direction when "off" */
|
||||||
switchctrl &= ~SWITCHCTRL_TX;
|
switchctrl &= ~SWITCHCTRL_TX;
|
||||||
rffc5071_disable();
|
rffc5071_disable();
|
||||||
|
ssp1_set_mode_max5864();
|
||||||
|
max5864_shutdown();
|
||||||
|
ssp1_set_mode_max2837();
|
||||||
max2837_stop();
|
max2837_stop();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -777,8 +777,6 @@ void usb_configuration_changed(
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
const uint32_t ifreq = 2600000000U;
|
|
||||||
|
|
||||||
pin_setup();
|
pin_setup();
|
||||||
enable_1v8_power();
|
enable_1v8_power();
|
||||||
cpu_clock_init();
|
cpu_clock_init();
|
||||||
@ -801,14 +799,6 @@ int main(void) {
|
|||||||
usb_run(&usb_device);
|
usb_run(&usb_device);
|
||||||
|
|
||||||
ssp1_init();
|
ssp1_init();
|
||||||
ssp1_set_mode_max5864();
|
|
||||||
max5864_xcvr();
|
|
||||||
|
|
||||||
ssp1_set_mode_max2837();
|
|
||||||
max2837_setup();
|
|
||||||
max2837_set_frequency(ifreq);
|
|
||||||
|
|
||||||
rffc5071_setup();
|
|
||||||
|
|
||||||
rf_path_init();
|
rf_path_init();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user