feat: add settings mgmt and split debug transport snippets

This commit is contained in:
2026-05-11 16:19:37 +02:00
parent 3fed249430
commit 5ae098962d
15 changed files with 366 additions and 56 deletions

View File

@@ -0,0 +1,34 @@
#ifndef SETTINGS_MGMT_H
#define SETTINGS_MGMT_H
#include <zephyr/types.h>
struct app_settings_t {
/* System */
char dev_name[33];
/* Audio */
uint8_t vol;
uint8_t shuffle_mode; /* 0: Rnd, 1: No-Rep */
/* BLE */
uint32_t ble_timeout; /* Seconds, 0xFFFFFFFF = forever */
uint16_t ble_interval; /* Milliseconds */
/* Power & Calibration */
uint8_t chg_mode; /* 0: 500mA, 1: 1A, 2: Auto */
uint16_t off_threshold;/* mV */
int16_t adc_gain;
int16_t adc_offset;
};
/* Global access to the current runtime configuration */
extern struct app_settings_t app_cfg;
/* Initializes the settings subsystem and loads values from flash */
int settings_mgmt_init(void);
/* Sets a setting via string path (for your protocol) */
int settings_mgmt_set_by_path(const char *path, const void *value, size_t len);
#endif