Push SGPIO configuration into RF path API.

This commit is contained in:
Jared Boone
2013-09-17 22:32:10 -07:00
parent 2e2275ed51
commit c06facdd25
2 changed files with 4 additions and 3 deletions

View File

@ -27,6 +27,7 @@
#include <rffc5071.h> #include <rffc5071.h>
#include <max2837.h> #include <max2837.h>
#include <max5864.h> #include <max5864.h>
#include <sgpio.h>
#ifdef JAWBREAKER #ifdef JAWBREAKER
/* /*
@ -98,6 +99,7 @@ void rf_path_set_direction(const rf_path_direction_t direction) {
ssp1_set_mode_max2837(); ssp1_set_mode_max2837();
max2837_start(); max2837_start();
max2837_tx(); max2837_tx();
sgpio_configure(SGPIO_DIRECTION_TX, true);
break; break;
case RF_PATH_DIRECTION_RX: case RF_PATH_DIRECTION_RX:
@ -117,6 +119,7 @@ void rf_path_set_direction(const rf_path_direction_t direction) {
ssp1_set_mode_max2837(); ssp1_set_mode_max2837();
max2837_start(); max2837_start();
max2837_rx(); max2837_rx();
sgpio_configure(SGPIO_DIRECTION_RX, true);
break; break;
case RF_PATH_DIRECTION_OFF: case RF_PATH_DIRECTION_OFF:
@ -128,6 +131,7 @@ void rf_path_set_direction(const rf_path_direction_t direction) {
max5864_shutdown(); max5864_shutdown();
ssp1_set_mode_max2837(); ssp1_set_mode_max2837();
max2837_stop(); max2837_stop();
sgpio_configure(SGPIO_DIRECTION_RX, true);
break; break;
} }

View File

@ -188,18 +188,15 @@ void set_transceiver_mode(const transceiver_mode_t new_transceiver_mode) {
gpio_set(PORT_LED1_3, PIN_LED2); gpio_set(PORT_LED1_3, PIN_LED2);
usb_endpoint_init(&usb_endpoint_bulk_in); usb_endpoint_init(&usb_endpoint_bulk_in);
rf_path_set_direction(RF_PATH_DIRECTION_RX); rf_path_set_direction(RF_PATH_DIRECTION_RX);
sgpio_configure(SGPIO_DIRECTION_RX, true);
} else if (transceiver_mode == TRANSCEIVER_MODE_TX) { } else if (transceiver_mode == TRANSCEIVER_MODE_TX) {
gpio_clear(PORT_LED1_3, PIN_LED2); gpio_clear(PORT_LED1_3, PIN_LED2);
gpio_set(PORT_LED1_3, PIN_LED3); gpio_set(PORT_LED1_3, PIN_LED3);
usb_endpoint_init(&usb_endpoint_bulk_out); usb_endpoint_init(&usb_endpoint_bulk_out);
rf_path_set_direction(RF_PATH_DIRECTION_TX); rf_path_set_direction(RF_PATH_DIRECTION_TX);
sgpio_configure(SGPIO_DIRECTION_TX, true);
} else { } else {
gpio_clear(PORT_LED1_3, PIN_LED2); gpio_clear(PORT_LED1_3, PIN_LED2);
gpio_clear(PORT_LED1_3, PIN_LED3); gpio_clear(PORT_LED1_3, PIN_LED3);
rf_path_set_direction(RF_PATH_DIRECTION_OFF); rf_path_set_direction(RF_PATH_DIRECTION_OFF);
sgpio_configure(SGPIO_DIRECTION_RX, true);
} }
if( transceiver_mode != TRANSCEIVER_MODE_OFF ) { if( transceiver_mode != TRANSCEIVER_MODE_OFF ) {