analog

low-speed 12 bit digital to analog conversion, not suitable for audio signals, but for control voltages...
Author: Johannes Taelman
License: BSD
Github: gpio/out/analog.axo

Inlets

frac32 voltage ratio (64u = 3.3V)

frac32 voltage ratio (64u = 3.3V)

Outlets

None

Init
palSetPadMode(GPIOA, 4, PAL_MODE_INPUT_ANALOG);
palSetPadMode(GPIOA, 5, PAL_MODE_INPUT_ANALOG);
RCC->APB1ENR |= 0x20000000;
DAC->CR |= 0x00030003;
Control Rate
DAC->DHR12R1 = inlet_PA4 >> 15;
DAC->DHR12R2 = inlet_PA5 >> 15;
Dispose
DAC->CR = 0x0;
RCC->APB1ENR &= ~0x20000000;

Privacy

© 2024 Zrna Research