|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Bounded console formatters for the C6 Wi-Fi join application. More...
#include <stddef.h>#include <stdint.h>#include "c6_join.h"#include "ra8_board_ek_ra8d2.h"#include "ra8_c6link.h"Go to the source code of this file.
Functions | |
| void | c6_join_puts (const char *text) |
| Write a NUL-terminated string to the board console. | |
| void | c6_join_put_u32 (uint32_t value) |
| Implementation of c6_join_put_u32() – reversed division loop. | |
| void | c6_join_put_hex (uint32_t value, uint8_t digits) |
| Emit a value as a fixed-width lower-case hexadecimal field. | |
| void | c6_join_put_ip (uint32_t ip) |
| Implementation of c6_join_put_ip() – four octets, dot-separated. | |
| void | c6_join_put_mac (const ra8_c6link_mac_t *mac) |
| Emit an IEEE 802 address as six colon-separated hexadecimal octets. | |
| void | c6_join_print_banner (uint32_t cpuclk_hz, uint32_t pclka_hz) |
| Print the banner: identity, clocks and link parameters. | |
Bounded console formatters for the C6 Wi-Fi join application.
Small serialisers – string, unsigned decimal, hexadecimal, IPv4 dotted quad and MAC address – plus the banner. They exist so the application can narrate itself without dragging newlib's printf (and its heap) into a bare-metal image that has no heap at all. Every loop here is bounded by a constant from c6_join.h (NASA Power of 10 Rule 2).
Definition in file c6_join_console.c.
| void c6_join_print_banner | ( | uint32_t | cpuclk_hz, |
| uint32_t | pclka_hz ) |
Print the banner: identity, clocks and link parameters.
Emits the application identity followed by measured CPU and peripheral clocks and immutable C6 transport geometry.
| [in] | cpuclk_hz | Live CPUCLK0 rate in hertz. |
| [in] | pclka_hz | Live PCLKA rate in hertz, the SCI baud-clock source. |
Definition at line 104 of file c6_join_console.c.
References c6_join_put_u32(), c6_join_puts(), k_c6_join_sck_hz, k_ra8_board_pmod1_sci_channel, k_ra8_c6link_frame_bytes, and k_ra8_c6link_max_payload.
Referenced by main().
| void c6_join_put_hex | ( | uint32_t | value, |
| uint8_t | digits ) |
Emit a value as a fixed-width lower-case hexadecimal field.
Extracts one nibble per requested digit from most to least significant position and emits a fixed local character buffer.
| [in] | value | Value to print. |
| [in] | digits | Field width, 1..k_c6_join_hex_digits; an out-of-range width prints nothing rather than overrunning the array. |
digits is within 1..k_c6_join_hex_digits. digits characters were emitted, or none on a bad width. digits (NASA Rule 2). Definition at line 58 of file c6_join_console.c.
References k_c6_join_hex_alpha, k_c6_join_hex_bits, k_c6_join_hex_digits, k_c6_join_hex_mask, and ra8_board_uart_console_write().
Referenced by c6_join_phase_ready(), and c6_join_put_mac().
| void c6_join_put_ip | ( | uint32_t | ip | ) |
Implementation of c6_join_put_ip() – four octets, dot-separated.
Emit a packed IPv4 address as a dotted quad.
Definition at line 75 of file c6_join_console.c.
References c6_join_put_u32(), c6_join_puts(), k_c6_join_ip_mask, k_c6_join_ip_octets, k_c6_join_ip_shift_0, k_c6_join_ip_shift_1, k_c6_join_ip_shift_2, and k_c6_join_ip_shift_3.
Referenced by c6_join_phase_ip().
| void c6_join_put_mac | ( | const ra8_c6link_mac_t * | mac | ) |
Emit an IEEE 802 address as six colon-separated hexadecimal octets.
Walks the fixed address extent in wire order, printing two hex digits per octet and a colon between adjacent octets.
| [in] | mac | Address to print; null prints nothing. |
mac was filled by ra8_c6link_wifi_mac or is the zero address. Definition at line 91 of file c6_join_console.c.
References c6_join_put_hex(), c6_join_puts(), k_c6_join_hex_byte, k_ra8_c6link_mac_bytes, and ra8_c6link_mac::octet.
Referenced by c6_join_phase_associate().
| void c6_join_put_u32 | ( | uint32_t | value | ) |
Implementation of c6_join_put_u32() – reversed division loop.
Emit an unsigned 32-bit value in decimal.
Definition at line 40 of file c6_join_console.c.
References k_c6_join_dec_digits, k_c6_join_dec_radix, and ra8_board_uart_console_write().
Referenced by c6_join_phase_associate(), c6_join_phase_ready(), c6_join_print_banner(), c6_join_put_ip(), and c6_join_worker_entry().
| void c6_join_puts | ( | const char * | text | ) |
Write a NUL-terminated string to the board console.
Measures at most the fixed string bound and forwards the resulting byte extent to the initialized board-console transmitter.
| [in] | text | String to emit; null is ignored and the length is capped at k_c6_join_str_max. |
text is NUL-terminated within k_c6_join_str_max bytes. Definition at line 27 of file c6_join_console.c.
References k_c6_join_str_max, and ra8_board_uart_console_write().
Referenced by c6_join_heartbeat(), c6_join_phase_associate(), c6_join_phase_ip(), c6_join_phase_ready(), c6_join_print_banner(), c6_join_put_ip(), c6_join_put_mac(), c6_join_report_fault(), c6_join_worker_entry(), main(), and tx_application_define().