26static const char*
s_tag =
"PINVAL";
65 *out_index = (uint16_t)(((uint16_t)port * (uint16_t)
k_ra8_pin_count) + (uint16_t)idx);
107 if ((
s_claimed[
byte] & bit_mask) != 0U) {
184 return (
s_claimed[
byte] & bit_mask) != 0U;
203 for (uint16_t i = 0U; i < (uint16_t)
sizeof(
s_claimed); i++) {
static const char * s_tag
Logging / check tag.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
Named Bit Positions and Masks for Register Manipulation.
@ k_ra8_bits_per_byte
Bits in a byte.
ra8_board_eth_pin_t pin
Pin.
Validation and Error-Checking Macros for ra8-firmware.
#define RA8_CHECK_NULL_PTR(ptr, tag, message)
Reject nullptr pointer, returning k_ra8_err_null_ptr.
Error Code Definitions for ra8-firmware.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
@ k_ra8_err_gpio_invalid_pin
GPIO pin index out of range within its port (valid: 0..15).
@ k_ra8_err_gpio_conflict
GPIO pin already owned by another peripheral or driver.
@ k_ra8_err_gpio_invalid_port
GPIO port index out of range for this MCU.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Lightweight Logging Interface for ra8-firmware.
#define ra8_log_error(tag, message)
RA8 log error.
static uint8_t s_claimed[((uint16_t) k_ra8_port_count *(uint16_t) k_ra8_pin_count)/(uint16_t) k_ra8_bits_per_byte]
Bitmap of claimed pins (1 bit per port/pin).
bool ra8_pin_validator_is_claimed(ra8_port_pin_t pin)
Implementation of ra8_pin_validator_is_claimed().
void ra8_pin_validator_reset(void)
Implementation of ra8_pin_validator_reset().
ra8_err_t ra8_pin_validator_claim(ra8_port_pin_t pin, const char *owner)
Implementation of ra8_pin_validator_claim().
static ra8_err_t internal_flat_index(ra8_port_pin_t pin, uint16_t *out_index)
static const char * s_owner[(uint16_t) k_ra8_port_count *(uint16_t) k_ra8_pin_count]
Owner tag for each claimed pin, indexed by flat (port, pin) index.
ra8_err_t ra8_pin_validator_release(ra8_port_pin_t pin)
Implementation of ra8_pin_validator_release().
Runtime Pin-Ownership Validator.
Typed Port / Pin Constants for the RA8D2 IOPORT Module.
ra8_port_pin_t
Packed (port << 8) | pin pin identifier.
@ k_ra8_port_count
Number of ports (0..14).
@ k_ra8_pin_count
Number of pins per port.
#define RA8_PIN_PORT(p)
Extract the port index from a packed ra8_port_pin_t.
#define RA8_PIN_PIN(p)
Extract the pin index from a packed ra8_port_pin_t.