zmk/app/drivers/sensor/battery/battery_common.h
Peter Johanson 3a958c667f refactor: Move to zephyr/ include paths.
* Zephyr moved to properly namespaced headers, so major "rip
  the bandaid" commit to move us to those everywhere.
2023-04-05 22:55:38 -07:00

22 lines
447 B
C

/*
* Copyright (c) 2021 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#pragma once
#include <zephyr/drivers/sensor.h>
#include <stdint.h>
struct battery_value {
uint16_t adc_raw;
uint16_t millivolts;
uint8_t state_of_charge;
};
int battery_channel_get(const struct battery_value *value, enum sensor_channel chan,
struct sensor_value *val_out);
uint8_t lithium_ion_mv_to_pct(int16_t bat_mv);