Add NVS support for relay channel config persistence
- Introduced NVS configuration options in Kconfig. - Implemented NVS initialization and deinitialization in relay_chn_core. - Added functions for storing and retrieving relay channel direction and tilt sensitivity in NVS. - Updated relay_chn_tilt and relay_chn_output to utilize NVS for state management. - Created relay_chn_nvs.c and relay_chn_nvs.h for NVS-related functionalities. Closes #1074.
This commit is contained in:
35
Kconfig
35
Kconfig
@@ -26,4 +26,39 @@ menu "Relay Channel Driver Configuration"
|
||||
at a time. Tilting is specifically designed for controlling some
|
||||
types of curtains that need to be adjusted to let enter specific
|
||||
amount of day light.
|
||||
|
||||
config RELAY_CHN_ENABLE_NVS
|
||||
bool "Enable persistent NVS storage for relay channel"
|
||||
default n
|
||||
help
|
||||
If enabled, relay channel configuration will be stored in NVS.
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Relay Channel NVS Storage Configuration"
|
||||
depends on RELAY_CHN_ENABLE_NVS
|
||||
|
||||
config RELAY_CHN_NVS_NAMESPACE
|
||||
string "NVS namespace for relay channel storage"
|
||||
default "relay_chn"
|
||||
help
|
||||
The NVS namespace used for storing relay channel configuration.
|
||||
This should be unique to avoid conflicts with other components.
|
||||
|
||||
config RELAY_CHN_NVS_CUSTOM_PARTITION
|
||||
bool "Use custom NVS partition for relay channel storage"
|
||||
default n
|
||||
help
|
||||
If enabled, a custom NVS partition will be used for storing
|
||||
relay channel configuration. If disabled, the default NVS
|
||||
partition will be used.
|
||||
|
||||
config RELAY_CHN_NVS_CUSTOM_PARTITION_NAME
|
||||
string "Custom NVS partition name"
|
||||
depends on RELAY_CHN_NVS_CUSTOM_PARTITION
|
||||
default "app_data"
|
||||
help
|
||||
The name of the custom NVS partition used for storing relay channel
|
||||
configuration. Make sure the name is exactly the same as label defined
|
||||
in the relevant partition table.
|
||||
endmenu
|
||||
Reference in New Issue
Block a user