Merge branch 'master' of git://github.com/mossmann/hackrf

This commit is contained in:
TitanMKD
2013-03-07 21:32:56 +01:00
3 changed files with 12 additions and 10 deletions

View File

@ -535,7 +535,7 @@ void rffc5071_set_gpo(uint8_t gpo)
int main(int ac, char **av)
{
rffc5071_setup();
rffc5071_tx();
rffc5071_tx(0);
rffc5071_set_frequency(500, 0);
rffc5071_set_frequency(525, 0);
rffc5071_set_frequency(550, 0);
@ -543,7 +543,7 @@ int main(int ac, char **av)
rffc5071_set_frequency(1525, 0);
rffc5071_set_frequency(1550, 0);
rffc5071_disable();
rffc5071_rx();
rffc5071_rx(0);
rffc5071_disable();
rffc5071_rxtx();
rffc5071_disable();

View File

@ -36,12 +36,12 @@ extern uint32_t rffc5071_regs_dirty;
* RF switches on Jawbreaker are controlled by General Purpose Outputs (GPO) on
* the RFFC5072.
*/
#define SWITCHCTRL_NO_TX_AMP_PWR (1 << 0) /* turn off TX amp power */
#define SWITCHCTRL_AMP_BYPASS (1 << 1) /* bypass amp section */
#define SWITCHCTRL_TX (1 << 2) /* 1 for TX mode, 0 for RX mode */
#define SWITCHCTRL_MIX_BYPASS (1 << 3) /* bypass RFFC5072 mixer section */
#define SWITCHCTRL_HP (1 << 4) /* 1 for high-pass, 0 for low-pass */
#define SWITCHCTRL_NO_RX_AMP_PWR (1 << 5) /* turn off RX amp power */
#define SWITCHCTRL_NO_TX_AMP_PWR (1 << 0) /* GPO1 turn off TX amp power */
#define SWITCHCTRL_AMP_BYPASS (1 << 1) /* GPO2 bypass amp section */
#define SWITCHCTRL_TX (1 << 2) /* GPO3 1 for TX mode, 0 for RX mode */
#define SWITCHCTRL_MIX_BYPASS (1 << 3) /* GPO4 bypass RFFC5072 mixer section */
#define SWITCHCTRL_HP (1 << 4) /* GPO5 1 for high-pass, 0 for low-pass */
#define SWITCHCTRL_NO_RX_AMP_PWR (1 << 5) /* GPO6 turn off RX amp power */
/*
* Safe (initial) switch settings turn off both amplifiers and enable both amp

View File

@ -187,6 +187,8 @@ void set_transceiver_mode(const transceiver_mode_t new_transceiver_mode) {
gpio_set(PORT_LED1_3, PIN_LED2);
usb_endpoint_init(&usb_endpoint_bulk_in);
rffc5071_rx(switchctrl);
rffc5071_set_frequency(1700, 0); // 2600 MHz IF - 1700 MHz LO = 900 MHz RF
max2837_start();
max2837_rx();
} else if (transceiver_mode == TRANSCEIVER_MODE_TX) {
@ -194,6 +196,8 @@ void set_transceiver_mode(const transceiver_mode_t new_transceiver_mode) {
gpio_set(PORT_LED1_3, PIN_LED3);
usb_endpoint_init(&usb_endpoint_bulk_out);
rffc5071_tx(switchctrl);
rffc5071_set_frequency(1700, 0); // 2600 MHz IF - 1700 MHz LO = 900 MHz RF
max2837_start();
max2837_tx();
} else {
@ -684,8 +688,6 @@ int main(void) {
#ifdef JAWBREAKER
switchctrl = SWITCHCTRL_AMP_BYPASS;
#endif
rffc5071_rx(switchctrl);
rffc5071_set_frequency(1700, 0); // 2600 MHz IF - 1700 MHz LO = 900 MHz RF
while(true) {
// Wait until buffer 0 is transmitted/received.