| // Copyright 2025 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| library fuchsia.hardware.ti.metadata; |
| |
| type Mode = flexible enum : uint16 { |
| SHUNT_AND_BUS_CONTINUOUS = 7; |
| }; |
| |
| type ConversionTime = flexible enum : uint16 { |
| CONVERSION_TIME_332US = 2; |
| }; |
| |
| type Averages = flexible enum : uint16 { |
| AVERAGES_1024 = 7; |
| }; |
| |
| type Alert = flexible enum : uint16 { |
| NONE = 0; |
| BUS_UNDER_VOLTAGE = 4096; |
| }; |
| |
| /// Metadata for the ti-ina231 driver. |
| @serializable |
| type Ina231Metadata = table { |
| 1: mode Mode; |
| |
| 2: shunt_voltage_conversion_time ConversionTime; |
| |
| 3: bus_voltage_conversion_time ConversionTime; |
| |
| 4: averages Averages; |
| |
| /// Shunt resistance in micro-ohms. May not be zero. |
| 5: shunt_resistance_microohm uint64; |
| |
| /// Bus voltage limit in micro-volts. Resolution is 1250 uV regardless of |
| /// other settings. Only used if |alert| is not `NONE`. |
| 6: bus_voltage_limit_microvolt uint64; |
| |
| 7: alert Alert; |
| |
| 8: power_sensor_domain uint32; |
| }; |