Ares LoRa Firmware
Loading...
Searching...
No Matches
settings.h File Reference

Ares-LoRa settings manager. More...

#include <zephyr/kernel.h>
Include dependency graph for settings.h:

Go to the source code of this file.

Macros

#define FOREACH_ARES_SETTING(FUNC)
#define GENERATE_ENUM(setting_, ...)

Enumerations

enum  ares_setting { ARES_SETTING_RESERVED }

Functions

int update_setting (enum ares_setting setting, uint32_t value)
int retrieve_setting (enum ares_setting setting, uint32_t *value)
void reset_settings (void)

Detailed Description

Ares-LoRa settings manager.

Date
3/27/26
Author
Tom Schmitz <tschm.nosp@m.itz@.nosp@m.andre.nosp@m.w.cm.nosp@m.u.edu>

Macro Definition Documentation

◆ FOREACH_ARES_SETTING

#define FOREACH_ARES_SETTING ( FUNC)
Value:
FUNC(ID, 0, 1, 0xFFFF) \
FUNC(WAIT_USB_HOST, 0, 0, 1) \
FUNC(PANID, 0, 0, 0xFFFF) \
FUNC(REPCNT, 10, 1, 0xFFFFFFFF)

The settings for Ares-LoRa, their defaults, and bounds.

  • Node ID
  • Wait for USB
  • Personal Area Network ID
  • Repetition count

Format: setting name, default value, minimum value, maximum value.

Parameters
FUNCThe generator macro function.

◆ GENERATE_ENUM

#define GENERATE_ENUM ( setting_,
... )
Value:
UTIL_CAT(ARES_SETTING_, setting_),

Helper for generating the enumerations for Ares-LoRa settings.

Parameters
setting_The setting name.

Enumeration Type Documentation

◆ ares_setting

Represents various settings for Ares-LoRa.

Note
This enumeration is automatically with FOREACH_ARES_SETTING and GENERATE_ENUM. Please refer to FOREACH_ARES_SETTING to get a complete list of settings generated.
Enumerator
ARES_SETTING_RESERVED 

Reserved settings enumerator indicating the last setting.

Function Documentation

◆ reset_settings()

void reset_settings ( void )

Resets all the settings to their default values.

◆ retrieve_setting()

int retrieve_setting ( enum ares_setting setting,
uint32_t * value )

Read the given setting value.

Parameters
[in]settingThe setting to read.
[out]valueA pointer to the container for the setting.
Returns
0 on success.
-EINVAL if setting is invalid or value is NULL.

◆ update_setting()

int update_setting ( enum ares_setting setting,
uint32_t value )

Write a new value for a setting.

Parameters
[in]settingThe setting to update.
[in]valueThe new value of the setting.
Returns
0 on success.
-EINVAL if setting is invalid.
-ERANGE if the setting is out of range.
negative error code otherwise.