Merge pull request #1162 from martinling/ant-bias-glitch

Fix antenna bias pulse glitch at startup.
This commit is contained in:
Michael Ossmann
2022-09-19 10:33:57 -04:00
committed by GitHub
4 changed files with 12 additions and 4 deletions

View File

@ -931,6 +931,9 @@ void disable_rf_power(void)
void enable_rf_power(void) void enable_rf_power(void)
{ {
gpio_set(&gpio_vaa_enable); gpio_set(&gpio_vaa_enable);
/* Let the voltage stabilize */
delay(1000000);
} }
void disable_rf_power(void) void disable_rf_power(void)

View File

@ -339,7 +339,10 @@ void rf_path_init(rf_path_t* const rf_path)
max2837_setup(&max2837); max2837_setup(&max2837);
max2837_start(&max2837); max2837_start(&max2837);
// On HackRF One, the mixer is now set up earlier in boot.
#ifndef HACKRF_ONE
mixer_setup(&mixer); mixer_setup(&mixer);
#endif
switchctrl_set(rf_path, switchctrl); switchctrl_set(rf_path, switchctrl);
} }

View File

@ -62,7 +62,7 @@ static const uint16_t rffc5071_regs_default[RFFC5071_NUM_REGS] = {
0x0000, /* 13 */ 0x0000, /* 13 */
0x0000, /* 14 */ 0x0000, /* 14 */
0x0000, /* 15 */ 0x0000, /* 15 */
0x0000, /* 16 */ 0x0206, /* 16 */
0x4900, /* 17 */ 0x4900, /* 17 */
0x0281, /* 18 */ 0x0281, /* 18 */
0xf00f, /* 19 */ 0xf00f, /* 19 */

View File

@ -229,11 +229,13 @@ int main(void)
detect_hardware_platform(); detect_hardware_platform();
pin_setup(); pin_setup();
enable_1v8_power(); enable_1v8_power();
#ifdef HACKRF_ONE
// Set up mixer before enabling RF power, because its
// GPO is used to control the antenna bias tee.
mixer_setup(&mixer);
#endif
#if (defined HACKRF_ONE || defined RAD1O) #if (defined HACKRF_ONE || defined RAD1O)
enable_rf_power(); enable_rf_power();
/* Let the voltage stabilize */
delay(1000000);
#endif #endif
cpu_clock_init(); cpu_clock_init();