Allow DEFAULT_DVI_SERIAL_CONFIG to be set via cmake

pull/17/head
Luke Wren 2021-06-16 08:47:49 +01:00
rodzic 855546c03e
commit bfa4907d88
2 zmienionych plików z 26 dodań i 2 usunięć

Wyświetl plik

@ -8,7 +8,12 @@ pico_sdk_init()
add_compile_options(-Wall)
# add_definitions(-DDEFAULT_DVI_SERIAL_CONFIG=picodvi_pmod0_cfg)
# To change the default serial config for all apps, pass e.g.
# cmake -DDEFAULT_DVI_SERIAL_CONFIG=pimoroni_demo_hdmi_cfg ..
# then rebuild.
set(DEFAULT_DVI_SERIAL_CONFIG "pico_sock_cfg" CACHE STRING
"Select a default pin configuration from common_dvi_pin_configs.h")
add_definitions(-DDEFAULT_DVI_SERIAL_CONFIG=${DEFAULT_DVI_SERIAL_CONFIG})
include_directories(
assets

Wyświetl plik

@ -17,7 +17,26 @@ This will build all the example apps. You can then do e.g.
cp apps/sprite_bounce/sprite_bounce.uf2 /media/${USER}/RPI-RP2/
```
To flash a DVI board plugged into your system.
To flash a DVI board plugged into your system. Note the `PICO_COPY_TO_RAM=1` is important -- some of the apps will not run if this is not passed, because they use the SSI in fast DMA streaming mode. Others might underperform if they have large image assets (larger than the XIP cache) in flash.
Support for Different Boards
----------------------------
The DVI code is configured with which pins and which PIO state machines to use for signal generation, defined by a `dvi_serialiser_cfg` struct which looks like this:
```
static const struct dvi_serialiser_cfg picodvi_dvi_cfg = {
.pio = pio0,
.sm_tmds = {0, 1, 2},
.pins_tmds = {10, 12, 14},
.pins_clk = 8,
.invert_diffpairs = true
};
```
Serial configurations for a handful of boards are listed in [common_dvi_pin_configs.h](include/common_dvi_pin_configs.h). Feel free to raise a PR to add your board to this file. All of the example apps use the `DEFAULT_DVI_SERIAL_CONFIG` from this header to select their pin configuration, which has a default value of `pico_sock_cfg`. You can pass `-DDEFAULT_DVI_SERIAL_CONFIG=some_other_board` to `cmake` to override this default, so that the example apps will be built with a different serial configuration.
As well as the DVI serial configuration, you may also want to set the `PICO_BOARD` flag for your target board to pick up things like UART and LED pin settings.
Example Apps
------------