Skip to content

Commit

Permalink
Massive Update: Convert BMS IC code into standard Zephyr driver
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjaeger committed Jan 9, 2024
1 parent 39bbaea commit f0ff664
Show file tree
Hide file tree
Showing 102 changed files with 6,198 additions and 4,974 deletions.
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

0 comments on commit f0ff664

Please sign in to comment.