Push SGPIO configuration into RF path API.
This commit is contained in:
@ -27,6 +27,7 @@
|
||||
#include <rffc5071.h>
|
||||
#include <max2837.h>
|
||||
#include <max5864.h>
|
||||
#include <sgpio.h>
|
||||
|
||||
#ifdef JAWBREAKER
|
||||
/*
|
||||
@ -98,6 +99,7 @@ void rf_path_set_direction(const rf_path_direction_t direction) {
|
||||
ssp1_set_mode_max2837();
|
||||
max2837_start();
|
||||
max2837_tx();
|
||||
sgpio_configure(SGPIO_DIRECTION_TX, true);
|
||||
break;
|
||||
|
||||
case RF_PATH_DIRECTION_RX:
|
||||
@ -117,6 +119,7 @@ void rf_path_set_direction(const rf_path_direction_t direction) {
|
||||
ssp1_set_mode_max2837();
|
||||
max2837_start();
|
||||
max2837_rx();
|
||||
sgpio_configure(SGPIO_DIRECTION_RX, true);
|
||||
break;
|
||||
|
||||
case RF_PATH_DIRECTION_OFF:
|
||||
@ -128,6 +131,7 @@ void rf_path_set_direction(const rf_path_direction_t direction) {
|
||||
max5864_shutdown();
|
||||
ssp1_set_mode_max2837();
|
||||
max2837_stop();
|
||||
sgpio_configure(SGPIO_DIRECTION_RX, true);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -188,18 +188,15 @@ 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);
|
||||
rf_path_set_direction(RF_PATH_DIRECTION_RX);
|
||||
sgpio_configure(SGPIO_DIRECTION_RX, true);
|
||||
} else if (transceiver_mode == TRANSCEIVER_MODE_TX) {
|
||||
gpio_clear(PORT_LED1_3, PIN_LED2);
|
||||
gpio_set(PORT_LED1_3, PIN_LED3);
|
||||
usb_endpoint_init(&usb_endpoint_bulk_out);
|
||||
rf_path_set_direction(RF_PATH_DIRECTION_TX);
|
||||
sgpio_configure(SGPIO_DIRECTION_TX, true);
|
||||
} else {
|
||||
gpio_clear(PORT_LED1_3, PIN_LED2);
|
||||
gpio_clear(PORT_LED1_3, PIN_LED3);
|
||||
rf_path_set_direction(RF_PATH_DIRECTION_OFF);
|
||||
sgpio_configure(SGPIO_DIRECTION_RX, true);
|
||||
}
|
||||
|
||||
if( transceiver_mode != TRANSCEIVER_MODE_OFF ) {
|
||||
|
Reference in New Issue
Block a user