Multipe versions of vgaboard.h #755

Open
opened 2022-03-11 11:41:01 -06:00 by Memotech-Bill · 7 comments
Memotech-Bill commented 2022-03-11 11:41:01 -06:00 (Migrated from github.com)

It would be useful if there were three different versions of the vgaboard,h board definition file for the Pimoroni VGA Demo board:

  • vgaboard_serial.h - For when the SD card is not being used. This would not define any of the PICO_SD macros.

  • vgaboard_sd.h - For when the SD card is being used. This would not define any of the PICO_DEFAULT_UART macros.

  • vgaboard_cut.h - For when the tracks between the Pico and SD Data 1 & 2 have been cut (or the links on the prototype board removed). This would define both the PICO_DEFAULT_UART and PICO_SD macros, but with PICO_DAT_PIN_COUNT=1.

This would make it easier to write code which has to be able to compile for any of these configurations.

It would be useful if there were three different versions of the vgaboard,h board definition file for the Pimoroni VGA Demo board: * vgaboard_serial.h - For when the SD card is not being used. This would not define any of the PICO_SD macros. * vgaboard_sd.h - For when the SD card is being used. This would not define any of the PICO_DEFAULT_UART macros. * vgaboard_cut.h - For when the tracks between the Pico and SD Data 1 & 2 have been cut (or the links on the prototype board removed). This would define both the PICO_DEFAULT_UART and PICO_SD macros, but with PICO_DAT_PIN_COUNT=1. This would make it easier to write code which has to be able to compile for any of these configurations.
lurch commented 2022-03-11 17:02:06 -06:00 (Migrated from github.com)

I believe the vgaboard.h was added to reflect the VGA Demo Board example design in https://datasheets.raspberrypi.com/rp2040/hardware-design-with-rp2040.pdf

If the Pimoroni VGA Demo board works differently, then it's up to them to provide appropriate board-definition files.
ping @ZodiusInfuser (who added many of the previous Pimoroni board definition files)

I believe the `vgaboard.h` was added to reflect the VGA Demo Board _example_ design in https://datasheets.raspberrypi.com/rp2040/hardware-design-with-rp2040.pdf If the **Pimoroni** VGA Demo board works differently, then it's up to them to provide appropriate board-definition files. ping @ZodiusInfuser (who added many of the previous Pimoroni board definition files)
ZodiusInfuser commented 2022-03-11 17:55:48 -06:00 (Migrated from github.com)

It has been a while since I've looked at the VGA Demo board but my understanding is that our VGA Demo board uses the reference design of the example you link to above?

It has been a while since I've looked at the VGA Demo board but my understanding is that our VGA Demo board uses the reference design of the example you link to above?
kilograham commented 2022-03-11 18:45:42 -06:00 (Migrated from github.com)

You can create your own board header files.

Just set the PICO_BOARD_HEADER_DIRS to point to the directory where you keep them, either in your environment, on the cmake command line or at the top of your CMakeLists.txt

You can create your own board header files. Just set the `PICO_BOARD_HEADER_DIRS` to point to the directory where you keep them, either in your environment, on the cmake command line or at the top of your `CMakeLists.txt`
Memotech-Bill commented 2022-03-12 01:48:25 -06:00 (Migrated from github.com)

With the reference board design, there are at least two hardware configurations, GPIO 20 & 21 (J7) links-in or links-out. If the links are in (or on the Pimoroni board the links are not cut) the user has to decide whether their design will use the SD card, or use the serial port as it is not possible to use both in this configuration. Hence the three board definitions.

I know that I can create my own board definitions, but ideally I would like to create a repository containing a CMake file that will compile for any user selected board. This would require being able to specify a search path for the board files, i.e. first look for any custom board definitions, and if not found there look in the standard board definitions.

With the reference board design, there are at least two hardware configurations, GPIO 20 & 21 (J7) links-in or links-out. If the links are in (or on the Pimoroni board the links are not cut) the user has to decide whether their design will use the SD card, or use the serial port as it is not possible to use both in this configuration. Hence the three board definitions. I know that I can create my own board definitions, but ideally I would like to create a repository containing a CMake file that will compile for any user selected board. This would require being able to specify a search path for the board files, i.e. first look for any custom board definitions, and if not found there look in the standard board definitions.
Memotech-Bill commented 2022-03-12 08:29:03 -06:00 (Migrated from github.com)

I have just re-read the relevant section of the documentation and discovered that PICO_BOARD_HEADER_DIRS is a search path, not a single folder so I can create my own board definition files and have either these or the standard ones used.

I still think that my argument that there should be three different files is valid.

I have just re-read the relevant section of the documentation and discovered that PICO_BOARD_HEADER_DIRS is a search path, not a single folder so I can create my own board definition files and have either these or the standard ones used. I still think that my argument that there should be three different files is valid.
lurch commented 2024-06-05 13:36:57 -05:00 (Migrated from github.com)

I still think that my argument that there should be three different files is valid.

Wouldn't it be simpler to just have a bunch of #if / #elif / #endif directives in the existing vgaboard.h ? 🤔

> I still think that my argument that there should be three different files is valid. Wouldn't it be simpler to just have a bunch of `#if / #elif / #endif` directives in the existing `vgaboard.h` ? :thinking:
Memotech-Bill commented 2024-06-06 01:36:14 -05:00 (Migrated from github.com)

I still think that my argument that there should be three different files is valid.

Wouldn't it be simpler to just have a bunch of #if / #elif / #endif directives in the existing vgaboard.h ? 🤔

That would work. I don't know whether it would be simpler.

  • With three board definitions you just have to specify which board to use.
  • With conditionals in vgaboard.h you have to both specify that board definition, and set the #defines needed to choose the particular configuration.
> > I still think that my argument that there should be three different files is valid. > > Wouldn't it be simpler to just have a bunch of `#if / #elif / #endif` directives in the existing `vgaboard.h` ? 🤔 That would work. I don't know whether it would be simpler. * With three board definitions you just have to specify which board to use. * With conditionals in `vgaboard.h` you have to both specify that board definition, and set the `#defines` needed to choose the particular configuration.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk#755
No description provided.