Rationalize board header pin defines, and add partner board headers (#192)
* Board definition header files for the iniital set of SparkFun rp2040 boards * Add default PICO_DEFAULT_I2C*, allow no PICO_DEFAULT_LED_PIN, no PICO_DEFAULT_UART* (instead of -1) Fixup SparkFun headers * Pimoroni board headers * Add LED related board defines PICO_CONFIGs (to pico_stdlib for now) * more board config changes * add Adafruit feather, itsybitsy, qtpy board headers * add PICO_DEFAULT_WS2812_POWER_PIN define * MOSI/MISO -> TX/RX, some UART cleanup.. make vgaboard.h defines take preference over pico.h ones * local change to tinyusb to cope with no default LED or UART * fix review issues Co-authored-by: Kirk Benell <github-stuff@accvec.com> Co-authored-by: ZodiusInfuser <christopher.parrott2@gmail.com> Co-authored-by: hathach <thach@tinyusb.org>
This commit is contained in:
committed by
graham sanderson
parent
839224c2a3
commit
7ee36e3328
88
src/boards/include/boards/adafruit_feather_rp2040.h
Normal file
88
src/boards/include/boards/adafruit_feather_rp2040.h
Normal file
@ -0,0 +1,88 @@
|
||||
/*
|
||||
* Copyright (c) 2020 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
|
||||
// -----------------------------------------------------
|
||||
|
||||
#ifndef _BOARDS_ADAFRUIT_FEATHER_RP2040_H
|
||||
#define _BOARDS_ADAFRUIT_FEATHER_RP2040_H
|
||||
|
||||
// For board detection
|
||||
#define ADAFRUIT_FEATHER_RP2040
|
||||
|
||||
//------------- UART -------------//
|
||||
#ifndef PICO_DEFAULT_UART
|
||||
#define PICO_DEFAULT_UART 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_TX_PIN
|
||||
#define PICO_DEFAULT_UART_TX_PIN 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_RX_PIN
|
||||
#define PICO_DEFAULT_UART_RX_PIN 1
|
||||
#endif
|
||||
|
||||
//------------- LED -------------//
|
||||
#ifndef PICO_DEFAULT_LED_PIN
|
||||
#define PICO_DEFAULT_LED_PIN 13
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_WS2812_PIN
|
||||
#define PICO_DEFAULT_WS2812_PIN 16
|
||||
#endif
|
||||
|
||||
//------------- I2C -------------//
|
||||
#ifndef PICO_DEFAULT_I2C
|
||||
#define PICO_DEFAULT_I2C 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_I2C_SDA_PIN
|
||||
#define PICO_DEFAULT_I2C_SDA_PIN 2
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_I2C_SCL_PIN
|
||||
#define PICO_DEFAULT_I2C_SCL_PIN 3
|
||||
#endif
|
||||
|
||||
//------------- SPI -------------//
|
||||
#ifndef PICO_DEFAULT_SPI
|
||||
#define PICO_DEFAULT_SPI 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_SPI_TX_PIN
|
||||
#define PICO_DEFAULT_SPI_TX_PIN 19
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_SPI_RX_PIN
|
||||
#define PICO_DEFAULT_SPI_RX_PIN 20
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_SPI_SCK_PIN
|
||||
#define PICO_DEFAULT_SPI_SCK_PIN 18
|
||||
#endif
|
||||
|
||||
//------------- FLASH -------------//
|
||||
#ifndef PICO_FLASH_SPI_CLKDIV
|
||||
#define PICO_FLASH_SPI_CLKDIV 2
|
||||
#endif
|
||||
|
||||
#ifndef PICO_FLASH_SIZE_BYTES
|
||||
#define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024)
|
||||
#endif
|
||||
|
||||
// All boards have B1 RP2040
|
||||
#ifndef PICO_FLOAT_SUPPORT_ROM_V1
|
||||
#define PICO_FLOAT_SUPPORT_ROM_V1 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DOUBLE_SUPPORT_ROM_V1
|
||||
#define PICO_DOUBLE_SUPPORT_ROM_V1 0
|
||||
#endif
|
||||
|
||||
#endif
|
92
src/boards/include/boards/adafruit_itsybitsy_rp2040.h
Normal file
92
src/boards/include/boards/adafruit_itsybitsy_rp2040.h
Normal file
@ -0,0 +1,92 @@
|
||||
/*
|
||||
* Copyright (c) 2020 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
|
||||
// -----------------------------------------------------
|
||||
|
||||
#ifndef _BOARDS_ADAFRUIT_ITSYBITSY_RP2040_H
|
||||
#define _BOARDS_ADAFRUIT_ITSYBITSY_RP2040_H
|
||||
|
||||
// For board detection
|
||||
#define ADAFRUIT_ITSYBITSY_RP2040
|
||||
|
||||
//------------- UART -------------//
|
||||
#ifndef PICO_DEFAULT_UART
|
||||
#define PICO_DEFAULT_UART 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_TX_PIN
|
||||
#define PICO_DEFAULT_UART_TX_PIN 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_RX_PIN
|
||||
#define PICO_DEFAULT_UART_RX_PIN 1
|
||||
#endif
|
||||
|
||||
//------------- LED -------------//
|
||||
#ifndef PICO_DEFAULT_LED_PIN
|
||||
#define PICO_DEFAULT_LED_PIN 11
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_WS2812_PIN
|
||||
#define PICO_DEFAULT_WS2812_PIN 17
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_WS2812_POWER_PIN
|
||||
#define PICO_DEFAULT_WS2812_POWER_PIN 16
|
||||
#endif
|
||||
|
||||
//------------- I2C -------------//
|
||||
#ifndef PICO_DEFAULT_I2C
|
||||
#define PICO_DEFAULT_I2C 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_I2C_SDA_PIN
|
||||
#define PICO_DEFAULT_I2C_SDA_PIN 2
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_I2C_SCL_PIN
|
||||
#define PICO_DEFAULT_I2C_SCL_PIN 3
|
||||
#endif
|
||||
|
||||
//------------- SPI -------------//
|
||||
#ifndef PICO_DEFAULT_SPI
|
||||
#define PICO_DEFAULT_SPI 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_SPI_TX_PIN
|
||||
#define PICO_DEFAULT_SPI_TX_PIN 19
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_SPI_RX_PIN
|
||||
#define PICO_DEFAULT_SPI_RX_PIN 20
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_SPI_SCK_PIN
|
||||
#define PICO_DEFAULT_SPI_SCK_PIN 18
|
||||
#endif
|
||||
|
||||
//------------- FLASH -------------//
|
||||
#ifndef PICO_FLASH_SPI_CLKDIV
|
||||
#define PICO_FLASH_SPI_CLKDIV 2
|
||||
#endif
|
||||
|
||||
#ifndef PICO_FLASH_SIZE_BYTES
|
||||
#define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024)
|
||||
#endif
|
||||
|
||||
// All boards have B1 RP2040
|
||||
#ifndef PICO_FLOAT_SUPPORT_ROM_V1
|
||||
#define PICO_FLOAT_SUPPORT_ROM_V1 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DOUBLE_SUPPORT_ROM_V1
|
||||
#define PICO_DOUBLE_SUPPORT_ROM_V1 0
|
||||
#endif
|
||||
|
||||
#endif
|
91
src/boards/include/boards/adafruit_qtpy_rp2040.h
Normal file
91
src/boards/include/boards/adafruit_qtpy_rp2040.h
Normal file
@ -0,0 +1,91 @@
|
||||
/*
|
||||
* Copyright (c) 2020 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
|
||||
// -----------------------------------------------------
|
||||
|
||||
#ifndef _BOARDS_ADAFRUIT_QTPY_RP2040_H
|
||||
#define _BOARDS_ADAFRUIT_QTPY_RP2040_H
|
||||
|
||||
// For board detection
|
||||
#define ADAFRUIT_QTPY_RP2040
|
||||
|
||||
//------------- UART -------------//
|
||||
#ifndef PICO_DEFAULT_UART
|
||||
#define PICO_DEFAULT_UART 1
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_TX_PIN
|
||||
#define PICO_DEFAULT_UART_TX_PIN 20
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_RX_PIN
|
||||
#define PICO_DEFAULT_UART_RX_PIN 9
|
||||
#endif
|
||||
|
||||
//------------- LED -------------//
|
||||
// No normal LED
|
||||
// #define PICO_DEFAULT_LED_PIN 13
|
||||
|
||||
#ifndef PICO_DEFAULT_WS2812_PIN
|
||||
#define PICO_DEFAULT_WS2812_PIN 12
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_WS2812_POWER_PIN
|
||||
#define PICO_DEFAULT_WS2812_POWER_PIN 11
|
||||
#endif
|
||||
|
||||
//------------- I2C -------------//
|
||||
#ifndef PICO_DEFAULT_I2C
|
||||
#define PICO_DEFAULT_I2C 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_I2C_SDA_PIN
|
||||
#define PICO_DEFAULT_I2C_SDA_PIN 24
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_I2C_SCL_PIN
|
||||
#define PICO_DEFAULT_I2C_SCL_PIN 25
|
||||
#endif
|
||||
|
||||
//------------- SPI -------------//
|
||||
#ifndef PICO_DEFAULT_SPI
|
||||
#define PICO_DEFAULT_SPI 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_SPI_TX_PIN
|
||||
#define PICO_DEFAULT_SPI_TX_PIN 3
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_SPI_RX_PIN
|
||||
#define PICO_DEFAULT_SPI_RX_PIN 4
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_SPI_SCK_PIN
|
||||
#define PICO_DEFAULT_SPI_SCK_PIN 6
|
||||
#endif
|
||||
|
||||
//------------- FLASH -------------//
|
||||
#ifndef PICO_FLASH_SPI_CLKDIV
|
||||
#define PICO_FLASH_SPI_CLKDIV 2
|
||||
#endif
|
||||
|
||||
#ifndef PICO_FLASH_SIZE_BYTES
|
||||
#define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024)
|
||||
#endif
|
||||
|
||||
// All boards have B1 RP2040
|
||||
#ifndef PICO_FLOAT_SUPPORT_ROM_V1
|
||||
#define PICO_FLOAT_SUPPORT_ROM_V1 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DOUBLE_SUPPORT_ROM_V1
|
||||
#define PICO_DOUBLE_SUPPORT_ROM_V1 0
|
||||
#endif
|
||||
|
||||
#endif
|
@ -14,21 +14,35 @@
|
||||
#ifndef _BOARDS_PICO_H
|
||||
#define _BOARDS_PICO_H
|
||||
|
||||
// --- UART ---
|
||||
#ifndef PICO_DEFAULT_UART
|
||||
#define PICO_DEFAULT_UART 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_TX_PIN
|
||||
#define PICO_DEFAULT_UART_TX_PIN 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_RX_PIN
|
||||
#define PICO_DEFAULT_UART_RX_PIN 1
|
||||
#endif
|
||||
|
||||
// --- LED ---
|
||||
#ifndef PICO_DEFAULT_LED_PIN
|
||||
#define PICO_DEFAULT_LED_PIN 25
|
||||
#endif
|
||||
// no PICO_DEFAULT_WS2812_PIN
|
||||
|
||||
// --- I2C ---
|
||||
#ifndef PICO_DEFAULT_I2C
|
||||
#define PICO_DEFAULT_I2C 0
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_I2C_SDA_PIN
|
||||
#define PICO_DEFAULT_I2C_SDA_PIN 4
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_I2C_SCL_PIN
|
||||
#define PICO_DEFAULT_I2C_SCL_PIN 5
|
||||
#endif
|
||||
|
||||
// --- FLASH ---
|
||||
|
||||
#ifndef PICO_FLASH_SPI_CLKDIV
|
||||
#define PICO_FLASH_SPI_CLKDIV 2
|
||||
|
132
src/boards/include/boards/pimoroni_keybow2040.h
Normal file
132
src/boards/include/boards/pimoroni_keybow2040.h
Normal file
@ -0,0 +1,132 @@
|
||||
/*
|
||||
* Copyright (c) 2020 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
|
||||
// -----------------------------------------------------
|
||||
|
||||
#ifndef _BOARDS_PIMORONI_KEYBOW2040_H
|
||||
#define _BOARDS_PIMORONI_KEYBOW2040_H
|
||||
|
||||
// For board detection
|
||||
#define PIMORONI_KEYBOW2040
|
||||
|
||||
#ifndef PICO_DEFAULT_UART
|
||||
#define PICO_DEFAULT_UART 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_TX_PIN
|
||||
#define PICO_DEFAULT_UART_TX_PIN 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_RX_PIN
|
||||
#define PICO_DEFAULT_UART_RX_PIN 1
|
||||
#endif
|
||||
|
||||
#ifndef KEYBOW2040_I2C_SDA_PIN
|
||||
#define KEYBOW2040_I2C_SDA_PIN 4
|
||||
#endif
|
||||
|
||||
#ifndef KEYBOW2040_I2C_SCL_PIN
|
||||
#define KEYBOW2040_I2C_SCL_PIN 5
|
||||
#endif
|
||||
|
||||
#ifndef KEYBOW2040_I2C_INT_PIN
|
||||
#define KEYBOW2040_I2C_INT_PIN 3
|
||||
#endif
|
||||
|
||||
#ifndef KEYBOW2040_USER_SW_PIN
|
||||
#define KEYBOW2040_USER_SW_PIN 23
|
||||
#endif
|
||||
|
||||
#ifndef KEYBOW2040_SW0_PIN
|
||||
#define KEYBOW2040_SW0_PIN 21
|
||||
#endif
|
||||
|
||||
#ifndef KEYBOW2040_SW1_PIN
|
||||
#define KEYBOW2040_SW1_PIN 20
|
||||
#endif
|
||||
|
||||
#ifndef KEYBOW2040_SW2_PIN
|
||||
#define KEYBOW2040_SW2_PIN 19
|
||||
#endif
|
||||
|
||||
#ifndef KEYBOW2040_SW3_PIN
|
||||
#define KEYBOW2040_SW3_PIN 18
|
||||
#endif
|
||||
|
||||
#ifndef KEYBOW2040_SW4_PIN
|
||||
#define KEYBOW2040_SW4_PIN 17
|
||||
#endif
|
||||
|
||||
#ifndef KEYBOW2040_SW5_PIN
|
||||
#define KEYBOW2040_SW5_PIN 16
|
||||
#endif
|
||||
|
||||
#ifndef KEYBOW2040_SW6_PIN
|
||||
#define KEYBOW2040_SW6_PIN 15
|
||||
#endif
|
||||
|
||||
#ifndef KEYBOW2040_SW7_PIN
|
||||
#define KEYBOW2040_SW7_PIN 14
|
||||
#endif
|
||||
|
||||
#ifndef KEYBOW2040_SW8_PIN
|
||||
#define KEYBOW2040_SW8_PIN 13
|
||||
#endif
|
||||
|
||||
#ifndef KEYBOW2040_SW9_PIN
|
||||
#define KEYBOW2040_SW9_PIN 12
|
||||
#endif
|
||||
|
||||
#ifndef KEYBOW2040_SW10_PIN
|
||||
#define KEYBOW2040_SW10_PIN 11
|
||||
#endif
|
||||
|
||||
#ifndef KEYBOW2040_SW11_PIN
|
||||
#define KEYBOW2040_SW11_PIN 10
|
||||
#endif
|
||||
|
||||
#ifndef KEYBOW2040_SW12_PIN
|
||||
#define KEYBOW2040_SW12_PIN 9
|
||||
#endif
|
||||
|
||||
#ifndef KEYBOW2040_SW13_PIN
|
||||
#define KEYBOW2040_SW13_PIN 8
|
||||
#endif
|
||||
|
||||
#ifndef KEYBOW2040_SW14_PIN
|
||||
#define KEYBOW2040_SW14_PIN 7
|
||||
#endif
|
||||
|
||||
#ifndef KEYBOW2040_SW15_PIN
|
||||
#define KEYBOW2040_SW15_PIN 6
|
||||
#endif
|
||||
|
||||
#ifndef KEYBOW2040_NUM_SWITCHES
|
||||
#define KEYBOW2040_NUM_SWITCHES_PINS 16
|
||||
#endif
|
||||
|
||||
#ifndef PICO_FLASH_SPI_CLKDIV
|
||||
#define PICO_FLASH_SPI_CLKDIV 2
|
||||
#endif
|
||||
|
||||
#ifndef PICO_FLASH_SIZE_BYTES
|
||||
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
|
||||
#endif
|
||||
|
||||
// All boards have B1 RP2040
|
||||
|
||||
#ifndef PICO_FLOAT_SUPPORT_ROM_V1
|
||||
#define PICO_FLOAT_SUPPORT_ROM_V1 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DOUBLE_SUPPORT_ROM_V1
|
||||
#define PICO_DOUBLE_SUPPORT_ROM_V1 0
|
||||
#endif
|
||||
|
||||
#endif
|
145
src/boards/include/boards/pimoroni_picosystem.h
Normal file
145
src/boards/include/boards/pimoroni_picosystem.h
Normal file
@ -0,0 +1,145 @@
|
||||
/*
|
||||
* Copyright (c) 2020 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
|
||||
// -----------------------------------------------------
|
||||
|
||||
#ifndef _BOARDS_PIMORONI_PICOSYSTEM_H
|
||||
#define _BOARDS_PIMORONI_PICOSYSTEM_H
|
||||
|
||||
// For board detection
|
||||
#define PIMORONI_PICOSYSTEM
|
||||
|
||||
#ifndef PICOSYSTEM_VBUS_DETECT_PIN
|
||||
#define PICOSYSTEM_VBUS_DETECT_PIN 2
|
||||
#endif
|
||||
|
||||
#ifndef PICOSYSTEM_LCD_RESET_PIN
|
||||
#define PICOSYSTEM_LCD_RESET_PIN 4
|
||||
#endif
|
||||
|
||||
#ifndef PICOSYSTEM_LCD_CS_PIN
|
||||
#define PICOSYSTEM_LCD_CS_PIN 5
|
||||
#endif
|
||||
|
||||
#ifndef PICOSYSTEM_LCD_SCLK_PIN
|
||||
#define PICOSYSTEM_LCD_SCLK_PIN 6
|
||||
#endif
|
||||
|
||||
#ifndef PICOSYSTEM_LCD_MOSI_PIN
|
||||
#define PICOSYSTEM_LCD_MOSI_PIN 7
|
||||
#endif
|
||||
|
||||
#ifndef PICOSYSTEM_LCD_VSYNC_PIN
|
||||
#define PICOSYSTEM_LCD_VSYNC_PIN 8
|
||||
#endif
|
||||
|
||||
#ifndef PICOSYSTEM_LCD_DC_PIN
|
||||
#define PICOSYSTEM_LCD_DC_PIN 9
|
||||
#endif
|
||||
|
||||
#ifndef PICOSYSTEM_AUDIO_PIN
|
||||
#define PICOSYSTEM_AUDIO_PIN 11
|
||||
#endif
|
||||
|
||||
#ifndef PICOSYSTEM_BACKLIGHT_PIN
|
||||
#define PICOSYSTEM_BACKLIGHT_PIN 12
|
||||
#endif
|
||||
|
||||
#ifndef PICOSYSTEM_LED_G_PIN
|
||||
#define PICOSYSTEM_LED_G_PIN 13
|
||||
#endif
|
||||
|
||||
#ifndef PICOSYSTEM_LED_R_PIN
|
||||
#define PICOSYSTEM_LED_R_PIN 14
|
||||
#endif
|
||||
|
||||
#ifndef PICOSYSTEM_LED_B_PIN
|
||||
#define PICOSYSTEM_LED_B_PIN 15
|
||||
#endif
|
||||
|
||||
#ifndef PICOSYSTEM_SW_Y_PIN
|
||||
#define PICOSYSTEM_SW_Y_PIN 16
|
||||
#endif
|
||||
|
||||
#ifndef PICOSYSTEM_SW_X_PIN
|
||||
#define PICOSYSTEM_SW_X_PIN 17
|
||||
#endif
|
||||
|
||||
#ifndef PICOSYSTEM_SW_A_PIN
|
||||
#define PICOSYSTEM_SW_A_PIN 18
|
||||
#endif
|
||||
|
||||
#ifndef PICOSYSTEM_SW_B_PIN
|
||||
#define PICOSYSTEM_SW_B_PIN 19
|
||||
#endif
|
||||
|
||||
#ifndef PICOSYSTEM_SW_DOWN_PIN
|
||||
#define PICOSYSTEM_SW_DOWN_PIN 20
|
||||
#endif
|
||||
|
||||
#ifndef PICOSYSTEM_SW_RIGHT_PIN
|
||||
#define PICOSYSTEM_SW_RIGHT_PIN 21
|
||||
#endif
|
||||
|
||||
#ifndef PICOSYSTEM_SW_LEFT_PIN
|
||||
#define PICOSYSTEM_SW_LEFT_PIN 22
|
||||
#endif
|
||||
|
||||
#ifndef PICOSYSTEM_SW_UP_PIN
|
||||
#define PICOSYSTEM_SW_UP_PIN 23
|
||||
#endif
|
||||
|
||||
#ifndef PICOSYSTEM_CHARGE_STAT_PIN
|
||||
#define PICOSYSTEM_CHARGE_STAT_PIN 24
|
||||
#endif
|
||||
|
||||
#ifndef PICOSYSTEM_BAT_SENSE_PIN
|
||||
#define PICOSYSTEM_BAT_SENSE_PIN 26
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART
|
||||
#define PICO_DEFAULT_UART 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_TX_PIN
|
||||
#define PICO_DEFAULT_UART_TX_PIN 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_RX_PIN
|
||||
#define PICO_DEFAULT_UART_RX_PIN 1
|
||||
#endif
|
||||
|
||||
// Included so basic examples will work, and set it to the green LED
|
||||
#ifndef PICO_DEFAULT_LED_PIN
|
||||
#define PICO_DEFAULT_LED_PIN PICOSYSTEM_LED_G_PIN
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_LED_PIN_INVERTED
|
||||
#define PICO_DEFAULT_LED_PIN_INVERTED 1
|
||||
#endif
|
||||
|
||||
#ifndef PICO_FLASH_SPI_CLKDIV
|
||||
#define PICO_FLASH_SPI_CLKDIV 2
|
||||
#endif
|
||||
|
||||
#ifndef PICO_FLASH_SIZE_BYTES
|
||||
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
|
||||
#endif
|
||||
|
||||
// All boards have B1 RP2040
|
||||
|
||||
#ifndef PICO_FLOAT_SUPPORT_ROM_V1
|
||||
#define PICO_FLOAT_SUPPORT_ROM_V1 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DOUBLE_SUPPORT_ROM_V1
|
||||
#define PICO_DOUBLE_SUPPORT_ROM_V1 0
|
||||
#endif
|
||||
|
||||
#endif
|
96
src/boards/include/boards/pimoroni_tiny2040.h
Normal file
96
src/boards/include/boards/pimoroni_tiny2040.h
Normal file
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright (c) 2020 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
|
||||
// -----------------------------------------------------
|
||||
|
||||
#ifndef _BOARDS_PIMORONI_TINY2040_H
|
||||
#define _BOARDS_PIMORONI_TINY2040_H
|
||||
|
||||
// For board detection
|
||||
#define PIMORONI_TINY2040
|
||||
|
||||
#ifndef PICO_DEFAULT_UART
|
||||
#define PICO_DEFAULT_UART 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_TX_PIN
|
||||
#define PICO_DEFAULT_UART_TX_PIN 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_RX_PIN
|
||||
#define PICO_DEFAULT_UART_RX_PIN 1
|
||||
#endif
|
||||
|
||||
#ifndef TINY2040_LED_R_PIN
|
||||
#define TINY2040_LED_R_PIN 18
|
||||
#endif
|
||||
|
||||
#ifndef TINY2040_LED_G_PIN
|
||||
#define TINY2040_LED_G_PIN 19
|
||||
#endif
|
||||
|
||||
#ifndef TINY2040_LED_B_PIN
|
||||
#define TINY2040_LED_B_PIN 20
|
||||
#endif
|
||||
|
||||
#ifndef TINY2040_USER_SW_PIN
|
||||
#define TINY2040_USER_SW_PIN 23
|
||||
#endif
|
||||
|
||||
#ifndef TINY2040_A0_PIN
|
||||
#define TINY2040_A0_PIN 26
|
||||
#endif
|
||||
|
||||
#ifndef TINY2040_A1_PIN
|
||||
#define TINY2040_A1_PIN 27
|
||||
#endif
|
||||
|
||||
#ifndef TINY2040_A2_PIN
|
||||
#define TINY2040_A2_PIN 28
|
||||
#endif
|
||||
|
||||
#ifndef TINY2040_A3_PIN
|
||||
#define TINY2040_A3_PIN 29
|
||||
#endif
|
||||
|
||||
#ifndef TINY2040_NUM_IO_PINS
|
||||
#define TINY2040_NUM_IO_PINS 8
|
||||
#endif
|
||||
|
||||
#ifndef TINY2040_NUM_ADC_PINS
|
||||
#define TINY2040_NUM_ADC_PINS 4
|
||||
#endif
|
||||
|
||||
// Included so basic examples will work, and set it to the green LED
|
||||
#ifndef PICO_DEFAULT_LED_PIN
|
||||
#define PICO_DEFAULT_LED_PIN TINY2040_LED_G_PIN
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_LED_PIN_INVERTED
|
||||
#define PICO_DEFAULT_LED_PIN_INVERTED 1
|
||||
#endif
|
||||
|
||||
#ifndef PICO_FLASH_SPI_CLKDIV
|
||||
#define PICO_FLASH_SPI_CLKDIV 2
|
||||
#endif
|
||||
|
||||
#ifndef PICO_FLASH_SIZE_BYTES
|
||||
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
|
||||
#endif
|
||||
|
||||
// All boards have B1 RP2040
|
||||
#ifndef PICO_FLOAT_SUPPORT_ROM_V1
|
||||
#define PICO_FLOAT_SUPPORT_ROM_V1 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DOUBLE_SUPPORT_ROM_V1
|
||||
#define PICO_DOUBLE_SUPPORT_ROM_V1 0
|
||||
#endif
|
||||
|
||||
#endif
|
68
src/boards/include/boards/sparkfun_micromod.h
Normal file
68
src/boards/include/boards/sparkfun_micromod.h
Normal file
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright (c) 2020 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
|
||||
// -----------------------------------------------------
|
||||
//
|
||||
//------------------------------------------------------------------------------------------
|
||||
// Board definition for the SparkFun RP2040 MicroMod processor board
|
||||
//
|
||||
// This header may be included by other board headers as "boards/sparkfun_micromod.h"
|
||||
|
||||
#ifndef _BOARDS_SPARKFUN_MICROMOD_H
|
||||
#define _BOARDS_SPARKFUN_MICROMOD_H
|
||||
|
||||
#ifndef PICO_DEFAULT_UART
|
||||
#define PICO_DEFAULT_UART 0
|
||||
#define
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_TX_PIN
|
||||
#define PICO_DEFAULT_UART_TX_PIN 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_RX_PIN
|
||||
#define PICO_DEFAULT_UART_RX_PIN 1
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_LED_PIN
|
||||
#define PICO_DEFAULT_LED_PIN 25
|
||||
#endif
|
||||
|
||||
// Default I2C - for qwiic connector
|
||||
#ifndef PICO_DEFAULT_I2C
|
||||
#define PICO_DEFAULT_I2C 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_I2C_SDA_PIN
|
||||
#define PICO_DEFAULT_I2C_SDA_PIN 4
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_I2C_SCL_PIN
|
||||
#define PICO_DEFAULT_I2C_SCL_PIN 5
|
||||
#endif
|
||||
|
||||
// spi flash
|
||||
#ifndef PICO_FLASH_SPI_CLKDIV
|
||||
#define PICO_FLASH_SPI_CLKDIV 2
|
||||
#endif
|
||||
|
||||
#ifndef PICO_FLASH_SIZE_BYTES
|
||||
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
|
||||
#endif
|
||||
|
||||
// All boards have B1 RP2040
|
||||
|
||||
#ifndef PICO_FLOAT_SUPPORT_ROM_V1
|
||||
#define PICO_FLOAT_SUPPORT_ROM_V1 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DOUBLE_SUPPORT_ROM_V1
|
||||
#define PICO_DOUBLE_SUPPORT_ROM_V1 0
|
||||
#endif
|
||||
|
||||
#endif
|
68
src/boards/include/boards/sparkfun_promicro.h
Normal file
68
src/boards/include/boards/sparkfun_promicro.h
Normal file
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright (c) 2020 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
|
||||
// -----------------------------------------------------
|
||||
//
|
||||
//------------------------------------------------------------------------------------------
|
||||
// Board definition for the SparkFun RP2040 ProMicro
|
||||
//
|
||||
// This header may be included by other board headers as "boards/sparkfun_promicro.h"
|
||||
|
||||
#ifndef _BOARDS_SPARKFUN_PROMICRO_H
|
||||
#define _BOARDS_SPARKFUN_PROMICRO_H
|
||||
|
||||
#ifndef PICO_DEFAULT_UART
|
||||
#define PICO_DEFAULT_UART 0
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_UART_TX_PIN
|
||||
#define PICO_DEFAULT_UART_TX_PIN 0
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_UART_RX_PIN
|
||||
#define PICO_DEFAULT_UART_RX_PIN 1
|
||||
#endif
|
||||
|
||||
// The PRO Micro doesnt have a plain LED, but a WS2812
|
||||
//#ifndef PICO_DEFAULT_LED_PIN
|
||||
//#define PICO_DEFAULT_LED_PIN 25
|
||||
//#endif
|
||||
#ifndef PICO_DEFAULT_WS2812_PIN
|
||||
#define PICO_DEFAULT_WS2812_PIN 25
|
||||
#endif
|
||||
|
||||
// Default I2C - for the onboard qwiic connector
|
||||
#ifndef PICO_DEFAULT_I2C
|
||||
#define PICO_DEFAULT_I2C 0
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_I2C_SDA_PIN
|
||||
#define PICO_DEFAULT_I2C_SDA_PIN 16
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_I2C_SCL_PIN
|
||||
#define PICO_DEFAULT_I2C_SCL_PIN 17
|
||||
#endif
|
||||
|
||||
#ifndef PICO_FLASH_SPI_CLKDIV
|
||||
#define PICO_FLASH_SPI_CLKDIV 2
|
||||
#endif
|
||||
|
||||
// board has 16M onboard flash
|
||||
#ifndef PICO_FLASH_SIZE_BYTES
|
||||
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
|
||||
#endif
|
||||
|
||||
// All boards have B1 RP2040
|
||||
|
||||
#ifndef PICO_FLOAT_SUPPORT_ROM_V1
|
||||
#define PICO_FLOAT_SUPPORT_ROM_V1 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DOUBLE_SUPPORT_ROM_V1
|
||||
#define PICO_DOUBLE_SUPPORT_ROM_V1 0
|
||||
#endif
|
||||
|
||||
#endif
|
75
src/boards/include/boards/sparkfun_thingplus.h
Normal file
75
src/boards/include/boards/sparkfun_thingplus.h
Normal file
@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright (c) 2020 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
|
||||
// -----------------------------------------------------
|
||||
//
|
||||
//------------------------------------------------------------------------------------------
|
||||
// Board definition for the SparkFun RP2040 Thing Plus
|
||||
//
|
||||
// This header may be included by other board headers as "boards/sparkfun_thingplus.h"
|
||||
|
||||
#ifndef _BOARDS_SPARKFUN_THINGPLUS_H
|
||||
#define _BOARDS_SPARKFUN_THINGPLUS_H
|
||||
|
||||
#ifndef PICO_DEFAULT_UART
|
||||
#define PICO_DEFAULT_UART 0
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_UART_TX_PIN
|
||||
#define PICO_DEFAULT_UART_TX_PIN 0
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_UART_RX_PIN
|
||||
#define PICO_DEFAULT_UART_RX_PIN 1
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_LED_PIN
|
||||
#define PICO_DEFAULT_LED_PIN 25
|
||||
#endif
|
||||
|
||||
// Default I2C - for qwiic connector
|
||||
#ifndef PICO_DEFAULT_I2C
|
||||
#define PICO_DEFAULT_I2C 1
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_I2C_SDA_PIN
|
||||
#define PICO_DEFAULT_I2C_SDA_PIN 6
|
||||
#endif
|
||||
#ifndef PICO_DEFAULT_I2C_SCL_PIN
|
||||
#define PICO_DEFAULT_I2C_SCL_PIN 7
|
||||
#endif
|
||||
|
||||
// spi flash
|
||||
#ifndef PICO_FLASH_SPI_CLKDIV
|
||||
#define PICO_FLASH_SPI_CLKDIV 2
|
||||
#endif
|
||||
|
||||
#ifndef PICO_FLASH_SIZE_BYTES
|
||||
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
|
||||
#endif
|
||||
|
||||
// The thing plus has a SD Card.
|
||||
#define PICO_SD_CLK_PIN 14
|
||||
#define PICO_SD_CMD_PIN 15
|
||||
#define PICO_SD_DAT0_PIN 12
|
||||
// DAT pins count down
|
||||
#define PICO_SD_DAT_PIN_INCREMENT -1
|
||||
|
||||
#ifndef PICO_SD_DAT_PIN_COUNT
|
||||
#define PICO_SD_DAT_PIN_COUNT 4
|
||||
#endif
|
||||
|
||||
// All boards have B1 RP2040
|
||||
|
||||
#ifndef PICO_FLOAT_SUPPORT_ROM_V1
|
||||
#define PICO_FLOAT_SUPPORT_ROM_V1 0
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DOUBLE_SUPPORT_ROM_V1
|
||||
#define PICO_DOUBLE_SUPPORT_ROM_V1 0
|
||||
#endif
|
||||
|
||||
#endif
|
@ -12,22 +12,6 @@
|
||||
#ifndef _BOARDS_VGABOARD_H
|
||||
#define _BOARDS_VGABOARD_H
|
||||
|
||||
#ifndef PICO_DEFAULT_UART
|
||||
#define PICO_DEFAULT_UART 1
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_TX_PIN
|
||||
#define PICO_DEFAULT_UART_TX_PIN 20
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_RX_PIN
|
||||
#define PICO_DEFAULT_UART_RX_PIN 21
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_LED_PIN
|
||||
#define PICO_DEFAULT_LED_PIN 25 // same as Pico
|
||||
#endif
|
||||
|
||||
// Audio pins. I2S BCK, LRCK are on the same pins as PWM L/R.
|
||||
// - When outputting I2S, PWM sees BCK and LRCK, which should sound silent as
|
||||
// they are constant duty cycle, and above the filter cutoff
|
||||
@ -54,25 +38,30 @@
|
||||
#define VGABOARD_BUTTON_B_PIN 6
|
||||
#define VGABOARD_BUTTON_C_PIN 11
|
||||
|
||||
#ifndef PICO_SCANVIDEO_COLOR_PIN_BASE
|
||||
#ifndef PICO_DEFAULT_UART
|
||||
#define PICO_DEFAULT_UART 1
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_TX_PIN
|
||||
#define PICO_DEFAULT_UART_TX_PIN 20
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DEFAULT_UART_RX_PIN
|
||||
#define PICO_DEFAULT_UART_RX_PIN 21
|
||||
#endif
|
||||
|
||||
#define PICO_SCANVIDEO_COLOR_PIN_BASE VGABOARD_VGA_COLOR_PIN_BASE
|
||||
#endif
|
||||
|
||||
#ifndef PICO_SCANVIDEO_SYMC_PIN_BASE
|
||||
#define PICO_SCANVIDEO_SYNC_PIN_BASE VGABOARD_VGA_SYNC_PIN_BASE
|
||||
#endif
|
||||
|
||||
#ifndef PICO_SD_CLK_PIN
|
||||
#define PICO_SD_CLK_PIN VGABOARD_SD_CLK_PIN
|
||||
#endif
|
||||
|
||||
#ifndef PICO_SD_CMD_PIN
|
||||
#define PICO_SD_CMD_PIN VGABOARD_SD_CMD_PIN
|
||||
#define PICO_SD_DAT0_PIN VGABOARD_SD_DAT0_PIN
|
||||
|
||||
#ifndef PICO_SD_DAT_PIN_COUNT
|
||||
#define PICO_SD_DAT_PIN_COUNT 4
|
||||
#endif
|
||||
|
||||
#ifndef PICO_SD_DAT0_PIN
|
||||
#define PICO_SD_DAT0_PIN VGABOARD_SD_DAT0_PIN
|
||||
#endif
|
||||
#define PICO_SD_DAT_PIN_INCREMENT 1
|
||||
|
||||
#define PICO_AUDIO_I2S_DATA_PIN VGABOARD_I2S_DIN_PIN
|
||||
#define PICO_AUDIO_I2S_CLOCK_PIN_BASE VGABOARD_I2S_BCK_PIN
|
||||
@ -80,25 +69,12 @@
|
||||
#define PICO_AUDIO_PWM_L_PIN VGABOARD_PWM_L_PIN
|
||||
#define PICO_AUDIO_PWM_R_PIN VGABOARD_PWM_R_PIN
|
||||
|
||||
#ifndef PICO_FLASH_SPI_CLKDIV
|
||||
#define PICO_FLASH_SPI_CLKDIV 2
|
||||
#endif
|
||||
|
||||
#ifndef PICO_FLASH_SIZE_BYTES
|
||||
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
|
||||
#endif
|
||||
|
||||
// Drive high to force power supply into PWM mode (lower ripple on 3V3 at light loads)
|
||||
#define PICO_SMPS_MODE_PIN 23
|
||||
|
||||
#ifndef PICO_FLOAT_SUPPORT_ROM_V1
|
||||
#define PICO_FLOAT_SUPPORT_ROM_V1 1
|
||||
#endif
|
||||
|
||||
#ifndef PICO_DOUBLE_SUPPORT_ROM_V1
|
||||
#define PICO_DOUBLE_SUPPORT_ROM_V1 1
|
||||
#endif
|
||||
|
||||
#define PICO_VGA_BOARD
|
||||
|
||||
// vgaboard has a Pico on it, so default anything we haven't set above
|
||||
#include "boards/pico.h"
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user