|
SDK for TESAIoT Dev Kit
API reference & tutorials (ModusToolbox)
|
Functions | |
| bool | ai_engine_init (void) |
| Create the inference task (idempotent); it must precede ai_engine_start(). | |
| bool | ai_engine_start (uint32_t index) |
| Activate a model (or set) by index and begin inferring; check the return. | |
| void | ai_engine_stop (void) |
| Stop the active model (idempotent); pair with a sensor-rate walk-down. | |
| int | ai_engine_active (void) |
| The LOADED model, or -1; lags requested by a cold-init window. | |
| int | ai_engine_requested (void) |
| The REQUESTED model, or -1; the correct guard for a fallback. | |
| uint32_t | ai_engine_stack_words (void) |
| Stack the inference task got, in words; 0 = engine never started — the universal gate. | |
| uint32_t | ai_engine_stack_free_words (void) |
| All-time minimum of unused stack words; O(stack) scan — read at ~1 Hz at most. | |
Seven functions: create the inference task, start and stop a model, read which model is requested versus loaded, and the two stack readings that gate everything else. Read The select → confirm → start discipline before using any of them.
| bool ai_engine_init | ( | void | ) |
Create the inference task (idempotent); it must precede ai_engine_start().
Create the inference task (idle until ai_engine_start). Idempotent; must precede ai_engine_start(). If it fails, ai_engine_stack_words() returns 0.
| bool ai_engine_start | ( | uint32_t | index | ) |
Activate a model (or set) by index and begin inferring; check the return.
Activate a model by registry index, or a set by set index, and begin inferring. Stops whatever was running first. Returns false on a bad index, a set index in an image built without a microphone model, or an engine that never started (see ai_engine_init). A model whose own init() fails is reported later: ai_engine_requested() drops back to -1.
| void ai_engine_stop | ( | void | ) |
Stop the active model (idempotent); pair with a sensor-rate walk-down.
Stop the active model (idempotent).
| int ai_engine_active | ( | void | ) |
The LOADED model, or -1; lags requested by a cold-init window.
Index of the active model, or -1 when idle.
| int ai_engine_requested | ( | void | ) |
The REQUESTED model, or -1; the correct guard for a fallback.
Index of the REQUESTED model (last ai_engine_start), or -1 when stopped. Leads ai_engine_active() until the requested model has finished loading, and drops to -1 if its init() fails. Guard a default-model fallback on this, never on ai_engine_active().
| uint32_t ai_engine_stack_words | ( | void | ) |
Stack the inference task got, in words; 0 = engine never started — the universal gate.
Stack the inference task actually got, in words; 0 if it was never created. Reported on the Edge AI page so a heap squeeze is visible, not silent.
| uint32_t ai_engine_stack_free_words | ( | void | ) |
All-time minimum of unused stack words; O(stack) scan — read at ~1 Hz at most.
Unused words left in the inference task's stack (all-time minimum); 0 if the task was never created. Read at about 1 Hz — the call scans the stack.