LEGO MINDSTORMS EV3 Battery

Schema identifier ($id): "http://devicetree.org/schemas/power/supply/lego,ev3-battery.yaml#"

Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"

Maintainers (maintainers): "David Lechner <david@lechnology.com>", "Sebastian Reichel <sre@kernel.org>"

LEGO MINDSTORMS EV3 has some built-in capability for monitoring the battery. It uses 6 AA batteries or a special Li-ion rechargeable battery pack that is detected by a key switch in the battery compartment.

All of these rules must match (allOf) #

Rule 1 #

Shared schema rule ($ref): power-supply.yaml#

Properties and child nodes (properties) #

compatible — required here #

Exact value (const): "lego,ev3-battery"

io-channels — required here #

Array item rules (items) #

Item 1

ADC channel for battery voltage

Item 2

ADC channel for battery current

io-channel-names — required here #

Array item rules (items) #

Item 1

Exact value (const): "voltage"

Item 2

Exact value (const): "current"

rechargeable-gpios — required here #

Maximum number of items (maxItems): 1

Rechargeable battery indication gpio

Required in this object (required): "compatible", "io-channels", "io-channel-names", "rechargeable-gpios"

Properties not matched by properties or patternProperties in this schema (additionalProperties) #

false

Not allowed by this rule.

Examples (examples) #

#include <dt-bindings/gpio/gpio.h>
battery {
  compatible = "lego,ev3-battery";
  io-channels = <&adc 4>, <&adc 3>;
  io-channel-names = "voltage", "current";
  rechargeable-gpios = <&gpio 136 GPIO_ACTIVE_LOW>;
};

Source notes #

Annotations retained from the schema source

Line 1: SPDX-License-Identifier: GPL-2.0

Edit this page