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

kymo_core_memory.h Source File

API contracts in their original English. Navigation and guides are bilingual.
Go to the documentation of this file.
1/* SPDX-License-Identifier: MIT */
9#ifndef KYMO_CORE_MEMORY_H
10#define KYMO_CORE_MEMORY_H
11#include "kymo_types.h"
12#if KYMO_EFFECTIVE_MEMORY || defined(DOXYGEN)
13
14#ifdef __cplusplus
15extern "C"
16{
17#endif
18
24#define KYMO_MEMORY_STACK_PEAK 1u
25
31#define KYMO_MEMORY_HEAP_FREE 2u
32
38#define KYMO_MEMORY_HEAP_MIN_FREE 3u
39
45#define KYMO_MEMORY_NAME_MAX 16u
46
53#define KYMO_MEMORY_FRAME_MAX_SIZE (12u + KYMO_MEMORY_NAME_MAX)
54
62 typedef struct
63 {
65 const char *pName;
66
69
71 uint8_t kind;
72
74 uint8_t channel;
76
86 typedef uint8_t (*KymoMemoryReadFn)(void *pContext, size_t entryIndex, uint32_t *pSizeBytes);
87
93 typedef struct
94 {
97
100
103
106
109
111 uint16_t infoPeriodMs;
113#if KYMO_EFFECTIVE_CORE || defined(DOXYGEN)
114
125
132#endif
133#ifdef __cplusplus
134}
135#endif
136#endif
137#endif
KymoStatus KymoCoreMemory_init(const KymoCoreMemoryConfig *pConfig)
Initialize memory and activate its processing in Core Main.
uint8_t(*) KymoMemoryReadFn(void *pContext, size_t entryIndex, uint32_t *pSizeBytes)
Reads one entry's current value.
void KymoCoreMemory_requestInfo(void)
Request another complete round of memory descriptions.
Status codes and callback types shared by every KymoCore module.
uint8_t KymoStatus
Result of a KymoCore operation.
Definition kymo_types.h:40
Application configuration for memory.
size_t entryCount
Number of entries, 1..KYMO_MAX_MEMORY_ENTRIES.
uint16_t infoPeriodMs
Description repeat interval in milliseconds; zero disables repetition.
KymoMemoryReadFn readBytesCbk
Required reader of one memory measurement, in bytes.
void * pReadContext
Read callback context.
const KymoMemoryEntry * pEntriesAv
Persistent memory-entry table.
uint16_t samplePeriodMs
Sample interval in milliseconds, nonzero.
One reported value.
const char * pName
Name shown by the host, e.g. the task name; NULL means empty.
uint8_t kind
KYMO_MEMORY_STACK_PEAK, KYMO_MEMORY_HEAP_FREE or KYMO_MEMORY_HEAP_MIN_FREE.
uint8_t channel
DATA channel of the samples; unique, not used by measurements.
uint32_t totalSizeBytes
Size of the stack or heap in bytes; 0 when unknown.