/* * Copyright (c) 2024 Raspberry Pi (Trading) Ltd. * * SPDX-License-Identifier: BSD-3-Clause */ // ----------------------------------------------------- // NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO // SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES // ----------------------------------------------------- // This header may be included by other board headers as "boards/pico2_w.h" // pico_cmake_set PICO_PLATFORM=rp2350 // pico_cmake_set PICO_CYW43_SUPPORTED = 1 #ifndef _BOARDS_PICO2_W_H #define _BOARDS_PICO2_W_H // For board detection #define PIMORONI_PLASMA2350 #define PIMORONI_PLASMA2350W // --- BOARD SPECIFIC --- #define SPICE_SPI 0 #define SPICE_TX_MISO_PIN 8 #define SPICE_RX_CS_PIN 9 #define SPICE_NETLIGHT_SCK_PIN 10 #define SPICE_RESET_MOSI_PIN 11 #define SPICE_PWRKEY_BL_PIN 7 #define PLASMA2350_SW_A_PIN 12 #define PLASMA2350_CLK_PIN 14 #define PLASMA2350_DATA_PIN 15 #define PLASMA2350_LED_R_PIN 16 #define PLASMA2350_LED_G_PIN 17 #define PLASMA2350_LED_B_PIN 18 #define PLASMA2350_I2C 0 #define PLASMA2350_INT_PIN 19 #define PLASMA2350_SDA_PIN 20 #define PLASMA2350_SCL_PIN 21 #define PLASMA2350_USER_SW_PIN 22 #define PLASMA2350_A0_PIN 26 #define PLASMA2350_A1_PIN 27 #define PLASMA2350_A2_PIN 28 #define PLASMA2350_NUM_ADC_PINS 3 #define PLASMA2350_CURRENT_SENSE_PIN 29 // --- RP2350 VARIANT --- #define PICO_RP2350A 1 // --- UART --- // no PICO_DEFAULT_UART // no PICO_DEFAULT_UART_TX_PIN // no PICO_DEFAULT_UART_RX_PIN // --- LED --- #ifndef PICO_DEFAULT_LED_PIN #define PICO_DEFAULT_LED_PIN TINY2350_LED_G_PIN #endif // no PICO_DEFAULT_WS2812_PIN #ifndef PICO_DEFAULT_LED_PIN_INVERTED #define PICO_DEFAULT_LED_PIN_INVERTED 1 #endif // --- I2C --- // routed to Qw/St connector #ifndef PICO_DEFAULT_I2C #define PICO_DEFAULT_I2C PLASMA2350_I2C #endif #ifndef PICO_DEFAULT_I2C_SDA_PIN #define PICO_DEFAULT_I2C_SDA_PIN PLASMA2350_SDA_PIN #endif #ifndef PICO_DEFAULT_I2C_SCL_PIN #define PICO_DEFAULT_I2C_SCL_PIN PLASMA2350_SCL_PIN #endif // --- SPI --- #ifndef PICO_DEFAULT_SPI #define PICO_DEFAULT_SPI 0 #endif #ifndef PICO_DEFAULT_SPI_SCK_PIN #define PICO_DEFAULT_SPI_SCK_PIN SPICE_NETLIGHT_SCK_PIN #endif #ifndef PICO_DEFAULT_SPI_TX_PIN #define PICO_DEFAULT_SPI_TX_PIN SPICE_RESET_MOSI_PIN #endif #ifndef PICO_DEFAULT_SPI_RX_PIN #define PICO_DEFAULT_SPI_RX_PIN SPICE_TX_MISO_PIN #endif #ifndef PICO_DEFAULT_SPI_CSN_PIN #define PICO_DEFAULT_SPI_CSN_PIN SPICE_RX_CS_PIN #endif // --- FLASH --- #define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1 #ifndef PICO_FLASH_SPI_CLKDIV #define PICO_FLASH_SPI_CLKDIV 2 #endif // pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (4 * 1024 * 1024) #ifndef PICO_FLASH_SIZE_BYTES #define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024) #endif // Drive high to force power supply into PWM mode (lower ripple on 3V3 at light loads) // note the SMSP mode pin is on WL_GPIO1 #ifndef CYW43_WL_GPIO_COUNT #define CYW43_WL_GPIO_COUNT 3 #endif #ifndef CYW43_WL_GPIO_LED_PIN #define CYW43_WL_GPIO_LED_PIN 0 #endif // If CYW43_WL_GPIO_VBUS_PIN is defined then a CYW43 GPIO has to be used to read VBUS. // This can be passed to cyw43_arch_gpio_get to determine if the device is battery powered. // PICO_VBUS_PIN and CYW43_WL_GPIO_VBUS_PIN should not both be defined. #ifndef CYW43_WL_GPIO_VBUS_PIN #define CYW43_WL_GPIO_VBUS_PIN 2 #endif // If CYW43_USES_VSYS_PIN is defined then CYW43 uses the VSYS GPIO (defined by PICO_VSYS_PIN) for other purposes. // If this is the case, to use the VSYS GPIO it's necessary to ensure CYW43 is not using it. // This can be achieved by wrapping the use of the VSYS GPIO in cyw43_thread_enter / cyw43_thread_exit. #ifndef CYW43_USES_VSYS_PIN #define CYW43_USES_VSYS_PIN 1 #endif // The GPIO Pin used to monitor VSYS. Typically you would use this with ADC. // There is an example in adc/read_vsys in pico-examples. #ifndef PICO_VSYS_PIN #define PICO_VSYS_PIN 29 #endif #ifndef PICO_RP2350_A2_SUPPORTED #define PICO_RP2350_A2_SUPPORTED 1 #endif // PICO_CONFIG: CYW43_PIN_WL_DYNAMIC, flag to indicate if cyw43 SPI pins can be changed at runtime, type=bool, default=false, advanced=true, group=pico_cyw43_driver #ifndef CYW43_PIN_WL_DYNAMIC #define CYW43_PIN_WL_DYNAMIC 1 #endif // PICO_CONFIG: CYW43_DEFAULT_PIN_WL_REG_ON, gpio pin to power up the cyw43 chip, type=int, default=23, advanced=true, group=pico_cyw43_driver #ifndef CYW43_DEFAULT_PIN_WL_REG_ON #define CYW43_DEFAULT_PIN_WL_REG_ON 23u #endif // PICO_CONFIG: CYW43_DEFAULT_PIN_WL_DATA_OUT, gpio pin for spi data out to the cyw43 chip, type=int, default=24, advanced=true, group=pico_cyw43_driver #ifndef CYW43_DEFAULT_PIN_WL_DATA_OUT #define CYW43_DEFAULT_PIN_WL_DATA_OUT 24u #endif // PICO_CONFIG: CYW43_DEFAULT_PIN_WL_DATA_IN, gpio pin for spi data in from the cyw43 chip, type=int, default=24, advanced=true, group=pico_cyw43_driver #ifndef CYW43_DEFAULT_PIN_WL_DATA_IN #define CYW43_DEFAULT_PIN_WL_DATA_IN 24u #endif // PICO_CONFIG: CYW43_DEFAULT_PIN_WL_HOST_WAKE, gpio (irq) pin for the irq line from the cyw43 chip, type=int, default=24, advanced=true, group=pico_cyw43_driver #ifndef CYW43_DEFAULT_PIN_WL_HOST_WAKE #define CYW43_DEFAULT_PIN_WL_HOST_WAKE 24u #endif // PICO_CONFIG: CYW43_DEFAULT_PIN_WL_CLOCK, gpio pin for the spi clock line to the cyw43 chip, type=int, default=29, advanced=true, group=pico_cyw43_driver #ifndef CYW43_DEFAULT_PIN_WL_CLOCK #define CYW43_DEFAULT_PIN_WL_CLOCK 29u #endif // PICO_CONFIG: CYW43_DEFAULT_PIN_WL_CS, gpio pin for the spi chip select to the cyw43 chip, type=int, default=25, advanced=true, group=pico_cyw43_driver #ifndef CYW43_DEFAULT_PIN_WL_CS #define CYW43_DEFAULT_PIN_WL_CS 25u #endif #endif