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

kymo_core_memory.h File Reference

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

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

#include "kymo_types.h"

Go to the source code of this file.

Classes

struct  KymoMemoryEntry
 One reported value. More...
struct  KymoCoreMemoryConfig
 Application configuration for memory. More...

Macros

#define KYMO_MEMORY_STACK_PEAK   1u
 Kind: peak stack use of a task in bytes (stack size minus watermark).
#define KYMO_MEMORY_HEAP_FREE   2u
 Kind: free heap bytes now.
#define KYMO_MEMORY_HEAP_MIN_FREE   3u
 Kind: lowest free heap bytes since start.
#define KYMO_MEMORY_NAME_MAX   16u
 Longest entry name in bytes; longer names are cut.
#define KYMO_MEMORY_FRAME_MAX_SIZE   (12u + KYMO_MEMORY_NAME_MAX)
 Largest frame KymoMemory_nextInfo produces.

Typedefs

typedef uint8_t(*) KymoMemoryReadFn(void *pContext, size_t entryIndex, uint32_t *pSizeBytes)
 Reads one entry's current value.

Functions

KymoStatus KymoCoreMemory_init (const KymoCoreMemoryConfig *pConfig)
 Initialize memory and activate its processing in Core Main.
void KymoCoreMemory_requestInfo (void)
 Request another complete round of memory descriptions.

Detailed Description

Complete application interface for the default Core memory feature.

Configuration is copied; referenced tables, buffers and callback contexts must remain alive. No heap or application-owned dispatcher state is required.

Usage Enable the feature, initialize Core, initialize this feature, call Core Main.

Definition in file kymo_core_memory.h.

Macro Definition Documentation

◆ KYMO_MEMORY_FRAME_MAX_SIZE

#define KYMO_MEMORY_FRAME_MAX_SIZE   (12u + KYMO_MEMORY_NAME_MAX)

Largest frame KymoMemory_nextInfo produces.

Sync (2), descriptor, length, operation, channel, kind, total (4), name, CRC.

Usage
Declare uint8_t frame[KYMO_MEMORY_FRAME_MAX_SIZE] for KymoMemory_nextInfo.

Definition at line 53 of file kymo_core_memory.h.

◆ KYMO_MEMORY_HEAP_FREE

#define KYMO_MEMORY_HEAP_FREE   2u

Kind: free heap bytes now.

Usage
{ "heap", total, KYMO_MEMORY_HEAP_FREE, 221u }

Definition at line 31 of file kymo_core_memory.h.

◆ KYMO_MEMORY_HEAP_MIN_FREE

#define KYMO_MEMORY_HEAP_MIN_FREE   3u

Kind: lowest free heap bytes since start.

Usage
{ "heap", total, KYMO_MEMORY_HEAP_MIN_FREE, 222u }

Definition at line 38 of file kymo_core_memory.h.

◆ KYMO_MEMORY_NAME_MAX

#define KYMO_MEMORY_NAME_MAX   16u

Longest entry name in bytes; longer names are cut.

Usage
Keep task names short, as FreeRTOS does (configMAX_TASK_NAME_LEN).

Definition at line 45 of file kymo_core_memory.h.

◆ KYMO_MEMORY_STACK_PEAK

#define KYMO_MEMORY_STACK_PEAK   1u

Kind: peak stack use of a task in bytes (stack size minus watermark).

Usage
{ "parser", 4096u, KYMO_MEMORY_STACK_PEAK, 220u }

Definition at line 24 of file kymo_core_memory.h.

Typedef Documentation

◆ KymoMemoryReadFn

typedef uint8_t(*) KymoMemoryReadFn(void *pContext, size_t entryIndex, uint32_t *pSizeBytes)

Reads one entry's current value.

Parameters
[in]pContextApplication context from pReadContext.
[in]entryIndexIndex into the configured pEntriesAv table.
[out]pSizeBytesValue in bytes (convert words to bytes here).
Returns
1 when bytes holds a value, 0 to skip this sample.
Usage
static uint8_t read(void *c, size_t i, uint32_t *b) { *b = stack_size[i] - 4u * uxTaskGetStackHighWaterMark(task[i]); return 1u; }

Definition at line 86 of file kymo_core_memory.h.

Function Documentation

◆ KymoCoreMemory_init()

KymoStatus KymoCoreMemory_init ( const KymoCoreMemoryConfig * pConfig)

Initialize memory and activate its processing in Core Main.

Call once after Core Init and before the first Main. Setup errors latch a Core fault; late calls are rejected without altering the running Core. No callbacks are invoked periodically until Core Main runs. Not ISR-safe.

Parameters
[in]pConfigPersistent referenced data and callbacks; NULL is invalid.
Returns
OK, BAD_CONFIG, REJECTED, or an existing Core error.
Usage Check success before entering the common main loop.

◆ KymoCoreMemory_requestInfo()

void KymoCoreMemory_requestInfo ( void )

Request another complete round of memory descriptions.

No effect before successful Init. Main transmits the descriptions later.

Usage Call from the Core task when the host needs refreshed labels.