KymoCore/Documentation
v8.0.0 Stable⌄
Versions8.0.0 Current
GitHub ↗
KYMOCORE / API REFERENCE

kymo_core_param.h File Reference

API contracts in their original English. Navigation and guides are bilingual.

Complete application interface for the default Core parameter feature. More...

#include "kymo_types.h"

Go to the source code of this file.

Classes

struct  KymoParameter
 One parameter the host may write. More...
struct  KymoCoreParamConfig
 Parameter-only configuration for the default Core. More...

Macros

#define KYMO_PARAM_NAME_MAX   24u
 Longest parameter name in bytes, without terminator.
#define KYMO_PARAM_UNIT_MAX   8u
 Longest unit text in bytes, without terminator.
#define KYMO_PARAM_FRAME_MAX_SIZE   (19u + KYMO_PARAM_NAME_MAX + KYMO_PARAM_UNIT_MAX)
 Largest parameter control frame: one description with maximum name and unit.
#define KYMO_PARAM(id_, variable_, minimum_, maximum_, unit_)
 Table entry for a variable; the variable's name becomes the parameter name.

Functions

KymoStatus KymoCoreParam_init (const KymoCoreParamConfig *pConfig)
 Initialize parameters and activate their processing in Core Main.

Detailed Description

Complete application interface for the default Core parameter feature.

No receiver or dispatcher state is exposed. Table, names, units and target variables must outlive Core processing. Calls run in the Core task; synchronize access to targets with other tasks/ISRs as required by the device.

Usage Include with kymo_core.h; configure the table, then call Param Init.

Definition in file kymo_core_param.h.

Macro Definition Documentation

◆ KYMO_PARAM

#define KYMO_PARAM ( id_,
variable_,
minimum_,
maximum_,
unit_ )
Value:
{(uint8_t)(id_), &(variable_), (float)(minimum_), (float)(maximum_), #variable_, (unit_)}

Table entry for a variable; the variable's name becomes the parameter name.

Expands to a KymoParameter initializer. Each argument is used once; the name is the variable expression as written, e.g. "kp" or "ctrl.kp".

Parameters
id_Wire ID (0..255), unique in the table.
variable_A float lvalue the host may write.
minimum_Smallest accepted value.
maximum_Largest accepted value.
unit_Unit text such as "°C", or "" for none.
Usage
static const KymoParameter params[] = { KYMO_PARAM(100, kp, 0.0f, 10.0f, "") };

Definition at line 56 of file kymo_core_param.h.

◆ KYMO_PARAM_FRAME_MAX_SIZE

#define KYMO_PARAM_FRAME_MAX_SIZE   (19u + KYMO_PARAM_NAME_MAX + KYMO_PARAM_UNIT_MAX)

Largest parameter control frame: one description with maximum name and unit.

Sync (2), descriptor, length, 14 fixed payload bytes, name, unit and CRC.

Usage
Use at least KYMO_PARAM_FRAME_MAX_SIZE bytes for the Core TX buffer.

Definition at line 41 of file kymo_core_param.h.

◆ KYMO_PARAM_NAME_MAX

#define KYMO_PARAM_NAME_MAX   24u

Longest parameter name in bytes, without terminator.

Parameter Init rejects longer names.

Usage
Keep variable names used with KYMO_PARAM within this length.

Definition at line 25 of file kymo_core_param.h.

◆ KYMO_PARAM_UNIT_MAX

#define KYMO_PARAM_UNIT_MAX   8u

Longest unit text in bytes, without terminator.

Parameter Init rejects longer units.

Usage
Short units such as "°C" or "rpm".

Definition at line 33 of file kymo_core_param.h.

Function Documentation

◆ KymoCoreParam_init()

KymoStatus KymoCoreParam_init ( const KymoCoreParamConfig * pConfig)

Initialize parameters and activate their processing in Core Main.

Uses feature-owned static storage; no heap or separate registration. Requires a configured Core with RX and sufficient TX storage. Call once before the first Main. Setup failure latches a Core configuration fault; calls after Main are rejected without changing the running Core.

Parameters
[in]pConfigTable configuration; NULL is invalid.
Returns
OK, BAD_CONFIG, REJECTED, or the previously latched Core error.
Usage Check success before entering the common main loop. Not ISR-safe.