C API for BALTECH SDK

§ brp_DHWCtrl_APortMeasure()

brp_errcode brp_DHWCtrl_APortMeasure ( brp_protocol  protocol,
unsigned  Port,
unsigned  Count,
unsigned **  Voltages,
size_t *  Voltages_len,
brp_mempool mempool 
)

The selected ADC Clock is MCU Clock / 128 (i.e.

13.56 Mhz / 128)

After 13 ADC Clock Ticks the first sample will measured. 13 ADC Clock Ticks are needed for one sample:

(1 / 13.56 Mhz) * 128 * 13 = 0.123 ms

So we have each 0.123ms one sample. As reference voltage the AVR internal 2.56V is used, the results are 10 bit values, so to get the voltage in Volt use the following formula:

Vin = float(result) / 1024 * 2.56V = float(result) / 400V

Parameters
[in]protocolused to execute the command
[in]PortMeasured port (same variable as in brp_DHWCtrl_PortGet())
[in]CountCount of taken measurements.
[out]Voltages
[out]Voltages_len
[in]mempoolis used to store response data. Maybe NULL to use an internal mempool, in this case the data is only available until another command uses the internal mempool