function read_voltage extends .Modelica.Icons.Function; import Modelica.Units.SI.Voltage; input .Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.AnalogPort analogPort; input Voltage vref "We need to pass a reference voltage in order to read a voltage"; input Integer voltageResolution "In bits; 10 bit resolution."; output Voltage value "The voltage on the selected PIN"; end read_voltage;