|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
SCI8 -> J-Link OB CDC console formatters for usb_host_keyboard. More...
#include <stdint.h>#include "ra8_board_ek_ra8d2.h"#include "ra8_err.h"#include "usb_host_keyboard_steps.h"Go to the source code of this file.
Functions | |
| uint8_t | hid_nibble_to_hex (uint32_t nibble) |
| Format one nibble (0..15) into an uppercase hex character. | |
| uint32_t | hid_str_len (const char *text) |
| Bounded ASCII string length (cap k_hid_print_cap). | |
| ra8_err_t | hid_sci_write (const uint8_t *data, uint32_t len) |
| Push a literal block over SCI8 polled. | |
| ra8_err_t | hid_print (const char *text) |
| Print a NUL-terminated ASCII string over the console. | |
| ra8_err_t | hid_print_dec (uint32_t value) |
| Print a uint32_t as ASCII decimal. | |
| ra8_err_t | hid_print_hex (uint32_t value, uint8_t digits) |
| Print a value as fixed-width uppercase hex. | |
| ra8_err_t | hid_print_fail (const char *what, ra8_err_t err) |
| Print "FAIL <what> err=0xNNNNNNNN" on its own line. | |
SCI8 -> J-Link OB CDC console formatters for usb_host_keyboard.
The text-formatting console cluster carved out of usb_host_keyboard/main.c so each translation unit stays under the 1000-line cap. These helpers push fixed strings, decimal counts, and fixed-width hex tokens over SCI8 (the J-Link OB CDC bridge, 115200) using polled TX. The host-side ladder in main.c calls them; the prototypes and the shared formatter enums live in usb_host_keyboard_steps.h. Pure code move – no logic change.
Definition in file usb_host_keyboard_console.c.
| uint8_t hid_nibble_to_hex | ( | uint32_t | nibble | ) |
Format one nibble (0..15) into an uppercase hex character.
| [in] | nibble | 4-bit value. |
| '0' | For a zero nibble. |
Definition at line 31 of file usb_host_keyboard_console.c.
References k_hid_hex_digit_split.
Referenced by hid_print_hex().
|
nodiscard |
Print a NUL-terminated ASCII string over the console.
| [in] | text | String to print (CR/LF included by the caller). |
| k_ra8_ok | All bytes queued. |
text is non-NULL. text is NUL-terminated within k_hid_print_cap bytes. Definition at line 56 of file usb_host_keyboard_console.c.
Referenced by hid_print_fail().
|
nodiscard |
Print a uint32_t as ASCII decimal.
| [in] | value | Value to print. |
| k_ra8_ok | All bytes queued. |
Definition at line 61 of file usb_host_keyboard_console.c.
Print "FAIL <what> err=0xNNNNNNNN" on its own line.
| [in] | what | Short description of the failed step. |
| [in] | err | Error code returned by the step. |
| k_ra8_ok | The diagnostic line is queued. |
what is NUL-terminated within the print cap. Definition at line 99 of file usb_host_keyboard_console.c.
|
nodiscard |
Print a value as fixed-width uppercase hex.
| [in] | value | Value to print. |
| [in] | digits | Hex digit count (4 for u16, 8 for u32). |
| k_ra8_ok | All bytes queued. |
digits is at most k_hid_hex_chars_u32. Definition at line 85 of file usb_host_keyboard_console.c.
Referenced by hid_print_fail().
|
nodiscard |
Push a literal block over SCI8 polled.
| [in] | data | Buffer to send. |
| [in] | len | Byte count. |
| k_ra8_ok | All bytes queued. |
data is non-NULL; SCI8 init already ran. len excludes any NUL terminator. Definition at line 51 of file usb_host_keyboard_console.c.
References ra8_board_uart_console_write().
Referenced by hid_print(), hid_print_dec(), and hid_print_hex().
| uint32_t hid_str_len | ( | const char * | text | ) |
Bounded ASCII string length (cap k_hid_print_cap).
| [in] | text | NUL-terminated string. |
| 0 | For an empty string. |
text is non-NULL. text points to readable storage of at least the length. Definition at line 39 of file usb_host_keyboard_console.c.
References k_hid_print_cap.
Referenced by hid_print().