Connect/disconnect DAC from pin on the fly for a diagnostic test?
I have an analog circuit that is read by an ADC input. I would like to have a self-diagnostic function where I inject a known signal to the input of that circuit with the DAC for a self test, then disconnect the DAC from the pin and leave the pin in analog mode for normal operation. I would like the pin to be in a high impedance state so as not to affect the circuit during normal use. What would be the best way to do this?
My thought is to switch from:
sConfig.DAC_ConnectOnChipPeripheral = DAC_CHIPCONNECT_EXTERNAL;
to
sConfig.DAC_ConnectOnChipPeripheral = DAC_CHIPCONNECT_INTERNAL;
with a HAL_DAC_ConfigChannel call after my diagnostic completes.
