Skip to content

Commit

Permalink
Merge pull request #829 from Daft-Freak/picovision
Browse files Browse the repository at this point in the history
PicoVision
  • Loading branch information
Daft-Freak authored Oct 19, 2023
2 parents 2e4df24 + b2128de commit eb56a53
Show file tree
Hide file tree
Showing 13 changed files with 581 additions and 22 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ jobs:
cmake-args: -D32BLIT_DIR=$GITHUB_WORKSPACE -DPICO_SDK_PATH=$GITHUB_WORKSPACE/pico-sdk -DPICO_BOARD=pimoroni_picosystem -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
apt-packages: ccache gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib python3-setuptools

- os: ubuntu-20.04
pico-sdk: true
name: PicoVision
cache-key: picovision
release-suffix: PicoVision
cmake-args: -D32BLIT_DIR=$GITHUB_WORKSPACE -DPICO_SDK_PATH=$GITHUB_WORKSPACE/pico-sdk -DPICO_BOARD=pico_w -DPICO_ADDON=pimoroni_picovision -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
apt-packages: ccache gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib python3-setuptools

- os: ubuntu-20.04
name: MinGW
cache-key: mingw
Expand Down Expand Up @@ -84,6 +92,15 @@ jobs:
repository: raspberrypi/pico-extras
path: pico-extras

# PicoVision needs the RAM driver and the firmware
- name: Checkout PicoVision
if: matrix.name == 'PicoVision'
uses: actions/checkout@v3
with:
repository: pimoroni/picovision
ref: 03df7694ed4fb396c1d12adf90d0150ada6baedc
path: picovision

- name: Cache
uses: actions/cache@v3
with:
Expand Down
9 changes: 8 additions & 1 deletion 32blit-pico/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ elseif(BLIT_AUDIO_DRIVER STREQUAL "pwm")
list(APPEND BLIT_BOARD_LIBRARIES pico_audio_pwm)
endif()

if(BLIT_DISPLAY_DRIVER STREQUAL "scanvideo")
if(BLIT_DISPLAY_DRIVER STREQUAL "picovision")
list(APPEND BLIT_BOARD_LIBRARIES hardware_i2c aps6404 swd_load)
elseif(BLIT_DISPLAY_DRIVER STREQUAL "scanvideo")
set(BLIT_REQUIRE_PICO_EXTRAS TRUE)
set(BLIT_ENABLE_CORE1 TRUE)
list(APPEND BLIT_BOARD_LIBRARIES pico_scanvideo_dpi)
Expand Down Expand Up @@ -147,6 +149,11 @@ pico_sdk_init()
pico_generate_pio_header(BlitHalPico ${CMAKE_CURRENT_LIST_DIR}/st7789.pio)
pico_generate_pio_header(BlitHalPico ${CMAKE_CURRENT_LIST_DIR}/spi.pio)

# include picovision drivers
if(BLIT_DISPLAY_DRIVER STREQUAL "picovision")
include(picovision_import.cmake)
endif()

# driver sources
target_sources(BlitHalPico INTERFACE
${CMAKE_CURRENT_LIST_DIR}/audio_${BLIT_AUDIO_DRIVER}.cpp
Expand Down
14 changes: 14 additions & 0 deletions 32blit-pico/board/pimoroni_picovision/config.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
set(BLIT_BOARD_NAME "PicoVision")

set(BLIT_BOARD_DEFINITIONS
PICO_AUDIO_I2S_PIO=0
PICO_AUDIO_I2S_DATA_PIN=26
PICO_AUDIO_I2S_CLOCK_PIN_BASE=27
PICO_AUDIO_I2S_BUFFER_SAMPLE_LENGTH=256
)

blit_driver(audio i2s)
blit_driver(display picovision)
blit_driver(input usb_hid)
blit_driver(storage sd_spi)
blit_driver(usb host)
14 changes: 14 additions & 0 deletions 32blit-pico/board/pimoroni_picovision/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once

#define DEFAULT_SCREEN_FORMAT PixelFormat::BGR555

// native
#define SD_CLK 10
#define SD_CMD 11
#define SD_DAT0 12

// spi
#define SD_SCK 10
#define SD_MOSI 11
#define SD_MISO 12
#define SD_CS 15
4 changes: 3 additions & 1 deletion 32blit-pico/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ using namespace blit;

static SurfaceInfo cur_surf_info;

#if ALLOW_HIRES
#if defined(BLIT_BOARD_PIMORONI_PICOVISION)
static const uint16_t *screen_fb = nullptr;
#elif ALLOW_HIRES
uint16_t screen_fb[DISPLAY_WIDTH * DISPLAY_HEIGHT];
#else
uint16_t screen_fb[lores_page_size]; // double-buffered
Expand Down
2 changes: 2 additions & 0 deletions 32blit-pico/display.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
static const int lores_page_size = (DISPLAY_WIDTH / 2) * ((DISPLAY_HEIGHT + 1) / 2) * 2;

extern blit::ScreenMode cur_screen_mode;
#ifndef BLIT_BOARD_PIMORONI_PICOVISION
extern uint16_t screen_fb[];
#endif

void init_display();
void update_display(uint32_t time);
Expand Down
Loading

0 comments on commit eb56a53

Please sign in to comment.