Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ CONFIG_LLEXT_HEAP_SIZE=16
CONFIG_LLEXT_STORAGE_WRITABLE=n

CONFIG_CAN=y
CONFIG_SPI=y

# OpenOCD programs internal flash; the loader reads the sketch directly through
# its memory-mapped secure address. The board's flash controller is disabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
* - user LED aliases: user_led0 -> GPIO port 8 pin 5, user_led1 -> GPIO port 8 pin 4
* - user buttons: SW_1 -> GPIO port 5 pin 0, SW_2 -> GPIO port 2 pin 0
* - serial console: uart3 -> scb3 on pins P6_3/P6_2
* - Arduino SPI header: scb2 on P7.0/P7.1/P7.2, with P7.3 as GPIO chip select
*
* The upstream board DTS does not define an Arduino Uno R3 header or a PWM/ADC
* alias table, so this file maps the board-defined GPIOs directly instead of
* inventing a non-existent Arduino header pin map.
* The board has Uno R3-compatible headers, but the upstream DTS does not define
* Arduino pin aliases. This variant maps its selected GPIOs and SCB2 SPI route.
*/

&flash0 {
Expand All @@ -33,16 +33,21 @@

/ {
zephyr,user {
digital-pin-gpios = <&gpio_prt5 0 0>, /* D0 / SW_1 */
<&gpio_prt2 0 0>, /* D1 / SW_2 */
<&gpio_prt8 5 GPIO_ACTIVE_LOW>, /* D2 / LED_0 */
<&gpio_prt8 4 GPIO_ACTIVE_LOW>; /* D3 / LED_1 */
digital-pin-gpios = <&gpio_prt5 0 0>, /* D0 / SW_1 */
<&gpio_prt2 0 0>, /* D1 / SW_2 */
<&gpio_prt8 5 GPIO_ACTIVE_LOW>, /* D2 / LED_0 */
<&gpio_prt8 4 GPIO_ACTIVE_LOW>, /* D3 / LED_1 */
<&gpio_prt7 3 0>, /* D4 / SPI SS (J3.3) */
<&gpio_prt7 0 0>, /* D5 / SPI SCK (J3.6) */
<&gpio_prt7 1 0>, /* D6 / SPI MOSI (J3.4) */
<&gpio_prt7 2 0>; /* D7 / SPI MISO (J3.5) */

builtin-led-gpios = <&gpio_prt8 5 GPIO_ACTIVE_LOW>,
<&gpio_prt8 4 GPIO_ACTIVE_LOW>;
<&gpio_prt8 4 GPIO_ACTIVE_LOW>;

serials = <&uart3>;
cans = <&can1>;
spis = <&scb2>;
};
};

Expand All @@ -52,4 +57,37 @@

&rtc0 {
status = "okay";
};
};

&gpio_prt7 {
status = "okay";
};

/* SPI changes its divider at runtime; keep CAN on its own divider. */
&peri0_group4_16_5bit_1 {
status = "okay";
clock-div = <1>;
};

&scb2 {
compatible = "infineon,spi";
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
clocks = <&peri0_group4_16_5bit_1>;
pinctrl-0 = <&p7_0_scb2_spi_m_clk &p7_1_scb2_spi_m_mosi
&p7_2_scb2_spi_m_miso>;
pinctrl-names = "default";
};

&p7_0_scb2_spi_m_clk {
drive-push-pull;
};

&p7_1_scb2_spi_m_mosi {
drive-push-pull;
};

&p7_2_scb2_spi_m_miso {
input-enable;
};
32 changes: 23 additions & 9 deletions variants/kit_psc3m5_evk_psc3m5fds2afq1/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
/*
* Minimal Arduino-style pin map for the Infineon KIT_PSC3M5_EVK.
*
* This board exposes its real GPIOs in the Zephyr DTS and we mapped the
* Arduino-style aliases to the actual board-defined GPIOs in the overlay.
* The mapping here is intentionally conservative and matches the board's
* runtime GPIO layout without inventing a non-existent Uno R3 header.
* This board has Uno R3-compatible headers, but the upstream DTS does not
* define Arduino aliases. The SPI aliases map to the documented header signals
* on P7.0-P7.3 through the variant overlay.
*/

#define PINS_COUNT (4u)
#define NUM_DIGITAL_PINS (4u)
#define PINS_COUNT (8u)
#define NUM_DIGITAL_PINS (8u)
#define NUM_ANALOG_INPUTS (0u)
#define NUM_ANALOG_OUTPUTS (0u)

Expand All @@ -33,11 +32,26 @@
#define PIN_D1 (1u)
#define PIN_D2 (2u)
#define PIN_D3 (3u)
#define PIN_D4 (4u)
#define PIN_D5 (5u)
#define PIN_D6 (6u)
#define PIN_D7 (7u)

#define PIN_SPI_SS (PIN_D4)
#define PIN_SPI_SCK (PIN_D5)
#define PIN_SPI_MOSI (PIN_D6)
#define PIN_SPI_MISO (PIN_D7)

static const uint8_t SS = PIN_SPI_SS;
static const uint8_t SCK = PIN_SPI_SCK;
static const uint8_t MOSI = PIN_SPI_MOSI;
static const uint8_t MISO = PIN_SPI_MISO;

#define SPI_HOWMANY (1u)

/*
* If the board gains ADC-capable GPIOs in the future, these can be mapped here
* and exposed as A0..A7 in the same way as the rest of the ArduinoCore-zephyr
* variants. For now the board DTS only exposes the user GPIOs/LEDs and UART.
* If ADC inputs are enabled for this variant, map them here and expose them as
* A0..A7 in the same way as the rest of the ArduinoCore-zephyr variants.
*/
#define PIN_A0 (0u)
#define PIN_A1 (1u)
Expand Down
Loading