ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_esp_hosted_pins.c
Go to the documentation of this file.
1
27
28#include "ra8_esp_hosted_pins.h"
29
30#include <stdint.h>
31
32#include "ra8_attributes.h"
34#include "ra8_port_constants.h"
35
69
95
109 {.pin = (uint16_t)k_ra8_board_pmod1_irq, .irq = (uint8_t)k_ra8_esp_hosted_irq_pmod1_sideband},
110 {.pin = (uint16_t)k_ra8_board_pmod1_spi_cs, .irq = (uint8_t)k_ra8_esp_hosted_irq_pmod1_cs},
111 {.pin = (uint16_t)k_ra8_board_pmod1_reset, .irq = (uint8_t)k_ra8_esp_hosted_irq_none},
112 {.pin = (uint16_t)k_ra8_board_pmod1_gpio_a, .irq = (uint8_t)k_ra8_esp_hosted_irq_none},
113 {.pin = (uint16_t)k_ra8_board_pmod1_gpio_b, .irq = (uint8_t)k_ra8_esp_hosted_irq_none},
114};
115
125static const uint32_t s_ra8_esp_hosted_irq_map_rows =
126 (uint32_t)(sizeof(s_ra8_esp_hosted_irq_map) / sizeof(s_ra8_esp_hosted_irq_map[0]));
127
132{
133 const uint16_t wanted = (uint16_t)pin;
134
135 for (uint32_t row = 0U; row < s_ra8_esp_hosted_irq_map_rows; row++) {
136 if (s_ra8_esp_hosted_irq_map[row].pin == wanted) {
137 return s_ra8_esp_hosted_irq_map[row].irq;
138 }
139 }
140
141 return (uint8_t)k_ra8_esp_hosted_irq_none;
142}
Annotation-attribute framework macros for ra8-firmware.
Board-identity, LEDs, switches, display, audio, Arduino, Pmod, and MikroBUS portion of the EK-RA8D2 v...
@ k_ra8_board_pmod1_spi_cs
Pmod1.1 CS (SS2/IRQ14), P804.
@ k_ra8_board_pmod1_gpio_a
Pmod1.9 GPIO, P412.
@ k_ra8_board_pmod1_gpio_b
Pmod1.10 GPIO, P413.
@ k_ra8_board_pmod1_irq
Pmod1.7 IRQ (IRQ11-DS), P006.
@ k_ra8_board_pmod1_reset
Pmod1.8 RESET, P402.
ra8_board_eth_pin_t pin
Pin.
static const uint32_t s_ra8_esp_hosted_irq_map_rows
Row count of s_ra8_esp_hosted_irq_map.
struct ra8_esp_hosted_irq_route ra8_esp_hosted_irq_route_row_t
static const ra8_esp_hosted_irq_route_row_t s_ra8_esp_hosted_irq_map[]
Pin-to-ICU-channel routing for every Pmod1 net the link may use.
ra8_esp_hosted_irq_route_t
ICU channel numbers the EK-RA8D2 board layer records for Pmod1.
@ k_ra8_esp_hosted_irq_pmod1_sideband
IRQ11, the channel P006 (J26-7) is routed to.
@ k_ra8_esp_hosted_irq_pmod1_cs
IRQ14, the channel P804 (J26-1) is routed to.
uint8_t ra8_esp_hosted_pin_irq_num(ra8_port_pin_t pin)
Implementation of ra8_esp_hosted_pin_irq_num() – linear scan over a compile-time-sized routing table,...
THE single point of change for the RA8 <-> ESP32-C6 harness map.
@ k_ra8_esp_hosted_irq_none
No ICU channel routes this pin.
Typed Port / Pin Constants for the RA8D2 IOPORT Module.
ra8_port_pin_t
Packed (port << 8) | pin pin identifier.
One row of the pin-to-ICU-channel routing table.
uint8_t irq
ICU channel, or k_ra8_esp_hosted_irq_none.
uint16_t pin
Packed RA8_PIN(port, pin) code for the net.