Kconfig: User-configuration added

This commit is contained in:
Martin Jaeger
2020-01-06 19:05:09 +01:00
parent d654324860
commit 7bd9bdeafd
3 changed files with 198 additions and 26 deletions
+3 -26
View File
@@ -1,32 +1,9 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2019 Martin Jaeger (Libre Solar)
# Copyright (c) 2019 Martin Jäger (Libre Solar)
#
# Generic Libre Solar Charge Controller configuration
#
# Invisible (hardware-specific) Kconfig symbols
source "$(BOARD_DIR)/../../Kconfig.hidden"
config HAS_DCDC_CONVERTER
bool
help
"Board has a DC/DC converter"
config HAS_PWM_SWITCH
bool
help
"PCB has PWM power switch"
config HAS_LOAD_OUTPUT
bool
help
"PCB has a load output"
config NUM_LED_PINS
int
help
"Number of LED pins for charlieplexing"
# Visible (user-configurable) Kconfig symbols
config OLED_DISPLAY
bool "OLED display connected via UEXT"
source "$(BOARD_DIR)/../../Kconfig.user"
+61
View File
@@ -0,0 +1,61 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2019 Martin Jäger (Libre Solar)
#
# Invisible (hardware-specific) Kconfig symbols
#
config DEVICE_TYPE
string
help
Device type name, e.g. MPPT-2420-LC
config HARDWARE_VERSION
string
help
Version of the PCB
config HAS_DCDC_CONVERTER
bool
help
Board has a DC/DC converter.
if HAS_DCDC_CONVERTER
config DCDC_PWM_FREQUENCY_KHZ
int
range 30 100
help
PWM frequency of DC/DC converter in kHz, range 30 to 100.
config DCDC_PWM_DEADTIME_NS
int
range 100 300
help
Dead time for synchronous PWM generation in nanoseconds.
endif # HAS_DCDC_CONVERTER
config HAS_PWM_SWITCH
bool
help
PCB has PWM power switch.
config HAS_LOAD_OUTPUT
bool
help
PCB has a load output.
config NUM_LED_PINS
int
help
Number of LED pins for charlieplexing.
config LOW_SIDE_VOLTAGE_MAX
int
help
Low side (usually battery) voltage maximum.
config HIGH_SIDE_VOLTAGE_MAX
int
help
High side (usually solar panel) voltage maximum.
+134
View File
@@ -0,0 +1,134 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2019 Martin Jäger (Libre Solar)
#
# Visible (user-configurable) Kconfig symbols
#
choice
prompt "High-voltage terminal"
depends on HAS_DCDC_CONVERTER
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 HAS_PWM_SWITCH
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 configuration"
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
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
menu "Extensions and interfaces"
config EXT_OLED_DISPLAY
bool "OLED display at UEXT"
config EXT_OLED_BRIGHTNESS
depends on EXT_OLED_DISPLAY
int "OLED display brightness"
range 1 255
default 1
config EXT_THINGSET_SERIAL
bool "ThingSet serial interface"
config EXT_THINGSET_CAN
depends on CAN
bool "ThingSet CAN interface"
config DEVICE_ID
int "Initial device ID for communication interfaces"
default 0
endmenu