File syn_trace.c¶
FileList > debug > syn_trace.c
Go to the source code of this file
Trace buffer implementation.
#include "../util/syn_assert.h"#include "../util/syn_fmt.h"#include "syn_trace.h"#include <string.h>
Public Functions¶
| Type | Name |
|---|---|
| void | syn_trace_clear (SYN_Trace * trace) Clear the trace buffer. |
| void | syn_trace_dump (const SYN_Trace * trace, SYN_TracePrintFunc print) Dump all entries via a print callback. |
| void | syn_trace_enable (SYN_Trace * trace, bool enable) Enable/disable recording. |
| void | syn_trace_init (SYN_Trace * trace, SYN_TraceEntry * entries, uint16_t capacity) Initialize the trace buffer. |
| bool | syn_trace_read (const SYN_Trace * trace, uint32_t index, SYN_TraceEntry * entry) Read an entry by index (0 = oldest available). |
| void | syn_trace_record (SYN_Trace * trace, uint16_t event_id, uint16_t value) Record a trace event. |
Public Functions Documentation¶
function syn_trace_clear¶
Clear the trace buffer.
Parameters:
traceTrace instance to reset.
function syn_trace_dump¶
Dump all entries via a print callback.
Output format: "[tick] event_id=0xNNNN value=0xNNNN\n"
Parameters:
traceTrace instance.printPrint function (e.g., write to UART).
function syn_trace_enable¶
Enable/disable recording.
Parameters:
traceTrace instance.enableTrue to enable recording, false to pause.
function syn_trace_init¶
Initialize the trace buffer.
Parameters:
traceTrace instance to initialize.entriesArray of trace entries (caller-owned).capacityNumber of entries in the array.
function syn_trace_read¶
Read an entry by index (0 = oldest available).
Parameters:
traceTrace instance.indexIndex from oldest available.entryOutput entry.
Returns:
true if a valid entry was read.
function syn_trace_record¶
Record a trace event.
Parameters:
traceTrace instance.event_idApplication-defined event ID.valueOptional 16-bit payload.
The documentation for this class was generated from the following file src/syntropic/debug/syn_trace.c