From 0af037b16a7216f738c4bbd7cfaa17f0e0df0666 Mon Sep 17 00:00:00 2001 From: tyler miller Date: Fri, 27 Oct 2023 11:44:15 -0400 Subject: [PATCH] use drawio diagram embedding --- Dockerfile | 17 --- assets/diagrams/hal_concept.drawio | 75 ------------ assets/diagrams/hal_concept.drawio.svg | 1 + assets/diagrams/hal_concept_with_board.drawio | 112 ------------------ .../hal_concept_with_board.drawio.svg | 1 + assets/diagrams/syncthing_setup.drawio | 25 ---- assets/diagrams/syncthing_setup.drawio.svg | 1 + conf.py | 1 - pip-requirements.txt | 1 - posts/embedded_dev_primer.rst | 4 +- posts/syncthing_arkos.rst | 2 +- 11 files changed, 6 insertions(+), 234 deletions(-) delete mode 100644 assets/diagrams/hal_concept.drawio create mode 100644 assets/diagrams/hal_concept.drawio.svg delete mode 100644 assets/diagrams/hal_concept_with_board.drawio create mode 100644 assets/diagrams/hal_concept_with_board.drawio.svg delete mode 100644 assets/diagrams/syncthing_setup.drawio create mode 100644 assets/diagrams/syncthing_setup.drawio.svg diff --git a/Dockerfile b/Dockerfile index 83c8a15..5d5ed45 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,23 +4,6 @@ ADD pip-requirements.txt /tmp/pip-requirements.txt RUN pip install -r /tmp/pip-requirements.txt \ && rm /tmp/pip-requirements.txt -# install drawio for doc diagram gen -ENV DRAWIO_VERSION "21.1.2" -RUN apt update \ - && apt install -yq --no-install-recommends \ - xvfb \ - wget \ - libnotify4 \ - libgbm1 \ - libasound2 \ - libxss1 \ - libsecret-1-0 \ - && wget https://github.com/jgraph/drawio-desktop/releases/download/v${DRAWIO_VERSION}/drawio-amd64-${DRAWIO_VERSION}.deb \ - && apt install -y ./drawio-amd64-${DRAWIO_VERSION}.deb \ - && rm -rf /var/lib/apt/lists/* \ - && rm -rf drawio-amd64-${DRAWIO_VERSION}.deb -ENV XVFB_DISPLAY ":42" - FROM dev as prod # Bundle app source diff --git a/assets/diagrams/hal_concept.drawio b/assets/diagrams/hal_concept.drawio deleted file mode 100644 index 56cedb2..0000000 --- a/assets/diagrams/hal_concept.drawio +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/diagrams/hal_concept.drawio.svg b/assets/diagrams/hal_concept.drawio.svg new file mode 100644 index 0000000..a5fd09c --- /dev/null +++ b/assets/diagrams/hal_concept.drawio.svg @@ -0,0 +1 @@ +
Hardware Abstraction Layer (Interfaces of core hardware drivers)
Hardware Abstraction Layer (Interfaces of core hardware driv...
ISPI
ISPI
IGPIO
IGPIO
IUART
IUART
II2C
II2C
...
...
Device Drivers
(decoupled from underlying
 hardware driver implementation)
Device Drivers...
IMU
IMU
etc etc
etc etc
Libraries
(Business logic that uses a combination of device and
hardware driver interfaces)
Libraries...
Hardware-specific implementations of interfaces
Hardware-specific implementations of interfaces
MCU X
implementation
MCU X...
MCU Y
implementation
MCU Y...


Implementation is build-time selectable depending on your target environment
Implementation is build-time s...
Text is not SVG - cannot display
\ No newline at end of file diff --git a/assets/diagrams/hal_concept_with_board.drawio b/assets/diagrams/hal_concept_with_board.drawio deleted file mode 100644 index db57f99..0000000 --- a/assets/diagrams/hal_concept_with_board.drawio +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/diagrams/hal_concept_with_board.drawio.svg b/assets/diagrams/hal_concept_with_board.drawio.svg new file mode 100644 index 0000000..2af9d44 --- /dev/null +++ b/assets/diagrams/hal_concept_with_board.drawio.svg @@ -0,0 +1 @@ +
Application ABC
- top-level execution (main())
- initializes libraries required for app using
interface references from Board Data ABC
Application ABC...
Hardware Abstraction Layer (Interfaces of core hardware drivers)
Hardware Abstraction Layer (Interfaces of core hardware driv...
ISPI
ISPI
IGPIO
IGPIO
IUART
IUART
II2C
II2C
...
...
Device Drivers
(decoupled from underlying
 hardware driver implementation)
Device Drivers...
IMU
IMU
etc etc
etc etc
Libraries
(Business logic that uses a combination of device and
hardware driver interfaces)
Libraries...
Hardware-specific implementations of interfaces
Hardware-specific implementations of interfaces
MCU X
implementation
MCU X...
MCU Y
implementation
MCU Y...


Implementation is build-time selectable depending on your target environment
Implementation is build-time s...
Board Configuration info:
- gpio configuration
- clock configuration
- any special bootup specifics
Board Configuration info:...
Board A
Has "MCU X"
Board A...
Board B
Has "MCU Y"
Board B...
Board Data ABC
- Selects board
- initializes board-specific drivers that are
required by the application
Board Data ABC...
Text is not SVG - cannot display
\ No newline at end of file diff --git a/assets/diagrams/syncthing_setup.drawio b/assets/diagrams/syncthing_setup.drawio deleted file mode 100644 index 3f7537a..0000000 --- a/assets/diagrams/syncthing_setup.drawio +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/diagrams/syncthing_setup.drawio.svg b/assets/diagrams/syncthing_setup.drawio.svg new file mode 100644 index 0000000..84d9fdb --- /dev/null +++ b/assets/diagrams/syncthing_setup.drawio.svg @@ -0,0 +1 @@ +
ArkOS (RG353M)
ArkOS (RG353M)
NAS
(Unraid + Syncthing container)
NAS...
SteamDeck
SteamDeck
Text is not SVG - cannot display
\ No newline at end of file diff --git a/conf.py b/conf.py index dda83e4..598adc9 100644 --- a/conf.py +++ b/conf.py @@ -10,7 +10,6 @@ extensions = [ "ablog", "sphinx.ext.intersphinx", "sphinx_design", - "sphinxcontrib.drawio", ] templates_path = ["_templates"] diff --git a/pip-requirements.txt b/pip-requirements.txt index 83f9f09..1f144e7 100644 --- a/pip-requirements.txt +++ b/pip-requirements.txt @@ -3,4 +3,3 @@ ablog sphinx-design sphinxcontrib-youtube pydata-sphinx-theme -sphinxcontrib-drawio diff --git a/posts/embedded_dev_primer.rst b/posts/embedded_dev_primer.rst index 751bb12..3d4b18a 100644 --- a/posts/embedded_dev_primer.rst +++ b/posts/embedded_dev_primer.rst @@ -84,7 +84,7 @@ Making unit-testable code in embedded development can be challenging. There is a What does that look like? Something like this: -.. drawio-image:: ../assets/diagrams/hal_concept.drawio +.. image:: ../assets/diagrams/hal_concept.drawio.svg Notice all SOC/MCU-specific code is encapsulated down in a single library which we abstract out with an interface layer immediately. @@ -107,7 +107,7 @@ What are "board-specifics"? This is the term I use to describe the configuration Here's an extension of the earlier diagram with these concepts added: -.. drawio-image:: ../assets/diagrams/hal_concept_with_board.drawio +.. image:: ../assets/diagrams/hal_concept_with_board.drawio.svg Benefits: diff --git a/posts/syncthing_arkos.rst b/posts/syncthing_arkos.rst index a8e1481..8f5b01f 100644 --- a/posts/syncthing_arkos.rst +++ b/posts/syncthing_arkos.rst @@ -13,7 +13,7 @@ Setup Syncthing on arkos `Syncthing `_ is a handy tool for syncronizing files between multiple machines. I currently use 2 devices for playing retro games: a Steam Deck and a `Anbernic RG353m `_ running `arkos `_ My goal here is to syncronize save states and games between the devices. Here's my goal for a final setup: -.. drawio-image:: ../assets/diagrams/syncthing_setup.drawio +.. image:: ../assets/diagrams/syncthing_setup.drawio.svg For now, this writeup only covers RetroArch savestate syncing. There are also plenty of guides and advice online for setting up syncthing on the Steam Deck or a NAS, so the focus here will be ArkOS.