-
-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add Bosch BME6XX driver as submodule
- Disable BME680 support in project configuration - Rename submodule path for BMI270 sensor to align it with the other external drivers - Remove not needed "CONFIG_INPUT" from debug config - Move "SPI RTT Flash Loader" into "ZSWatch" menu - Move CST816S driver into device specific directory - Move GC9A01 driver into device specific directory - Add default configuration menu in Kconfig - Add default idle timeout option to Kconfig - Remove "CONFIG_DISPLAY_FAST_WAKEUP" because it´s not needed anymore Signed-off-by: Daniel Kampert <[email protected]>
- Loading branch information
Showing
26 changed files
with
827 additions
and
97 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
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
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
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 |
---|---|---|
@@ -1 +1,9 @@ | ||
zephyr_sources_ifdef(CONFIG_GC9A01 gc9a01.c) | ||
# TODO: | ||
# Weird compilation issue when not using | ||
# zephyr_library() | ||
# zephyr_library_sources(apds9306.c) | ||
# | ||
# -> ..add_library cannot create target "..__app__drivers__sensor" because another | ||
# -> target with the same name already exists. The existing target is a static... | ||
# | ||
add_subdirectory_ifdef(CONFIG_GC9A01 gc9a01) |
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
rsource "Kconfig.gc9a01" | ||
if DISPLAY | ||
rsource "gc9a01/Kconfig" | ||
endif |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
zephyr_sources(gc9a01.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,6 @@ | ||
menuconfig GC9A01 | ||
bool "GC9A01 compatible display controller driver" | ||
default n | ||
select SPI | ||
help | ||
Enable driver for GC9A01 compatible controller. |
File renamed without changes.
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 |
---|---|---|
@@ -1 +1,9 @@ | ||
zephyr_sources_ifdef(CONFIG_INPUT_MODIFIED_CST816S input_cst816s.c) | ||
# TODO: | ||
# Weird compilation issue when not using | ||
# zephyr_library() | ||
# zephyr_library_sources(apds9306.c) | ||
# | ||
# -> ..add_library cannot create target "..__app__drivers__sensor" because another | ||
# -> target with the same name already exists. The existing target is a static... | ||
# | ||
add_subdirectory_ifdef(CONFIG_INPUT_MODIFIED_CST816S cst816s) |
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 |
---|---|---|
@@ -1,29 +1,3 @@ | ||
# Copyright (c) 2020 Qingsong Gou <[email protected]> | ||
# Copyright (c) 2022 Jakob Krantz <[email protected]> | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
menuconfig INPUT_MODIFIED_CST816S | ||
bool "Use modified out of tree CST816S capacitive touch panel driver" | ||
default y | ||
depends on DT_HAS_HYNITRON_CST816S_ENABLED | ||
select I2C | ||
help | ||
Enable modified out of tree driver for hynitron cst816s touch panel. | ||
|
||
if INPUT_MODIFIED_CST816S | ||
|
||
config INPUT_CST816S_PERIOD | ||
int "Sample period" | ||
depends on !INPUT_CST816S_INTERRUPT | ||
default 20 | ||
help | ||
Sample period in milliseconds when in polling mode. | ||
|
||
config INPUT_CST816S_INTERRUPT | ||
bool "Interrupt support" | ||
default y | ||
depends on GPIO | ||
help | ||
Enable interrupt support (requires GPIO). | ||
|
||
endif # INPUT_CST816S | ||
if INPUT | ||
rsource "cst816s/Kconfig" | ||
endif |
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 @@ | ||
zephyr_sources(input_cst816s.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,29 @@ | ||
# Copyright (c) 2020 Qingsong Gou <[email protected]> | ||
# Copyright (c) 2022 Jakob Krantz <[email protected]> | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
menuconfig INPUT_MODIFIED_CST816S | ||
bool "Use modified out of tree CST816S capacitive touch panel driver" | ||
default y | ||
depends on DT_HAS_HYNITRON_CST816S_ENABLED | ||
select I2C | ||
help | ||
Enable modified out of tree driver for hynitron cst816s touch panel. | ||
|
||
if INPUT_MODIFIED_CST816S | ||
|
||
config INPUT_CST816S_PERIOD | ||
int "Sample period" | ||
depends on !INPUT_CST816S_INTERRUPT | ||
default 20 | ||
help | ||
Sample period in milliseconds when in polling mode. | ||
|
||
config INPUT_CST816S_INTERRUPT | ||
bool "Interrupt support" | ||
default y | ||
depends on GPIO | ||
help | ||
Enable interrupt support (requires GPIO). | ||
|
||
endif # INPUT_CST816S |
File renamed without changes.
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
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
if SENSOR | ||
rsource "apds9306/Kconfig" | ||
endif # SENSOR | ||
rsource "bme68x_iaq/Kconfig" | ||
endif |
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,47 @@ | ||
if(CONFIG_EXTERNAL_USE_BOSCH_BSEC) | ||
zephyr_library_compile_definitions_ifdef(CONFIG_BME68X_IAQ_SAMPLE_RATE_ULTRA_LOW_POWER | ||
BSEC_SAMPLE_RATE=BSEC_SAMPLE_RATE_ULP | ||
BSEC_SAMPLE_PERIOD_S=300 | ||
) | ||
|
||
zephyr_library_compile_definitions_ifdef(CONFIG_BME68X_IAQ_SAMPLE_RATE_LOW_POWER | ||
BSEC_SAMPLE_RATE=BSEC_SAMPLE_RATE_LP | ||
BSEC_SAMPLE_PERIOD_S=3 | ||
) | ||
|
||
zephyr_library_compile_definitions_ifdef(CONFIG_BME68X_IAQ_SAMPLE_RATE_CONTINUOUS | ||
BSEC_SAMPLE_RATE=BSEC_SAMPLE_RATE_CONT | ||
BSEC_SAMPLE_PERIOD_S=1 | ||
) | ||
|
||
#if (CONFIG_FP_HARDABI) | ||
# if (CONFIG_CPU_CORTEX_M33) | ||
# zephyr_library_import(bsec_lib ${ZEPHYR_BASE}/../modules/lib/bsec/src/cortex-m33/fpv5-sp-d16-hard/libalgobsec.a) | ||
# elseif(CONFIG_CPU_CORTEX_M4) | ||
# zephyr_library_import(bsec_lib ${ZEPHYR_BASE}/../modules/lib/bsec/src/cortex-m4/fpv4-sp-d16-hard/libalgobsec.a) | ||
# else() | ||
# assert(0 "Unsupported configuration.") | ||
# endif() | ||
#else() | ||
# zephyr_library_compile_definitions(BME68X_DO_NOT_USE_FPU) | ||
# if (CONFIG_CPU_CORTEX_M33 OR CONFIG_CPU_CORTEX_M4) | ||
# zephyr_library_import(bsec_lib ${ZEPHYR_BASE}/../modules/lib/bsec/src/cortex-m4/libalgobsec.a) | ||
# else() | ||
# assert(0 "Unsupported configuration.") | ||
# endif() | ||
#endif() | ||
#zephyr_library_sources(bme68x_iaq.c) | ||
|
||
zephyr_sources(bme68x_iaq.c) | ||
|
||
# Add the Bosch BSEC2 library to the project. | ||
zephyr_library_include_directories(${PROJECT_SOURCE_DIR}/src/ext_drivers/BSEC2/algo/normal_version/inc) | ||
set(LIB_DIR ${PROJECT_SOURCE_DIR}/src/ext_drivers/BSEC2/algo/normal_version/bin/gcc/Cortex_M4) | ||
add_library(libalgobsec STATIC IMPORTED PRIVATE) | ||
set_target_properties(libalgobsec PROPERTIES IMPORTED_LOCATION ${LIB_DIR}/libalgobsec.a) | ||
target_link_libraries(app PUBLIC libalgobsec) | ||
|
||
# Add the Bosch BME68X-Sensor-API to the project. | ||
zephyr_library_include_directories(${PROJECT_SOURCE_DIR}/src/ext_drivers/BME68x-Sensor-API) | ||
zephyr_sources(${PROJECT_SOURCE_DIR}/src/ext_drivers/BME68x-Sensor-API/bme68x.c) | ||
endif() |
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,74 @@ | ||
# | ||
# Copyright (c) 2023 Nordic Semiconductor | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
config BME68X_IAQ | ||
bool "Use Bosch BSEC library" | ||
depends on !BME680 | ||
depends on SETTINGS && !SETTINGS_NONE | ||
depends on I2C | ||
help | ||
Enable the use of Bosch BSEC library. | ||
This configuration depends on the BME680 Zephyr driver being disabled. | ||
|
||
if BME68X_IAQ | ||
|
||
config BME68X_IAQ_SAVE_INTERVAL_MINUTES | ||
int "Period in minutes after which BSEC state is saved to flash" | ||
default 60 | ||
|
||
config BME68X_IAQ_THREAD_STACK_SIZE | ||
int "BSEC thread stack size" | ||
default 4096 | ||
|
||
config BME68X_IAQ_EXPECTED_AMBIENT_TEMP | ||
int "Expected ambient temperature in C" | ||
default 25 | ||
|
||
config BME68X_IAQ_TEMPERATURE_OFFSET | ||
int "BSEC temperature offset in centidegrees" | ||
default 200 if BOARD_THINGY91_NRF9160_NS | ||
default 200 if BOARD_THINGY53_NRF5340_CPUAPP | ||
default 200 if BOARD_THINGY53_NRF5340_CPUAPP_NS | ||
default 200 if BOARD_THINGY53_NRF5340_CPUNET | ||
default 100 | ||
help | ||
BSEC temperature offset. To account for external heat sources on the board. | ||
The actual value is divided by 100. This is due to the Kconfig parser | ||
not supporting floating point types. | ||
The default value 200 is translated to 2.0 degrees celsius offset. | ||
|
||
choice BME68X_IAQ_SAMPLE_RATE | ||
prompt "Bosch BSEC sample mode" | ||
default BME68X_IAQ_SAMPLE_RATE_LOW_POWER | ||
help | ||
Configuration that sets how often sensor data is sampled from the BSEC library. | ||
Each mode corresponds an internal preset that decides how often data is sampled from the | ||
BME680. | ||
|
||
config BME68X_IAQ_SAMPLE_RATE_ULTRA_LOW_POWER | ||
bool "BSEC low ultra power mode" | ||
help | ||
Sample data from BSEC severy 300 seconds. | ||
|
||
config BME68X_IAQ_SAMPLE_RATE_LOW_POWER | ||
bool "BSEC low power mode" | ||
help | ||
Sample data from BSEC every 3 seconds. | ||
|
||
config BME68X_IAQ_SAMPLE_RATE_CONTINUOUS | ||
bool "BSEC continuous mode" | ||
help | ||
Sample data from BSEC every second. | ||
This is a particularly power-hungry sample mode that should only be considered for | ||
testing purposes. | ||
|
||
endchoice # BME68X_IAQ_SAMPLE_RATE | ||
|
||
module = BME68X_IAQ | ||
module-str = BME68X_IAQ | ||
source "subsys/logging/Kconfig.template.log_config" | ||
|
||
endif # BME68X_IAQ |
Oops, something went wrong.