Relocate and clean up application Kconfig structure
This commit is contained in:
+233
@@ -0,0 +1,233 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# Copyright (c) 2019 Martin Jäger (Libre Solar)
|
||||
|
||||
mainmenu "Libre Solar Charge Controller Firmware"
|
||||
|
||||
#
|
||||
# Invisible (board-specific) Kconfig symbols
|
||||
#
|
||||
|
||||
config CONTROL_FREQUENCY
|
||||
int
|
||||
default 10
|
||||
help
|
||||
Main control function frequency (Hz)
|
||||
|
||||
Frequencies higher than 10 Hz caused issues with MPPT control during lab test with
|
||||
PV simulator. Might be different with actual solar panel.
|
||||
|
||||
config LIBRE_SOLAR_TYPE_ID
|
||||
int
|
||||
help
|
||||
Numeric Libre Solar hardware type ID
|
||||
|
||||
config HS_MOSFET_FAIL_SAFE_PROTECTION
|
||||
bool
|
||||
default y
|
||||
help
|
||||
If enabled, the DC/DC control function will will detect if the high-side MOSFET has failed
|
||||
short and trip the fuse by switching the low-side MOSFET continuously on. This will prevent
|
||||
accidental overcharging of the battery.
|
||||
|
||||
#
|
||||
# Visible (user-configurable) Kconfig symbols
|
||||
#
|
||||
|
||||
menu "Charge Controller Setup"
|
||||
|
||||
choice
|
||||
prompt "High-voltage terminal"
|
||||
depends on $(dt_compat_enabled,dcdc)
|
||||
help
|
||||
Select the device connected to the high-voltage
|
||||
side terminal of the DC/DC converter.
|
||||
|
||||
config HV_TERMINAL_SOLAR
|
||||
bool "Solar panel"
|
||||
|
||||
config HV_TERMINAL_NANOGRID
|
||||
bool "DC nanogrid"
|
||||
|
||||
config HV_TERMINAL_GENERATOR
|
||||
bool "DC generator, e.g. wind turbine"
|
||||
|
||||
config HV_TERMINAL_BATTERY
|
||||
bool "Battery, e.g. electric bicycle"
|
||||
endchoice
|
||||
|
||||
|
||||
choice
|
||||
prompt "Low-voltage terminal"
|
||||
help
|
||||
Select the device connected to the low-voltage side
|
||||
of the charge controller (usually battery terminal).
|
||||
|
||||
config LV_TERMINAL_BATTERY
|
||||
depends on !HV_TERMINAL_BATTERY
|
||||
bool "Battery 12V/24V"
|
||||
|
||||
config LV_TERMINAL_SOLAR
|
||||
depends on HV_TERMINAL_BATTERY || HV_TERMINAL_NANOGRID
|
||||
bool "Solar panel"
|
||||
endchoice
|
||||
|
||||
|
||||
choice
|
||||
prompt "PWM terminal"
|
||||
depends on $(dt_node_has_bool_prop,/outputs/pwm_switch,kconfig-flag)
|
||||
help
|
||||
Select the device connected to the PWM switch (currently
|
||||
only solar panel possible)
|
||||
|
||||
config PWM_TERMINAL_SOLAR
|
||||
depends on LV_TERMINAL_BATTERY && !HV_TERMINAL_SOLAR
|
||||
bool "Solar panel"
|
||||
endchoice
|
||||
|
||||
|
||||
menu "Battery"
|
||||
|
||||
choice
|
||||
prompt "Default battery cell type"
|
||||
default BAT_DEFAULT_TYPE_GEL
|
||||
help
|
||||
Select the type of the single cells inside the battery
|
||||
to determine voltage set points. Total voltage set points
|
||||
are multiplied with the selected number of cells.
|
||||
|
||||
config BAT_DEFAULT_TYPE_FLOODED
|
||||
bool "Flooded (wet) lead-acid"
|
||||
|
||||
config BAT_DEFAULT_TYPE_GEL
|
||||
bool "VRLA gel, maintainance-free"
|
||||
|
||||
config BAT_DEFAULT_TYPE_AGM
|
||||
bool "AGM, maintainance-free"
|
||||
|
||||
config BAT_DEFAULT_TYPE_LFP
|
||||
bool "LiFePO4 Li-ion, 3.3V nominal"
|
||||
|
||||
config BAT_DEFAULT_TYPE_NMC
|
||||
bool "NMC/Graphite Li-ion, 3.7V nominal, 4.2V max"
|
||||
|
||||
config BAT_DEFAULT_TYPE_NMC_HV
|
||||
bool "NMC/Graphite High Voltage Li-ion, 3.7V nominal, 4.35 max"
|
||||
endchoice
|
||||
|
||||
# values must match enum BatType in bat_charger.h
|
||||
config BAT_DEFAULT_TYPE
|
||||
int
|
||||
default 1 if BAT_DEFAULT_TYPE_FLOODED
|
||||
default 2 if BAT_DEFAULT_TYPE_GEL
|
||||
default 3 if BAT_DEFAULT_TYPE_AGM
|
||||
default 4 if BAT_DEFAULT_TYPE_LFP
|
||||
default 5 if BAT_DEFAULT_TYPE_NMC
|
||||
default 6 if BAT_DEFAULT_TYPE_NMC_HV
|
||||
|
||||
config BAT_DEFAULT_NUM_CELLS
|
||||
int "Default number of battery cells"
|
||||
default 6
|
||||
range 3 16
|
||||
help
|
||||
Typical choices:
|
||||
- 6 for 12V lead-acid battery
|
||||
- 4 for 12V LiFePO4 battery
|
||||
- 3 for 12V NMC Li-ion battery
|
||||
|
||||
Remarks:
|
||||
- If you choose settings for 12V system, 24V systems
|
||||
(2 batteries in series) are recognized automatically
|
||||
- Make sure the voltage of the used charge controller
|
||||
is not exceeded.
|
||||
|
||||
config BAT_DEFAULT_CAPACITY_AH
|
||||
int "Default battery capacity in Ah"
|
||||
range 10 200
|
||||
default 50
|
||||
|
||||
endmenu
|
||||
|
||||
endmenu # Terminal configuration
|
||||
|
||||
|
||||
menu "UEXT port"
|
||||
|
||||
config EXT_OLED_DISPLAY
|
||||
bool "OLED display"
|
||||
|
||||
config EXT_OLED_BRIGHTNESS
|
||||
depends on EXT_OLED_DISPLAY
|
||||
int "OLED display brightness"
|
||||
range 1 255
|
||||
default 1
|
||||
|
||||
endmenu # UEXT port
|
||||
|
||||
|
||||
menu "ThingSet interfaces"
|
||||
|
||||
config THINGSET_SERIAL
|
||||
bool "ThingSet serial interface"
|
||||
|
||||
config THINGSET_SERIAL_RX_BUF_SIZE
|
||||
depends on THINGSET_SERIAL
|
||||
int "ThingSet serial RX buffer size"
|
||||
range 64 2048
|
||||
default 512
|
||||
|
||||
config THINGSET_SERIAL_TX_BUF_SIZE
|
||||
depends on THINGSET_SERIAL
|
||||
int "ThingSet serial TX buffer size"
|
||||
range 256 2048
|
||||
default 1024
|
||||
|
||||
config THINGSET_CAN
|
||||
depends on CAN
|
||||
bool "ThingSet CAN interface"
|
||||
|
||||
config THINGSET_CAN_DEFAULT_NODE_ID
|
||||
depends on THINGSET_CAN
|
||||
int "ThingSet CAN default node ID"
|
||||
range 0 255
|
||||
default 20
|
||||
|
||||
config THINGSET_EXPERT_PASSWORD
|
||||
string "ThingSet expert user password"
|
||||
default "expert123"
|
||||
|
||||
config THINGSET_MAKER_PASSWORD
|
||||
string "ThingSet maker password"
|
||||
default "maker456"
|
||||
|
||||
endmenu # ThingSet interfaces
|
||||
|
||||
|
||||
menuconfig CUSTOMIZATION
|
||||
bool "Firmware customization"
|
||||
help
|
||||
Activating this option allows to overwrite existing firmware functions
|
||||
or add customizations independent of the master branch.
|
||||
Custom implementations should be stored in the
|
||||
src/custom subdirectory.
|
||||
|
||||
if CUSTOMIZATION
|
||||
|
||||
config CUSTOM_DATA_NODES_FILE
|
||||
bool "Use custom data nodes file"
|
||||
default n
|
||||
help
|
||||
Use a custom file instead of default data_nodes.cpp for
|
||||
ThingSet configuration.
|
||||
|
||||
config CUSTOM_DCDC_CONTROLLER
|
||||
bool "Custom implementation of DC/DC controller"
|
||||
depends on $(dt_compat_enabled,dcdc)
|
||||
default n
|
||||
help
|
||||
Use a custom implementation instead of the default perturb & observe
|
||||
MPPT control.
|
||||
|
||||
endif
|
||||
|
||||
# include main Zephyr menu entries from Zephyr root directory
|
||||
source "Kconfig.zephyr"
|
||||
+21
-21
@@ -1,38 +1,38 @@
|
||||
# direct printf calls to console
|
||||
CONFIG_STDOUT_CONSOLE=y
|
||||
# Main application configuration (overrides board-specific settings)
|
||||
|
||||
# default is 1024
|
||||
CONFIG_HEAP_MEM_POOL_SIZE=1024
|
||||
|
||||
CONFIG_CPLUSPLUS=y
|
||||
|
||||
CONFIG_NEWLIB_LIBC=y
|
||||
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
|
||||
|
||||
CONFIG_BUILD_OUTPUT_BIN=y
|
||||
|
||||
CONFIG_WATCHDOG=y
|
||||
CONFIG_WDT_DISABLE_AT_BOOT=y
|
||||
|
||||
CONFIG_REBOOT=y
|
||||
|
||||
CONFIG_HWINFO=y
|
||||
|
||||
CONFIG_GPIO=y
|
||||
CONFIG_SERIAL=y
|
||||
CONFIG_I2C=y
|
||||
|
||||
CONFIG_WDT_DISABLE_AT_BOOT=y
|
||||
|
||||
# disable log by default to save memory for STM32F0 with little RAM
|
||||
CONFIG_LOG=y
|
||||
CONFIG_LOG_MINIMAL=y
|
||||
|
||||
#CONFIG_NEWLIB_LIBC_NANO=y
|
||||
CONFIG_NEWLIB_LIBC=y
|
||||
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
|
||||
|
||||
CONFIG_CONSOLE_SUBSYS=y
|
||||
CONFIG_CONSOLE_GETCHAR=y
|
||||
|
||||
CONFIG_CPLUSPLUS=y
|
||||
# direct printf calls to console
|
||||
CONFIG_STDOUT_CONSOLE=y
|
||||
|
||||
CONFIG_HWINFO=y
|
||||
|
||||
CONFIG_BUILD_OUTPUT_BIN=y
|
||||
# use minimal log by default to save memory for STM32F0 with little RAM
|
||||
CONFIG_LOG=y
|
||||
CONFIG_LOG_MINIMAL=y
|
||||
|
||||
# ThingSet protocol interface at UART serial
|
||||
CONFIG_EXT_THINGSET_SERIAL=y
|
||||
CONFIG_THINGSET_SERIAL=y
|
||||
|
||||
# I2C OLED display in UEXT connector
|
||||
#CONFIG_EXT_OLED_DISPLAY=y
|
||||
|
||||
CONFIG_REBOOT=y
|
||||
|
||||
CONFIG_WATCHDOG=y
|
||||
|
||||
Reference in New Issue
Block a user