-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: drivers: build_all: fuel_gauge: Add devices to build test
Add build tests for the following devices. - maxim,max17048 - ti,bq27z746 - sbs,sbs-gauge-new-api - zephyr,fuel-gauge-composite Signed-off-by: TOKITA Hiroshi <[email protected]>
- Loading branch information
Showing
6 changed files
with
132 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright (c) 2024 TOKITA Hiroshi | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
cmake_minimum_required(VERSION 3.20.0) | ||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) | ||
project(build_all) | ||
|
||
target_sources(app PRIVATE src/main.c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Copyright (c) 2024 TOKITA Hiroshi | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <zephyr/dt-bindings/i2c/i2c.h> | ||
|
||
/ { | ||
test { | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
test_gpio: gpio@deadbeef { | ||
compatible = "vnd,gpio"; | ||
gpio-controller; | ||
reg = <0xdeadbeef 0x1000>; | ||
#gpio-cells = <0x2>; | ||
status = "okay"; | ||
}; | ||
|
||
test_i2c: i2c@11112222 { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
compatible = "vnd,i2c"; | ||
reg = <0x11112222 0x1000>; | ||
status = "okay"; | ||
clock-frequency = <I2C_BITRATE_STANDARD>; | ||
|
||
#include "i2c.dtsi" | ||
}; | ||
|
||
test_adc: adc@adc0adc0 { | ||
compatible = "vnd,adc"; | ||
reg = <0xadc0adc0 0x1000>; | ||
#io-channel-cells = <1>; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
status = "okay"; | ||
|
||
channel@0 { | ||
reg = <0>; | ||
zephyr,gain = "ADC_GAIN_1"; | ||
zephyr,reference = "ADC_REF_VDD_1"; | ||
zephyr,acquisition-time = <0>; | ||
}; | ||
}; | ||
|
||
test_vbatt: vbatt { | ||
compatible = "voltage-divider"; | ||
io-channels = <&test_adc 0>; | ||
output-ohms = <180000>; | ||
full-ohms = <(1500000 + 180000)>; | ||
power-gpios = <&gpio0 16 0>; | ||
}; | ||
|
||
test_fuel_gauge: fuel_gauge { | ||
compatible = "zephyr,fuel-gauge-composite"; | ||
status = "okay"; | ||
battery-voltage = <&test_vbatt>; | ||
device-chemistry = "lithium-ion-polymer"; | ||
ocv-capacity-table-0 = <0>; | ||
charge-full-design-microamp-hours = <1350000>; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright (c) 2024 TOKITA Hiroshi | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/**************************************** | ||
* PLEASE KEEP REG ADDRESSES SEQUENTIAL * | ||
***************************************/ | ||
|
||
max17048@0 { | ||
compatible = "maxim,max17048"; | ||
reg = <0x0>; | ||
status = "okay"; | ||
}; | ||
|
||
bq27z746@1 { | ||
compatible = "ti,bq27z746"; | ||
reg = <0x1>; | ||
status = "okay"; | ||
}; | ||
|
||
sbs-gauge-new-api@2 { | ||
compatible = "sbs,sbs-gauge-new-api"; | ||
reg = <0x2>; | ||
status = "okay"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CONFIG_FUEL_GAUGE=y | ||
CONFIG_SENSOR=y | ||
CONFIG_GPIO=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* Copyright (c) 2024 TOKITA Hiroshi | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
int main(void) | ||
{ | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (c) 2024 TOKITA hiroshi | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
tests: | ||
drivers.fuel_gauge.build: | ||
tags: | ||
- drivers | ||
- fuel_gauge | ||
build_only: true | ||
platform_allow: | ||
- native_sim | ||
|
||
drivers.fuel_gauge.emul.build: | ||
tags: | ||
- drivers | ||
- fuel_gauge | ||
build_only: true | ||
platform_allow: | ||
- native_sim | ||
extra_configs: | ||
- CONFIG_EMUL=y |