Skip to content

new board :) πŸπŸ‰πŸ‡πŸ‹β€πŸŸ©πŸ #2510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
121 changes: 121 additions & 0 deletions src/boards/include/boards/adafruit_fruitjam.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
/*
* Copyright (c) 2024 FRUITJAM Board
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably this should be a company-name, rather than a product-name? πŸ€”

*
* 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/fruitjam.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ought to be "boards/adafruit_fruitjam.h"


// pico_cmake_set PICO_PLATFORM=rp2350
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be replaced with the new-style

pico_board_cmake_set(PICO_PLATFORM, rp2350)

instead.


#ifndef _BOARDS_FRUITJAM_H
#define _BOARDS_FRUITJAM_H
Comment on lines +16 to +17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ought to be _BOARDS_ADAFRUIT_FRUITJAM_H


// For board detection
#define FRUITJAM_BOARD
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ought to be ADAFRUIT_FRUITJAM


// --- BOARD SPECIFIC ---
#define FRUITJAM_LED_PIN 29
#define FRUITJAM_NEOPIXEL_PIN 32
#define FRUITJAM_NEOPIXEL_COUNT 5
#define FRUITJAM_BUTTON1_PIN 0
#define FRUITJAM_BUTTON2_PIN 4
#define FRUITJAM_BUTTON3_PIN 5
#define FRUITJAM_PSRAM_CS_PIN 47

// SD Card pins
#define FRUITJAM_SD_DETECT_PIN 33
#define FRUITJAM_SD_CLK_PIN 34
#define FRUITJAM_SD_CMD_PIN 35
#define FRUITJAM_SD_DAT0_PIN 36
#define FRUITJAM_SD_DAT1_PIN 37
#define FRUITJAM_SD_DAT2_PIN 38
#define FRUITJAM_SD_CS_PIN 39

// I2S pins
#define FRUITJAM_I2S_DATA_PIN 24
#define FRUITJAM_I2S_WS_PIN 25
#define FRUITJAM_I2S_BCK_PIN 26
#define FRUITJAM_I2S_MCK_PIN 27
#define FRUITJAM_I2S_IRQ_PIN 23

// WiFi/ESP32 pins
#define FRUITJAM_WIFI_CS_PIN 46
#define FRUITJAM_WIFI_ACK_PIN 3
#define FRUITJAM_WIFI_RESET_PIN 22

// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GPIO 8 and 9 are UART1 TX and UART1 RX, so was this supposed to be #define PICO_DEFAULT_UART 1 ?

#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 8
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 9
#endif

// --- LED ---
#ifndef PICO_DEFAULT_LED_PIN
#define PICO_DEFAULT_LED_PIN FRUITJAM_LED_PIN
#endif

// --- NEOPIXEL/WS2812 ---
#ifndef PICO_DEFAULT_WS2812_PIN
#define PICO_DEFAULT_WS2812_PIN FRUITJAM_NEOPIXEL_PIN
#endif

// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 20
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 21
#endif

// --- SPI ---
// Default SPI uses SD card interface
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 0
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN FRUITJAM_SD_CLK_PIN
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN FRUITJAM_SD_CMD_PIN
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN FRUITJAM_SD_DAT0_PIN
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN FRUITJAM_SD_CS_PIN
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FRUITJAM_SD_CS_PIN is set to 39, but according to Table 3 in https://datasheets.raspberrypi.com/rp2350/rp2350-datasheet.pdf GPIO 39 is SPI0 TX. (If this is a software-controlled CS pin that's totally fine; but in that case you shouldn't define PICO_DEFAULT_SPI_CSN_PIN.)

#endif

// --- FLASH ---
// Winbond W25Q128 (16MB) 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 = (16 * 1024 * 1024)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be replaced with the new-style

pico_board_cmake_set_default(PICO_FLASH_SIZE_BYTES, (16 * 1024 * 1024))

#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif

// --- RP2350 specific settings ---
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be replaced with the new-style

pico_board_cmake_set_default(PICO_RP2350_A2_SUPPORTED, 1)

#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif

#endif