Sweep DAC on PA4 added

master
erikkaashoek 5 years ago
parent 84528e8869
commit f7790b7fdc

@ -128,7 +128,7 @@
PIN_MODE_INPUT(1U) | \ PIN_MODE_INPUT(1U) | \
PIN_MODE_INPUT(2U) | \ PIN_MODE_INPUT(2U) | \
PIN_MODE_INPUT(3U) | \ PIN_MODE_INPUT(3U) | \
PIN_MODE_INPUT(4U) | \ PIN_MODE_ANALOG(4U) | \
PIN_MODE_INPUT(5U) | \ PIN_MODE_INPUT(5U) | \
PIN_MODE_ANALOG(GPIOA_XP) | \ PIN_MODE_ANALOG(GPIOA_XP) | \
PIN_MODE_ANALOG(GPIOA_YP) | \ PIN_MODE_ANALOG(GPIOA_YP) | \
@ -160,7 +160,7 @@
PIN_OSPEED_2M(1) | \ PIN_OSPEED_2M(1) | \
PIN_OSPEED_2M(2) | \ PIN_OSPEED_2M(2) | \
PIN_OSPEED_2M(3) | \ PIN_OSPEED_2M(3) | \
PIN_OSPEED_100M(4) | \ PIN_OSPEED_2M(4) | \
PIN_OSPEED_100M(5) | \ PIN_OSPEED_100M(5) | \
PIN_OSPEED_2M(6) | \ PIN_OSPEED_2M(6) | \
PIN_OSPEED_2M(7) | \ PIN_OSPEED_2M(7) | \
@ -176,7 +176,7 @@
PIN_PUPDR_PULLDOWN(1) | \ PIN_PUPDR_PULLDOWN(1) | \
PIN_PUPDR_PULLDOWN(2) | \ PIN_PUPDR_PULLDOWN(2) | \
PIN_PUPDR_PULLDOWN(3) | \ PIN_PUPDR_PULLDOWN(3) | \
PIN_PUPDR_PULLDOWN(4) | \ PIN_PUPDR_FLOATING(4) | \
PIN_PUPDR_PULLDOWN(5) | \ PIN_PUPDR_PULLDOWN(5) | \
PIN_PUPDR_FLOATING(6) | \ PIN_PUPDR_FLOATING(6) | \
PIN_PUPDR_FLOATING(7) | \ PIN_PUPDR_FLOATING(7) | \

@ -2710,12 +2710,12 @@ static const I2CConfig i2ccfg = {
.cr1 = 0, // CR1 register initialization. .cr1 = 0, // CR1 register initialization.
.cr2 = 0 // CR2 register initialization. .cr2 = 0 // CR2 register initialization.
}; };
#endif
static DACConfig dac1cfg1 = { static DACConfig dac1cfg1 = {
//init: 2047U, //init: 2047U,
init: 1922U, init: 1922U,
datamode: DAC_DHRM_12BIT_RIGHT datamode: DAC_DHRM_12BIT_RIGHT
}; };
#endif
#pragma GCC pop_options #pragma GCC pop_options
@ -2861,15 +2861,13 @@ int main(void)
*/ */
shell_init_connection(); shell_init_connection();
/* restore frequencies and calibration 0 slot properties from flash memory */ dac1cfg1.init = 0;
#ifdef __VNA__
dac1cfg1.init = config.dac_value;
/* /*
* Starting DAC1 driver, setting up the output pin as analog as suggested * Starting DAC1 driver, setting up the output pin as analog as suggested
* by the Reference Manual. * by the Reference Manual.
*/ */
dacStart(&DACD2, &dac1cfg1); dacStart(&DACD2, &dac1cfg1);
#endif
setupSA(); setupSA();
set_sweep_points(POINTS_COUNT); set_sweep_points(POINTS_COUNT);

@ -2171,6 +2171,8 @@ sweep_again: // stay in sweep loop when output mo
return false; return false;
} }
dacPutChannelX(&DACD2, 0, i*14); // Output sweep voltage
// ----------------------- in loop AGC --------------------------------- // ----------------------- in loop AGC ---------------------------------
#ifdef __SI4432__ #ifdef __SI4432__

Loading…
Cancel
Save

Powered by TurnKey Linux.