forked from kofal.net/zmk
refactor: Move drivers into properly module.
* Align our driver module layout to properly match Zephyr conventions, allowing proper CMake setup to amend the library for each type of driver.
This commit is contained in:
committed by
Pete Johanson
parent
eaeea4bdfa
commit
690bc1bb44
21
app/module/drivers/sensor/battery/battery_common.h
Normal file
21
app/module/drivers/sensor/battery/battery_common.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* 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);
|
||||
Reference in New Issue
Block a user