ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
c6_console.c File Reference

Bounded console formatters for the ESP32-C6 SPI probe. More...

#include <stddef.h>
#include <stdint.h>
#include "c6_probe.h"
#include "ra8_board_ek_ra8d2.h"
Include dependency graph for c6_console.c:

Go to the source code of this file.

Functions

void c6_probe_puts (const char *text)
 Emit a bounded, NUL-terminated ASCII literal on the console.
void c6_probe_put_u32 (uint32_t value)
 Implementation of c6_probe_put_u32() – reversed division loop.
void c6_probe_put_hex (uint32_t value, uint8_t digits)
 Emit a value as fixed-width lowercase hexadecimal.

Detailed Description

Bounded console formatters for the ESP32-C6 SPI probe.

Tag
[Ring 6 / APP] {World: S}

Three tiny serialisers – string, decimal and hexadecimal – so the probe can narrate itself without dragging newlib's printf (and its heap and reentrancy machinery) into a bare-metal image. Every loop here is bounded by a constant from c6_probe.h.

Since
0.1.0

Definition in file c6_console.c.

Function Documentation

◆ c6_probe_put_hex()

void c6_probe_put_hex ( uint32_t value,
uint8_t digits )

Emit a value as fixed-width lowercase hexadecimal.

Parameters
[in]valueValue to print.
[in]digitsNumber of nibbles to emit (1..8).
Precondition
The board UART console has been initialised.
digits is between one and eight inclusive.
Postcondition
Exactly digits characters were queued when in range.
Nothing is queued when digits is out of range.
Note
Not thread-safe.
See also
c6_probe_put_u32
Since
0.1.0

Definition at line 56 of file c6_console.c.

References k_c6_fmt_hex_alpha, k_c6_fmt_hex_bits, k_c6_fmt_hex_mask, k_c6_fmt_hex_max, and ra8_board_uart_console_write().

Referenced by c6_probe_dump_payload(), and c6_probe_print_header().

◆ c6_probe_put_u32()

void c6_probe_put_u32 ( uint32_t value)

◆ c6_probe_puts()

void c6_probe_puts ( const char * text)

Emit a bounded, NUL-terminated ASCII literal on the console.

Measures the literal with a statically bounded scan (k_c6_probe_str_max) rather than calling strlen, keeping NASA Power of 10 Rule 2 provable without linking newlib string code.

Parameters
[in]textNUL-terminated ASCII string; ignored when NULL.
Precondition
The board UART console has been initialised.
text is NUL-terminated within k_c6_probe_str_max bytes.
Postcondition
At most k_c6_probe_str_max bytes were queued to the console.
text is unmodified.
Note
Not thread-safe; single-threaded logging only.
See also
c6_probe_put_u32
Since
0.1.0

Definition at line 25 of file c6_console.c.

References k_c6_probe_str_max, and ra8_board_uart_console_write().

Referenced by c6_probe_cs_hunt(), c6_probe_dump_payload(), c6_probe_print_header(), c6_probe_print_map(), c6_probe_print_sideband(), c6_probe_print_verdict(), c6_probe_pull_contest(), c6_probe_run(), c6_probe_setup_or_halt(), c6_probe_sweep_mode(), c6_probe_wire_test(), internal_cs_try(), internal_one_xfer(), internal_report_frame(), and main().