ADC

ADC (Analogue to Digital Converter) will read and analogue value and provide a 8- or 12- bit sampling value. A standard MCU have several ADC’s that either can be used separately at higher sampling frequencies or multiplexed towards several GPIO pins. Available sampling frequency and resolution will vary from MCU to MCU.

The HAL module can optionally buffer input either using fast polling, interrupt or DMA. The buffer size is decided in the call to Init.

Init Initialize and wire the ADC group. Please notice that the used pin’s also need to be wired with GPIO in advance. The Init also configure sampling frequency and resolution.
readAnalogue Return an analogue value from the buffer or pin. To read pin directly on call just set buffer to zero in Init.