|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Bounded console formatters for the HAL Wi-Fi join application. More...
#include <stddef.h>#include <stdint.h>#include "ra8_board_ek_ra8d2.h"#include "ra8_c6link.h"#include "ra8_wifi.h"#include "wifi_hal_join.h"Go to the source code of this file.
Functions | |
| void | wifi_hal_puts (const char *text) |
| Write a NUL-terminated string to the console, bounded. | |
| void | wifi_hal_put_u32 (uint32_t value) |
| Implementation of wifi_hal_put_u32() – reversed division loop. | |
| void | wifi_hal_put_hex (uint32_t value, uint8_t digits) |
Write the low digits nibbles of a value in hexadecimal. | |
| void | wifi_hal_put_ip (uint32_t ip) |
| Implementation of wifi_hal_put_ip() – four octets, dot-separated. | |
| void | wifi_hal_put_mac (const ra8_wifi_mac_t *mac) |
| Write a station MAC as colon-separated hex octets. | |
| void | wifi_hal_print_banner (uint32_t cpuclk_hz, uint32_t pclka_hz) |
| Print the start-up banner naming the clocks and the link geometry. | |
Bounded console formatters for the HAL 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 wifi_hal_join.h (NASA Power of 10 Rule 2).
Definition in file wifi_hal_console.c.
| void wifi_hal_print_banner | ( | uint32_t | cpuclk_hz, |
| uint32_t | pclka_hz ) |
Print the start-up banner naming the clocks and the link geometry.
Emits application identity, measured clock values, and immutable C6 transport bounds through the bounded console helpers.
| [in] | cpuclk_hz | CPUCLK0 rate in hertz. |
| [in] | pclka_hz | PCLKA rate in hertz. |
Definition at line 106 of file wifi_hal_console.c.
References k_ra8_board_pmod1_sci_channel, k_ra8_c6link_frame_bytes, k_wifi_hal_sck_hz, wifi_hal_put_u32(), and wifi_hal_puts().
Referenced by main().
| void wifi_hal_put_hex | ( | uint32_t | value, |
| uint8_t | digits ) |
Write the low digits nibbles of a value in hexadecimal.
Extracts each requested nibble from most to least significant position and translates it through an immutable lowercase alphabet.
| [in] | value | Value whose low nibbles are printed. |
| [in] | digits | Hex digits to print; 1..k_wifi_hal_hex_digits. |
digits is in range, else the call is a no-op. digits characters were emitted on the valid path. Definition at line 60 of file wifi_hal_console.c.
References k_wifi_hal_hex_alpha, k_wifi_hal_hex_bits, k_wifi_hal_hex_digits, k_wifi_hal_hex_mask, and ra8_board_uart_console_write().
Referenced by wifi_hal_put_mac().
| void wifi_hal_put_ip | ( | uint32_t | ip | ) |
Implementation of wifi_hal_put_ip() – four octets, dot-separated.
Write a packed IPv4 address as a dotted quad.
Definition at line 77 of file wifi_hal_console.c.
References k_wifi_hal_ip_mask, k_wifi_hal_ip_octets, k_wifi_hal_ip_shift_0, k_wifi_hal_ip_shift_1, k_wifi_hal_ip_shift_2, k_wifi_hal_ip_shift_3, wifi_hal_put_u32(), and wifi_hal_puts().
Referenced by wifi_hal_print_lease().
| void wifi_hal_put_mac | ( | const ra8_wifi_mac_t * | mac | ) |
Write a station MAC as colon-separated hex octets.
Walks the fixed address extent in wire order and delegates each two-digit octet conversion while inserting colon separators.
| [in] | mac | Address to print, or null for a no-op. |
mac, when non-null, holds k_ra8_wifi_mac_bytes octets. Definition at line 93 of file wifi_hal_console.c.
References k_ra8_wifi_mac_bytes, k_wifi_hal_hex_byte, ra8_wifi_mac::octet, wifi_hal_put_hex(), and wifi_hal_puts().
Referenced by wifi_hal_report().
| void wifi_hal_put_u32 | ( | uint32_t | value | ) |
Implementation of wifi_hal_put_u32() – reversed division loop.
Write an unsigned 32-bit value in decimal.
Definition at line 42 of file wifi_hal_console.c.
References k_wifi_hal_dec_digits, k_wifi_hal_dec_radix, and ra8_board_uart_console_write().
Referenced by wifi_hal_print_banner(), wifi_hal_put_ip(), and wifi_hal_report().
| void wifi_hal_puts | ( | const char * | text | ) |
Write a NUL-terminated string to the console, bounded.
Measures the string within the application maximum and forwards exactly that byte extent to the initialized board console.
| [in] | text | String to write, or null for a no-op; at most k_wifi_hal_str_max octets are emitted. |
text is NUL-terminated within k_wifi_hal_str_max octets. Definition at line 29 of file wifi_hal_console.c.
References k_wifi_hal_str_max, and ra8_board_uart_console_write().
Referenced by main(), tx_application_define(), wifi_hal_heartbeat(), wifi_hal_print_banner(), wifi_hal_print_lease(), wifi_hal_put_ip(), wifi_hal_put_mac(), wifi_hal_report(), wifi_hal_run(), and wifi_hal_worker_entry().