forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10081 from tannewt/fruit_jam
Rev A Fruit Jam definition
- Loading branch information
Showing
12 changed files
with
386 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// This file is part of the CircuitPython project: https://circuitpython.org | ||
// | ||
// SPDX-FileCopyrightText: Copyright (c) 2021 Scott Shawcroft for Adafruit Industries | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
#include "common-hal/microcontroller/Pin.h" | ||
#include "hardware/gpio.h" | ||
#include "shared-bindings/usb_host/Port.h" | ||
#include "supervisor/board.h" | ||
|
||
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. | ||
|
||
|
||
#if defined(DEFAULT_USB_HOST_5V_POWER) | ||
bool board_reset_pin_number(uint8_t pin_number) { | ||
if (pin_number == DEFAULT_USB_HOST_5V_POWER->number) { | ||
// doing this (rather than gpio_init) in this specific order ensures no | ||
// glitch if pin was already configured as a high output. gpio_init() temporarily | ||
// configures the pin as an input, so the power enable value would potentially | ||
// glitch. | ||
gpio_put(pin_number, 1); | ||
gpio_set_dir(pin_number, GPIO_OUT); | ||
gpio_set_function(pin_number, GPIO_FUNC_SIO); | ||
|
||
return true; | ||
} | ||
return false; | ||
} | ||
#endif | ||
|
||
#if defined(DEFAULT_USB_HOST_DATA_PLUS) | ||
void board_init(void) { | ||
common_hal_usb_host_port_construct(DEFAULT_USB_HOST_DATA_PLUS, DEFAULT_USB_HOST_DATA_MINUS); | ||
} | ||
#endif |
24 changes: 24 additions & 0 deletions
24
ports/raspberrypi/boards/adafruit_fruit_jam/mpconfigboard.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// This file is part of the CircuitPython project: https://circuitpython.org | ||
// | ||
// SPDX-FileCopyrightText: Copyright (c) 2024 Scott Shawcroft for Adafruit Industries | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
#define MICROPY_HW_BOARD_NAME "Adafruit Fruit Jam" | ||
#define MICROPY_HW_MCU_NAME "rp2350b" | ||
|
||
#define MICROPY_HW_NEOPIXEL (&pin_GPIO32) | ||
#define MICROPY_HW_NEOPIXEL_COUNT (5) | ||
|
||
#define DEFAULT_I2C_BUS_SCL (&pin_GPIO21) | ||
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO20) | ||
|
||
#define DEFAULT_SPI_BUS_SCK (&pin_GPIO30) | ||
#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO31) | ||
#define DEFAULT_SPI_BUS_MISO (&pin_GPIO28) | ||
|
||
#define DEFAULT_USB_HOST_DATA_PLUS (&pin_GPIO1) | ||
#define DEFAULT_USB_HOST_DATA_MINUS (&pin_GPIO2) | ||
#define DEFAULT_USB_HOST_5V_POWER (&pin_GPIO11) | ||
|
||
#define CIRCUITPY_PSRAM_CHIP_SELECT (&pin_GPIO47) |
10 changes: 10 additions & 0 deletions
10
ports/raspberrypi/boards/adafruit_fruit_jam/mpconfigboard.mk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
USB_VID = 0x239A | ||
USB_PID = 0x816C | ||
USB_PRODUCT = "Fruit Jam" | ||
USB_MANUFACTURER = "Adafruit" | ||
|
||
CHIP_VARIANT = RP2350 | ||
CHIP_PACKAGE = B | ||
CHIP_FAMILY = rp2 | ||
|
||
EXTERNAL_FLASH_DEVICES = "W25Q128JVxQ" |
10 changes: 10 additions & 0 deletions
10
ports/raspberrypi/boards/adafruit_fruit_jam/pico-sdk-configboard.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// This file is part of the CircuitPython project: https://circuitpython.org | ||
// | ||
// SPDX-FileCopyrightText: Copyright (c) 2021 Scott Shawcroft for Adafruit Industries | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
// Put board-specific pico-sdk definitions here. This file must exist. | ||
|
||
// Allow extra time for xosc to start. | ||
#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
// This file is part of the CircuitPython project: https://circuitpython.org | ||
// | ||
// SPDX-FileCopyrightText: Copyright (c) 2024 Scott Shawcroft for Adafruit Industries | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
#include "shared-bindings/board/__init__.h" | ||
|
||
static const mp_rom_map_elem_t board_module_globals_table[] = { | ||
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS | ||
|
||
{ MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO41) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO42) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO43) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO44) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO45) }, | ||
|
||
// On-board switch reverses D0 and D1 connections to RX and TX. | ||
|
||
{ MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, | ||
|
||
{ MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO29) }, | ||
|
||
{ MP_OBJ_NEW_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO0) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO0) }, | ||
|
||
{ MP_OBJ_NEW_QSTR(MP_QSTR_BUTTON1), MP_ROM_PTR(&pin_GPIO4) }, | ||
|
||
{ MP_OBJ_NEW_QSTR(MP_QSTR_BUTTON2), MP_ROM_PTR(&pin_GPIO5) }, | ||
|
||
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO20) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO21) }, | ||
|
||
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO30) }, | ||
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO31) }, | ||
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO28) }, | ||
|
||
{ MP_ROM_QSTR(MP_QSTR_TFT_CS), MP_ROM_PTR(&pin_GPIO46) }, | ||
|
||
{ MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO32) }, | ||
|
||
{ MP_ROM_QSTR(MP_QSTR_CKN), MP_ROM_PTR(&pin_GPIO12) }, | ||
{ MP_ROM_QSTR(MP_QSTR_CKP), MP_ROM_PTR(&pin_GPIO13) }, | ||
{ MP_ROM_QSTR(MP_QSTR_D0N), MP_ROM_PTR(&pin_GPIO14) }, | ||
{ MP_ROM_QSTR(MP_QSTR_D0P), MP_ROM_PTR(&pin_GPIO15) }, | ||
{ MP_ROM_QSTR(MP_QSTR_D1N), MP_ROM_PTR(&pin_GPIO16) }, | ||
{ MP_ROM_QSTR(MP_QSTR_D1P), MP_ROM_PTR(&pin_GPIO17) }, | ||
{ MP_ROM_QSTR(MP_QSTR_D2N), MP_ROM_PTR(&pin_GPIO18) }, | ||
{ MP_ROM_QSTR(MP_QSTR_D2P), MP_ROM_PTR(&pin_GPIO19) }, | ||
|
||
{ MP_ROM_QSTR(MP_QSTR_I2S_RESET), MP_ROM_PTR(&pin_GPIO22) }, | ||
{ MP_ROM_QSTR(MP_QSTR_I2S_MCLK), MP_ROM_PTR(&pin_GPIO27) }, | ||
{ MP_ROM_QSTR(MP_QSTR_I2S_BCLK), MP_ROM_PTR(&pin_GPIO26) }, | ||
{ MP_ROM_QSTR(MP_QSTR_I2S_WS), MP_ROM_PTR(&pin_GPIO25) }, | ||
{ MP_ROM_QSTR(MP_QSTR_I2S_DIN), MP_ROM_PTR(&pin_GPIO24) }, | ||
{ MP_ROM_QSTR(MP_QSTR_I2S_GPIO1), MP_ROM_PTR(&pin_GPIO23) }, | ||
|
||
{ MP_OBJ_NEW_QSTR(MP_QSTR_SD_SCK), MP_ROM_PTR(&pin_GPIO34) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_CLOCK), MP_ROM_PTR(&pin_GPIO34) }, | ||
|
||
{ MP_OBJ_NEW_QSTR(MP_QSTR_SD_MOSI), MP_ROM_PTR(&pin_GPIO35) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_COMMAND), MP_ROM_PTR(&pin_GPIO35) }, | ||
|
||
{ MP_OBJ_NEW_QSTR(MP_QSTR_SD_MISO), MP_ROM_PTR(&pin_GPIO36) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_DATA0), MP_ROM_PTR(&pin_GPIO36) }, | ||
|
||
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_DATA1), MP_ROM_PTR(&pin_GPIO37) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_DATA2), MP_ROM_PTR(&pin_GPIO38) }, | ||
|
||
{ MP_OBJ_NEW_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_GPIO39) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_DATA3), MP_ROM_PTR(&pin_GPIO39) }, | ||
|
||
{ MP_OBJ_NEW_QSTR(MP_QSTR_SD_CARD_DETECT), MP_ROM_PTR(&pin_GPIO33) }, | ||
|
||
{ MP_ROM_QSTR(MP_QSTR_USB_HOST_DATA_PLUS), MP_ROM_PTR(&pin_GPIO1) }, | ||
{ MP_ROM_QSTR(MP_QSTR_USB_HOST_DATA_MINUS), MP_ROM_PTR(&pin_GPIO2) }, | ||
{ MP_ROM_QSTR(MP_QSTR_USB_HOST_5V_POWER), MP_ROM_PTR(&pin_GPIO11) }, | ||
|
||
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, | ||
{ MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, | ||
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, | ||
}; | ||
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.