ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_port_constants.h
Go to the documentation of this file.
1
42
43#pragma once
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
49#include <stdint.h>
50
51/* =============================================================================
52 * Port indices
53 * =============================================================================
54 */
55
83
84/* =============================================================================
85 * Pin indices within a port
86 * =============================================================================
87 */
88
113
114/* =============================================================================
115 * Packed port+pin type (matches FSP BSP_IO_PORT_XX_PIN_YY layout)
116 * =============================================================================
117 */
118
147typedef enum : uint16_t {
148 k_ra8_pin_none = 0xFFFFU,
149
150 /* ---- On-board LEDs on the EK-RA8D2 (from FSP board_leds.c). ------- */
151 k_ra8_pin_led1 = 0x0600U,
152 k_ra8_pin_led2 = 0x0303U,
153 k_ra8_pin_led3 = 0x0A07U,
154
155 /* ---- Parallel Graphics Expansion Board 1 GPIO control (J1 + UM Table 33). */
159
166#define RA8_PIN(port, pin) ((ra8_port_pin_t)(((uint16_t)(port) << 8) | (uint16_t)(pin)))
167
173#define RA8_PIN_PORT(p) ((ra8_port_t)(((uint16_t)(p) >> 8) & 0xFFU))
174
180#define RA8_PIN_PIN(p) ((ra8_pin_t)((uint16_t)(p) & 0xFFU))
181
182/* =============================================================================
183 * Pin direction / level / pull
184 * =============================================================================
185 */
186
188typedef enum : uint8_t {
192
194typedef enum : uint8_t {
198
200typedef enum : uint8_t {
205
213
214#ifdef __cplusplus
215}
216#endif
ra8_port_pin_t
Packed (port << 8) | pin pin identifier.
@ k_ra8_pin_lcd_reset_l
J1-6 RST, P606 (active-low).
@ k_ra8_pin_none
Sentinel: no pin selected.
@ k_ra8_pin_lcd_blen
J1-1 BLEN, P514 (active-high).
@ k_ra8_pin_led2
LED2 on P3_03 – (port 3 << 8) | pin 3.
@ k_ra8_pin_led3
LED3 on P10_07 – (port 10 << 8) | pin 7.
@ k_ra8_pin_led1
LED1 on P6_00 – (port 6 << 8) | pin 0.
ra8_port_t
Port indices for the RA8D2 IOPORT module.
@ k_ra8_port_count
Number of ports (0..14).
@ k_ra8_port_13
RA8 port 13.
@ k_ra8_port_14
RA8 port 14.
@ k_ra8_port_12
RA8 port 12.
@ k_ra8_port_9
RA8 port 9.
@ k_ra8_port_7
RA8 port 7.
@ k_ra8_port_3
RA8 port 3.
@ k_ra8_port_11
RA8 port 11.
@ k_ra8_port_2
RA8 port 2.
@ k_ra8_port_6
RA8 port 6.
@ k_ra8_port_4
RA8 port 4.
@ k_ra8_port_max
Highest valid port index.
@ k_ra8_port_5
RA8 port 5.
@ k_ra8_port_0
RA8 port 0.
@ k_ra8_port_8
RA8 port 8.
@ k_ra8_port_1
RA8 port 1.
@ k_ra8_port_10
RA8 port 10.
ra8_level_t
Digital output / input level.
@ k_ra8_level_high
Drive or read 1.
@ k_ra8_level_low
Drive or read 0.
ra8_pin_t
Pin indices within an IOPORT port (0..15).
@ k_ra8_pin_4
RA8 pin 4.
@ k_ra8_pin_6
RA8 pin 6.
@ k_ra8_pin_11
RA8 pin 11.
@ k_ra8_pin_count
Number of pins per port.
@ k_ra8_pin_7
RA8 pin 7.
@ k_ra8_pin_10
RA8 pin 10.
@ k_ra8_pin_max
Highest valid pin index.
@ k_ra8_pin_1
RA8 pin 1.
@ k_ra8_pin_2
RA8 pin 2.
@ k_ra8_pin_13
RA8 pin 13.
@ k_ra8_pin_12
RA8 pin 12.
@ k_ra8_pin_5
RA8 pin 5.
@ k_ra8_pin_14
RA8 pin 14.
@ k_ra8_pin_9
RA8 pin 9.
@ k_ra8_pin_8
RA8 pin 8.
@ k_ra8_pin_0
RA8 pin 0.
@ k_ra8_pin_3
RA8 pin 3.
@ k_ra8_pin_15
RA8 pin 15.
ra8_pin_dir_t
Pin input / output direction.
@ k_ra8_dir_input
Pin is an input (PDR bit = 0).
@ k_ra8_dir_output
Pin is an output (PDR bit = 1).
ra8_pin_drive_t
Output drive strength (per Hardware User's Manual IOPORT chapter).
@ k_ra8_drive_medium
Medium drive.
@ k_ra8_drive_low
Low drive.
@ k_ra8_drive_highest
Highest drive.
@ k_ra8_drive_high
High drive.
ra8_pin_pull_t
Pull-up/pull-down selection (where supported).
@ k_ra8_pull_down
Internal pull-down.
@ k_ra8_pull_none
No internal pull.
@ k_ra8_pull_up
Internal pull-up.