Determining input voltage for switchmode PSU