commit 71329d548477daae873fd0bbe92fa7a3a6dc0113 Author: KenwoodFox Date: Tue Dec 26 16:55:02 2023 -0500 Import from https://github.com/KenwoodFox/Project-Template diff --git a/.github/workflows/docs_workflow.yml b/.github/workflows/docs_workflow.yml new file mode 100644 index 0000000..2bb56be --- /dev/null +++ b/.github/workflows/docs_workflow.yml @@ -0,0 +1,72 @@ +name: Docs + +permissions: + contents: write + +on: + push: + branches: + - "main" + tags: + - "*" + pull_request: + paths: + - "Docs/**" + - ".github/workflows/**" + +# +jobs: + make_docs: + runs-on: ubuntu-latest + name: Build Docs + steps: + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + architecture: x64 + + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - run: sudo apt update && sudo apt install texlive-latex-recommended texlive-latex-extra texlive-pictures pandoc rename latexmk + + - name: Install docs requirements + run: pip install -r Docs/requirements.txt + + - name: Build pdf + run: cd Docs && make + + # + - run: mv Docs/_build/latex/*.pdf Docs/_build/latex/InstrumentVisor.pdf + + - uses: actions/upload-artifact@v2 + with: + name: Uniform_and_Style_Guide + path: Docs/_build/latex/InstrumentVisor.pdf + # + + publish_docs: + # Only run on tags + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + name: Publish Docs + needs: [make_docs] + + steps: + - uses: actions/download-artifact@v2 + with: + name: Uniform_and_Style_Guide + + - name: Upload Docs to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: "*.pdf" + tag: ${{ github.ref }} + overwrite: true + prerelease: true + # + body: "Kitsune Scientific, Automated with github ci/cd." + file_glob: true diff --git a/.github/workflows/firmware_workflow.yml b/.github/workflows/firmware_workflow.yml new file mode 100644 index 0000000..e4900f4 --- /dev/null +++ b/.github/workflows/firmware_workflow.yml @@ -0,0 +1,76 @@ +name: Firmware + +on: + push: + branches: + - "main" + tags: + - "*" + pull_request: + paths: + - "Firmware/**" + - ".github/workflows/**" + +# +jobs: + make_firmware: + runs-on: ubuntu-latest + name: Firmware Builder + + steps: + - uses: actions/checkout@v2 + - name: Cache pip + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Cache PlatformIO + uses: actions/cache@v2 + with: + path: ~/.platformio + key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} + - name: Set up Python + uses: actions/setup-python@v2 + - name: Install PlatformIO + run: | + python -m pip install --upgrade pip + pip install --upgrade platformio + + - name: Run PlatformIO + run: cd Firmware && make build + + - uses: actions/upload-artifact@v2 + with: + name: Display_Binaries + path: Firmware/.pio/build/ATmega328P/firmware.* + + delint: + runs-on: ubuntu-latest + name: Delinter + + steps: + - uses: actions/checkout@v2 + - name: Cache pip + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Cache PlatformIO + uses: actions/cache@v2 + with: + path: ~/.platformio + key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} + - name: Set up Python + uses: actions/setup-python@v2 + - name: Install PlatformIO + run: | + python -m pip install --upgrade pip + pip install --upgrade platformio + + - name: Run Delinter + run: cd Firmware && pio check +# diff --git a/.github/workflows/hardware_workflow.yml b/.github/workflows/hardware_workflow.yml new file mode 100644 index 0000000..895a338 --- /dev/null +++ b/.github/workflows/hardware_workflow.yml @@ -0,0 +1,104 @@ +name: Hardware + +permissions: + contents: write + actions: read + checks: write + +on: + push: + branches: + - "main" + tags: + - "*" + pull_request: + paths: + - "Hardware/**" + - ".github/workflows/**" + +# +jobs: + KiCad_Hardware: + runs-on: ubuntu-latest + name: KiCad Hardware + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + submodules: true + + - uses: INTI-CMNB/KiBot@v2_k7 + with: + # Config file + config: Hardware/config.kibot.yaml + # Prefix for output in config file. + dir: _hardwareOutput + + # Hardware Files + # + schema: "Hardware/InstrumentVisor/InstrumentVisor.kicad_sch" + board: "Hardware/InstrumentVisor/InstrumentVisor.kicad_pcb" + # + + - name: upload results + uses: actions/upload-artifact@v2 + with: + name: Board-Hardware + path: _hardwareOutput + + dev-publish: + # publish only to devs + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + name: Dev-Publish + needs: [KiCad_Hardware] + + steps: + - uses: actions/download-artifact@v2 + with: + name: Board-Hardware + + - name: Upload KiCAD Artifacts + uses: edunad/actions-image@v2.0.3 + with: + path: "*-3D_top.png" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + title: "PCB" + + publish: + # Only run on tags + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + name: Publish + needs: [KiCad_Hardware] + + steps: + # Be in our repo + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - uses: actions/download-artifact@v2 + with: + name: Board-Hardware + + - run: mkdir -p _staging/ + + - run: cp *.step _staging/ + + # Copy gerbers + - run: cp PCBWay/*.zip _staging/Board-$(git rev-parse --short HEAD)-PCBWay.zip + - run: cp JLCPCB/*.zip _staging/Board-$(git rev-parse --short HEAD)-JLCPCB.zip + + - name: Upload artifacts to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: "_staging/*" + tag: ${{ github.ref }} + overwrite: true + prerelease: true + # + body: "Kitsune Scientific, Automated with github ci/cd." + file_glob: true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c642030 --- /dev/null +++ b/.gitignore @@ -0,0 +1,51 @@ +# Build artifacts +version.h +_build + +# Binaries +*.FCStd1 +*.stl +*.pdf +*.zip +*.*~ + +# CAD Artifacts +*.stl + +# Doc artifacts +_*/ + +# Temporary files +*.000 +*.bak +*.bck +*.kicad_pcb-bak +*.kicad_sch-bak +*-backups +*.kicad_prl +*.sch-bak +*~ +_autosave-* +*.tmp +*-save.pro +*-save.kicad_pcb +fp-info-cache +*auto_saved_files# +*.lck + +# Netlist files (exported from Eeschema) +*.net + +# Autorouter files (exported from Pcbnew) +*.dsn +*.ses + +# Exported BOM files +*.xml +*.csv + +# Pio +.pio + +# dev artifacts +.vscode diff --git a/CAD/Cube.FCStd b/CAD/Cube.FCStd new file mode 100644 index 0000000..949d708 Binary files /dev/null and b/CAD/Cube.FCStd differ diff --git a/Docs/.gitignore b/Docs/.gitignore new file mode 100644 index 0000000..e04e21a --- /dev/null +++ b/Docs/.gitignore @@ -0,0 +1,5 @@ +# Dev +Pipfile* + +# Build +_build diff --git a/Docs/Makefile b/Docs/Makefile new file mode 100644 index 0000000..0aeea3c --- /dev/null +++ b/Docs/Makefile @@ -0,0 +1,17 @@ +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Refactored from minimal makefile + +all: latexpdf + +clean: + git clean -fdX + +latexpdf: Makefile + @$(SPHINXBUILD) -M latexpdf "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +html: Makefile + @$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/Docs/README.md b/Docs/README.md new file mode 100644 index 0000000..0c30a0b --- /dev/null +++ b/Docs/README.md @@ -0,0 +1,21 @@ +# Building the Docs + +To get started, you'll need a few things, you should have `pipenv` +(or your favorite python container tool). And some familiarly with RST. + +To begin, install the requirements into your python environment + +``` +pipenv install -r requirements.txt +pipenv shell +``` + +To make things easier, this project uses a build tool called make + +To use it just run + +``` +make +``` + +Thats it! Make some edits, and then run `make html` diff --git a/Docs/conf.py b/Docs/conf.py new file mode 100644 index 0000000..c9f8ba5 --- /dev/null +++ b/Docs/conf.py @@ -0,0 +1,57 @@ +import os +import sys +import subprocess +import sphinx_theme + +# Revision/git information +try: + release = ( + subprocess.check_output( + [ + "git", + "describe", + "--abbrev=4", + "--always", + "--tags", + ] + ) + .strip() + .decode("utf-8") + ) +except subprocess.CalledProcessError: + release = "NotARepo" + + +# Project Information +project = "InstrumentVisor" +copyright = "2023, Joe" +author = "Joe" + + +# General Config +extensions = [ + "sphinx.ext.autosectionlabel", +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] + + +# HTML output options +html_theme = "sphinx_rtd_theme" + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +# html_static_path = ['_static'] + + +# PDF output options +latex_elements = {"extraclassoptions": "openany,oneside"} + +latex_logo = "resources/logo.png" diff --git a/Docs/index.rst b/Docs/index.rst new file mode 100644 index 0000000..2cee3b3 --- /dev/null +++ b/Docs/index.rst @@ -0,0 +1,9 @@ +InstrumentVisor Docs +=============================== + +.. toctree:: + :maxdepth: 3 + :caption: Contents: + + introduction/introduction + \ No newline at end of file diff --git a/Docs/introduction/introduction.rst b/Docs/introduction/introduction.rst new file mode 100644 index 0000000..68cc3da --- /dev/null +++ b/Docs/introduction/introduction.rst @@ -0,0 +1,7 @@ +Introduction +############ + +Welcome! +======== + +Put an introduction here! diff --git a/Docs/requirements.txt b/Docs/requirements.txt new file mode 100644 index 0000000..6c9ee86 --- /dev/null +++ b/Docs/requirements.txt @@ -0,0 +1,5 @@ +# Sphinx +sphinx +sphinx-theme +sphinx-rtd-theme +readthedocs-sphinx-search diff --git a/Docs/resources/logo.kra b/Docs/resources/logo.kra new file mode 100644 index 0000000..a188c32 Binary files /dev/null and b/Docs/resources/logo.kra differ diff --git a/Docs/resources/logo.png b/Docs/resources/logo.png new file mode 100644 index 0000000..3b56210 Binary files /dev/null and b/Docs/resources/logo.png differ diff --git a/Firmware/.gitignore b/Firmware/.gitignore new file mode 100644 index 0000000..b9f3806 --- /dev/null +++ b/Firmware/.gitignore @@ -0,0 +1,2 @@ +.pio +.vscode diff --git a/Firmware/Makefile b/Firmware/Makefile new file mode 100644 index 0000000..069a30f --- /dev/null +++ b/Firmware/Makefile @@ -0,0 +1,46 @@ +# A very simple makefile full of shortcuts + +# What port the arduino is on +ifndef SERIAL_DEV + ifneq (,$(wildcard /dev/ttyUSB0)) + SERIAL_DEV = /dev/ttyUSB0 + else ifneq (,$(wildcard /dev/ttyACM0)) + SERIAL_DEV = /dev/ttyACM0 + else + SERIAL_DEV = unknown + endif +endif + +.PHONY: help + +help: ## Prints this help message + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + +build: ## Invokes pio run + pio run + +# For CI +binaries: ## Builds the binaries + pio run + pio run -t .pio/build/uno328/firmware.hex + +flash: ## Flashes the code to the processor + pio run -t upload + +deep: ## Flashes the code to processor with fresh EEPROM values + pio run -t uploadeep + +clean: ## Cleans the repo of artefacts + pio run -t clean + git clean -fdx + +lint: ## De-lints the repo + pio check + +test: ## Run automated tests + pio test --upload-port $(SERIAL_DEV) + +debug: flash monitor ## Flashes then Monitors + +monitor: ## Monitors the device serial + pio device monitor --filter=direct --filter=time diff --git a/Firmware/build_flags.py b/Firmware/build_flags.py new file mode 100644 index 0000000..3ff0b4e --- /dev/null +++ b/Firmware/build_flags.py @@ -0,0 +1,76 @@ +import logging +import subprocess + +from datetime import date + + +today = date.today() + +try: + revision = ( + subprocess.check_output( + [ + "git", + "describe", + "--abbrev=8", + "--dirty", + "--always", + "--tags", + ] + ) + .strip() + .decode("utf-8") + ) + + print(f"-D REVISION='\"{revision}\"'") +except Exception as e: + logging.warning("Getting git revision failed!! Check that you have git installed?") + logging.warning(e) + + print("-D REVISION='Unknown'") + +try: + host = ( + subprocess.check_output( + [ + "hostname", + ] + ) + .strip() + .decode("utf-8") + ) + + print(f"-D FWHOST='\"{host}\"'") +except Exception as e: + logging.warning("Getting host failed!! Are you using a UNIX compatible system?") + logging.warning(e) + + print("-D FWHOST='Unknown'") + +try: + username = ( + subprocess.check_output( + [ + "id", + "-u", + "-n", + ] + ) + .strip() + .decode("utf-8") + ) + + # Cleanup CI + if username == "root": + username = "git" + host = "git" + + print(f"-D USERNAME='\"{username}\"'") +except Exception as e: + logging.warning("Getting host failed!! Are you using a UNIX compatible system?") + logging.warning(e) + + print("-D USERNAME='Unknown'") + +# Print to enable debugging +# print("-D DEBUG") diff --git a/Firmware/include/boardPins.h b/Firmware/include/boardPins.h new file mode 100644 index 0000000..fbd1ce3 --- /dev/null +++ b/Firmware/include/boardPins.h @@ -0,0 +1,7 @@ +#ifndef _BOARD_PINS_H +#define _BOARD_PINS_H + +// LEDs +#define STAT_LED 13 + +#endif diff --git a/Firmware/lib/README.md b/Firmware/lib/README.md new file mode 100644 index 0000000..bef5d2e --- /dev/null +++ b/Firmware/lib/README.md @@ -0,0 +1 @@ +PIO stores lib data in here, you can create lib folders with objects inside. \ No newline at end of file diff --git a/Firmware/platformio.ini b/Firmware/platformio.ini new file mode 100644 index 0000000..16f009e --- /dev/null +++ b/Firmware/platformio.ini @@ -0,0 +1,23 @@ +; PlatformIO Project Configuration File + +[env:ATmega328P] +platform = atmelavr ; Platform to build for +board = ATmega328P ; Supported board +framework = arduino ; What framework we're using + +board_build.mcu = atmega328p ; Microcontroller +board_build.f_cpu = 16000000L ; Frequency + +build_flags = !python build_flags.py ; Build flags before we push + +check_tool = clangtidy ; De-linter +check_flags = + clangtidy: --fix --checks=abseil,boost,bugprone,cert,cppcoreguidelines,clang-analyzer,google,hicpp,modernize,performance,portability,readability,cppcoreguidelines-avoid-magic-numbers,fuchsia-statically-constructed-objects,cert-err58-cpp,cppcoreguidelines-avoid-non-const-global-variables,cppcoreguidelines-macro-usage + +lib_deps = ; External libraries + SPI + +# Monitor Settings +monitor_speed = 115200 +monitor_rts = 0 +monitor_dtr = 0 diff --git a/Firmware/src/main.cpp b/Firmware/src/main.cpp new file mode 100644 index 0000000..992bc3e --- /dev/null +++ b/Firmware/src/main.cpp @@ -0,0 +1,31 @@ +/** + * @file main.cpp + * @author Joe + * @brief Source code for InstrumentVisor + */ + +// Libs +#include + +// Headers +#include "boardPins.h" + +void setup() +{ + // Setup serial + delay(200); + Serial.begin(115200); + Serial.println(REVISION); + + // Pins + pinMode(STAT_LED, OUTPUT); +} + +void loop() +{ + // Flash LED + digitalWrite(STAT_LED, HIGH); + delay(1000); + digitalWrite(STAT_LED, LOW); + delay(1000); +} diff --git a/Firmware/test/README b/Firmware/test/README new file mode 100644 index 0000000..9b1e87b --- /dev/null +++ b/Firmware/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html diff --git a/Hardware/InstrumentVisor/InstrumentVisor.kicad_pcb b/Hardware/InstrumentVisor/InstrumentVisor.kicad_pcb new file mode 100644 index 0000000..2b8ba10 --- /dev/null +++ b/Hardware/InstrumentVisor/InstrumentVisor.kicad_pcb @@ -0,0 +1,2 @@ +(kicad_pcb (version 20221018) (generator pcbnew) +) \ No newline at end of file diff --git a/Hardware/InstrumentVisor/InstrumentVisor.kicad_pro b/Hardware/InstrumentVisor/InstrumentVisor.kicad_pro new file mode 100644 index 0000000..08c3991 --- /dev/null +++ b/Hardware/InstrumentVisor/InstrumentVisor.kicad_pro @@ -0,0 +1,332 @@ +{ + "board": { + "3dviewports": [], + "design_settings": { + "defaults": { + "board_outline_line_width": 0.1, + "copper_line_width": 0.2, + "copper_text_size_h": 1.5, + "copper_text_size_v": 1.5, + "copper_text_thickness": 0.3, + "other_line_width": 0.15, + "silk_line_width": 0.15, + "silk_text_size_h": 1.0, + "silk_text_size_v": 1.0, + "silk_text_thickness": 0.15 + }, + "diff_pair_dimensions": [], + "drc_exclusions": [], + "rules": { + "min_copper_edge_clearance": 0.0, + "solder_mask_clearance": 0.0, + "solder_mask_min_width": 0.0 + }, + "track_widths": [], + "via_dimensions": [] + }, + "layer_presets": [], + "viewports": [] + }, + "boards": [], + "cvpcb": { + "equivalence_files": [] + }, + "erc": { + "erc_exclusions": [], + "meta": { + "version": 0 + }, + "pin_map": [ + [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 2 + ], + [ + 0, + 2, + 0, + 1, + 0, + 0, + 1, + 0, + 2, + 2, + 2, + 2 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 2 + ], + [ + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 1, + 2, + 1, + 1, + 2 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 2 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2 + ], + [ + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 2 + ], + [ + 0, + 0, + 0, + 1, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 2 + ], + [ + 0, + 2, + 1, + 2, + 0, + 0, + 1, + 0, + 2, + 2, + 2, + 2 + ], + [ + 0, + 2, + 0, + 1, + 0, + 0, + 1, + 0, + 2, + 0, + 0, + 2 + ], + [ + 0, + 2, + 1, + 1, + 0, + 0, + 1, + 0, + 2, + 0, + 0, + 2 + ], + [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ] + ], + "rule_severities": { + "bus_definition_conflict": "error", + "bus_entry_needed": "error", + "bus_to_bus_conflict": "error", + "bus_to_net_conflict": "error", + "conflicting_netclasses": "error", + "different_unit_footprint": "error", + "different_unit_net": "error", + "duplicate_reference": "error", + "duplicate_sheet_names": "error", + "endpoint_off_grid": "warning", + "extra_units": "error", + "global_label_dangling": "warning", + "hier_label_mismatch": "error", + "label_dangling": "error", + "lib_symbol_issues": "warning", + "missing_bidi_pin": "warning", + "missing_input_pin": "warning", + "missing_power_pin": "error", + "missing_unit": "warning", + "multiple_net_names": "warning", + "net_not_bus_member": "warning", + "no_connect_connected": "warning", + "no_connect_dangling": "warning", + "pin_not_connected": "error", + "pin_not_driven": "error", + "pin_to_pin": "warning", + "power_pin_not_driven": "error", + "similar_labels": "warning", + "simulation_model_issue": "ignore", + "unannotated": "error", + "unit_value_mismatch": "error", + "unresolved_variable": "error", + "wire_dangling": "error" + } + }, + "libraries": { + "pinned_footprint_libs": [], + "pinned_symbol_libs": [] + }, + "meta": { + "filename": "InstrumentVisor.kicad_pro", + "version": 1 + }, + "net_settings": { + "classes": [ + { + "bus_width": 12, + "clearance": 0.2, + "diff_pair_gap": 0.25, + "diff_pair_via_gap": 0.25, + "diff_pair_width": 0.2, + "line_style": 0, + "microvia_diameter": 0.3, + "microvia_drill": 0.1, + "name": "Default", + "pcb_color": "rgba(0, 0, 0, 0.000)", + "schematic_color": "rgba(0, 0, 0, 0.000)", + "track_width": 0.25, + "via_diameter": 0.8, + "via_drill": 0.4, + "wire_width": 6 + } + ], + "meta": { + "version": 3 + }, + "net_colors": null, + "netclass_assignments": null, + "netclass_patterns": [] + }, + "pcbnew": { + "last_paths": { + "gencad": "", + "idf": "", + "netlist": "", + "specctra_dsn": "", + "step": "", + "vrml": "" + }, + "page_layout_descr_file": "" + }, + "schematic": { + "annotate_start_num": 0, + "drawing": { + "dashed_lines_dash_length_ratio": 12.0, + "dashed_lines_gap_length_ratio": 3.0, + "default_line_thickness": 6.0, + "default_text_size": 50.0, + "field_names": [], + "intersheets_ref_own_page": false, + "intersheets_ref_prefix": "", + "intersheets_ref_short": false, + "intersheets_ref_show": false, + "intersheets_ref_suffix": "", + "junction_size_choice": 3, + "label_size_ratio": 0.375, + "pin_symbol_size": 25.0, + "text_offset_ratio": 0.15 + }, + "legacy_lib_dir": "", + "legacy_lib_list": [], + "meta": { + "version": 1 + }, + "net_format_name": "", + "page_layout_descr_file": "", + "plot_directory": "", + "spice_current_sheet_as_root": false, + "spice_external_command": "spice \"%I\"", + "spice_model_current_sheet_as_root": true, + "spice_save_all_currents": false, + "spice_save_all_voltages": false, + "subpart_first_id": 65, + "subpart_id_separator": 0 + }, + "sheets": [ + [ + "894f620e-3404-4a40-a2a7-513bc1d5f99b", + "" + ] + ], + "text_variables": {} +} diff --git a/Hardware/InstrumentVisor/InstrumentVisor.kicad_sch b/Hardware/InstrumentVisor/InstrumentVisor.kicad_sch new file mode 100644 index 0000000..018f374 --- /dev/null +++ b/Hardware/InstrumentVisor/InstrumentVisor.kicad_sch @@ -0,0 +1,20 @@ +(kicad_sch (version 20230121) (generator eeschema) + + (uuid 894f620e-3404-4a40-a2a7-513bc1d5f99b) + + (paper "A4") + + (title_block + (title "InstrumentVisor") + (rev "${REVISION}") + (company "Kitsune Scientific") + ) + + (lib_symbols + ) + + + (sheet_instances + (path "/" (page "1")) + ) +) diff --git a/Hardware/InstrumentVisor/Libraries/README.md b/Hardware/InstrumentVisor/Libraries/README.md new file mode 100644 index 0000000..096c32f --- /dev/null +++ b/Hardware/InstrumentVisor/Libraries/README.md @@ -0,0 +1,3 @@ +# External Libraries + +Add external libraries here: `git submodule add ` diff --git a/Hardware/InstrumentVisor/Stencils/README.md b/Hardware/InstrumentVisor/Stencils/README.md new file mode 100644 index 0000000..e3db0d0 --- /dev/null +++ b/Hardware/InstrumentVisor/Stencils/README.md @@ -0,0 +1,3 @@ +# Stencils and Templates + +Assembly jigs and tools. \ No newline at end of file diff --git a/Hardware/InstrumentVisor/Stencils/SolderMaskStencil.FCStd b/Hardware/InstrumentVisor/Stencils/SolderMaskStencil.FCStd new file mode 100644 index 0000000..0be8073 Binary files /dev/null and b/Hardware/InstrumentVisor/Stencils/SolderMaskStencil.FCStd differ diff --git a/Hardware/config.kibot.yaml b/Hardware/config.kibot.yaml new file mode 100644 index 0000000..9484ecf --- /dev/null +++ b/Hardware/config.kibot.yaml @@ -0,0 +1,230 @@ +kibot: + version: 1 +# Look into pcb_replace, looks sick! Also sch_replace + +preflight: + run_erc: true + update_xml: true + run_drc: false + check_zone_fills: false + ignore_unconnected: false + + # Replace variables + set_text_variables: + - name: "REVISION" + command: "git rev-parse --short HEAD" + - name: "FULL_REVISION" + command: "git describe --always --tags" + - name: "ISSUE" + command: "date '+%Y-%m-%d'" + # - name: "KENWOODFOX_3DMODELS" # My custom libs! + # command: "echo 'Hardware/InstrumentVisor/Libraries/kenwoodfox-kicad-libraries/3d'" + +filters: + - name: only_jlc_parts + comment: "Only parts with JLC code" + type: generic + include_only: + - column: "LCSC#" + regex: '^C\d+' + +variants: + - name: rotated + comment: "Just a place holder for the rotation filter" + type: kibom + variant: rotated + pre_transform: _rot_footprint + +outputs: + - name: "Images" + comment: "Schematics and media for use in docs" + type: svg_sch_print + + - name: "3D Models" + comment: "3D Models" + type: step + + - name: "3D Renders" + comment: "3D Renders for docs!" + type: render_3d + options: + ray_tracing: true + rotate_x: -1 + rotate_y: 2 + zoom: 3 + wait_render: 20 + width: 800 + + # ====== + # PCBWay + # ====== + + - name: PCBWay_gerbers + comment: Gerbers compatible with PCBWay + type: gerber + dir: PCBWay + options: + exclude_edge_layer: true + exclude_pads_from_silkscreen: true + plot_sheet_reference: false + plot_footprint_refs: true + plot_footprint_values: true + force_plot_invisible_refs_vals: false + tent_vias: true + use_protel_extensions: true + create_gerber_job_file: false + output: "%f.%x" + gerber_precision: 4.6 + use_gerber_x2_attributes: false + use_gerber_net_attributes: false + disable_aperture_macros: true + line_width: 0.1 + subtract_mask_from_silk: false + inner_extension_pattern: ".gl%N" + layers: + - copper + - F.SilkS + - B.SilkS + - F.Mask + - B.Mask + - F.Paste + - B.Paste + - Edge.Cuts + + - name: PCBWay_drill + comment: Drill files compatible with PCBWay + type: excellon + dir: PCBWay + options: + metric_units: false + minimal_header: true + zeros_format: SUPPRESS_LEADING + # left_digits: 3 + # right_digits: 3 + # See https://github.com/INTI-CMNB/kicad-ci-test-spora/issues/1 + # and https://docs.oshpark.com/design-tools/gerbv/fix-drill-format/ + left_digits: 2 + right_digits: 4 + pth_and_npth_single_file: false + pth_id: "" + npth_id: "-NPTH" + output: "%f%i.drl" + + - name: PCBWay + comment: ZIP file for PCBWay + type: compress + dir: PCBWay + options: + format: ZIP + files: + - from_output: PCBWay_gerbers + dest: / + - from_output: PCBWay_drill + dest: / + + # ====== + # JLCPCB + # ====== + + - name: JLCPCB_gerbers + comment: Gerbers compatible with JLCPCB + type: gerber + dir: JLCPCB + options: + exclude_edge_layer: true + exclude_pads_from_silkscreen: true + plot_sheet_reference: false + plot_footprint_refs: true + plot_footprint_values: true + force_plot_invisible_refs_vals: false + tent_vias: true + use_protel_extensions: true + create_gerber_job_file: false + disable_aperture_macros: true + gerber_precision: 4.6 + use_gerber_x2_attributes: false + use_gerber_net_attributes: false + line_width: 0.1 + subtract_mask_from_silk: true + inner_extension_pattern: ".gp%n" + layers: + - copper + - F.SilkS + - B.SilkS + - F.Mask + - B.Mask + - F.Paste + - B.Paste + - Edge.Cuts + + - name: JLCPCB_drill + comment: Drill files compatible with JLCPCB + type: excellon + dir: JLCPCB + options: + pth_and_npth_single_file: false + pth_id: "-PTH" + npth_id: "-NPTH" + metric_units: true + map: gerber + route_mode_for_oval_holes: false + output: "%f%i.%x" + + - name: "JLCPCB_position" + comment: "Pick and place file, JLCPCB style" + type: position + options: + variant: rotated + output: "%f_cpl_jlc.%x" + format: CSV + units: millimeters + separate_files_for_front_and_back: false + only_smd: true + columns: + - id: Ref + name: Designator + - Val + - Package + - id: PosX + name: "Mid X" + - id: PosY + name: "Mid Y" + - id: Rot + name: Rotation + - id: Side + name: Layer + + - name: "JLCPCB_bom" + comment: "BoM for JLCPCB" + type: bom + options: + output: "%f_%i_jlc.%x" + exclude_filter: "only_jlc_parts" + ref_separator: "," + columns: + - field: Value + name: Comment + - field: References + name: Designator + - Footprint + - field: "LCSC#" + name: "LCSC Part #" + csv: + hide_pcb_info: true + hide_stats_info: true + quote_all: true + + - name: JLCPCB + comment: ZIP file for JLCPCB + type: compress + dir: JLCPCB + options: + files: + - from_output: JLCPCB_gerbers + dest: / + - from_output: JLCPCB_drill + dest: / + - from_output: JLCPCB_position + dest: / + - from_output: JLCPCB_bom + dest: / diff --git a/README.md b/README.md new file mode 100644 index 0000000..0d8b10a --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +[![Docs](https://github.com/Kenwood/InstrumentVisor/actions/workflows/docs_workflow.yml/badge.svg)](https://github.com/Kenwood/InstrumentVisor/actions/workflows/docs_workflow.yml) +[![Hardware](https://github.com/Kenwood/InstrumentVisor/actions/workflows/hardware_workflow.yml/badge.svg)](https://github.com/Kenwood/InstrumentVisor/actions/workflows/hardware_workflow.yml) +[![Firmware](https://github.com/Kenwood/InstrumentVisor/actions/workflows/firmware_workflow.yml/badge.svg)](https://github.com/Kenwood/InstrumentVisor/actions/workflows/firmware_workflow.yml) + + +# InstrumentVisor + +![Banner](Static/Banner.png) + +This repo contains all the firmware and hardware for the InstrumentVisor. + +If you're looking for the latest docs/builds, see our [Releases Page](https://github.com/Kenwood/InstrumentVisor/releases). + +# Getting Started + +First, clone this repo (and optionally checkout a branch) + +```shell +git clone https://github.com/Kenwood/InstrumentVisor.git +cd InstrumentVisor +``` + +# Init Submodules + +Some libraries and resources are included as submodules, run the following +command to initialize them before opening the main sch + +(If you get a missing library error, make sure to do this) + +```shell +git submodule update --init --recursive +``` + + +## Project Layout + +If you want to use this project template for yourself, you can find it [here!](https://github.com/KenwoodFox/Project-Template) diff --git a/Static/Banner.kra b/Static/Banner.kra new file mode 100644 index 0000000..1a9fc92 Binary files /dev/null and b/Static/Banner.kra differ diff --git a/Static/Banner.png b/Static/Banner.png new file mode 100644 index 0000000..5eab420 Binary files /dev/null and b/Static/Banner.png differ