From f74dae180b846c125f6981305e0f984805fb570a Mon Sep 17 00:00:00 2001 From: Michael Ossmann Date: Fri, 24 Aug 2012 13:57:27 -0600 Subject: [PATCH] sgpio-rx updates for testing with Lollipop --- firmware/sgpio-rx/Makefile | 3 ++- firmware/sgpio-rx/sgpio-rx.c | 28 ++++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/firmware/sgpio-rx/Makefile b/firmware/sgpio-rx/Makefile index ac4d565c..9f750ea3 100644 --- a/firmware/sgpio-rx/Makefile +++ b/firmware/sgpio-rx/Makefile @@ -6,6 +6,7 @@ SRC = $(BINARY).c \ ../common/hackrf_core.c \ ../common/si5351c.c \ ../common/max2837.c \ - ../common/max5864.c + ../common/max5864.c \ + ../common/rffc5071.c include ../common/Makefile_inc.mk diff --git a/firmware/sgpio-rx/sgpio-rx.c b/firmware/sgpio-rx/sgpio-rx.c index c2e00ee3..aefd86e6 100644 --- a/firmware/sgpio-rx/sgpio-rx.c +++ b/firmware/sgpio-rx/sgpio-rx.c @@ -29,6 +29,7 @@ #include #include #include +#include void pin_setup(void) { /* Configure SCU Pin Mux as GPIO */ @@ -309,7 +310,7 @@ void configure_sgpio_test_rx() { int main(void) { - const uint32_t freq = 2483000000U; + const uint32_t freq = 2700000000U; pin_setup(); enable_1v8_power(); @@ -322,9 +323,31 @@ int main(void) { | (CGU_SRC_PLL1 << CGU_BASE_CLK_SEL_SHIFT)); ssp1_init(); - ssp1_set_mode_max2837(); max2837_setup(); + rffc5071_init(); + rffc5071_config_synth_int(500); + rffc5071_enable_rx(); + //rffc5071_reg_write(RFFC5071_GPO, 0x0001); /* PLL lock output on GPO4 */ + /* lollipop */ + uint8_t gpo = + (1 << 0) /* SWTXB1 (!tx_bypass) */ + | (0 << 1) /* SWRXB1 (rx_bypass) */ + | (1 << 2) /* SWTXA1 (tx_hp) */ + | (0 << 3) /* unused */ + | (1 << 4) /* SWRXA1 (rx_hp) */ + | (0 << 5); /* SWD1 (!tx_ant) */ + /* licorice */ + //uint8_t gpo = + //(0 << 0) /* MIX_BYPASS */ + //| (0 << 1) /* AMP_BYPASS */ + //| (0 << 2) /* TX */ + //| (0 << 3) /* unused */ + //| (0 << 4) /* HP */ + //| (0 << 5); /* !AMP_PWR */ + rffc5071_reg_write(RFFC5071_GPO, (gpo << 9) | (gpo << 2) | 0x3); + gpio_set(PORT_LED1_3, (PIN_LED1)); /* LED1 on */ + max2837_set_frequency(freq); max2837_start(); max2837_rx(); @@ -332,6 +355,7 @@ int main(void) { ssp1_set_mode_max5864(); max5864_xcvr(); configure_sgpio_test_rx(); + gpio_set(PORT_LED1_3, (PIN_LED2)); /* LED2 on */ while (1) {