File tree Expand file tree Collapse file tree 12 files changed +240
-0
lines changed
ports/rp2/boards/VCC_GND_RP2040 Expand file tree Collapse file tree 12 files changed +240
-0
lines changed Original file line number Diff line number Diff line change
1
+ # VCC-GND Studio YD-RP2040
2
+
3
+ The VCC-GND Studio YD-RP2040 Board is based on the Raspberry Pi RP2040 and can be
4
+ purchased with 4/8/16 MiB of flash.
5
+
6
+ These boards are available from a number of resellers and often have the name
7
+ "YD-RP2040". initdc maintain the [ YD-RP2040] ( https://github.com/initdc/YD-RP2040/tree/master )
8
+ repository containing information on the board.
9
+
10
+ ## Build notes
11
+
12
+ Builds can be configured with the ` BOARD_VARIANT ` parameter. Valid variants
13
+ can be displayed with the ` query-variant ` target. An example:
14
+
15
+ ``` bash
16
+ > cd ports/rp2
17
+ > make BOARD=VCC_GND_RP2040 query-variants
18
+ VARIANTS: flash_4mb flash_8mb flash_16mb
19
+ > make BOARD=VCC_GND_RP2040 BOARD_VARIANT=flash_8mb submodules all # Build the 8 MiB variant
20
+ ```
21
+
22
+ ` flash_4mb ` is the default if ` BOARD_VARIANT ` is not supplied.
23
+
24
+ ## Board-specific modules
25
+
26
+ The ` board ` module contains definitions for the onboard LED, onboard WS2812B and user button.
27
+
28
+ Example:
29
+
30
+ ``` python
31
+ > import board
32
+ > board.led.toggle() # Toggles the state of the on-board LED
33
+ > board.key.value() # Returns 0 or 1 corresponding to the state of the user key
34
+ ```
Original file line number Diff line number Diff line change
1
+ {
2
+ "deploy" : [
3
+ " deploy.md"
4
+ ],
5
+ "docs" : " " ,
6
+ "features" : [
7
+ " Breadboard Friendly" ,
8
+ " SPI Flash" ,
9
+ " USB-C" ,
10
+ " WS2812B"
11
+ ],
12
+ "images" : [
13
+ " YD-RP2040.jpg"
14
+ ],
15
+ "mcu" : " rp2040" ,
16
+ "product" : " YD-RP2040" ,
17
+ "url" : " http://vcc-gnd.com/" ,
18
+ "variants" : {
19
+ "flash_4mb" : " 4 MiB Flash" ,
20
+ "flash_8mb" : " 8 MiB Flash" ,
21
+ "flash_16mb" : " 16 MiB Flash"
22
+ },
23
+ "vendor" : " VCC-GND Studio"
24
+ }
Original file line number Diff line number Diff line change
1
+ ### Flashing via UF2 bootloader
2
+
3
+ To get the board in bootloader mode ready for the firmware update, execute
4
+ ` machine.bootloader() ` at the MicroPython REPL. Alternatively, hold
5
+ down the BOOTSEL button while pressing reset (NRST). The uf2 file below
6
+ should then be copied to the USB mass storage device that appears. Once
7
+ programming of the new firmware is complete the device will automatically reset
8
+ and be ready for use.
Original file line number Diff line number Diff line change
1
+ include ("$(PORT_DIR)/boards/manifest.py" )
2
+ freeze ("./modules" )
Original file line number Diff line number Diff line change
1
+ from machine import Pin , Timer
2
+
3
+ led = Pin (25 , Pin .OUT )
4
+ ws2812 = Pin (23 , Pin .OUT , Pin .PULL_UP )
5
+ key = Pin (24 , Pin .IN , Pin .PULL_UP )
6
+
7
+ led_status = 1
8
+ key_status = key .value ()
9
+ led .value (led_status )
10
+
11
+ def toggle_led_by_button ():
12
+ global led_status
13
+ led_status = 0 if led_status == 1 else 1
14
+ led .value (led_status )
15
+
16
+ while True :
17
+ if key .value () != key_status :
18
+ key_status = key .value ()
19
+ if key_status == 0 :
20
+ print ("pressdown" )
21
+ toggle_led_by_button ()
22
+ else :
23
+ print ("pressup" )
Original file line number Diff line number Diff line change
1
+ # CMake file for VCC-GND Studio YD-RP2040 boards
2
+
3
+ # The VCC-GND Studio boards don't have official pico-sdk support so we define it
4
+ # See also: https://github.com/raspberrypi/pico-sdk/tree/master/src/boards/include/boards
5
+ list (APPEND PICO_BOARD_HEADER_DIRS ${MICROPY_BOARD_DIR} )
6
+
7
+ # Freeze board.py
8
+ set (MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR} /manifest.py )
9
+
10
+ # Provide different variants for the downloads page
11
+ set (BOARD_VARIANTS "flash_4mb flash_8mb flash_16mb" )
12
+
13
+ # Select the 4MB variant as the default
14
+ set (PICO_BOARD "vccgndstudio_4mb" )
15
+
16
+ if ("${BOARD_VARIANT} " STREQUAL "flash_8mb" )
17
+ set (PICO_BOARD "vccgndstudio_8mb" )
18
+ endif ()
19
+
20
+ if ("${BOARD_VARIANT} " STREQUAL "flash_16mb" )
21
+ set (PICO_BOARD "vccgndstudio_16mb" )
22
+ endif ()
Original file line number Diff line number Diff line change
1
+ #define MICROPY_HW_BOARD_NAME "VCC-GND Studio YD-RP2040"
2
+
3
+ // Allow 1MB for the firmware image itself, allocate the remainder to the filesystem
4
+ #define MICROPY_HW_FLASH_STORAGE_BYTES (PICO_FLASH_SIZE_BYTES - (1 * 1024 * 1024))
5
+
6
+ // https://github.com/adafruit/circuitpython/blob/main/ports/raspberrypi/boards/vcc_gnd_yd_rp2040/mpconfigboard.h#L4
7
+ #define MICROPY_HW_NEOPIXEL (&pin_GPIO23)
Original file line number Diff line number Diff line change
1
+ RGB,GPIO23
2
+ NEOPIXEL,GPIO23
3
+ BUTTON,GPIO24
4
+ LED,GPIO25
Original file line number Diff line number Diff line change
1
+ // A pico-sdk board definition is required since the WeAct Studio boards are
2
+ // not officially supported.
3
+ //
4
+ // Officially supported boards:
5
+ // https://github.com/raspberrypi/pico-sdk/tree/master/src/boards/include/boards
6
+
7
+ #ifndef _BOARDS_VCCGNDSTUDIO_16MB_H
8
+ #define _BOARDS_VCCGNDSTUDIO_16MB_H
9
+
10
+ #include "vccgndstudio_common.h"
11
+
12
+ #define VCCGNDSTUDIO_16MB
13
+
14
+ #ifndef PICO_FLASH_SIZE_BYTES
15
+ #define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
16
+ #endif
17
+
18
+ #endif
Original file line number Diff line number Diff line change
1
+ // A pico-sdk board definition is required since the WeAct Studio boards are
2
+ // not officially supported.
3
+ //
4
+ // Officially supported boards:
5
+ // https://github.com/raspberrypi/pico-sdk/tree/master/src/boards/include/boards
6
+
7
+ #ifndef _BOARDS_VCCGNDSTUDIO_4MB_H
8
+ #define _BOARDS_VCCGNDSTUDIO_4MB_H
9
+
10
+ #include "vccgndstudio_common.h"
11
+
12
+ #define VCCGNDSTUDIO_4MB
13
+
14
+ #ifndef PICO_FLASH_SIZE_BYTES
15
+ #define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024)
16
+ #endif
17
+
18
+ #endif
You can’t perform that action at this time.
0 commit comments