New switches configuration

Speed-test
erikkaashoek 4 years ago
parent c2fbf20eb7
commit 3b6d29f33a

@ -89,8 +89,13 @@
#define GPIOB_SPI_MOSI 5 #define GPIOB_SPI_MOSI 5
#define GPIO_LO_SEL 6 #define GPIO_LO_SEL 6
#define LINE_LO_SEL PAL_LINE(GPIOB, GPIO_LO_SEL) #define LINE_LO_SEL PAL_LINE(GPIOB, GPIO_LO_SEL)
#ifdef __NEW_SWITCHES__
#define GPIO_SD_CD 12
#define LINE_SD_CD PAL_LINE(GPIOB, GPIO_SD_CD)
#else
#define GPIO_SD_CD 7 #define GPIO_SD_CD 7
#define LINE_SD_CD PAL_LINE(GPIOB, GPIO_SD_CD) #define LINE_SD_CD PAL_LINE(GPIOB, GPIO_SD_CD)
#endif
#define GPIO_RX_SEL 8 #define GPIO_RX_SEL 8
#define LINE_RX_SEL PAL_LINE(GPIOB, GPIO_RX_SEL) #define LINE_RX_SEL PAL_LINE(GPIOB, GPIO_RX_SEL)
#define GPIO_RX_CTS 9 #define GPIO_RX_CTS 9
@ -99,8 +104,13 @@
#define GPIO_LCD_CD_PORT GPIOB #define GPIO_LCD_CD_PORT GPIOB
#define GPIO_LCD_CS 11 #define GPIO_LCD_CS 11
#define GPIO_LCD_CS_PORT GPIOB #define GPIO_LCD_CS_PORT GPIOB
#ifdef __NEW_SWITCHES__
#define GPIO_RX_SDN 7
#define LINE_RX_SDN PAL_LINE(GPIOB, GPIO_RX_SDN)
#else
#define GPIO_RX_SDN 12 #define GPIO_RX_SDN 12
#define LINE_RX_SDN PAL_LINE(GPIOB, GPIO_RX_SDN) #define LINE_RX_SDN PAL_LINE(GPIOB, GPIO_RX_SDN)
#endif
#define GPIO_PB13 13 #define GPIO_PB13 13
#define LINE_PB13 PAL_LINE(GPIOB, GPIO_PB13) #define LINE_PB13 PAL_LINE(GPIOB, GPIO_PB13)
#define GPIO_PB14 14 #define GPIO_PB14 14

@ -61,7 +61,7 @@
#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) #if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
#define HAL_USE_DAC FALSE #define HAL_USE_DAC FALSE
#endif #endif
#define STM32_DMA_REQUIRED
/** /**
* @brief Enables the EXT subsystem. * @brief Enables the EXT subsystem.
*/ */

@ -49,6 +49,7 @@
#define __SI4463__ #define __SI4463__
#define __SI4468__ #define __SI4468__
#define __ADF4351__ #define __ADF4351__
#define __NEW_SWITCHES__
#endif #endif
#define __PE4302__ #define __PE4302__
//#define __SIMULATION__ //#define __SIMULATION__

@ -709,7 +709,7 @@ void set_modulation_frequency(int f)
void set_repeat(int r) void set_repeat(int r)
{ {
if (r > 0 && r <= 100) { if (r > 0 && r <= 500) {
setting.repeat = r; setting.repeat = r;
// dirty = true; // No HW update required, only status panel refresh // dirty = true; // No HW update required, only status panel refresh
} }
@ -1786,7 +1786,7 @@ done:
float peakLevel; float peakLevel;
float min_level; float min_level;
freq_t peakFreq; freq_t peakFreq;
int peakIndex; int peakIndex = 0;
float temppeakLevel; float temppeakLevel;
uint16_t temppeakIndex; uint16_t temppeakIndex;
// volatile int t; // volatile int t;
@ -1824,7 +1824,9 @@ void setup_sa(void)
#endif #endif
enable_rx_output(false); enable_rx_output(false);
enable_high(false); enable_high(false);
#ifdef __NEW_SWITCHES__
enable_direct(false);
#endif
fill_spur_table(); fill_spur_table();
#endif #endif
#if 0 // Measure fast scan time #if 0 // Measure fast scan time
@ -3891,8 +3893,8 @@ static uint8_t sweep_counter = 0; // Only used for HW refresh
static bool sweep(bool break_on_operation) static bool sweep(bool break_on_operation)
{ {
float RSSI; float RSSI;
float local_peakLevel; float local_peakLevel = -150.0;
int local_peakIndex; int local_peakIndex = 0;
#ifdef __SI4432__ #ifdef __SI4432__
freq_t agc_peak_freq = 0; freq_t agc_peak_freq = 0;
float agc_peak_rssi = -150; float agc_peak_rssi = -150;

@ -825,8 +825,9 @@ pureRSSI_t SI4432_RSSI(uint32_t i, int s)
my_microsecond_delay(100); my_microsecond_delay(100);
}while(1); }while(1);
if (setting.repeat > 1) if (setting.repeat > 1){
RSSI_RAW = RSSI_RAW / setting.repeat; RSSI_RAW = RSSI_RAW / setting.repeat;
}
// if (MODE_INPUT(setting.mode) && RSSI_RAW == 0) // if (MODE_INPUT(setting.mode) && RSSI_RAW == 0)
// SI4432_Init(); // SI4432_Init();
#ifdef __SIMULATION__ #ifdef __SIMULATION__

@ -203,6 +203,7 @@ void enable_extra_lna(int s);
void enable_ultra(int s); void enable_ultra(int s);
void enable_rx_output(int s); void enable_rx_output(int s);
void enable_high(int s); void enable_high(int s);
void enable_direct(int s);
#endif #endif

@ -149,6 +149,7 @@ void stop_PE4312_SPI_mode(void){
SI4432_SPI->CR1 = old_spi_settings; SI4432_SPI->CR1 = old_spi_settings;
} }
#if 0
static void software_shiftOut(uint8_t val) static void software_shiftOut(uint8_t val)
{ {
SI4432_log(SI4432_Sel); SI4432_log(SI4432_Sel);
@ -164,7 +165,7 @@ static void software_shiftOut(uint8_t val)
val<<=1; val<<=1;
}while((++i) & 0x07); }while((++i) & 0x07);
} }
#endif
static void shiftOut(uint8_t val) static void shiftOut(uint8_t val)
{ {
@ -819,11 +820,12 @@ static void SI4463_set_state(si446x_state_t newState)
SI4463_do_api(data, sizeof(data), NULL, 0); SI4463_do_api(data, sizeof(data), NULL, 0);
} }
static uint8_t gpio_state[4] = { static uint8_t gpio_state[5] = {
SI446X_GPIO_MODE_DIV_CLK, SI446X_GPIO_MODE_DIV_CLK,
SI446X_GPIO_MODE_CTS, SI446X_GPIO_MODE_CTS,
SI446X_GPIO_MODE_DONOTHING, SI446X_GPIO_MODE_DONOTHING,
SI446X_GPIO_MODE_DONOTHING SI446X_GPIO_MODE_DONOTHING,
SI446X_GPIO_MODE_DRIVE1
}; };
void SI4463_refresh_gpio(void) void SI4463_refresh_gpio(void)
@ -832,9 +834,9 @@ void SI4463_refresh_gpio(void)
SI446X_CMD_GPIO_PIN_CFG, SI446X_CMD_GPIO_PIN_CFG,
gpio_state[0], // GPIO[0] gpio_state[0], // GPIO[0]
gpio_state[1], // GPIO[1] gpio_state[1], // GPIO[1]
gpio_state[2], // GPIO[2] gpio_state[2], // GPIO[2] // High
gpio_state[3], // GPIO[3] gpio_state[3], // GPIO[3] // TX/RX
0, // NIRQ gpio_state[4], // NIRQ // Direct
0, // SDO 0, // SDO
0 // GEN_CONFIG 0 // GEN_CONFIG
}; };
@ -1853,11 +1855,28 @@ void enable_rx_output(int s)
void enable_high(int s) void enable_high(int s)
{ {
#ifdef __NEW_SWITCHES__
if (s)
SI4463_set_gpio(2,SI446X_GPIO_MODE_DRIVE0);
else
SI4463_set_gpio(2,SI446X_GPIO_MODE_DRIVE1);
#else
if (s) if (s)
SI4463_set_gpio(2,SI446X_GPIO_MODE_DRIVE1); SI4463_set_gpio(2,SI446X_GPIO_MODE_DRIVE1);
else else
SI4463_set_gpio(2,SI446X_GPIO_MODE_DRIVE0); SI4463_set_gpio(2,SI446X_GPIO_MODE_DRIVE0);
#endif
}
#ifdef __NEW_SWITCHES__
void enable_direct(int s)
{
if (s)
SI4463_set_gpio(4,SI446X_GPIO_MODE_DRIVE0);
else
SI4463_set_gpio(4,SI446X_GPIO_MODE_DRIVE1);
} }
#endif
#pragma GCC pop_options #pragma GCC pop_options

@ -1111,6 +1111,7 @@ static UI_FUNCTION_ADV_CALLBACK(menu_harmonic_spur_acb)
#endif #endif
#endif #endif
#if 0
#ifdef __ULTRA__ #ifdef __ULTRA__
static UI_FUNCTION_ADV_CALLBACK(menu_debug_spur_acb) static UI_FUNCTION_ADV_CALLBACK(menu_debug_spur_acb)
{ {
@ -1125,6 +1126,7 @@ static UI_FUNCTION_ADV_CALLBACK(menu_debug_spur_acb)
ui_mode_normal(); ui_mode_normal();
} }
#endif #endif
#endif
#ifdef TINYSA4 #ifdef TINYSA4
static UI_FUNCTION_ADV_CALLBACK(menu_extra_lna_acb) static UI_FUNCTION_ADV_CALLBACK(menu_extra_lna_acb)
@ -1804,6 +1806,7 @@ static UI_FUNCTION_ADV_CALLBACK(menu_marker_modify_acb)
break; break;
case M_DELTA: case M_DELTA:
uistat.text[0] = markers[active_marker].ref+'1'; uistat.text[0] = markers[active_marker].ref+'1';
/* fall through */
case M_NOISE: case M_NOISE:
case M_TRACKING: case M_TRACKING:
case M_AVER: case M_AVER:

Loading…
Cancel
Save

Powered by TurnKey Linux.