1 /* 2 * Copyright (c) 2023 The ChromiumOS Authors 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef __MEAS_H__ 8 #define __MEAS_H__ 9 10 /** 11 * @brief Initializes the measurement module, sets up all the adc channels through the device tree 12 * binding 13 * 14 * @return 0 on success 15 */ 16 int meas_init(void); 17 18 /** 19 * @brief Measure the voltage on VBUS 20 * 21 * @param v pointer where VBUS voltage, in millivolts, is stored 22 * 23 * @return 0 on success 24 */ 25 int meas_vbus_v(int32_t *v); 26 27 /** 28 * @brief Measure the current on VBUS 29 * 30 * @param c pointer where VBUS current, in milliamperes, is stored 31 * 32 * @return 0 on success 33 */ 34 int meas_vbus_c(int32_t *c); 35 36 #endif 37