Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Massive Update: Convert BMS IC code into standard Zephyr driver #37

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/zephyr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ jobs:
cd app
west build -p -b bms_5s50_sc
west build -p -b bms_8s50_ic@0.2 -- -DEXTRA_CONF_FILE=oled.conf -DSHIELD=uext_oled
west build -p -b bms_8s50_ic_f072
west build -p -b bms_15s80_sc
west build -p -b bms_16s100_sc
west build -p -b bms_16s100_sc_esp32c3@0.2
west build -p -b bms_c1@0.4

- name: Run unit-tests
working-directory: bms-firmware
run: |
cd tests
west build -p -b native_posix -t run -- -DDTC_OVERLAY_FILE="boards/bq769x0.overlay"
west build -p -b native_posix -t run -- -DDTC_OVERLAY_FILE="boards/bq769x2.overlay"
west build -p -b native_posix -t run -- -DDTC_OVERLAY_FILE="boards/isl94202.overlay"
west build -p -b native_posix -t run -- -DDTC_OVERLAY_FILE="boards/native_posix.overlay;boards/bq769x2.overlay"
west build -p -b native_posix -t run -- -DDTC_OVERLAY_FILE="boards/native_posix.overlay;boards/isl94202.overlay"
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2021 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
#
# This CMake file is picked by the Zephyr build system because it is defined
# as the module CMake entry point (see zephyr/module.yml).

zephyr_include_directories(include)

add_subdirectory(drivers)
8 changes: 8 additions & 0 deletions Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2021 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
#
# This Kconfig file is picked by the Zephyr build system because it is defined
# as the module Kconfig entry point (see zephyr/module.yml). You can browse
# module options by going to Zephyr -> Modules in Kconfig.

rsource "drivers/Kconfig"
3 changes: 0 additions & 3 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# SPDX-License-Identifier: Apache-2.0

set(BOARD_ROOT ${CMAKE_SOURCE_DIR}/..)
set(DTS_ROOT ${CMAKE_SOURCE_DIR}/..)

cmake_minimum_required(VERSION 3.13.1)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

Expand Down
24 changes: 0 additions & 24 deletions app/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,6 @@ mainmenu "Libre Solar Battery Management System Firmware"
# Invisible (board-specific) Kconfig symbols
#

DT_COMPAT_TI_BQ769X0 := ti,bq769x0
DT_COMPAT_TI_BQ769X2_I2C := ti,bq769x2-i2c
DT_COMPAT_TI_BQ769X2_SPI := ti,bq769x2-spi
DT_COMPAT_RENESAS_ISL94202 := renesas,isl94202

config BQ769X0
bool
default $(dt_compat_enabled,$(DT_COMPAT_TI_BQ769X0))
help
Texas Instruments bq769x0 series used as BMS IC

config BQ769X2
bool
default $(dt_compat_enabled,$(DT_COMPAT_TI_BQ769X2_I2C)) || \
$(dt_compat_enabled,$(DT_COMPAT_TI_BQ769X2_SPI))
help
Texas Instruments bq769x2 series used as BMS IC

config ISL94202
bool
default $(dt_compat_enabled,$(DT_COMPAT_RENESAS_ISL94202))
help
Intersil/Renesas ISL94202 used as BMS IC

config LIBRE_SOLAR_TYPE_ID
int
help
Expand Down
4 changes: 0 additions & 4 deletions app/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,3 @@ target_sources(app PRIVATE
)

zephyr_sources_ifdef(CONFIG_SHIELD_UEXT_OLED oled.c)

add_subdirectory_ifdef(CONFIG_BQ769X0 bq769x0)
add_subdirectory_ifdef(CONFIG_BQ769X2 bq769x2)
add_subdirectory_ifdef(CONFIG_ISL94202 isl94202)
Loading
Loading