ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_err.h
Go to the documentation of this file.
1
75
76#pragma once
77
78#ifdef __cplusplus
79extern "C" {
80#endif
81
82#include <stdint.h>
83
84/* =============================================================================
85 * Error Code Enum
86 * =============================================================================
87 */
88
108typedef enum : uint16_t {
109 /* =========================================================================
110 * Success
111 * =========================================================================
112 */
113
120
121 /* =========================================================================
122 * Generic errors (0x100 -- 0x1FF)
123 * General-purpose failures not tied to a specific peripheral or bus
124 * =========================================================================
125 */
126
133 k_ra8_fail = 0x101,
134
143
153
162
168
174
181
189
196
203
211
217
223
230
236
246
259
277
278 /* =========================================================================
279 * Hardware errors (0x200 -- 0x2FF)
280 * Peripheral, GPIO, and hardware-interface errors
281 * =========================================================================
282 */
283
291
299
305
311
319
326
332
338
346
347 /* =========================================================================
348 * RTOS errors (0x300 -- 0x3FF)
349 * Reserved for the future RTOS. Unused in the bare-metal v0.x build.
350 * =========================================================================
351 */
352
358
364
370
376
382
388
389 /* =========================================================================
390 * Communication errors (0x400 -- 0x4FF)
391 * Bus-level and protocol-level failures
392 * =========================================================================
393 */
394
400
406
412
418
424
430
436
442
448
449 /* =========================================================================
450 * Validation errors (0x500 -- 0x5FF)
451 * Raised by ra8_check.h helpers and explicit pre/post-condition checks
452 * =========================================================================
453 */
454
460
466
472
479
490
500
510
521
533
547
548/* =============================================================================
549 * Helpers
550 * =============================================================================
551 */
552
568static inline bool ra8_err_is_error(ra8_err_t err)
569{
570 return err != k_ra8_ok;
571}
572
599const char* ra8_err_to_str(ra8_err_t err);
600
601#ifdef __cplusplus
602}
603#endif
ra8_err_codes_t
Canonical error code list for ra8-firmware.
Definition ra8_err.h:108
@ k_ra8_err_rtos_mutex
Mutex API error (reserved for future use).
Definition ra8_err.h:375
@ k_ra8_err_retry_limit
Retry budget exhausted – operation still failing after all attempts.
Definition ra8_err.h:447
@ k_ra8_err_hw_init_failed
Hardware peripheral failed to initialise.
Definition ra8_err.h:290
@ k_ra8_err_not_supported
Requested feature not compiled in, not wired, or not supported by this MCU variant.
Definition ra8_err.h:180
@ k_ra8_err_crc_mismatch
CRC mismatch detected on received data.
Definition ra8_err.h:423
@ k_ra8_err_no_mem
Static buffer exhausted (no dynamic memory on this project).
Definition ra8_err.h:142
@ k_ra8_err_empty
Container empty – nothing to retrieve.
Definition ra8_err.h:222
@ k_ra8_err_busy
Resource busy – blocking operation cannot proceed.
Definition ra8_err.h:195
@ k_ra8_err_rtos_thread_create
Thread create failed (reserved for future use).
Definition ra8_err.h:363
@ k_ra8_err_no_data
No application data available (e.g.
Definition ra8_err.h:202
@ k_ra8_err_decomp_ratio
Compression ratio bound breached (ra8_decomp_limits_t).
Definition ra8_err.h:499
@ k_ra8_err_would_block
Non-blocking operation would have blocked.
Definition ra8_err.h:210
@ k_ra8_err_not_empty
Container still holds members – the operation requires it empty.
Definition ra8_err.h:258
@ k_ra8_err_hw_unmapped
Peripheral register block is not mapped in this MCU variant.
Definition ra8_err.h:345
@ k_ra8_err_spi_error
SPI transfer failed (bus fault, mode fault, overrun, ...).
Definition ra8_err.h:405
@ k_ra8_err_checksum_mismatch
Stored / transmitted checksum does not match computed value.
Definition ra8_err.h:465
@ k_ra8_fail
Generic unspecified failure.
Definition ra8_err.h:133
@ k_ra8_err_out_of_range
Sensor or peripheral output out of valid range.
Definition ra8_err.h:337
@ k_ra8_err_invalid_arg
Invalid function argument.
Definition ra8_err.h:152
@ k_ra8_err_exists
Item already exists – cannot create again.
Definition ra8_err.h:216
@ k_ra8_err_invalid_state
Module in wrong state for requested operation.
Definition ra8_err.h:161
@ k_ra8_err_hw_timeout
Hardware timed out waiting for a flag or handshake.
Definition ra8_err.h:304
@ k_ra8_err_validation_failed
Validation rule failed (caller-supplied invariant not satisfied).
Definition ra8_err.h:459
@ k_ra8_err_decomp_output_cap
Decompression output cap breached (ra8_decomp_limits_t).
Definition ra8_err.h:489
@ k_ra8_err_range_check_failed
Value outside range enforced by RA8_CHECK_RANGE / RA8_CHECK_RANGE_TAG.
Definition ra8_err.h:471
@ k_ra8_err_not_initialized
Module not initialized – _init() not yet called successfully.
Definition ra8_err.h:235
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
Definition ra8_err.h:119
@ k_ra8_err_null_ptr
Pointer was NULL where a valid pointer was required.
Definition ra8_err.h:478
@ k_ra8_err_hw_not_ready
Hardware peripheral exists but not ready yet.
Definition ra8_err.h:298
@ k_ra8_err_rtos_queue
Queue / message API error (reserved for future use).
Definition ra8_err.h:381
@ k_ra8_err_hw_error
Generic hardware fault detected (error flag set, fault interrupt).
Definition ra8_err.h:310
@ k_ra8_err_rtos_error
Generic RTOS error (reserved for future use).
Definition ra8_err.h:357
@ k_ra8_err_gpio_invalid_pin
GPIO pin index out of range within its port (valid: 0..15).
Definition ra8_err.h:331
@ k_ra8_err_estop
Emergency stop active – operation forbidden until cleared.
Definition ra8_err.h:245
@ k_ra8_err_access_denied
Operation refused because the target is protected against it.
Definition ra8_err.h:276
@ k_ra8_err_protocol_error
Protocol-level error (e.g.
Definition ra8_err.h:429
@ k_ra8_err_gpio_conflict
GPIO pin already owned by another peripheral or driver.
Definition ra8_err.h:318
@ k_ra8_err_decomp_iterations
Decode-loop iteration budget exhausted (ra8_decomp_limits_t).
Definition ra8_err.h:531
@ k_ra8_err_uart_error
UART / SCI error (framing, parity, overrun, break).
Definition ra8_err.h:411
@ k_ra8_err_i2c_error
I2C / IIC error (arbitration lost, NACK, timeout, bus error).
Definition ra8_err.h:417
@ k_ra8_err_timeout
Operation exceeded its time budget.
Definition ra8_err.h:188
@ k_ra8_err_not_found
Requested item not found (lookup / search missed).
Definition ra8_err.h:173
@ k_ra8_err_comm_error
Generic communication error (use a more specific code when possible).
Definition ra8_err.h:399
@ k_ra8_err_rtos_timer
Timer API error (reserved for future use).
Definition ra8_err.h:387
@ k_ra8_err_cancelled
Operation cancelled before completion.
Definition ra8_err.h:229
@ k_ra8_err_conflict
Conflict with concurrent access detected.
Definition ra8_err.h:441
@ k_ra8_err_decomp_depth
Container nesting-depth cap breached (ra8_decomp_limits_t).
Definition ra8_err.h:520
@ k_ra8_err_rtos_semaphore
Semaphore API error (reserved for future use).
Definition ra8_err.h:369
@ k_ra8_err_nack
Peer responded with NACK (negative acknowledgement).
Definition ra8_err.h:435
@ k_ra8_err_gpio_invalid_port
GPIO port index out of range for this MCU.
Definition ra8_err.h:325
@ k_ra8_err_invalid_size
Invalid size parameter (too large, too small, or misaligned).
Definition ra8_err.h:167
@ k_ra8_err_decomp_entries
Archive entry-count cap breached (ra8_decomp_limits_t).
Definition ra8_err.h:509
static bool ra8_err_is_error(ra8_err_t err)
Test whether a code represents failure.
Definition ra8_err.h:568
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
const char * ra8_err_to_str(ra8_err_t err)
Human-readable string for an error code.
Definition ra8_log.c:737