Add single channel mode feature.

The addition of a single-channel mode implied further modularisation of the component. This commit has broken the component down into the following modules to avoid a huge single source file and to make unit testing easier.

The modules:

- Separation of public and private code
- *types and *defs
- public relay_chn API
- *adapter
- *output
- *run_info
- *core
- *ctl (control)
- *tilt

Closes #957.
This commit is contained in:
2025-08-13 17:53:27 +03:00
parent 22668b6759
commit 61f8ed440e
17 changed files with 2453 additions and 1472 deletions

24
include/relay_chn_defs.h Normal file
View File

@@ -0,0 +1,24 @@
/*
* SPDX-FileCopyrightText: 2025 Kozmotronik Tech
*
* SPDX-License-Identifier: MIT
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
/* Config defines for covenient writing */
#define RELAY_CHN_OPPOSITE_INERTIA_MS CONFIG_RELAY_CHN_OPPOSITE_INERTIA_MS
#define RELAY_CHN_COUNT CONFIG_RELAY_CHN_COUNT
#define RELAY_CHN_ENABLE_TILTING CONFIG_RELAY_CHN_ENABLE_TILTING
#if RELAY_CHN_COUNT > 1
#define RELAY_CHN_ID_ALL RELAY_CHN_COUNT /*!< Special ID to address all channels */
#endif
#ifdef __cplusplus
}
#endif