|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Typed Port / Pin Constants for the RA8D2 IOPORT Module. More...
#include <stdint.h>Go to the source code of this file.
Macros | |
| #define | RA8_PIN(port, pin) |
| Build a ra8_port_pin_t from explicit port / pin indices. | |
| #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. | |
Enumerations | |
| enum | ra8_port_t : uint8_t { k_ra8_port_0 = 0U , k_ra8_port_1 = 1U , k_ra8_port_2 = 2U , k_ra8_port_3 = 3U , k_ra8_port_4 = 4U , k_ra8_port_5 = 5U , k_ra8_port_6 = 6U , k_ra8_port_7 = 7U , k_ra8_port_8 = 8U , k_ra8_port_9 = 9U , k_ra8_port_10 = 10U , k_ra8_port_11 = 11U , k_ra8_port_12 = 12U , k_ra8_port_13 = 13U , k_ra8_port_14 = 14U , k_ra8_port_count = 15U , k_ra8_port_max = 14U } |
| Port indices for the RA8D2 IOPORT module. More... | |
| enum | ra8_pin_t : uint8_t { k_ra8_pin_0 = 0U , k_ra8_pin_1 = 1U , k_ra8_pin_2 = 2U , k_ra8_pin_3 = 3U , k_ra8_pin_4 = 4U , k_ra8_pin_5 = 5U , k_ra8_pin_6 = 6U , k_ra8_pin_7 = 7U , k_ra8_pin_8 = 8U , k_ra8_pin_9 = 9U , k_ra8_pin_10 = 10U , k_ra8_pin_11 = 11U , k_ra8_pin_12 = 12U , k_ra8_pin_13 = 13U , k_ra8_pin_14 = 14U , k_ra8_pin_15 = 15U , k_ra8_pin_count = 16U , k_ra8_pin_max = 15U } |
| Pin indices within an IOPORT port (0..15). More... | |
| enum | ra8_port_pin_t : uint16_t { k_ra8_pin_none = 0xFFFFU , k_ra8_pin_led1 = 0x0600U , k_ra8_pin_led2 = 0x0303U , k_ra8_pin_led3 = 0x0A07U , k_ra8_pin_lcd_reset_l = 0x0606U , k_ra8_pin_lcd_blen = 0x050EU } |
| Packed (port << 8) | pin pin identifier. More... | |
| enum | ra8_pin_dir_t : uint8_t { k_ra8_dir_input = 0U , k_ra8_dir_output = 1U } |
| Pin input / output direction. More... | |
| enum | ra8_level_t : uint8_t { k_ra8_level_low = 0U , k_ra8_level_high = 1U } |
| Digital output / input level. More... | |
| enum | ra8_pin_pull_t : uint8_t { k_ra8_pull_none = 0U , k_ra8_pull_up = 1U , k_ra8_pull_down = 2U } |
| Pull-up/pull-down selection (where supported). More... | |
| enum | ra8_pin_drive_t : uint8_t { k_ra8_drive_low = 0U , k_ra8_drive_medium = 1U , k_ra8_drive_high = 2U , k_ra8_drive_highest = 3U } |
| Output drive strength (per Hardware User's Manual IOPORT chapter). More... | |
Typed Port / Pin Constants for the RA8D2 IOPORT Module.
Provides ra8_port_t, ra8_pin_t, and a packed ra8_port_pin_t type that every GPIO, pin-function-select (PFS) and peripheral-routing API consumes.
A single ra8_port_pin_t encodes both port and pin in 16 bits:
This matches the FSP BSP_IO_PORT_XX_PIN_YY layout exactly, so code can be read against the Hardware User's Manual without mental arithmetic.
Not every port has 16 pins bonded out on the 289-pin BGA. The pin-validator will reject claims against unpopulated pins at runtime. See the Hardware User's Manual chapter 20 ("I/O Ports") for the full availability table.
| LED | ra8_port_pin_t | Raw value |
|---|---|---|
| LED1 | k_ra8_pin_p6_00 | 0x0600 |
| LED2 | k_ra8_pin_p3_03 | 0x0303 |
| LED3 | k_ra8_pin_p10_07 | 0x0A07 |
Definition in file ra8_port_constants.h.
| #define RA8_PIN | ( | port, | |
| pin ) |
Build a ra8_port_pin_t from explicit port / pin indices.
| [in] | port | ra8_port_t value (0..k_ra8_port_max). |
| [in] | pin | ra8_pin_t value (0..k_ra8_pin_max). |
Definition at line 166 of file ra8_port_constants.h.
Referenced by cam_claim_probe_pins(), cam_release_probe_pins(), internal_usbhs_role_select_device(), and priv_ra8_esp_hosted_gpio_decode_pin().
| #define RA8_PIN_PIN | ( | p | ) |
Extract the pin index from a packed ra8_port_pin_t.
| [in] | p | Packed pin id. |
Definition at line 180 of file ra8_port_constants.h.
Referenced by blink_m33_hal_step(), c6_hosted_print_pin(), internal_claim(), internal_flat_index(), internal_glcdc_force_pin_output(), internal_pin_in_range(), ra8_gpio_read(), ra8_gpio_toggle(), ra8_gpio_write(), ra8_pfs_route_peripheral(), and ra8_pfs_set_drive_strength().
| #define RA8_PIN_PORT | ( | p | ) |
Extract the port index from a packed ra8_port_pin_t.
| [in] | p | Packed pin id. |
Definition at line 173 of file ra8_port_constants.h.
Referenced by blink_m33_hal_step(), c6_hosted_print_pin(), internal_claim(), internal_flat_index(), internal_glcdc_force_pin_output(), internal_pin_in_range(), internal_ra8_epaper_wait_ready(), ra8_gpio_read(), ra8_gpio_toggle(), ra8_gpio_write(), ra8_pfs_route_peripheral(), and ra8_pfs_set_drive_strength().
| enum ra8_level_t : uint8_t |
Digital output / input level.
| Enumerator | |
|---|---|
| k_ra8_level_low | Drive or read 0. |
| k_ra8_level_high | Drive or read 1. |
Definition at line 194 of file ra8_port_constants.h.
| enum ra8_pin_dir_t : uint8_t |
Pin input / output direction.
| Enumerator | |
|---|---|
| k_ra8_dir_input | Pin is an input (PDR bit = 0). |
| k_ra8_dir_output | Pin is an output (PDR bit = 1). |
Definition at line 188 of file ra8_port_constants.h.
| enum ra8_pin_drive_t : uint8_t |
Output drive strength (per Hardware User's Manual IOPORT chapter).
| Enumerator | |
|---|---|
| k_ra8_drive_low | Low drive. |
| k_ra8_drive_medium | Medium drive. |
| k_ra8_drive_high | High drive. |
| k_ra8_drive_highest | Highest drive. |
Definition at line 207 of file ra8_port_constants.h.
| enum ra8_pin_pull_t : uint8_t |
Pull-up/pull-down selection (where supported).
| Enumerator | |
|---|---|
| k_ra8_pull_none | No internal pull. |
| k_ra8_pull_up | Internal pull-up. |
| k_ra8_pull_down | Internal pull-down. |
Definition at line 200 of file ra8_port_constants.h.
| enum ra8_pin_t : uint8_t |
Pin indices within an IOPORT port (0..15).
Definition at line 93 of file ra8_port_constants.h.
| enum ra8_port_pin_t : uint16_t |
Packed (port << 8) | pin pin identifier.
Used by every GPIO, PFS and peripheral-routing API. The encoding matches the FSP BSP_IO_PORT_XX_PIN_YY convention so pinout tables from the Hardware User's Manual can be transcribed verbatim.
For the three on-board LEDs we also provide ready-made k_ra8_pin_led* enumerators below.
Definition at line 147 of file ra8_port_constants.h.
| enum ra8_port_t : uint8_t |
Port indices for the RA8D2 IOPORT module.
The RA8D2 has ports 0..14. Each port's exact pin population depends on the package. Use k_ra8_port_count for loop bounds.
Definition at line 64 of file ra8_port_constants.h.