#ifndef SETTINGS_MGMT_H #define SETTINGS_MGMT_H #include 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