├── __init__.py ├── util ├── __init__.py ├── file_util.py └── rev_info.py ├── electronics ├── scripts │ ├── __init__.py │ ├── dependencies.sh │ ├── export_jlcpcb.py │ ├── generate_pdf.py │ ├── config │ │ ├── eeschema │ │ └── policy.xml │ ├── pcb_util.py │ └── export_util.py ├── lib │ ├── MagnTek.dcm │ ├── Trinamic.dcm │ ├── VEML7700.dcm │ ├── no_pin.dcm │ ├── strain.dcm │ ├── lilygo_micro32.dcm │ ├── SK6812.dcm │ ├── SN74AVC4T774.dcm │ ├── GCT_USB.3dshapes │ │ └── proprietary │ │ │ └── README.txt │ ├── no_pin.lib │ ├── BOM_Only.pretty │ │ └── bom_only_no_pin.kicad_mod │ ├── VEML7700.lib │ ├── Holes.pretty │ │ ├── AlignmentHole_1.6.kicad_mod │ │ ├── MountingHole_M1.6.kicad_mod │ │ └── MountingHole_2.2mm_M2_ISO7380_Pad_NonVirtual.kicad_mod │ ├── SolderPads.pretty │ │ ├── SolderPads_2mm_3.kicad_mod │ │ ├── SolderPads_2mm_4.kicad_mod │ │ ├── SolderPads_2mm_8.kicad_mod │ │ └── SolderPads_2mm_3_STRAIN.kicad_mod │ ├── MagnTek.lib │ ├── SK6812.lib │ ├── Modified.pretty │ │ ├── TestPoint_Pad_D2.0mm_ValueSilk.kicad_mod │ │ ├── QFN-20-1EP_3x3mm_P0.4mm_EP1.65x1.65mm_ThermalVias_LargerViaHoles.kicad_mod │ │ └── CP_Radial_D5.0mm_P2.00mm_HorizontalCutout.kicad_mod │ ├── strain.lib │ ├── Trinamic.lib │ ├── VEML7700.pretty │ │ └── VEML7700-TOP.kicad_mod │ ├── sk6812.pretty │ │ └── SK6812-SIDE-A.kicad_mod │ ├── SN74AVC4T774.lib │ ├── LCD_GC9A01.pretty │ │ └── GC9A01Round1.28.kicad_mod │ ├── BM28.pretty │ │ └── BM28B0.6-24DS.kicad_mod │ ├── GCT_USB.pretty │ │ ├── USB4510_NoPaste.kicad_mod │ │ └── USB4510.kicad_mod │ ├── SN74AVC4T774.pretty │ │ └── Texas_Instruments-RSV_R-PUQFN-N16-0-0-0.kicad_mod │ ├── Molex.pretty │ │ └── 532610371.kicad_mod │ ├── strain.pretty │ │ └── BF350-3AA.kicad_mod │ ├── lilygo_micro32.lib │ └── lilygo_micro32.pretty │ │ └── T-Micro32.kicad_mod ├── BM28B0.6-24DSBreakout │ ├── fp-lib-table │ ├── BM28B0.6-24DSBreakout.sch │ ├── BM28B0.6-24DSBreakout-cache.lib │ └── BM28B0.6-24DSBreakout.pro ├── LevelShifterBreakout │ ├── fp-lib-table │ ├── sym-lib-table │ ├── LevelShifterBreakout-cache.lib │ ├── LevelShifterBreakout.pro │ └── LevelShifterBreakout.sch ├── view_screen │ ├── fp-lib-table │ ├── sym-lib-table │ ├── view_screen.kibot.yml │ ├── view_screen.pro │ └── view_screen-cache.lib └── view_base │ ├── sym-lib-table │ ├── view_base.kibot.yml │ ├── fp-lib-table │ └── view_base.pro ├── .github ├── FUNDING.yml └── workflows │ ├── pio.yml │ └── electronics.yml ├── doc └── img │ ├── explodedv145.gif │ ├── PXL_20220212_013249074.jpg │ └── motors │ ├── PXL_20220121_220504138.jpg │ ├── PXL_20220121_220515698.jpg │ ├── PXL_20220121_220530808.jpg │ ├── PXL_20220121_220546761.jpg │ ├── PXL_20220121_221738745.jpg │ └── PXL_20220121_221746595.jpg ├── scripts ├── RobotoMono-Bold.ttf └── annotate_image.sh ├── firmware ├── .gitignore ├── src │ ├── logger.h │ ├── util.h │ ├── knob_data.h │ ├── interface_task.h │ ├── mt6701_sensor.h │ ├── display_task.h │ ├── tlv_sensor.h │ ├── motor_task.h │ ├── semaphore_guard.h │ ├── tlv_sensor.cpp │ ├── task.h │ ├── main.cpp │ └── mt6701_sensor.cpp ├── lib │ ├── tlv │ │ ├── .piopm │ │ ├── library.json │ │ ├── library.properties │ │ ├── LICENSE.md │ │ ├── src │ │ │ ├── util │ │ │ │ ├── BusInterface.h │ │ │ │ ├── RegMask.h │ │ │ │ ├── BusInterface2.h │ │ │ │ ├── RegMask.cpp │ │ │ │ ├── BusInterface.cpp │ │ │ │ └── Tlv493d_conf.h │ │ │ └── Tlv493d.h │ │ └── README.md │ └── README ├── .vscode │ └── extensions.json ├── test │ └── README ├── include │ └── README └── platformio.ini ├── .vscode └── extensions.json ├── .gitignore └── cad └── README.md /__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /util/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /electronics/scripts/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /electronics/lib/MagnTek.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /electronics/lib/Trinamic.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /electronics/lib/VEML7700.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /electronics/lib/no_pin.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /electronics/lib/strain.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: scottbez1 4 | -------------------------------------------------------------------------------- /electronics/lib/lilygo_micro32.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /doc/img/explodedv145.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThinkCodeStudio/smartknob/master/doc/img/explodedv145.gif -------------------------------------------------------------------------------- /scripts/RobotoMono-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThinkCodeStudio/smartknob/master/scripts/RobotoMono-Bold.ttf -------------------------------------------------------------------------------- /doc/img/PXL_20220212_013249074.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThinkCodeStudio/smartknob/master/doc/img/PXL_20220212_013249074.jpg -------------------------------------------------------------------------------- /firmware/.gitignore: -------------------------------------------------------------------------------- 1 | .pio 2 | .vscode/.browse.c_cpp.db* 3 | .vscode/c_cpp_properties.json 4 | .vscode/launch.json 5 | .vscode/ipch 6 | -------------------------------------------------------------------------------- /firmware/src/logger.h: -------------------------------------------------------------------------------- 1 | 2 | class Logger { 3 | public: 4 | Logger() {}; 5 | virtual ~Logger() {}; 6 | 7 | }; 8 | -------------------------------------------------------------------------------- /doc/img/motors/PXL_20220121_220504138.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThinkCodeStudio/smartknob/master/doc/img/motors/PXL_20220121_220504138.jpg -------------------------------------------------------------------------------- /doc/img/motors/PXL_20220121_220515698.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThinkCodeStudio/smartknob/master/doc/img/motors/PXL_20220121_220515698.jpg -------------------------------------------------------------------------------- /doc/img/motors/PXL_20220121_220530808.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThinkCodeStudio/smartknob/master/doc/img/motors/PXL_20220121_220530808.jpg -------------------------------------------------------------------------------- /doc/img/motors/PXL_20220121_220546761.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThinkCodeStudio/smartknob/master/doc/img/motors/PXL_20220121_220546761.jpg -------------------------------------------------------------------------------- /doc/img/motors/PXL_20220121_221738745.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThinkCodeStudio/smartknob/master/doc/img/motors/PXL_20220121_221738745.jpg -------------------------------------------------------------------------------- /doc/img/motors/PXL_20220121_221746595.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThinkCodeStudio/smartknob/master/doc/img/motors/PXL_20220121_221746595.jpg -------------------------------------------------------------------------------- /electronics/BM28B0.6-24DSBreakout/fp-lib-table: -------------------------------------------------------------------------------- 1 | (fp_lib_table 2 | (lib (name BM28)(type KiCad)(uri ${KIPRJMOD}/../lib/BM28.pretty)(options "")(descr "")) 3 | ) 4 | -------------------------------------------------------------------------------- /electronics/lib/SK6812.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | $CMP SK6812SIDE-A 4 | D RGB LED with integrated controller 5 | $ENDCMP 6 | # 7 | #End Doc Library 8 | -------------------------------------------------------------------------------- /electronics/LevelShifterBreakout/fp-lib-table: -------------------------------------------------------------------------------- 1 | (fp_lib_table 2 | (lib (name SN74AVC4T774)(type KiCad)(uri ${KIPRJMOD}/../lib/SN74AVC4T774.pretty)(options "")(descr "")) 3 | ) 4 | -------------------------------------------------------------------------------- /electronics/LevelShifterBreakout/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (lib (name SN74AVC4T774)(type Legacy)(uri ${KIPRJMOD}/../lib/SN74AVC4T774.lib)(options "")(descr "")) 3 | ) 4 | -------------------------------------------------------------------------------- /firmware/src/util.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | template T CLAMP(const T& value, const T& low, const T& high) 5 | { 6 | return value < low ? low : (value > high ? high : value); 7 | } 8 | -------------------------------------------------------------------------------- /electronics/lib/SN74AVC4T774.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | $CMP SN74AVC4T774RSVR 4 | D SN74AVC4T774RSVR 5 | F http://www.ti.com/lit/ds/symlink/sn74avc4t774.pdf 6 | $ENDCMP 7 | # end doc library 8 | -------------------------------------------------------------------------------- /firmware/lib/tlv/.piopm: -------------------------------------------------------------------------------- 1 | {"type": "library", "name": "TLV493D-Magnetic-Sensor", "version": "1.0.3", "spec": {"owner": "infineon", "id": 957, "name": "TLV493D-Magnetic-Sensor", "requirements": null, "url": null}} -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "platformio.platformio-ide" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /util/file_util.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import errno 4 | import os 5 | 6 | def mkdir_p(path): 7 | try: 8 | os.makedirs(path) 9 | except OSError as exc: # Python >2.5 10 | if exc.errno == errno.EEXIST and os.path.isdir(path): 11 | pass 12 | else: 13 | raise 14 | 15 | -------------------------------------------------------------------------------- /firmware/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "platformio.platformio-ide" 6 | ], 7 | "unwantedRecommendations": [ 8 | "ms-vscode.cpptools-extension-pack" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /electronics/lib/GCT_USB.3dshapes/proprietary/README.txt: -------------------------------------------------------------------------------- 1 | This folder should contain a single file named: 2 | USB4510-03-1-A.stp 3 | 4 | Unfortunately it cannot be distributed directly as part of this project. 5 | 6 | The model can be downloaded for your own use for free (with CADENAS account): 7 | https://gct.co/mouser/connector/usb4510 8 | 9 | 10 | -------------------------------------------------------------------------------- /electronics/lib/no_pin.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # no_pin 5 | # 6 | DEF no_pin Z 0 40 Y Y 1 F N 7 | F0 "Z" -350 150 60 H V C CNN 8 | F1 "no_pin" 0 0 60 H V C CNN 9 | F2 "" 0 0 60 H I C CNN 10 | F3 "" 0 0 60 H I C CNN 11 | DRAW 12 | S -400 100 400 -100 0 1 0 N 13 | ENDDRAW 14 | ENDDEF 15 | # 16 | #End Library 17 | -------------------------------------------------------------------------------- /electronics/lib/BOM_Only.pretty/bom_only_no_pin.kicad_mod: -------------------------------------------------------------------------------- 1 | (module bom_only_no_pin (layer F.Cu) (tedit 622E7E88) 2 | (attr smd) 3 | (fp_text reference REF** (at 0 0.5) (layer F.Fab) 4 | (effects (font (size 1 1) (thickness 0.15))) 5 | ) 6 | (fp_text value bom_only_no_pin (at 0 -0.5) (layer F.Fab) 7 | (effects (font (size 1 1) (thickness 0.15))) 8 | ) 9 | ) 10 | -------------------------------------------------------------------------------- /electronics/view_screen/fp-lib-table: -------------------------------------------------------------------------------- 1 | (fp_lib_table 2 | (lib (name Holes)(type KiCad)(uri ${KIPRJMOD}/../lib/Holes.pretty)(options "")(descr "")) 3 | (lib (name Modified)(type KiCad)(uri ${KIPRJMOD}/../lib/Modified.pretty)(options "")(descr "")) 4 | (lib (name SolderPads)(type KiCad)(uri ${KIPRJMOD}/../lib/SolderPads.pretty)(options "")(descr "")) 5 | (lib (name LCD_GC9A01)(type KiCad)(uri ${KIPRJMOD}/../lib/LCD_GC9A01.pretty)(options "")(descr "")) 6 | ) 7 | -------------------------------------------------------------------------------- /firmware/src/knob_data.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | struct KnobConfig { 6 | int32_t num_positions; 7 | int32_t position; 8 | float position_width_radians; 9 | float detent_strength_unit; 10 | float endstop_strength_unit; 11 | float snap_point; 12 | char descriptor[50]; 13 | }; 14 | 15 | struct KnobState { 16 | int32_t current_position; 17 | float sub_position_unit; 18 | KnobConfig config; 19 | }; 20 | -------------------------------------------------------------------------------- /scripts/annotate_image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 6 | 7 | FONT="$DIR/RobotoMono-Bold.ttf" 8 | 9 | # Make sure font exists 10 | ls "$FONT" 11 | 12 | set -v 13 | 14 | LABEL="`date --rfc-3339=seconds`\n`git rev-parse --short HEAD`" 15 | convert -background black -fill white -pointsize 12 -font "$FONT" -size 300x36 label:"$LABEL" -bordercolor black -border 3 $1 +swap -append $1 16 | 17 | -------------------------------------------------------------------------------- /electronics/lib/VEML7700.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.4 2 | #encoding utf-8 3 | # 4 | # VEML7700 5 | # 6 | DEF VEML7700 U 0 40 Y Y 1 F N 7 | F0 "U" -250 450 50 H V C CNN 8 | F1 "VEML7700" 0 0 50 H V C CNN 9 | F2 "VEML7700:VEML7700-TOP" 0 0 50 H I C CNN 10 | F3 "" 0 0 50 H I C CNN 11 | DRAW 12 | S 250 -450 -250 400 0 1 0 f 13 | X SCL 1 350 -150 100 L 50 50 1 1 C 14 | X VDD 2 0 500 100 D 50 50 1 1 W 15 | X GND 3 0 -550 100 U 50 50 1 1 W 16 | X SDA 4 350 150 100 L 50 50 1 1 C 17 | ENDDRAW 18 | ENDDEF 19 | # 20 | #End Library 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # KiCAD files 2 | *.000 3 | *.bak 4 | *.bck 5 | *.kicad_pcb-bak 6 | *.sch-bak 7 | *.net 8 | *.dsn 9 | fp-info-cache 10 | _autosave*.kicad_pcb 11 | 12 | # Proprietary 3d model (for KiCAD) 13 | **/proprietary/*.stp 14 | **/proprietary/*.step 15 | 16 | # PlatformIO 17 | .pio/ 18 | 19 | # General build outputs 20 | build/ 21 | 22 | # VSCode 23 | .vscode/* 24 | !.vscode/settings.json 25 | !.vscode/tasks.json 26 | #!.vscode/launch.json 27 | !.vscode/extensions.json 28 | !.vscode/*.code-snippets 29 | 30 | __pycache__ 31 | 32 | -------------------------------------------------------------------------------- /firmware/test/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for PIO Unit Testing and project tests. 3 | 4 | Unit Testing is a software testing method by which individual units of 5 | source code, sets of one or more MCU program modules together with associated 6 | control data, usage procedures, and operating procedures, are tested to 7 | determine whether they are fit for use. Unit testing finds problems early 8 | in the development cycle. 9 | 10 | More information about PIO Unit Testing: 11 | - https://docs.platformio.org/page/plus/unit-testing.html 12 | -------------------------------------------------------------------------------- /firmware/lib/tlv/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "TLV493D-Magnetic-Sensor", 3 | "keywords": "3D, magnetic, sensor2go", 4 | "description": "This library provides an Interface for Infineon's TLV493D Magnetic Sensor", 5 | "repository": 6 | { 7 | "type": "git", 8 | "url": "https://github.com/Infineon/TLV493D-A1B6-3DMagnetic-Sensor.git", 9 | "branch": "master" 10 | }, 11 | "version":"1.0.3", 12 | "frameworks": "arduino", 13 | "platforms": [ 14 | "infineonxmc", 15 | "atmelavr" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /firmware/lib/tlv/library.properties: -------------------------------------------------------------------------------- 1 | name=TLV493D-A1B6 2 | version=1.0.3 3 | author=Infineon Technologies 4 | maintainer=Infineon Technologies 5 | sentence=This library provides an Interface for Infineon's TLV493D-A1B6 3D Magnetic Sensor. 6 | paragraph=With this Sensor, you can detect the position of a Joystick etc. without any additional mechanical components. You just have to provide a magnet that is fixed to a movable component. 7 | category=Sensors 8 | url=http://www.infineon.com/cms/de/product/sensor/magnetic-position-sensor/3d-magnetic-sensor/TLV493D-A1B6/productType.html?productType=5546d462525dbac401529cebc74f07b7 9 | architectures=* 10 | 11 | -------------------------------------------------------------------------------- /electronics/lib/Holes.pretty/AlignmentHole_1.6.kicad_mod: -------------------------------------------------------------------------------- 1 | (module AlignmentHole_1.6 (layer F.Cu) (tedit 620752D6) 2 | (descr "Mounting Hole 2.2mm, no annular, M2, ISO7380") 3 | (tags "mounting hole 2.2mm no annular m2 iso7380") 4 | (attr virtual) 5 | (fp_text reference REF** (at 0 -2.75) (layer F.SilkS) hide 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value AlignmentHole (at 0 2.75) (layer F.Fab) hide 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (fp_text user %R (at 0.3 0) (layer F.Fab) 12 | (effects (font (size 1 1) (thickness 0.15))) 13 | ) 14 | (pad 1 thru_hole circle (at 0 0) (size 2.4 2.4) (drill 1.6) (layers *.Cu *.Mask)) 15 | ) 16 | -------------------------------------------------------------------------------- /electronics/lib/SolderPads.pretty/SolderPads_2mm_3.kicad_mod: -------------------------------------------------------------------------------- 1 | (module SolderPads_2mm_3 (layer F.Cu) (tedit 620309F0) 2 | (fp_text reference REF** (at 0 0.5) (layer F.SilkS) hide 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value SolderPads_2mm_3 (at 0 -0.5) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_line (start -1 -1.5) (end -1 -1) (layer F.SilkS) (width 0.15)) 9 | (fp_line (start -0.5 -1.5) (end -1 -1.5) (layer F.SilkS) (width 0.15)) 10 | (pad 1 smd oval (at 0 0) (size 1.25 2.5) (layers F.Cu F.Mask)) 11 | (pad 2 smd oval (at 2 0) (size 1.25 2.5) (layers F.Cu F.Mask)) 12 | (pad 3 smd oval (at 4 0) (size 1.25 2.5) (layers F.Cu F.Mask)) 13 | ) 14 | -------------------------------------------------------------------------------- /electronics/lib/MagnTek.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.4 2 | #encoding utf-8 3 | # 4 | # MT6701-CT 5 | # 6 | DEF MT6701-CT U 0 40 Y Y 1 F N 7 | F0 "U" -500 250 50 H V C CNN 8 | F1 "MT6701-CT" 0 250 50 H V C CNN 9 | F2 "Package_SO:SOIC-8_3.9x4.9mm_P1.27mm" 0 0 50 H I C CNN 10 | F3 "" 0 0 50 H I C CNN 11 | DRAW 12 | S -550 200 650 -200 0 1 0 f 13 | X VDD 1 -650 150 100 R 50 50 1 1 W 14 | X MODE 2 -650 50 100 R 50 50 1 1 I 15 | X ANALOG/PWM 3 -650 -50 100 R 50 50 1 1 O 16 | X GND 4 -650 -150 100 R 50 50 1 1 W 17 | X PUSH 5 750 -150 100 L 50 50 1 1 O 18 | X A/U/SDA/DO 6 750 -50 100 L 50 50 1 1 B 19 | X B/V/SCL/CLK 7 750 50 100 L 50 50 1 1 B 20 | X Z/W/CSN 8 750 150 100 L 50 50 1 1 B 21 | ENDDRAW 22 | ENDDEF 23 | # 24 | #End Library 25 | -------------------------------------------------------------------------------- /electronics/view_base/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (lib (name MagnTek)(type Legacy)(uri ${KIPRJMOD}/../lib/MagnTek.lib)(options "")(descr "")) 3 | (lib (name SK6812)(type Legacy)(uri ${KIPRJMOD}/../lib/SK6812.lib)(options "")(descr "")) 4 | (lib (name no_pin)(type Legacy)(uri ${KIPRJMOD}/../lib/no_pin.lib)(options "")(descr "")) 5 | (lib (name lilygo_micro32)(type Legacy)(uri ${KIPRJMOD}/../lib/lilygo_micro32.lib)(options "")(descr "")) 6 | (lib (name strain)(type Legacy)(uri ${KIPRJMOD}/../lib/strain.lib)(options "")(descr "")) 7 | (lib (name Trinamic)(type Legacy)(uri ${KIPRJMOD}/../lib/Trinamic.lib)(options "")(descr "")) 8 | (lib (name VEML7700)(type Legacy)(uri ${KIPRJMOD}/../lib/VEML7700.lib)(options "")(descr "")) 9 | ) 10 | -------------------------------------------------------------------------------- /electronics/view_screen/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (lib (name MagnTek)(type Legacy)(uri ${KIPRJMOD}/../lib/MagnTek.lib)(options "")(descr "")) 3 | (lib (name SK6812)(type Legacy)(uri ${KIPRJMOD}/../lib/SK6812.lib)(options "")(descr "")) 4 | (lib (name no_pin)(type Legacy)(uri ${KIPRJMOD}/../lib/no_pin.lib)(options "")(descr "")) 5 | (lib (name lilygo_micro32)(type Legacy)(uri ${KIPRJMOD}/../lib/lilygo_micro32.lib)(options "")(descr "")) 6 | (lib (name strain)(type Legacy)(uri ${KIPRJMOD}/../lib/strain.lib)(options "")(descr "")) 7 | (lib (name Trinamic)(type Legacy)(uri ${KIPRJMOD}/../lib/Trinamic.lib)(options "")(descr "")) 8 | (lib (name VEML7700)(type Legacy)(uri ${KIPRJMOD}/../lib/VEML7700.lib)(options "")(descr "")) 9 | ) 10 | -------------------------------------------------------------------------------- /electronics/view_base/view_base.kibot.yml: -------------------------------------------------------------------------------- 1 | kibot: 2 | version: 1 3 | 4 | preflight: 5 | check_zone_fills: true 6 | run_drc: true 7 | run_erc: true 8 | update_xml: true 9 | 10 | outputs: 11 | - name: ibom 12 | comment: 'Interactive BOM' 13 | type: ibom 14 | options: 15 | dark_mode: true 16 | netlist_file: '%F.xml' 17 | extra_fields: 'LCSC,Mouser,Digikey,AliExpress,Note' 18 | 19 | - name: schematic 20 | type: pdf_sch_print 21 | 22 | - name: 'bom_csv' 23 | comment: "Bill of Materials in CSV format" 24 | type: bom 25 | options: 26 | use_alt: false 27 | number: 1 28 | aggregate: 29 | - file: electronics/view_screen/view_screen.sch 30 | name: 'Screen' 31 | number: 1 32 | ref_id: 'SCREEN-' 33 | -------------------------------------------------------------------------------- /electronics/lib/SolderPads.pretty/SolderPads_2mm_4.kicad_mod: -------------------------------------------------------------------------------- 1 | (module SolderPads_2mm_4 (layer F.Cu) (tedit 622E46A5) 2 | (attr virtual) 3 | (fp_text reference REF** (at 0 0.5) (layer F.SilkS) hide 4 | (effects (font (size 1 1) (thickness 0.15))) 5 | ) 6 | (fp_text value SolderPads_2mm_4 (at 0 -0.5) (layer F.Fab) 7 | (effects (font (size 1 1) (thickness 0.15))) 8 | ) 9 | (fp_line (start -1 -1.5) (end -1 -1) (layer F.SilkS) (width 0.15)) 10 | (fp_line (start -0.5 -1.5) (end -1 -1.5) (layer F.SilkS) (width 0.15)) 11 | (pad 1 smd oval (at 0 0) (size 1.25 2.5) (layers F.Cu F.Mask)) 12 | (pad 2 smd oval (at 2 0) (size 1.25 2.5) (layers F.Cu F.Mask)) 13 | (pad 3 smd oval (at 4 0) (size 1.25 2.5) (layers F.Cu F.Mask)) 14 | (pad 4 smd oval (at 6 0) (size 1.25 2.5) (layers F.Cu F.Mask)) 15 | ) 16 | -------------------------------------------------------------------------------- /electronics/lib/Holes.pretty/MountingHole_M1.6.kicad_mod: -------------------------------------------------------------------------------- 1 | (module MountingHole_M1.6 (layer F.Cu) (tedit 622E47EB) 2 | (descr "Mounting Hole 2.2mm, no annular, M2, ISO7380") 3 | (tags "mounting hole 2.2mm no annular m2 iso7380") 4 | (fp_text reference REF** (at 0 -2.75) (layer F.SilkS) hide 5 | (effects (font (size 1 1) (thickness 0.15))) 6 | ) 7 | (fp_text value MountingHole_M1.6_Pad (at 0 2.75) (layer F.Fab) 8 | (effects (font (size 1 1) (thickness 0.15))) 9 | ) 10 | (fp_circle (center 0 0) (end 1.34 0) (layer Cmts.User) (width 0.15)) 11 | (fp_circle (center 0 0) (end 1.5 0) (layer F.CrtYd) (width 0.05)) 12 | (fp_text user %R (at 0.3 0) (layer F.Fab) 13 | (effects (font (size 1 1) (thickness 0.15))) 14 | ) 15 | (pad 1 thru_hole circle (at 0 0) (size 2.4 2.4) (drill 1.7) (layers *.Cu *.Mask)) 16 | ) 17 | -------------------------------------------------------------------------------- /electronics/lib/Holes.pretty/MountingHole_2.2mm_M2_ISO7380_Pad_NonVirtual.kicad_mod: -------------------------------------------------------------------------------- 1 | (module MountingHole_2.2mm_M2_ISO7380_Pad_NonVirtual (layer F.Cu) (tedit 622E47A4) 2 | (descr "Mounting Hole 2.2mm, M2, ISO7380") 3 | (tags "mounting hole 2.2mm m2 iso7380") 4 | (fp_text reference REF** (at 0 -2.75) (layer F.SilkS) hide 5 | (effects (font (size 1 1) (thickness 0.15))) 6 | ) 7 | (fp_text value MountingHole_2.2mm_M2_ISO7380_Pad_NonVirtual (at 0 2.75) (layer F.Fab) 8 | (effects (font (size 1 1) (thickness 0.15))) 9 | ) 10 | (fp_circle (center 0 0) (end 1.75 0) (layer Cmts.User) (width 0.15)) 11 | (fp_circle (center 0 0) (end 2 0) (layer F.CrtYd) (width 0.05)) 12 | (fp_text user %R (at 0.3 0) (layer F.Fab) 13 | (effects (font (size 1 1) (thickness 0.15))) 14 | ) 15 | (pad 1 thru_hole circle (at 0 0) (size 3.5 3.5) (drill 2.2) (layers *.Cu *.Mask)) 16 | ) 17 | -------------------------------------------------------------------------------- /firmware/src/interface_task.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "display_task.h" 7 | #include "motor_task.h" 8 | #include "task.h" 9 | 10 | class InterfaceTask : public Task, public ace_button::IEventHandler { 11 | friend class Task; // Allow base Task to invoke protected run() 12 | 13 | public: 14 | InterfaceTask(const uint8_t task_core, MotorTask& motor_task, DisplayTask* display_task); 15 | ~InterfaceTask(); 16 | 17 | void handleEvent(ace_button::AceButton* button, uint8_t event_type, uint8_t button_state) override; 18 | 19 | protected: 20 | void run(); 21 | 22 | private: 23 | MotorTask& motor_task_; 24 | DisplayTask* display_task_; 25 | 26 | int current_config_ = 0; 27 | 28 | void changeConfig(bool next); 29 | }; 30 | -------------------------------------------------------------------------------- /firmware/src/mt6701_sensor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "driver/spi_master.h" 5 | 6 | class MT6701Sensor : public Sensor { 7 | public: 8 | MT6701Sensor(); 9 | 10 | // initialize the sensor hardware 11 | void init(); 12 | 13 | // Get current shaft angle from the sensor hardware, and 14 | // return it as a float in radians, in the range 0 to 2PI. 15 | // - This method is pure virtual and must be implemented in subclasses. 16 | // Calling this method directly does not update the base-class internal fields. 17 | // Use update() when calling from outside code. 18 | float getSensorAngle(); 19 | private: 20 | 21 | spi_device_handle_t spi_device_; 22 | spi_transaction_t spi_transaction_ = {}; 23 | 24 | float x_; 25 | float y_; 26 | uint32_t last_update_; 27 | }; 28 | -------------------------------------------------------------------------------- /electronics/lib/SK6812.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.4 2 | #encoding utf-8 3 | # 4 | # SK6812SIDE-A 5 | # 6 | DEF SK6812SIDE-A D 0 10 Y Y 1 F N 7 | F0 "D" 200 225 50 H V R BNN 8 | F1 "SK6812SIDE-A" 50 -225 50 H V L TNN 9 | F2 "sk6812:SK6812-SIDE-A" 50 -300 50 H I L TNN 10 | F3 "" 100 -375 50 H I L TNN 11 | $FPLIST 12 | LED*WS2812*PLCC*5.0x5.0mm*P3.2mm* 13 | $ENDFPLIST 14 | DRAW 15 | T 0 90 -165 30 0 0 0 RGB Normal 0 C C 16 | S 200 200 -200 -200 0 1 10 f 17 | P 2 0 1 0 50 -140 70 -140 N 18 | P 2 0 1 0 50 -100 70 -100 N 19 | P 2 0 1 0 185 -140 105 -140 N 20 | P 3 0 1 0 90 -100 50 -140 50 -120 N 21 | P 3 0 1 0 90 -60 50 -100 50 -80 N 22 | P 3 0 1 0 145 -40 145 -140 145 -160 N 23 | P 4 0 1 0 185 -60 105 -60 145 -140 185 -60 N 24 | X DIN 1 -300 0 100 R 50 50 1 1 I 25 | X VDD 2 0 300 100 D 50 50 1 1 W 26 | X DOUT 3 300 0 100 L 50 50 1 1 O 27 | X VSS 4 0 -300 100 U 50 50 1 1 W 28 | ENDDRAW 29 | ENDDEF 30 | # 31 | #End Library 32 | -------------------------------------------------------------------------------- /electronics/lib/Modified.pretty/TestPoint_Pad_D2.0mm_ValueSilk.kicad_mod: -------------------------------------------------------------------------------- 1 | (module TestPoint_Pad_D2.0mm_ValueSilk (layer F.Cu) (tedit 62094535) 2 | (descr "SMD pad as test Point, diameter 2.0mm") 3 | (tags "test point SMD pad") 4 | (attr virtual) 5 | (fp_text reference REF** (at 0 -1.998) (layer F.SilkS) hide 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value TestPoint_Pad_D2.0mm_ValueSilk (at 0 2.05) (layer F.Fab) hide 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (fp_circle (center 0 0) (end 0 1.2) (layer F.SilkS) (width 0.12)) 12 | (fp_circle (center 0 0) (end 1.5 0) (layer F.CrtYd) (width 0.05)) 13 | (fp_text user %R (at 0 -2) (layer F.Fab) 14 | (effects (font (size 1 1) (thickness 0.15))) 15 | ) 16 | (fp_text user %V (at 0 -2) (layer F.SilkS) 17 | (effects (font (size 1 1) (thickness 0.15))) 18 | ) 19 | (pad 1 smd circle (at 0 0) (size 2 2) (layers F.Cu F.Mask)) 20 | ) 21 | -------------------------------------------------------------------------------- /electronics/view_screen/view_screen.kibot.yml: -------------------------------------------------------------------------------- 1 | kibot: 2 | version: 1 3 | 4 | preflight: 5 | check_zone_fills: true 6 | run_drc: true 7 | run_erc: true 8 | update_xml: true 9 | 10 | outputs: 11 | - name: ibom 12 | comment: 'Interactive BOM' 13 | type: ibom 14 | options: 15 | dark_mode: true 16 | netlist_file: '%F.xml' 17 | extra_fields: 'LCSC,Mouser,Digikey,AliExpress,Note' 18 | 19 | - name: schematic 20 | type: pdf_sch_print 21 | 22 | # - name: 3d 23 | # type: render_3d 24 | # options: 25 | # no_virtual: true 26 | # view: 'top' 27 | # silk: '#111111' 28 | # solder_mask: '#ffffff' 29 | # board: '#C3BA9B' 30 | # copper: '#99967F' 31 | # orthographic: true 32 | # ray_tracing: true 33 | # height: 1920 34 | # width: 1920 35 | # zoom: 4 36 | 37 | # - name: 3d_back 38 | # type: render_3d 39 | # extends: 3d 40 | # options: 41 | # view: 'bottom' 42 | # zoom: 3 43 | -------------------------------------------------------------------------------- /firmware/src/display_task.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if SK_DISPLAY 4 | 5 | #include 6 | #include 7 | 8 | #include "knob_data.h" 9 | #include "task.h" 10 | 11 | class DisplayTask : public Task { 12 | friend class Task; // Allow base Task to invoke protected run() 13 | 14 | public: 15 | DisplayTask(const uint8_t task_core); 16 | ~DisplayTask(); 17 | 18 | QueueHandle_t getKnobStateQueue(); 19 | 20 | void setBrightness(uint16_t brightness); 21 | 22 | protected: 23 | void run(); 24 | 25 | private: 26 | TFT_eSPI tft_ = TFT_eSPI(); 27 | 28 | /** Full-size sprite used as a framebuffer */ 29 | TFT_eSprite spr_ = TFT_eSprite(&tft_); 30 | 31 | QueueHandle_t knob_state_queue_; 32 | 33 | KnobState state_; 34 | 35 | SemaphoreHandle_t mutex_; 36 | 37 | uint16_t brightness_; 38 | }; 39 | 40 | #else 41 | 42 | class DisplayTask {}; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /firmware/src/tlv_sensor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | class TlvSensor : public Sensor { 7 | public: 8 | TlvSensor(); 9 | 10 | // initialize the sensor hardware 11 | void init(TwoWire* wire, bool invert); 12 | 13 | // Get current shaft angle from the sensor hardware, and 14 | // return it as a float in radians, in the range 0 to 2PI. 15 | // - This method is pure virtual and must be implemented in subclasses. 16 | // Calling this method directly does not update the base-class internal fields. 17 | // Use update() when calling from outside code. 18 | float getSensorAngle(); 19 | private: 20 | Tlv493d tlv_ = Tlv493d(); 21 | float x_; 22 | float y_; 23 | uint32_t last_update_; 24 | TwoWire* wire_; 25 | bool invert_; 26 | 27 | uint8_t frame_counts_[3] = {}; 28 | uint8_t cur_frame_count_index_ = 0; 29 | }; 30 | -------------------------------------------------------------------------------- /electronics/lib/strain.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.4 2 | #encoding utf-8 3 | # 4 | # HX711 5 | # 6 | DEF HX711 U 0 40 Y Y 1 F N 7 | F0 "U" 200 500 50 H V C CNN 8 | F1 "HX711" -200 500 50 H V C CNN 9 | F2 "Package_SO:SOIC-16_3.9x9.9mm_P1.27mm" 0 0 50 H I C CNN 10 | F3 "" 0 0 50 H I C CNN 11 | DRAW 12 | S -350 450 350 -450 0 1 0 f 13 | X VSUP 1 -450 350 100 R 50 50 1 1 W 14 | X INB+ 10 450 -250 100 L 50 50 1 1 I 15 | X PD_SCK 11 450 -150 100 L 50 50 1 1 I 16 | X DOUT 12 450 -50 100 L 50 50 1 1 O 17 | X XO 13 450 50 100 L 50 50 1 1 O 18 | X XI 14 450 150 100 L 50 50 1 1 I 19 | X RATE 15 450 250 100 L 50 50 1 1 I 20 | X DVDD 16 450 350 100 L 50 50 1 1 W 21 | X BASE 2 -450 250 100 R 50 50 1 1 O 22 | X AVDD 3 -450 150 100 R 50 50 1 1 B 23 | X VFB 4 -450 50 100 R 50 50 1 1 I 24 | X AGND 5 -450 -50 100 R 50 50 1 1 W 25 | X VBG 6 -450 -150 100 R 50 50 1 1 O 26 | X INA- 7 -450 -250 100 R 50 50 1 1 I 27 | X INA+ 8 -450 -350 100 R 50 50 1 1 I 28 | X INB- 9 450 -350 100 L 50 50 1 1 I 29 | ENDDRAW 30 | ENDDEF 31 | # 32 | #End Library 33 | -------------------------------------------------------------------------------- /electronics/lib/SolderPads.pretty/SolderPads_2mm_8.kicad_mod: -------------------------------------------------------------------------------- 1 | (module SolderPads_2mm_8 (layer F.Cu) (tedit 622E2DC9) 2 | (attr virtual) 3 | (fp_text reference REF** (at 0 0.5) (layer F.SilkS) hide 4 | (effects (font (size 1 1) (thickness 0.15))) 5 | ) 6 | (fp_text value SolderPads_2mm_8 (at 0 -0.5) (layer F.Fab) 7 | (effects (font (size 1 1) (thickness 0.15))) 8 | ) 9 | (fp_line (start -0.5 -1.5) (end -1 -1.5) (layer F.SilkS) (width 0.15)) 10 | (fp_line (start -1 -1.5) (end -1 -1) (layer F.SilkS) (width 0.15)) 11 | (pad 1 smd oval (at 0 0) (size 1.25 2.5) (layers F.Cu F.Mask)) 12 | (pad 2 smd oval (at 2 0) (size 1.25 2.5) (layers F.Cu F.Mask)) 13 | (pad 3 smd oval (at 4 0) (size 1.25 2.5) (layers F.Cu F.Mask)) 14 | (pad 4 smd oval (at 6 0) (size 1.25 2.5) (layers F.Cu F.Mask)) 15 | (pad 5 smd oval (at 8 0) (size 1.25 2.5) (layers F.Cu F.Mask)) 16 | (pad 6 smd oval (at 10 0) (size 1.25 2.5) (layers F.Cu F.Mask)) 17 | (pad 7 smd oval (at 12 0) (size 1.25 2.5) (layers F.Cu F.Mask)) 18 | (pad 8 smd oval (at 14 0) (size 1.25 2.5) (layers F.Cu F.Mask)) 19 | ) 20 | -------------------------------------------------------------------------------- /electronics/lib/SolderPads.pretty/SolderPads_2mm_3_STRAIN.kicad_mod: -------------------------------------------------------------------------------- 1 | (module SolderPads_2mm_3_STRAIN (layer F.Cu) (tedit 622E2DE5) 2 | (attr virtual) 3 | (fp_text reference REF** (at 0 0.5) (layer F.SilkS) hide 4 | (effects (font (size 1 1) (thickness 0.15))) 5 | ) 6 | (fp_text value SolderPads_2mm_3_STRAIN (at 0 -0.5) (layer F.Fab) 7 | (effects (font (size 1 1) (thickness 0.15))) 8 | ) 9 | (fp_line (start -1 -1.5) (end -1 -1) (layer F.SilkS) (width 0.15)) 10 | (fp_line (start -0.5 -1.5) (end -1 -1.5) (layer F.SilkS) (width 0.15)) 11 | (fp_text user + (at 0 2.5) (layer F.SilkS) 12 | (effects (font (size 1 1) (thickness 0.15))) 13 | ) 14 | (fp_text user - (at 4 2.5) (layer F.SilkS) 15 | (effects (font (size 1 1) (thickness 0.15))) 16 | ) 17 | (fp_text user %V (at 2 2.5) (layer F.SilkS) 18 | (effects (font (size 1 1) (thickness 0.15))) 19 | ) 20 | (pad 1 smd oval (at 0 0) (size 1.25 2.5) (layers F.Cu F.Mask)) 21 | (pad 2 smd oval (at 2 0) (size 1.25 2.5) (layers F.Cu F.Mask)) 22 | (pad 3 smd oval (at 4 0) (size 1.25 2.5) (layers F.Cu F.Mask)) 23 | ) 24 | -------------------------------------------------------------------------------- /firmware/src/motor_task.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "knob_data.h" 7 | #include "task.h" 8 | 9 | 10 | enum class CommandType { 11 | CONFIG, 12 | HAPTIC, 13 | }; 14 | 15 | struct HapticData { 16 | bool press; 17 | }; 18 | 19 | struct Command { 20 | CommandType command_type; 21 | union CommandData { 22 | KnobConfig config; 23 | HapticData haptic; 24 | }; 25 | CommandData data; 26 | }; 27 | 28 | class MotorTask : public Task { 29 | friend class Task; // Allow base Task to invoke protected run() 30 | 31 | public: 32 | MotorTask(const uint8_t task_core); 33 | ~MotorTask(); 34 | 35 | void setConfig(const KnobConfig& config); 36 | void playHaptic(bool press); 37 | 38 | void addListener(QueueHandle_t queue); 39 | 40 | protected: 41 | void run(); 42 | 43 | private: 44 | QueueHandle_t queue_; 45 | 46 | std::vector listeners_; 47 | 48 | void publish(const KnobState& state); 49 | }; 50 | -------------------------------------------------------------------------------- /electronics/scripts/dependencies.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | if [[ -z "${GITHUB_WORKFLOW}" ]]; then 5 | >&2 echo "Aborting! This script is meant to be run in CI (Github Actions) only. It may modify/damage your system configuration if run outside of CI." 6 | exit 1 7 | fi 8 | 9 | set -v 10 | 11 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 12 | 13 | sudo add-apt-repository --yes ppa:kicad/kicad-5.1-releases 14 | sudo apt-get update -qq 15 | sudo DEBIAN_FRONTEND=noninteractive apt-get install -y kicad inkscape poppler-utils xdotool recordmydesktop python3-dev python3-pip 16 | 17 | sudo python3 -m pip install psutil kikit==1.0.4 xvfbwrapper 18 | 19 | mkdir -p ~/.config/kicad 20 | cp /usr/share/kicad/template/fp-lib-table ~/.config/kicad/ 21 | cp /usr/share/kicad/template/sym-lib-table ~/.config/kicad/ 22 | 23 | cp "$DIR/config/eeschema" ~/.config/kicad/ 24 | cp "$DIR/config/pcbnew" ~/.config/kicad/ 25 | 26 | # Install ImageMagick policy that allows PDF conversion (safe in CI because we control all inputs/outputs) 27 | sudo cp "$DIR/config/policy.xml" /etc/ImageMagick-6/policy.xml 28 | -------------------------------------------------------------------------------- /electronics/view_base/fp-lib-table: -------------------------------------------------------------------------------- 1 | (fp_lib_table 2 | (lib (name sk6812)(type KiCad)(uri ${KIPRJMOD}/../lib/sk6812.pretty)(options "")(descr "")) 3 | (lib (name Holes)(type KiCad)(uri ${KIPRJMOD}/../lib/Holes.pretty)(options "")(descr "")) 4 | (lib (name strain)(type KiCad)(uri ${KIPRJMOD}/../lib/strain.pretty)(options "")(descr "")) 5 | (lib (name GCT_USB)(type KiCad)(uri ${KIPRJMOD}/../lib/GCT_USB.pretty)(options "")(descr "")) 6 | (lib (name Molex)(type KiCad)(uri ${KIPRJMOD}/../lib/Molex.pretty)(options "")(descr "")) 7 | (lib (name lilygo_micro32)(type KiCad)(uri ${KIPRJMOD}/../lib/lilygo_micro32.pretty)(options "")(descr "")) 8 | (lib (name Modified)(type KiCad)(uri ${KIPRJMOD}/../lib/Modified.pretty)(options "")(descr "")) 9 | (lib (name view_custom)(type KiCad)(uri ${KIPRJMOD}/lib/view_custom.pretty)(options "")(descr "")) 10 | (lib (name VEML7700)(type KiCad)(uri ${KIPRJMOD}/../lib/VEML7700.pretty)(options "")(descr "")) 11 | (lib (name SolderPads)(type KiCad)(uri ${KIPRJMOD}/../lib/SolderPads.pretty)(options "")(descr "")) 12 | (lib (name BOM_Only)(type KiCad)(uri ${KIPRJMOD}/../lib/BOM_Only.pretty)(options "")(descr "")) 13 | ) 14 | -------------------------------------------------------------------------------- /firmware/src/semaphore_guard.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Scott Bezek and the splitflap contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include 19 | 20 | class SemaphoreGuard { 21 | public: 22 | SemaphoreGuard(SemaphoreHandle_t handle) : handle_{handle} { 23 | xSemaphoreTake(handle_, portMAX_DELAY); 24 | } 25 | ~SemaphoreGuard() { 26 | xSemaphoreGive(handle_); 27 | } 28 | SemaphoreGuard(SemaphoreGuard const&)=delete; 29 | SemaphoreGuard& operator=(SemaphoreGuard const&)=delete; 30 | 31 | private: 32 | SemaphoreHandle_t handle_; 33 | }; 34 | -------------------------------------------------------------------------------- /electronics/lib/Trinamic.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.4 2 | #encoding utf-8 3 | # 4 | # TMC6300 5 | # 6 | DEF TMC6300 U 0 40 Y Y 1 F N 7 | F0 "U" 0 100 50 H V C CNN 8 | F1 "TMC6300" 0 0 50 H V C CNN 9 | F2 "Modified:QFN-20-1EP_3x3mm_P0.4mm_EP1.65x1.65mm_ThermalVias_LargerViaHoles" 0 0 50 H I C CNN 10 | F3 "" 0 0 50 H I C CNN 11 | DRAW 12 | S -400 900 400 -900 0 1 0 f 13 | X W 1 500 600 100 L 50 50 1 1 O 14 | X VL 10 -500 200 100 R 50 50 1 1 I 15 | X VIO/~STDBY 11 -500 -300 100 R 50 50 1 1 W 16 | X DIAG 12 -500 -200 100 R 50 50 1 1 O 17 | X 1V8OUT 13 500 -800 100 L 50 50 1 1 w 18 | X GND 14 -500 -700 100 R 50 50 1 1 W 19 | X U 15 500 800 100 L 50 50 1 1 O 20 | X BRUV 16 500 400 100 L 50 50 1 1 P 21 | X V 17 500 700 100 L 50 50 1 1 O 22 | X VS 18 -500 800 100 R 50 50 1 1 W 23 | X NC 19 500 -700 100 L 50 50 1 1 N N 24 | X VCP 2 -500 700 100 R 50 50 1 1 B 25 | X BRW 20 500 300 100 L 50 50 1 1 P 26 | X UH 3 -500 500 100 R 50 50 1 1 I 27 | X VH 4 -500 300 100 R 50 50 1 1 I 28 | X WH 5 -500 100 100 R 50 50 1 1 I 29 | X UL 6 -500 400 100 R 50 50 1 1 I 30 | X WL 7 -500 0 100 R 50 50 1 1 I 31 | X GND 8 -500 -500 100 R 50 50 1 1 W 32 | X GND 9 -500 -600 100 R 50 50 1 1 W 33 | X PAD PAD -500 -800 100 R 50 50 1 1 W 34 | ENDDRAW 35 | ENDDEF 36 | # 37 | #End Library 38 | -------------------------------------------------------------------------------- /firmware/lib/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project specific (private) libraries. 3 | PlatformIO will compile them to static libraries and link into executable file. 4 | 5 | The source code of each library should be placed in a an own separate directory 6 | ("lib/your_library_name/[here are source files]"). 7 | 8 | For example, see a structure of the following two libraries `Foo` and `Bar`: 9 | 10 | |--lib 11 | | | 12 | | |--Bar 13 | | | |--docs 14 | | | |--examples 15 | | | |--src 16 | | | |- Bar.c 17 | | | |- Bar.h 18 | | | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html 19 | | | 20 | | |--Foo 21 | | | |- Foo.c 22 | | | |- Foo.h 23 | | | 24 | | |- README --> THIS FILE 25 | | 26 | |- platformio.ini 27 | |--src 28 | |- main.c 29 | 30 | and a contents of `src/main.c`: 31 | ``` 32 | #include 33 | #include 34 | 35 | int main (void) 36 | { 37 | ... 38 | } 39 | 40 | ``` 41 | 42 | PlatformIO Library Dependency Finder will find automatically dependent 43 | libraries scanning project source files. 44 | 45 | More information about PlatformIO Library Dependency Finder 46 | - https://docs.platformio.org/page/librarymanager/ldf.html 47 | -------------------------------------------------------------------------------- /cad/README.md: -------------------------------------------------------------------------------- 1 | # CAD 2 | 3 | Most CAD work is done in Fusion 360 and versioned outside of this git repo. 4 | 5 | # Assemblies 6 | ## SmartKnob View 7 | - [Complete SmartKnob View assembly](https://a360.co/3BzkU0n) 8 | 9 | ## Handheld 10 | - [Case bottom](https://a360.co/3LM82se) For breadboard with power rails removed. 11 | - [Motor adapter](https://a360.co/3LO03eC) Connects motor to Adafruit TLV493d adapter board, and screws into Case 12 | - [Thumbwheel](https://a360.co/3H3jSee) Test thumbwheel for motor rotor, for turning from the side 13 | 14 | # Motors 15 | Note that all measurements were done by hand and will be approximate. Chamfers & fillets are approximated. 16 | 17 | ## 32mm 18 | - [Motor model](https://a360.co/3H8LUFi) 19 | 20 | ## 17mm 21 | - [Motor model](https://a360.co/3sYa93Y) 22 | - [Spacer](https://a360.co/3H3xh5M) (screw at the bottom is replaced with a longer M1.4 screw with this spacer inserted; diametric magnet is glued to screw) 23 | - [Dummy test jig](https://a360.co/3sPQgvB) 24 | 25 | ## 15mm 26 | - [Motor model](https://a360.co/34N1nOa) 27 | - [Magnet spacer](https://a360.co/3532Tvb) 28 | - [Magnet gluing jig](https://a360.co/3I1xbx6) 29 | - [Adapter](https://a360.co/35gC86B) - mount motor to Adafruit TLV493d adapter board 30 | -------------------------------------------------------------------------------- /.github/workflows/pio.yml: -------------------------------------------------------------------------------- 1 | name: PlatformIO CI 2 | 3 | on: 4 | push: 5 | pull_request: 6 | 7 | jobs: 8 | pio-build: 9 | runs-on: ubuntu-20.04 10 | 11 | steps: 12 | - name: Checkout code 13 | uses: actions/checkout@v2 14 | 15 | - name: Cache pip 16 | uses: actions/cache@v2 17 | with: 18 | path: ~/.cache/pip 19 | key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} 20 | restore-keys: | 21 | ${{ runner.os }}-pip- 22 | 23 | - name: Cache PlatformIO 24 | uses: actions/cache@v2 25 | with: 26 | path: ~/.platformio 27 | key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} 28 | 29 | - name: Set up Python 30 | uses: actions/setup-python@v2 31 | 32 | - name: Install PlatformIO 33 | id: pio_install 34 | run: | 35 | python -m pip install --upgrade pip 36 | pip install --upgrade platformio 37 | 38 | - name: Build Firmware (view) 39 | # Run regardless of other build step failures, as long as setup steps completed 40 | if: always() && steps.pio_install.outcome == 'success' 41 | run: | 42 | pio run -d ./firmware \ 43 | -e view \ 44 | 45 | - name: Build Firmware (handheld_tdisplay) 46 | # Run regardless of other build step failures, as long as setup steps completed 47 | if: always() && steps.pio_install.outcome == 'success' 48 | run: | 49 | pio run -d ./firmware \ 50 | -e handheld_tdisplay \ 51 | -------------------------------------------------------------------------------- /firmware/include/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project header files. 3 | 4 | A header file is a file containing C declarations and macro definitions 5 | to be shared between several project source files. You request the use of a 6 | header file in your project source file (C, C++, etc) located in `src` folder 7 | by including it, with the C preprocessing directive `#include'. 8 | 9 | ```src/main.c 10 | 11 | #include "header.h" 12 | 13 | int main (void) 14 | { 15 | ... 16 | } 17 | ``` 18 | 19 | Including a header file produces the same results as copying the header file 20 | into each source file that needs it. Such copying would be time-consuming 21 | and error-prone. With a header file, the related declarations appear 22 | in only one place. If they need to be changed, they can be changed in one 23 | place, and programs that include the header file will automatically use the 24 | new version when next recompiled. The header file eliminates the labor of 25 | finding and changing all the copies as well as the risk that a failure to 26 | find one copy will result in inconsistencies within a program. 27 | 28 | In C, the usual convention is to give header files names that end with `.h'. 29 | It is most portable to use only letters, digits, dashes, and underscores in 30 | header file names, and at most one dot. 31 | 32 | Read more about using header files in official GCC documentation: 33 | 34 | * Include Syntax 35 | * Include Operation 36 | * Once-Only Headers 37 | * Computed Includes 38 | 39 | https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html 40 | -------------------------------------------------------------------------------- /firmware/src/tlv_sensor.cpp: -------------------------------------------------------------------------------- 1 | #include "tlv_sensor.h" 2 | 3 | static const float ALPHA = 1; 4 | 5 | TlvSensor::TlvSensor() {} 6 | 7 | void TlvSensor::init(TwoWire* wire, bool invert) { 8 | wire_ = wire; 9 | invert_ = invert; 10 | tlv_.begin(*wire); 11 | tlv_.setAccessMode(Tlv493d::AccessMode_e::MASTERCONTROLLEDMODE); 12 | tlv_.disableInterrupt(); 13 | tlv_.disableTemp(); 14 | } 15 | 16 | float TlvSensor::getSensorAngle() { 17 | uint32_t now = micros(); 18 | if (now - last_update_ > 50) { 19 | tlv_.updateData(); 20 | frame_counts_[cur_frame_count_index_] = tlv_.getExpectedFrameCount(); 21 | cur_frame_count_index_++; 22 | if (cur_frame_count_index_ >= sizeof(frame_counts_)) { 23 | cur_frame_count_index_ = 0; 24 | } 25 | x_ = tlv_.getX() * ALPHA + x_ * (1-ALPHA); 26 | y_ = tlv_.getY() * ALPHA + y_ * (1-ALPHA); 27 | last_update_ = now; 28 | 29 | bool all_same = true; 30 | uint8_t match_frame = frame_counts_[0]; 31 | for (uint8_t i = 1; i < sizeof(frame_counts_); i++) { 32 | if (frame_counts_[i] != match_frame) { 33 | all_same = false; 34 | break; 35 | } 36 | } 37 | if (all_same) { 38 | Serial.println("LOCKED!"); 39 | init(wire_, invert_); 40 | // Force unique frame counts to avoid reset loop 41 | for (uint8_t i = 1; i < sizeof(frame_counts_); i++) { 42 | frame_counts_[i] = i; 43 | } 44 | } 45 | } 46 | float rad = (invert_ ? -1 : 1) * atan2f(y_, x_); 47 | if (rad < 0) { 48 | rad += 2*PI; 49 | } 50 | return rad; 51 | } 52 | -------------------------------------------------------------------------------- /electronics/lib/VEML7700.pretty/VEML7700-TOP.kicad_mod: -------------------------------------------------------------------------------- 1 | (module VEML7700-TOP (layer F.Cu) (tedit 6203268B) 2 | (attr smd) 3 | (fp_text reference REF** (at 0 0.5) (layer F.SilkS) 4 | (effects (font (size 1 1) (thickness 0.15))) 5 | ) 6 | (fp_text value VEML7700-TOP (at 0 -0.5) (layer F.Fab) 7 | (effects (font (size 1 1) (thickness 0.15))) 8 | ) 9 | (fp_line (start 3.4 1.95) (end 2.4 1.95) (layer F.SilkS) (width 0.15)) 10 | (fp_line (start 3.4 1.95) (end 3.4 0.95) (layer F.SilkS) (width 0.15)) 11 | (fp_line (start -3.4 -1.05) (end -3.4 0) (layer F.SilkS) (width 0.15)) 12 | (fp_line (start -2.4 -1.05) (end -3.4 -1.05) (layer F.SilkS) (width 0.15)) 13 | (fp_line (start -3.4 -1.05) (end 3.4 -1.05) (layer Dwgs.User) (width 0.12)) 14 | (fp_line (start 3.4 -1.05) (end 3.4 1.95) (layer Dwgs.User) (width 0.12)) 15 | (fp_line (start 3.4 1.95) (end -3.4 1.95) (layer Dwgs.User) (width 0.12)) 16 | (fp_line (start -3.4 1.95) (end -3.4 -1.05) (layer Dwgs.User) (width 0.12)) 17 | (fp_line (start 0 -0.2) (end 0 0.2) (layer Dwgs.User) (width 0.12)) 18 | (fp_line (start 0.2 0) (end -0.2 0) (layer Dwgs.User) (width 0.12)) 19 | (pad 1 smd rect (at -1.905 1.35) (size 0.7 1.6) (layers F.Cu F.Paste F.Mask)) 20 | (pad 2 smd rect (at -0.635 1.35) (size 0.7 1.6) (layers F.Cu F.Paste F.Mask)) 21 | (pad 3 smd rect (at 0.635 1.35) (size 0.7 1.6) (layers F.Cu F.Paste F.Mask)) 22 | (pad 4 smd rect (at 1.905 1.35) (size 0.7 1.6) (layers F.Cu F.Paste F.Mask)) 23 | (model ${KIPRJMOD}/../lib/VEML7700.3dshapes/84592VEML7700.stp 24 | (offset (xyz 0 -0.35 0)) 25 | (scale (xyz 1 1 1)) 26 | (rotate (xyz 0 0 0)) 27 | ) 28 | ) 29 | -------------------------------------------------------------------------------- /util/rev_info.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import subprocess 3 | 4 | def git_short_rev(): 5 | try: 6 | return subprocess.check_output([ 7 | 'git', 8 | 'rev-parse', 9 | '--short', 10 | 'HEAD', 11 | ]).decode('utf-8').strip() 12 | except Exception: 13 | raise RuntimeError("Could not read git revision. Make sure you have git installed and you're working with a git clone of the repository.") 14 | 15 | def current_date(): 16 | return datetime.date.today().strftime('%Y-%m-%d') 17 | 18 | def git_date(short=True): 19 | try: 20 | iso = subprocess.check_output([ 21 | 'git', 22 | 'log', 23 | '-1', 24 | '--format=%ci', 25 | 'HEAD', 26 | ]).decode('utf-8').strip() 27 | if short: 28 | return iso.split(' ')[0] 29 | else: 30 | return iso 31 | except Exception: 32 | raise RuntimeError("Could not read git commit date. Make sure you have git installed and you're working with a git clone of the repository.") 33 | 34 | def git_release_version(search_prefix): 35 | try: 36 | tags = subprocess.check_output([ 37 | 'git', 38 | 'tag', 39 | '--points-at', 40 | 'HEAD', 41 | ]).decode('utf-8').splitlines() 42 | for tag in tags: 43 | if tag.startswith(search_prefix): 44 | return tag[len(search_prefix):] 45 | return None 46 | except Exception: 47 | raise RuntimeError("Could not read git release tags. Make sure you have git installed and you're working with a git clone of the repository.") 48 | 49 | -------------------------------------------------------------------------------- /electronics/lib/sk6812.pretty/SK6812-SIDE-A.kicad_mod: -------------------------------------------------------------------------------- 1 | (module SK6812-SIDE-A (layer F.Cu) (tedit 6205A40B) 2 | (fp_text reference REF** (at 2.032 -1.397) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value SK6812-SIDE-A (at 0 -0.5) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_line (start -0.7 -0.6) (end 4.3 -0.6) (layer F.SilkS) (width 0.1)) 9 | (fp_line (start 4.3 -0.6) (end 4.3 0.7) (layer F.SilkS) (width 0.1)) 10 | (fp_line (start 4.3 0.7) (end 3.7 1.4) (layer F.SilkS) (width 0.1)) 11 | (fp_line (start 3.7 1.4) (end -0.7 1.4) (layer F.SilkS) (width 0.1)) 12 | (fp_line (start -0.7 1.4) (end -0.7 -0.6) (layer F.SilkS) (width 0.1)) 13 | (pad 1 smd custom (at 0 0) (size 1 0.55) (layers F.Cu F.Paste F.Mask) 14 | (zone_connect 0) 15 | (options (clearance outline) (anchor rect)) 16 | (primitives 17 | (gr_poly (pts 18 | (xy -0.05 -0.525) (xy 0.5 -0.525) (xy 0.5 0.675) (xy -0.05 0.675)) (width 0)) 19 | )) 20 | (pad 2 smd rect (at 1.35 0) (size 0.7 1.2) (drill (offset 0 0.075)) (layers F.Cu F.Paste F.Mask) 21 | (zone_connect 0)) 22 | (pad 3 smd rect (at 2.375 0) (size 0.45 1.2) (drill (offset 0 0.075)) (layers F.Cu F.Paste F.Mask) 23 | (zone_connect 0)) 24 | (pad 4 smd custom (at 3.6 0) (size 1 0.55) (layers F.Cu F.Paste F.Mask) 25 | (zone_connect 0) 26 | (options (clearance outline) (anchor rect)) 27 | (primitives 28 | (gr_poly (pts 29 | (xy 0.05 -0.525) (xy -0.5 -0.525) (xy -0.5 0.675) (xy 0.05 0.675)) (width 0)) 30 | )) 31 | (model ${KIPRJMOD}/../lib/sk6812.3dshapes/SK6812-SIDE-A.step 32 | (offset (xyz 1.76 -0.6 0)) 33 | (scale (xyz 1 1 1)) 34 | (rotate (xyz 0 0 0)) 35 | ) 36 | ) 37 | -------------------------------------------------------------------------------- /electronics/lib/SN74AVC4T774.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.4 2 | #encoding utf-8 3 | # 4 | # Texas Instruments SN74AVC4T774RSVR 5 | # 6 | DEF SN74AVC4T774RSVR U 0 40 Y Y 1 L N 7 | F0 "U" 0 200 50 H V L CNN 8 | F1 "SN74AVC4T774RSVR" 0 300 50 H V L CNN 9 | F2 "Texas_Instruments-RSV_R-PUQFN-N16-0-0-*" 0 400 50 H I L CNN 10 | F3 "http://www.ti.com/lit/ds/symlink/sn74avc4t774.pdf" 0 500 50 H I L CNN 11 | F4 "380Mbps" 0 600 50 H I L CNN "Data Rate" 12 | F5 "1.2V ~ 3.6V" 0 700 50 H I L CNN "Voltage - VCCA" 13 | F6 "1.2V ~ 3.6V" 0 800 50 H I L CNN "Voltage - VCCB" 14 | F7 "IC" 0 900 50 H I L CNN "category" 15 | F8 "Voltage Level Translator Bidirectional 1 Circuit 4 Channel 380Mbps 16-UQFN (2.6x1.8)" 0 1000 50 H I L CNN "digikey description" 16 | F9 "296-24741-1-ND" 0 1100 50 H I L CNN "digikey part number" 17 | F10 "yes" 0 1200 50 H I L CNN "lead free" 18 | F11 "e3c229e32d4c5fe7" 0 1300 50 H I L CNN "library id" 19 | F12 "Texas Instruments" 0 1400 50 H I L CNN "manufacturer" 20 | F13 "595-SN74AVC4T774RSVR" 0 1500 50 H I L CNN "mouser part number" 21 | F14 "16-UFQFN" 0 1600 50 H I L CNN "package" 22 | F15 "yes" 0 1700 50 H I L CNN "rohs" 23 | F16 "+85°C" 0 1800 50 H I L CNN "temperature range high" 24 | F17 "-40°C" 0 1900 50 H I L CNN "temperature range low" 25 | DRAW 26 | X VCCA 14 100 0 100 R 40 40 1 1 W 27 | X VCCB 13 100 -100 100 R 40 40 1 1 W 28 | X DIR1 15 100 -800 100 R 40 40 1 1 I 29 | X DIR2 16 100 -900 100 R 40 40 1 1 I 30 | X DIR3 5 100 -1000 100 R 40 40 1 1 I 31 | X DIR4 6 100 -1100 100 R 40 40 1 1 I 32 | X ~OE~ 7 100 -1300 100 R 40 40 1 1 I 33 | X A1 1 100 -300 100 R 40 40 1 1 B 34 | X A2 2 100 -400 100 R 40 40 1 1 B 35 | X A3 3 100 -500 100 R 40 40 1 1 B 36 | X A4 4 100 -600 100 R 40 40 1 1 B 37 | X B1 12 1000 0 100 L 40 40 1 1 B 38 | X B2 11 1000 -100 100 L 40 40 1 1 B 39 | X B3 10 1000 -200 100 L 40 40 1 1 B 40 | X B4 9 1000 -300 100 L 40 40 1 1 B 41 | X GND 8 1000 -1300 100 L 40 40 1 1 W 42 | S 200 100 900 -1400 1 1 0 f 43 | ENDDRAW 44 | ENDDEF 45 | # 46 | # End Library 47 | -------------------------------------------------------------------------------- /firmware/src/task.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Scott Bezek and the splitflap contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include 19 | 20 | // Static polymorphic abstract base class for a FreeRTOS task using CRTP pattern. Concrete implementations 21 | // should implement a run() method. 22 | // Inspired by https://fjrg76.wordpress.com/2018/05/23/objectifying-task-creation-in-freertos-ii/ 23 | template 24 | class Task { 25 | public: 26 | Task(const char* name, uint32_t stackDepth, UBaseType_t priority, const BaseType_t coreId = tskNO_AFFINITY) : 27 | name { name }, 28 | stackDepth {stackDepth}, 29 | priority { priority }, 30 | coreId { coreId } 31 | {} 32 | virtual ~Task() {}; 33 | 34 | TaskHandle_t getHandle() { 35 | return taskHandle; 36 | } 37 | 38 | void begin() { 39 | BaseType_t result = xTaskCreatePinnedToCore(taskFunction, name, stackDepth, this, priority, &taskHandle, coreId); 40 | assert("Failed to create task" && result == pdPASS); 41 | } 42 | 43 | private: 44 | static void taskFunction(void* params) { 45 | T* t = static_cast(params); 46 | t->run(); 47 | } 48 | 49 | const char* name; 50 | uint32_t stackDepth; 51 | UBaseType_t priority; 52 | TaskHandle_t taskHandle; 53 | const BaseType_t coreId; 54 | }; 55 | -------------------------------------------------------------------------------- /firmware/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "display_task.h" 5 | #include "interface_task.h" 6 | #include "motor_task.h" 7 | 8 | #if SK_DISPLAY 9 | static DisplayTask display_task = DisplayTask(0); 10 | static DisplayTask* display_task_p = &display_task; 11 | #else 12 | static DisplayTask* display_task_p = nullptr; 13 | #endif 14 | static MotorTask motor_task = MotorTask(1); 15 | 16 | 17 | InterfaceTask interface_task = InterfaceTask(0, motor_task, display_task_p); 18 | 19 | static QueueHandle_t knob_state_debug_queue; 20 | 21 | void setup() { 22 | Serial.begin(115200); 23 | 24 | motor_task.begin(); 25 | interface_task.begin(); 26 | 27 | #if SK_DISPLAY 28 | display_task.begin(); 29 | 30 | // Connect display to motor_task's knob state feed 31 | motor_task.addListener(display_task.getKnobStateQueue()); 32 | #endif 33 | 34 | // Create a queue and register it with motor_task to print knob state to serial (see loop() below) 35 | knob_state_debug_queue = xQueueCreate(1, sizeof(KnobState)); 36 | assert(knob_state_debug_queue != NULL); 37 | 38 | motor_task.addListener(knob_state_debug_queue); 39 | 40 | // Free up the loop task 41 | vTaskDelete(NULL); 42 | } 43 | 44 | 45 | static KnobState state = {}; 46 | uint32_t last_debug; 47 | 48 | void loop() { 49 | // Print any new state, at most 5 times per second 50 | if (millis() - last_debug > 200 && xQueueReceive(knob_state_debug_queue, &state, portMAX_DELAY) == pdTRUE) { 51 | Serial.println(state.current_position); 52 | last_debug = millis(); 53 | } 54 | 55 | static uint32_t last_stack_debug; 56 | if (millis() - last_stack_debug > 1000) { 57 | Serial.println("Stack high water:"); 58 | Serial.printf("main: %d\n", uxTaskGetStackHighWaterMark(NULL)); 59 | #if SK_DISPLAY 60 | Serial.printf("display: %d\n", uxTaskGetStackHighWaterMark(display_task.getHandle())); 61 | #endif 62 | Serial.printf("motor: %d\n", uxTaskGetStackHighWaterMark(motor_task.getHandle())); 63 | Serial.printf("interface: %d\n", uxTaskGetStackHighWaterMark(interface_task.getHandle())); 64 | last_stack_debug = millis(); 65 | } 66 | } -------------------------------------------------------------------------------- /firmware/lib/tlv/LICENSE.md: -------------------------------------------------------------------------------- 1 | # License Summary for Repository 2 | ``` 3 | Important Notice: 4 | Changes, suggestions and commits in this repository may only be done putting them 5 | under the same license of the respective file. 6 | All rights of the respective copyright holders shall be reserved. 7 | Brands and product names are trademarks of their respective owners. 8 | Referred and linked files/pages are out-of-scope of this repository and underly 9 | their respective licenses. 10 | ``` 11 | ## License 12 | 13 | Copyright (c) 2018 Infineon Technologies AG 14 | 15 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 16 | following conditions are met: 17 | 18 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following 19 | disclaimer. 20 | 21 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following 22 | disclaimer in the documentation and/or other materials provided with the distribution. 23 | 24 | Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote 25 | products derived from this software without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 28 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | 36 | -------------------------------------------------------------------------------- /electronics/lib/LCD_GC9A01.pretty/GC9A01Round1.28.kicad_mod: -------------------------------------------------------------------------------- 1 | (module GC9A01Round1.28 (layer F.Cu) (tedit 622E4650) 2 | (attr smd) 3 | (fp_text reference REF** (at 4 1) (layer F.SilkS) hide 4 | (effects (font (size 1 1) (thickness 0.15))) 5 | ) 6 | (fp_text value GC9A01Round1.28 (at 0 -0.5) (layer F.Fab) 7 | (effects (font (size 1 1) (thickness 0.15))) 8 | ) 9 | (fp_line (start 0 -5.7) (end -3 -5.7) (layer F.SilkS) (width 0.15)) 10 | (fp_line (start 0 5.7) (end -6.5 5.7) (layer F.SilkS) (width 0.15)) 11 | (fp_line (start -6.5 -6.4) (end -4.5 -6.4) (layer F.SilkS) (width 0.15)) 12 | (fp_line (start -4.5 -6.4) (end -3 -5.7) (layer F.SilkS) (width 0.15)) 13 | (fp_line (start 0 -5.7) (end 0 -4.5) (layer F.SilkS) (width 0.15)) 14 | (fp_line (start 0 5.7) (end 0 4.5) (layer F.SilkS) (width 0.15)) 15 | (fp_text user 1 (at 2 -4) (layer F.SilkS) 16 | (effects (font (size 0.8 0.8) (thickness 0.12))) 17 | ) 18 | (fp_text user 12 (at 2 4) (layer F.SilkS) 19 | (effects (font (size 0.8 0.8) (thickness 0.12))) 20 | ) 21 | (pad 1 smd roundrect (at 0 -3.85) (size 2 0.35) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 22 | (pad 2 smd roundrect (at 0 -3.15) (size 2 0.35) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 23 | (pad 3 smd roundrect (at 0 -2.45) (size 2 0.35) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 24 | (pad 4 smd roundrect (at 0 -1.75) (size 2 0.35) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 25 | (pad 5 smd roundrect (at 0 -1.05) (size 2 0.35) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 26 | (pad 6 smd roundrect (at 0 -0.35) (size 2 0.35) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 27 | (pad 7 smd roundrect (at 0 0.35) (size 2 0.35) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 28 | (pad 8 smd roundrect (at 0 1.05) (size 2 0.35) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 29 | (pad 9 smd roundrect (at 0 1.75) (size 2 0.35) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 30 | (pad 10 smd roundrect (at 0 2.45) (size 2 0.35) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 31 | (pad 11 smd roundrect (at 0 3.15) (size 2 0.35) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 32 | (pad 12 smd roundrect (at 0 3.85) (size 2 0.35) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 33 | (model ${KIPRJMOD}/../lib/LCD_GC9A01.3dshapes/TFT-Round-1.28.step 34 | (offset (xyz 10.9 0 -1.8)) 35 | (scale (xyz 1 1 1)) 36 | (rotate (xyz 0 180 90)) 37 | ) 38 | ) 39 | -------------------------------------------------------------------------------- /electronics/scripts/export_jlcpcb.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Copyright 2021 Scott Bezek and the splitflap contributors 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | import argparse 18 | import logging 19 | import os 20 | import subprocess 21 | import sys 22 | 23 | electronics_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 24 | repo_root = os.path.dirname(electronics_root) 25 | sys.path.append(repo_root) 26 | 27 | from util import file_util 28 | from export_util import ( 29 | versioned_file, 30 | ) 31 | 32 | logging.basicConfig(level=logging.DEBUG) 33 | logger = logging.getLogger(__name__) 34 | 35 | 36 | def export_jlcpcb(pcb, schematic, alt_fields, release_prefix): 37 | pcb_file = os.path.abspath(pcb) 38 | 39 | output_dir = os.path.join(electronics_root, 'build', os.path.splitext(os.path.basename(pcb_file))[0] + '-jlc') 40 | file_util.mkdir_p(output_dir) 41 | 42 | with versioned_file(pcb_file, release_prefix): 43 | command = [ 44 | 'kikit', 45 | 'fab', 46 | 'jlcpcb', 47 | ] 48 | if schematic is not None: 49 | schematic_file = os.path.abspath(schematic) 50 | command += [ 51 | '--assembly', 52 | '--schematic', 53 | schematic_file, 54 | '--field', 55 | ] 56 | command.append(','.join(alt_fields + ['LCSC'])) 57 | command += [ 58 | pcb_file, 59 | output_dir, 60 | ] 61 | subprocess.check_call(command) 62 | 63 | 64 | if __name__ == '__main__': 65 | parser = argparse.ArgumentParser() 66 | parser.add_argument('pcb') 67 | parser.add_argument('--assembly-schematic') 68 | parser.add_argument('--alt-fields', nargs='+') 69 | parser.add_argument('--release-prefix', type=str, required=True, help='Tag prefix to check if this is a tagged/versioned release. E.g. "releases/" for tags like "releases/v1.0"') 70 | args = parser.parse_args() 71 | export_jlcpcb(args.pcb, args.assembly_schematic, args.alt_fields, args.release_prefix) 72 | -------------------------------------------------------------------------------- /electronics/lib/BM28.pretty/BM28B0.6-24DS.kicad_mod: -------------------------------------------------------------------------------- 1 | (module BM28B0.6-24DS (layer F.Cu) (tedit 6180705A) 2 | (attr smd) 3 | (fp_text reference REF** (at -3.515 0 90) (layer F.SilkS) 4 | (effects (font (size 1 1) (thickness 0.15))) 5 | ) 6 | (fp_text value BM28B0.6-24DS (at 0 3.6) (layer F.Fab) 7 | (effects (font (size 1 1) (thickness 0.15))) 8 | ) 9 | (pad 1 smd rect (at -0.795 -1.925) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 10 | (pad 2 smd rect (at 0.795 -1.925) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 11 | (pad 3 smd rect (at -0.795 -1.575) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 12 | (pad 4 smd rect (at 0.795 -1.575) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 13 | (pad 5 smd rect (at -0.795 -1.225) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 14 | (pad 6 smd rect (at 0.795 -1.225) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 15 | (pad 7 smd rect (at -0.795 -0.875) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 16 | (pad 8 smd rect (at 0.795 -0.875) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 17 | (pad 9 smd rect (at -0.795 -0.525) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 18 | (pad 10 smd rect (at 0.795 -0.525) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 19 | (pad 11 smd rect (at -0.795 -0.175) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 20 | (pad 12 smd rect (at 0.795 -0.175) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 21 | (pad 13 smd rect (at -0.795 0.175) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 22 | (pad 14 smd rect (at 0.795 0.175) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 23 | (pad 15 smd rect (at -0.795 0.525) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 24 | (pad 16 smd rect (at 0.795 0.525) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 25 | (pad 17 smd rect (at -0.795 0.875) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 26 | (pad 18 smd rect (at 0.795 0.875) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 27 | (pad 19 smd rect (at -0.795 1.225) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 28 | (pad 20 smd rect (at 0.795 1.225) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 29 | (pad 21 smd rect (at -0.795 1.575) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 30 | (pad 22 smd rect (at 0.795 1.575) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 31 | (pad 23 smd rect (at -0.795 1.925) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 32 | (pad 24 smd rect (at 0.795 1.925) (size 0.41 0.18) (layers F.Cu F.Paste F.Mask)) 33 | (pad 25 smd rect (at -0.745 -2.63) (size 0.31 0.53) (layers F.Cu F.Paste F.Mask)) 34 | (pad 26 smd rect (at 0.745 -2.63) (size 0.31 0.53) (layers F.Cu F.Paste F.Mask)) 35 | (pad 27 smd rect (at -0.745 2.63) (size 0.31 0.53) (layers F.Cu F.Paste F.Mask)) 36 | (pad 28 smd rect (at 0.745 2.63) (size 0.31 0.53) (layers F.Cu F.Paste F.Mask)) 37 | ) 38 | -------------------------------------------------------------------------------- /electronics/lib/GCT_USB.pretty/USB4510_NoPaste.kicad_mod: -------------------------------------------------------------------------------- 1 | (module USB4510_NoPaste (layer F.Cu) (tedit 620C1622) 2 | (attr smd) 3 | (fp_text reference REF** (at 0 -3.35) (layer F.Fab) 4 | (effects (font (size 1 1) (thickness 0.15))) 5 | ) 6 | (fp_text value USB4510_NoPaste (at 0 -0.5) (layer F.Fab) 7 | (effects (font (size 1 1) (thickness 0.15))) 8 | ) 9 | (fp_line (start -4.62 0) (end -4.62 -5.7) (layer Edge.Cuts) (width 0.2)) 10 | (fp_line (start -4.12 -6.2) (end 4.12 -6.2) (layer Edge.Cuts) (width 0.2)) 11 | (fp_line (start 4.62 0) (end 4.62 -5.7) (layer Edge.Cuts) (width 0.2)) 12 | (fp_line (start -4.47 0.5) (end -4.47 -6) (layer F.Fab) (width 0.05)) 13 | (fp_line (start 4.47 0.5) (end 4.47 -6) (layer F.Fab) (width 0.05)) 14 | (fp_line (start -4.47 0.5) (end 4.47 0.5) (layer F.Fab) (width 0.05)) 15 | (fp_line (start 4.47 -6) (end -4.47 -6) (layer F.Fab) (width 0.05)) 16 | (fp_arc (start -4.12 -5.7) (end -4.12 -6.2) (angle -90) (layer Edge.Cuts) (width 0.2)) 17 | (fp_arc (start 4.12 -5.7) (end 4.62 -5.7) (angle -90) (layer Edge.Cuts) (width 0.2)) 18 | (pad S1 thru_hole oval (at 5.62 -5.6) (size 1 1.8) (drill oval 0.6 1.4) (layers *.Cu *.Mask)) 19 | (pad S1 thru_hole oval (at -5.62 -1.6) (size 1 2.2) (drill oval 0.6 1.8) (layers *.Cu *.Mask)) 20 | (pad S1 thru_hole oval (at 5.62 -1.6) (size 1 2.2) (drill oval 0.6 1.8) (layers *.Cu *.Mask)) 21 | (pad S1 thru_hole oval (at -5.62 -5.6) (size 1 1.8) (drill oval 0.6 1.4) (layers *.Cu *.Mask)) 22 | (pad A1 smd rect (at -3.2 -6.75) (size 0.6 1.1) (layers F.Cu F.Mask)) 23 | (pad A4 smd rect (at -2.4 -6.75) (size 0.6 1.1) (layers F.Cu F.Mask)) 24 | (pad B12 smd rect (at -3.2 -6.75) (size 0.6 1.1) (layers F.Cu F.Mask)) 25 | (pad B9 smd rect (at -2.4 -6.75) (size 0.6 1.1) (layers F.Cu F.Mask)) 26 | (pad B8 smd rect (at -1.75 -6.75) (size 0.3 1.1) (layers F.Cu F.Mask)) 27 | (pad A5 smd rect (at -1.25 -6.75) (size 0.3 1.1) (layers F.Cu F.Mask)) 28 | (pad B7 smd rect (at -0.75 -6.75) (size 0.3 1.1) (layers F.Cu F.Mask)) 29 | (pad A6 smd rect (at -0.25 -6.75) (size 0.3 1.1) (layers F.Cu F.Mask)) 30 | (pad A7 smd rect (at 0.25 -6.75) (size 0.3 1.1) (layers F.Cu F.Mask)) 31 | (pad B6 smd rect (at 0.75 -6.75) (size 0.3 1.1) (layers F.Cu F.Mask)) 32 | (pad A8 smd rect (at 1.25 -6.75) (size 0.3 1.1) (layers F.Cu F.Mask)) 33 | (pad B5 smd rect (at 1.75 -6.75) (size 0.3 1.1) (layers F.Cu F.Mask)) 34 | (pad A9 smd rect (at 2.4 -6.75) (size 0.6 1.1) (layers F.Cu F.Mask)) 35 | (pad B4 smd rect (at 2.4 -6.75) (size 0.6 1.1) (layers F.Cu F.Mask)) 36 | (pad B1 smd rect (at 3.2 -6.75) (size 0.6 1.1) (layers F.Cu F.Mask)) 37 | (pad A12 smd rect (at 3.2 -6.75) (size 0.6 1.1) (layers F.Cu F.Mask)) 38 | (model ${KIPRJMOD}/../lib/GCT_USB.3dshapes/proprietary/USB4510-03-1-A.stp 39 | (offset (xyz 0 -0.5 0)) 40 | (scale (xyz 1 1 1)) 41 | (rotate (xyz -90 0 0)) 42 | ) 43 | ) 44 | -------------------------------------------------------------------------------- /firmware/lib/tlv/src/util/BusInterface.h: -------------------------------------------------------------------------------- 1 | /** 2 | * BusInterface.h - Part of the library for Arduino to control the TLV493D-A1B6 3D magnetic sensor. 3 | * 4 | * The 3D magnetic sensor TLV493D-A1B6 offers accurate three dimensional sensing with extremely low power consumption 5 | * in a small 6-pin package. With an opportunity to detect the magnetic field in x, y, and z-direction the sensor is 6 | * ideally suited for the measurement of 3D movements, linear movements and rotation movements. 7 | * 8 | * Have a look at the application note/reference manual for more information. 9 | * 10 | * Copyright (c) 2018 Infineon Technologies AG 11 | * 12 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 13 | * following conditions are met: 14 | * 15 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following 16 | * disclaimer. 17 | * 18 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following 19 | * disclaimer in the documentation and/or other materials provided with the distribution. 20 | * 21 | * Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote 22 | * products derived from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 25 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 27 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef TLV493D_BUSIF_H_INCLUDED 34 | #define TLV493D_BUSIF_H_INCLUDED 35 | 36 | #include 37 | #include 38 | 39 | #define TLV493D_BUSIF_READSIZE 10 40 | #define TLV493D_BUSIF_WRITESIZE 4 41 | 42 | namespace tlv493d 43 | { 44 | 45 | typedef struct 46 | { 47 | TwoWire *bus; 48 | uint8_t adress; 49 | uint8_t regReadData[TLV493D_BUSIF_READSIZE]; 50 | uint8_t regWriteData[TLV493D_BUSIF_WRITESIZE]; 51 | } BusInterface_t; 52 | 53 | } 54 | 55 | #endif -------------------------------------------------------------------------------- /firmware/lib/tlv/src/util/RegMask.h: -------------------------------------------------------------------------------- 1 | /** 2 | * RegMask.h - Part of the library for Arduino to control the TLV493D-A1B6 3D magnetic sensor. 3 | * 4 | * The 3D magnetic sensor TLV493D-A1B6 offers accurate three dimensional sensing with extremely low power consumption 5 | * in a small 6-pin package. With an opportunity to detect the magnetic field in x, y, and z-direction the sensor is 6 | * ideally suited for the measurement of 3D movements, linear movements and rotation movements. 7 | * 8 | * Have a look at the application note/reference manual for more information. 9 | * 10 | * Copyright (c) 2018 Infineon Technologies AG 11 | * 12 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 13 | * following conditions are met: 14 | * 15 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following 16 | * disclaimer. 17 | * 18 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following 19 | * disclaimer in the documentation and/or other materials provided with the distribution. 20 | * 21 | * Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote 22 | * products derived from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 25 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 27 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef TLV493D_REGMASK_H_INCLUDED 34 | #define TLV493D_REGMASK_H_INCLUDED 35 | 36 | #include 37 | 38 | #define REGMASK_READ 0 39 | #define REGMASK_WRITE 1 40 | 41 | namespace tlv493d 42 | { 43 | 44 | typedef struct 45 | { 46 | uint8_t rw; 47 | uint8_t byteAdress; 48 | uint8_t bitMask; 49 | uint8_t shift; 50 | } RegMask_t; 51 | 52 | uint8_t getFromRegs(const RegMask_t *mask, uint8_t *regData); 53 | uint8_t setToRegs(const RegMask_t *mask, uint8_t *regData, uint8_t toWrite); 54 | 55 | } 56 | 57 | #endif -------------------------------------------------------------------------------- /electronics/lib/GCT_USB.pretty/USB4510.kicad_mod: -------------------------------------------------------------------------------- 1 | (module USB4510 (layer F.Cu) (tedit 6206B6FF) 2 | (attr smd) 3 | (fp_text reference REF** (at 0 -3.35) (layer F.Fab) 4 | (effects (font (size 1 1) (thickness 0.15))) 5 | ) 6 | (fp_text value USB4510 (at 0 -0.5) (layer F.Fab) 7 | (effects (font (size 1 1) (thickness 0.15))) 8 | ) 9 | (fp_line (start 4.47 -6) (end -4.47 -6) (layer F.Fab) (width 0.05)) 10 | (fp_line (start -4.47 0.5) (end 4.47 0.5) (layer F.Fab) (width 0.05)) 11 | (fp_line (start 4.47 0.5) (end 4.47 -6) (layer F.Fab) (width 0.05)) 12 | (fp_line (start -4.47 0.5) (end -4.47 -6) (layer F.Fab) (width 0.05)) 13 | (fp_line (start 4.62 0) (end 4.62 -5.7) (layer Edge.Cuts) (width 0.2)) 14 | (fp_line (start -4.12 -6.2) (end 4.12 -6.2) (layer Edge.Cuts) (width 0.2)) 15 | (fp_line (start -4.62 0) (end -4.62 -5.7) (layer Edge.Cuts) (width 0.2)) 16 | (fp_arc (start -4.12 -5.7) (end -4.12 -6.2) (angle -90) (layer Edge.Cuts) (width 0.2)) 17 | (fp_arc (start 4.12 -5.7) (end 4.62 -5.7) (angle -90) (layer Edge.Cuts) (width 0.2)) 18 | (pad S1 thru_hole oval (at 5.62 -5.6) (size 1 1.8) (drill oval 0.6 1.4) (layers *.Cu *.Mask)) 19 | (pad S1 thru_hole oval (at -5.62 -1.6) (size 1 2.2) (drill oval 0.6 1.8) (layers *.Cu *.Mask)) 20 | (pad S1 thru_hole oval (at 5.62 -1.6) (size 1 2.2) (drill oval 0.6 1.8) (layers *.Cu *.Mask)) 21 | (pad S1 thru_hole oval (at -5.62 -5.6) (size 1 1.8) (drill oval 0.6 1.4) (layers *.Cu *.Mask)) 22 | (pad A1 smd rect (at -3.2 -6.75) (size 0.6 1.1) (layers F.Cu F.Paste F.Mask)) 23 | (pad A4 smd rect (at -2.4 -6.75) (size 0.6 1.1) (layers F.Cu F.Paste F.Mask)) 24 | (pad B12 smd rect (at -3.2 -6.75) (size 0.6 1.1) (layers F.Cu F.Paste F.Mask)) 25 | (pad B9 smd rect (at -2.4 -6.75) (size 0.6 1.1) (layers F.Cu F.Paste F.Mask)) 26 | (pad B8 smd rect (at -1.75 -6.75) (size 0.3 1.1) (layers F.Cu F.Paste F.Mask)) 27 | (pad A5 smd rect (at -1.25 -6.75) (size 0.3 1.1) (layers F.Cu F.Paste F.Mask)) 28 | (pad B7 smd rect (at -0.75 -6.75) (size 0.3 1.1) (layers F.Cu F.Paste F.Mask)) 29 | (pad A6 smd rect (at -0.25 -6.75) (size 0.3 1.1) (layers F.Cu F.Paste F.Mask)) 30 | (pad A7 smd rect (at 0.25 -6.75) (size 0.3 1.1) (layers F.Cu F.Paste F.Mask)) 31 | (pad B6 smd rect (at 0.75 -6.75) (size 0.3 1.1) (layers F.Cu F.Paste F.Mask)) 32 | (pad A8 smd rect (at 1.25 -6.75) (size 0.3 1.1) (layers F.Cu F.Paste F.Mask)) 33 | (pad B5 smd rect (at 1.75 -6.75) (size 0.3 1.1) (layers F.Cu F.Paste F.Mask)) 34 | (pad A9 smd rect (at 2.4 -6.75) (size 0.6 1.1) (layers F.Cu F.Paste F.Mask)) 35 | (pad B4 smd rect (at 2.4 -6.75) (size 0.6 1.1) (layers F.Cu F.Paste F.Mask)) 36 | (pad B1 smd rect (at 3.2 -6.75) (size 0.6 1.1) (layers F.Cu F.Paste F.Mask)) 37 | (pad A12 smd rect (at 3.2 -6.75) (size 0.6 1.1) (layers F.Cu F.Paste F.Mask)) 38 | (model ${KIPRJMOD}/../lib/GCT_USB.3dshapes/proprietary/USB4510-03-1-A.stp 39 | (offset (xyz 0 -0.5 0)) 40 | (scale (xyz 1 1 1)) 41 | (rotate (xyz -90 0 0)) 42 | ) 43 | ) 44 | -------------------------------------------------------------------------------- /firmware/lib/tlv/src/util/BusInterface2.h: -------------------------------------------------------------------------------- 1 | /** 2 | * BusInterface2.h - Part of the library for Arduino to control the TLV493D-A1B6 3D magnetic sensor. 3 | * 4 | * The 3D magnetic sensor TLV493D-A1B6 offers accurate three dimensional sensing with extremely low power consumption 5 | * in a small 6-pin package. With an opportunity to detect the magnetic field in x, y, and z-direction the sensor is 6 | * ideally suited for the measurement of 3D movements, linear movements and rotation movements. 7 | * 8 | * Have a look at the application note/reference manual for more information. 9 | * 10 | * Copyright (c) 2018 Infineon Technologies AG 11 | * 12 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 13 | * following conditions are met: 14 | * 15 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following 16 | * disclaimer. 17 | * 18 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following 19 | * disclaimer in the documentation and/or other materials provided with the distribution. 20 | * 21 | * Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote 22 | * products derived from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 25 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 27 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef TLV493D_BUSIF_2_H_INCLUDED 34 | #define TLV493D_BUSIF_2_H_INCLUDED 35 | 36 | #include "BusInterface.h" 37 | 38 | #define BUS_ERROR 1 39 | #define BUS_OK 0 40 | 41 | namespace tlv493d 42 | { 43 | 44 | void initInterface(BusInterface_t *interface, TwoWire *bus, uint8_t adress); 45 | bool readOut(BusInterface_t *interface); 46 | bool readOut(BusInterface_t *interface, uint8_t count); 47 | bool writeOut(BusInterface_t *interface); 48 | bool writeOut(BusInterface_t *interface, uint8_t count); 49 | 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /firmware/lib/tlv/src/util/RegMask.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * RegMask.cpp - Part of the library for Arduino to control the TLV493D-A1B6 3D magnetic sensor. 3 | * 4 | * The 3D magnetic sensor TLV493D-A1B6 offers accurate three dimensional sensing with extremely low power consumption 5 | * in a small 6-pin package. With an opportunity to detect the magnetic field in x, y, and z-direction the sensor is 6 | * ideally suited for the measurement of 3D movements, linear movements and rotation movements. 7 | * 8 | * Have a look at the application note/reference manual for more information. 9 | * 10 | * Copyright (c) 2018 Infineon Technologies AG 11 | * 12 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 13 | * following conditions are met: 14 | * 15 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following 16 | * disclaimer. 17 | * 18 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following 19 | * disclaimer in the documentation and/or other materials provided with the distribution. 20 | * 21 | * Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote 22 | * products derived from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 25 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 27 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #include "RegMask.h" 34 | 35 | uint8_t tlv493d::getFromRegs(const RegMask_t *mask, uint8_t *regData) 36 | { 37 | return (regData[mask->byteAdress] & mask->bitMask) >> mask->shift; 38 | } 39 | 40 | 41 | uint8_t tlv493d::setToRegs(const RegMask_t *mask, uint8_t *regData, uint8_t toWrite) 42 | { 43 | if(mask->rw == REGMASK_WRITE) 44 | { 45 | uint8_t regValue = regData[mask->byteAdress]; 46 | regValue &= ~(mask->bitMask); 47 | regValue |= (toWrite << mask->shift) & mask->bitMask; 48 | regData[mask->byteAdress] = regValue; 49 | } 50 | return 0; 51 | } 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /electronics/lib/SN74AVC4T774.pretty/Texas_Instruments-RSV_R-PUQFN-N16-0-0-0.kicad_mod: -------------------------------------------------------------------------------- 1 | (module Texas_Instruments-RSV_R-PUQFN-N16-0-0-0 (layer F.Cu) (tedit 618090B4) 2 | (fp_text reference REF** (at -1.75 -2.05) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15)) (justify left)) 4 | ) 5 | (fp_text value Val** (at 0 0) (layer F.SilkS) 6 | (effects (font (size 1.27 1.27) (thickness 0.15))) 7 | ) 8 | (fp_circle (center -0.6 1.675) (end -0.475 1.675) (layer F.SilkS) (width 0.25)) 9 | (fp_line (start 1.3 1.075) (end 1.1 1.075) (layer F.SilkS) (width 0.15)) 10 | (fp_line (start -1.3 1.075) (end -1.1 1.075) (layer F.SilkS) (width 0.15)) 11 | (fp_line (start 1.3 -1.075) (end 1.1 -1.075) (layer F.SilkS) (width 0.15)) 12 | (fp_line (start -1.3 -1.075) (end -1.1 -1.075) (layer F.SilkS) (width 0.15)) 13 | (fp_line (start 1.525 1.125) (end 1.525 -1.125) (layer F.CrtYd) (width 0.15)) 14 | (fp_line (start -1.525 1.125) (end 1.525 1.125) (layer F.CrtYd) (width 0.15)) 15 | (fp_line (start -1.525 -1.125) (end -1.525 1.125) (layer F.CrtYd) (width 0.15)) 16 | (fp_line (start 1.525 -1.125) (end -1.525 -1.125) (layer F.CrtYd) (width 0.15)) 17 | (fp_line (start 1.525 -1.125) (end 1.525 -1.125) (layer F.CrtYd) (width 0.15)) 18 | (fp_line (start 1.3 0.9) (end -1.3 0.9) (layer F.Fab) (width 0.15)) 19 | (fp_line (start 1.3 -0.9) (end 1.3 0.9) (layer F.Fab) (width 0.15)) 20 | (fp_line (start -1.3 -0.9) (end 1.3 -0.9) (layer F.Fab) (width 0.15)) 21 | (fp_line (start -1.3 0.9) (end -1.3 -0.9) (layer F.Fab) (width 0.15)) 22 | (pad 1 smd rect (at -0.6 0.725) (size 0.2 0.75) (layers F.Cu F.Paste F.Mask)) 23 | (pad 2 smd rect (at -0.2 0.775) (size 0.2 0.65) (layers F.Cu F.Paste F.Mask)) 24 | (pad 3 smd rect (at 0.2 0.775) (size 0.2 0.65) (layers F.Cu F.Paste F.Mask)) 25 | (pad 4 smd rect (at 0.6 0.775) (size 0.2 0.65) (layers F.Cu F.Paste F.Mask)) 26 | (pad 5 smd rect (at 1.175 0.6) (size 0.65 0.2) (layers F.Cu F.Paste F.Mask)) 27 | (pad 6 smd rect (at 1.175 0.2) (size 0.65 0.2) (layers F.Cu F.Paste F.Mask)) 28 | (pad 7 smd rect (at 1.175 -0.2) (size 0.65 0.2) (layers F.Cu F.Paste F.Mask)) 29 | (pad 8 smd rect (at 1.175 -0.6) (size 0.65 0.2) (layers F.Cu F.Paste F.Mask)) 30 | (pad 9 smd rect (at 0.6 -0.775) (size 0.2 0.65) (layers F.Cu F.Paste F.Mask)) 31 | (pad 10 smd rect (at 0.2 -0.775) (size 0.2 0.65) (layers F.Cu F.Paste F.Mask)) 32 | (pad 11 smd rect (at -0.2 -0.775) (size 0.2 0.65) (layers F.Cu F.Paste F.Mask)) 33 | (pad 12 smd rect (at -0.6 -0.775) (size 0.2 0.65) (layers F.Cu F.Paste F.Mask)) 34 | (pad 13 smd rect (at -1.175 -0.6) (size 0.65 0.2) (layers F.Cu F.Paste F.Mask)) 35 | (pad 14 smd rect (at -1.175 -0.2) (size 0.65 0.2) (layers F.Cu F.Paste F.Mask)) 36 | (pad 15 smd rect (at -1.175 0.2) (size 0.65 0.2) (layers F.Cu F.Paste F.Mask)) 37 | (pad 16 smd rect (at -1.175 0.6) (size 0.65 0.2) (layers F.Cu F.Paste F.Mask)) 38 | (model SN74AVC4T774.models/Texas_Instruments_-_SN74AVC4T774RSVR.step 39 | (at (xyz 0 0 0)) 40 | (scale (xyz 1 1 1)) 41 | (rotate (xyz 0 0 0)) 42 | ) 43 | ) 44 | -------------------------------------------------------------------------------- /electronics/lib/Molex.pretty/532610371.kicad_mod: -------------------------------------------------------------------------------- 1 | (module 532610371 (layer F.Cu) (tedit 620AE163) 2 | (fp_text reference REF** (at 1.25 -3.02) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value CON_532610371 (at 1.25 -5.08) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_line (start -3.453991 0) (end -4.977991 -0.635) (layer F.Fab) (width 0.1)) 9 | (fp_line (start -4.977991 -0.635) (end -4.977991 0.635) (layer F.Fab) (width 0.1)) 10 | (fp_line (start -4.977991 0.635) (end -3.453991 0) (layer F.Fab) (width 0.1)) 11 | (fp_line (start -3.199991 -0.2) (end -3.199991 1.07996) (layer F.SilkS) (width 0.12)) 12 | (fp_line (start -3.199991 5) (end 5.699991 5) (layer F.SilkS) (width 0.12)) 13 | (fp_line (start 5.699991 5) (end 5.699991 4.720039) (layer F.SilkS) (width 0.12)) 14 | (fp_line (start 5.699991 -0.2) (end 3.22004 -0.2) (layer F.SilkS) (width 0.12)) 15 | (fp_line (start -3.199991 5) (end 5.699991 5) (layer F.Fab) (width 0.1)) 16 | (fp_line (start 5.699991 5) (end 5.699991 -0.2) (layer F.Fab) (width 0.1)) 17 | (fp_line (start 5.699991 -0.2) (end -3.199991 -0.2) (layer F.Fab) (width 0.1)) 18 | (fp_line (start -3.199991 -0.2) (end -3.199991 5) (layer F.Fab) (width 0.1)) 19 | (fp_line (start -0.72004 -0.2) (end -3.199991 -0.2) (layer F.SilkS) (width 0.12)) 20 | (fp_line (start -3.199991 4.720039) (end -3.199991 5) (layer F.SilkS) (width 0.12)) 21 | (fp_line (start 5.699991 1.07996) (end 5.699991 -0.2) (layer F.SilkS) (width 0.12)) 22 | (fp_line (start -4 -1) (end -4 5.5) (layer F.CrtYd) (width 0.05)) 23 | (fp_line (start -4 5.5) (end 6.5 5.5) (layer F.CrtYd) (width 0.05)) 24 | (fp_line (start 6.5 5.5) (end 6.5 -1) (layer F.CrtYd) (width 0.05)) 25 | (fp_line (start 6.5 -1) (end -4 -1) (layer F.CrtYd) (width 0.05)) 26 | (fp_text user "Copyright 2021 Accelerated Designs. All rights reserved." (at 0 0) (layer Cmts.User) 27 | (effects (font (size 0.127 0.127) (thickness 0.002))) 28 | ) 29 | (fp_text user 532610371 (at 1.25 -11.57) (layer F.Fab) 30 | (effects (font (size 1 1) (thickness 0.15))) 31 | ) 32 | (fp_text user PICOBLADE_1.25_WIRE_TO_BOARD_WAFER_ASSY_SMT_-3_CKT (at 1.25 -9.03) (layer F.Fab) 33 | (effects (font (size 1 1) (thickness 0.15))) 34 | ) 35 | (fp_text user NOTE (at -3.199991 9.960001) (layer Cmts.User) 36 | (effects (font (size 1 1) (thickness 0.15))) 37 | ) 38 | (fp_text user MAXIMUM_PACKAGE_HEIGHT:_3.4_MM (at -3.199991 12.500001) (layer Cmts.User) 39 | (effects (font (size 1 1) (thickness 0.15))) 40 | ) 41 | (pad 1 smd rect (at 0 0) (size 0.8 1.6) (layers F.Cu F.Paste F.Mask)) 42 | (pad 2 smd rect (at 1.25 0) (size 0.8 1.6) (layers F.Cu F.Paste F.Mask)) 43 | (pad 3 smd rect (at 2.5 0) (size 0.8 1.6) (layers F.Cu F.Paste F.Mask)) 44 | (pad "" smd rect (at -2.55 2.899999) (size 2.1 2.999999) (layers F.Cu F.Paste F.Mask)) 45 | (pad "" smd rect (at 5.05 2.899999) (size 2.1 2.999999) (layers F.Cu F.Paste F.Mask)) 46 | (model ${KIPRJMOD}/../lib/Molex.3dshapes/532610371.stp 47 | (offset (xyz 1.25 -4 1.9)) 48 | (scale (xyz 1 1 1)) 49 | (rotate (xyz 0 0 180)) 50 | ) 51 | ) 52 | -------------------------------------------------------------------------------- /electronics/scripts/generate_pdf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright 2015-2021 Scott Bezek and the splitflap contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | import argparse 16 | import logging 17 | import os 18 | import pcbnew 19 | import shutil 20 | import subprocess 21 | 22 | from collections import namedtuple 23 | 24 | import pcb_util 25 | 26 | electronics_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 27 | 28 | logging.basicConfig(level=logging.DEBUG) 29 | logger = logging.getLogger(__name__) 30 | 31 | 32 | def run(pcb_file, release_prefix): 33 | output_directory = os.path.join(electronics_root, 'build') 34 | temp_dir = os.path.join(output_directory, 'temp_pdfs') 35 | shutil.rmtree(temp_dir, ignore_errors=True) 36 | try: 37 | os.makedirs(temp_dir) 38 | plot_to_directory(pcb_file, output_directory, temp_dir, release_prefix) 39 | finally: 40 | shutil.rmtree(temp_dir, ignore_errors=True) 41 | 42 | 43 | def plot_to_directory(pcb_file, output_directory, temp_dir, release_prefix): 44 | board_name = os.path.splitext(os.path.basename(pcb_file))[0] 45 | 46 | with pcb_util.get_plotter(pcb_file, temp_dir, release_prefix) as plotter: 47 | plotter.plot_options.SetDrillMarksType(pcbnew.PCB_PLOT_PARAMS.NO_DRILL_SHAPE) 48 | plotter.plot_options.SetExcludeEdgeLayer(False) 49 | 50 | LayerDef = namedtuple('LayerDef', ['layer', 'mirror']) 51 | layers = [ 52 | LayerDef(pcbnew.F_Cu, False), 53 | LayerDef(pcbnew.B_Cu, True), 54 | LayerDef(pcbnew.F_SilkS, False), 55 | LayerDef(pcbnew.B_SilkS, True), 56 | LayerDef(pcbnew.F_Mask, False), 57 | LayerDef(pcbnew.B_Mask, True), 58 | LayerDef(pcbnew.F_Paste, False), 59 | ] 60 | 61 | pdfs = [] 62 | for layer in layers: 63 | plotter.plot_options.SetMirror(layer.mirror) 64 | output_filename = plotter.plot(layer.layer, pcbnew.PLOT_FORMAT_PDF) 65 | pdfs.append(output_filename) 66 | 67 | _, map_file = plotter.plot_drill() 68 | pdfs.append(map_file) 69 | 70 | output_pdf_filename = os.path.join(output_directory, '%s-pcb-packet.pdf' % (board_name,)) 71 | 72 | command = ['pdfunite'] + pdfs + [output_pdf_filename] 73 | subprocess.check_call(command) 74 | 75 | if __name__ == '__main__': 76 | parser = argparse.ArgumentParser('Generate a pdf of the PCB') 77 | parser.add_argument('--release-prefix', type=str, required=True, help='Tag prefix to check if this is a tagged/versioned release. E.g. "releases/" for tags like "releases/v1.0"') 78 | parser.add_argument('pcb_file') 79 | args = parser.parse_args() 80 | run(args.pcb_file, args.release_prefix) 81 | 82 | -------------------------------------------------------------------------------- /electronics/BM28B0.6-24DSBreakout/BM28B0.6-24DSBreakout.sch: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 4 2 | EELAYER 30 0 3 | EELAYER END 4 | $Descr A4 11693 8268 5 | encoding utf-8 6 | Sheet 1 1 7 | Title "" 8 | Date "" 9 | Rev "" 10 | Comp "" 11 | Comment1 "" 12 | Comment2 "" 13 | Comment3 "" 14 | Comment4 "" 15 | $EndDescr 16 | $Comp 17 | L Connector_Generic:Conn_02x14_Odd_Even J3 18 | U 1 1 61B58607 19 | P 3850 3050 20 | F 0 "J3" H 3900 3867 50 0000 C CNN 21 | F 1 "Conn_02x14_Odd_Even" H 3900 3776 50 0000 C CNN 22 | F 2 "BM28:BM28B0.6-24DS" H 3850 3050 50 0001 C CNN 23 | F 3 "~" H 3850 3050 50 0001 C CNN 24 | 1 3850 3050 25 | 1 0 0 -1 26 | $EndComp 27 | $Comp 28 | L Connector:Conn_01x14_Male J1 29 | U 1 1 61B59B74 30 | P 3050 2950 31 | F 0 "J1" H 3158 3731 50 0000 C CNN 32 | F 1 "Conn_01x14_Male" H 3158 3640 50 0000 C CNN 33 | F 2 "Connector_PinHeader_2.54mm:PinHeader_1x14_P2.54mm_Vertical" H 3050 2950 50 0001 C CNN 34 | F 3 "~" H 3050 2950 50 0001 C CNN 35 | 1 3050 2950 36 | 1 0 0 -1 37 | $EndComp 38 | $Comp 39 | L Connector:Conn_01x14_Male J2 40 | U 1 1 61B5ADB8 41 | P 4750 2950 42 | F 0 "J2" H 4722 2924 50 0000 R CNN 43 | F 1 "Conn_01x14_Male" H 4722 2833 50 0000 R CNN 44 | F 2 "Connector_PinHeader_2.54mm:PinHeader_1x14_P2.54mm_Vertical" H 4750 2950 50 0001 C CNN 45 | F 3 "~" H 4750 2950 50 0001 C CNN 46 | 1 4750 2950 47 | -1 0 0 -1 48 | $EndComp 49 | Wire Wire Line 50 | 3250 2450 3650 2450 51 | Wire Wire Line 52 | 3650 2550 3250 2550 53 | Wire Wire Line 54 | 3250 2650 3650 2650 55 | Wire Wire Line 56 | 3650 2750 3250 2750 57 | Wire Wire Line 58 | 3250 2850 3650 2850 59 | Wire Wire Line 60 | 3650 2950 3250 2950 61 | Wire Wire Line 62 | 3250 3050 3650 3050 63 | Wire Wire Line 64 | 3650 3150 3250 3150 65 | Wire Wire Line 66 | 3250 3250 3650 3250 67 | Wire Wire Line 68 | 3650 3350 3250 3350 69 | Wire Wire Line 70 | 3250 3450 3650 3450 71 | Wire Wire Line 72 | 3650 3550 3250 3550 73 | Wire Wire Line 74 | 4150 2450 4550 2450 75 | Wire Wire Line 76 | 4550 2550 4150 2550 77 | Wire Wire Line 78 | 4150 2650 4550 2650 79 | Wire Wire Line 80 | 4550 2750 4150 2750 81 | Wire Wire Line 82 | 4150 2850 4550 2850 83 | Wire Wire Line 84 | 4550 2950 4150 2950 85 | Wire Wire Line 86 | 4150 3050 4550 3050 87 | Wire Wire Line 88 | 4550 3150 4150 3150 89 | Wire Wire Line 90 | 4150 3250 4550 3250 91 | Wire Wire Line 92 | 4550 3350 4150 3350 93 | Wire Wire Line 94 | 4150 3450 4550 3450 95 | Wire Wire Line 96 | 4550 3550 4150 3550 97 | Wire Wire Line 98 | 4150 3750 4300 3750 99 | Text Label 4300 3750 2 50 ~ 0 100 | P28 101 | Wire Wire Line 102 | 3250 2350 3400 2350 103 | Text Label 3400 2350 2 50 ~ 0 104 | P25 105 | Wire Wire Line 106 | 4150 3650 4300 3650 107 | Text Label 4300 3650 2 50 ~ 0 108 | P26 109 | Wire Wire Line 110 | 3500 3750 3650 3750 111 | Text Label 3500 3750 0 50 ~ 0 112 | P27 113 | Wire Wire Line 114 | 3500 3650 3650 3650 115 | Text Label 3500 3650 0 50 ~ 0 116 | P25 117 | Wire Wire Line 118 | 3250 3650 3400 3650 119 | Text Label 3400 3650 2 50 ~ 0 120 | P27 121 | Wire Wire Line 122 | 4550 2350 4400 2350 123 | Text Label 4400 2350 0 50 ~ 0 124 | P26 125 | Wire Wire Line 126 | 4550 3650 4400 3650 127 | Text Label 4400 3650 0 50 ~ 0 128 | P28 129 | $EndSCHEMATC 130 | -------------------------------------------------------------------------------- /electronics/scripts/config/eeschema: -------------------------------------------------------------------------------- 1 | SchematicFramePos_x=89 2 | SchematicFramePos_y=38 3 | SchematicFrameSize_x=1125 4 | SchematicFrameSize_y=739 5 | SchematicFrameMaximized=0 6 | SchematicFrameAutoSaveInterval=600 7 | SchematicFramePerspective=layout2|name=MainToolbar;caption=;state=139644;dir=1;layer=6;row=0;pos=0;prop=100000;bestw=1016;besth=36;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=OptToolbar;caption=;state=139596;dir=4;layer=3;row=0;pos=0;prop=100000;bestw=36;besth=212;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=ToolsToolbar;caption=;state=139596;dir=2;layer=1;row=0;pos=0;prop=100000;bestw=36;besth=688;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=DrawFrame;caption=;state=1020;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=387;besth=181;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=MsgPanel;caption=;state=131452;dir=3;layer=6;row=0;pos=0;prop=100000;bestw=400;besth=34;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|dock_size(1,6,0)=36|dock_size(4,3,0)=36|dock_size(2,1,0)=36|dock_size(5,0,0)=337|dock_size(3,6,0)=34| 8 | SchematicFrameMostRecentlyUsedPath= 9 | SchematicFrameUnits=1 10 | SchematicFrameShowGrid=1 11 | SchematicFrame_LastGridSize=5 12 | SchematicFrameFirstRunShown=0 13 | SchematicFrameDevelMaxUndoItems=0 14 | SchematicFrameGalDisplayOptionsGridStyle=0 15 | SchematicFrameGalDisplayOptionsGridLineWidth=1 16 | SchematicFrameGalDisplayOptionsGridMaxDensity=10 17 | SchematicFrameGalDisplayOptionsGridAxesEnabled=0 18 | SchematicFrameGalDisplayOptionsCursorFullscreen=0 19 | SchematicFrameGalDisplayOptionsForceDisplayCursor=1 20 | ShowPageLimits=1 21 | Units=1 22 | PrintMonochrome=1 23 | PrintSheetReferenceAndTitleBlock=1 24 | RepeatStepX=0 25 | RepeatStepY=100 26 | RepeatLabelIncrement=1 27 | ShowIllegalSymbolLibDialog=1 28 | ShowSheetFileNameCaseSensitivityDlg=1 29 | DefaultBusWidth=12 30 | DefaultWireWidth=6 31 | DefaultJunctionSize=40 32 | ShowHiddenPins=0 33 | HorizVertLinesOnly=1 34 | AutoplaceFields=1 35 | AutoplaceJustify=1 36 | AutoplaceAlign=0 37 | FootprintPreview=0 38 | SimCmdLine= 39 | LastFindReplaceFlags=1 40 | LastFindString= 41 | LastReplaceString= 42 | FieldNames=(templatefields) 43 | canvas_type=2 44 | Color4DWireEx=rgb(0, 132, 0) 45 | Color4DBusEx=rgb(0, 0, 132) 46 | Color4DConnEx=rgb(0, 132, 0) 47 | Color4DLLabelEx=rgb(0, 0, 0) 48 | Color4DHLabelEx=rgb(132, 132, 0) 49 | Color4DGLabelEx=rgb(132, 0, 0) 50 | Color4DPinNumEx=rgb(132, 0, 0) 51 | Color4DPinNameEx=rgb(0, 132, 132) 52 | Color4DFieldEx=rgb(132, 0, 132) 53 | Color4DReferenceEx=rgb(0, 132, 132) 54 | Color4DValueEx=rgb(0, 132, 132) 55 | Color4DNoteEx=rgb(0, 0, 194) 56 | Color4DBodyEx=rgb(132, 0, 0) 57 | Color4DBodyBgEx=rgb(255, 255, 194) 58 | Color4DNetNameEx=rgb(132, 132, 132) 59 | Color4DPinEx=rgb(132, 0, 0) 60 | Color4DSheetEx=rgb(132, 0, 132) 61 | Color4DSheetFileNameEx=rgb(132, 132, 0) 62 | Color4DSheetNameEx=rgb(0, 132, 132) 63 | Color4DSheetLabelEx=rgb(132, 132, 0) 64 | Color4DNoConnectEx=rgb(0, 0, 132) 65 | Color4DErcWEx=rgba(0, 132, 0, 0.800) 66 | Color4DErcEEx=rgba(132, 0, 0, 0.800) 67 | Color4DGridEx=rgb(132, 132, 132) 68 | Color4DBgCanvasEx=rgb(255, 255, 255) 69 | Color4DCursorEx=rgb(0, 0, 0) 70 | Color4DBrightenedEx=rgb(255, 0, 255) 71 | Color4DHiddenEx=rgb(194, 194, 194) 72 | Color4DWorksheetEx=rgb(132, 0, 0) 73 | file1= 74 | file2= 75 | file3= 76 | file4= 77 | file5= 78 | file6= 79 | file7= 80 | file8= 81 | file9= 82 | PlotModeColor=1 83 | PlotFrameRef=1 84 | PlotFormat=3 85 | PlotHPGLOrg=0 86 | PlotHPGLPaperSize=0 87 | PlotHPGLPenSize=0.4826 88 | -------------------------------------------------------------------------------- /electronics/lib/strain.pretty/BF350-3AA.kicad_mod: -------------------------------------------------------------------------------- 1 | (module BF350-3AA (layer F.Cu) (tedit 622E2DB0) 2 | (attr smd) 3 | (fp_text reference REF** (at 0.1 -4.2 180) (layer F.Fab) 4 | (effects (font (size 1 1) (thickness 0.15))) 5 | ) 6 | (fp_text value BF350-3AA (at -2.65 0.05 90) (layer F.Fab) 7 | (effects (font (size 0.8 0.8) (thickness 0.1))) 8 | ) 9 | (fp_line (start 1.3 0.35) (end 1.5 0.35) (layer F.Fab) (width 0.12)) 10 | (fp_line (start 1.5 0.35) (end 1.5 -3.15) (layer F.Fab) (width 0.12)) 11 | (fp_line (start 1.5 -3.15) (end 1.7 -3.15) (layer F.Fab) (width 0.12)) 12 | (fp_line (start 1.7 -3.15) (end 1.7 1.05) (layer F.Fab) (width 0.12)) 13 | (fp_line (start 0.9 0.35) (end 1.1 0.35) (layer F.Fab) (width 0.12)) 14 | (fp_line (start 1.1 0.35) (end 1.1 -3.15) (layer F.Fab) (width 0.12)) 15 | (fp_line (start 1.1 -3.15) (end 1.3 -3.15) (layer F.Fab) (width 0.12)) 16 | (fp_line (start 1.3 -3.15) (end 1.3 0.35) (layer F.Fab) (width 0.12)) 17 | (fp_line (start 0.5 0.35) (end 0.7 0.35) (layer F.Fab) (width 0.12)) 18 | (fp_line (start 0.7 0.35) (end 0.7 -3.15) (layer F.Fab) (width 0.12)) 19 | (fp_line (start 0.7 -3.15) (end 0.9 -3.15) (layer F.Fab) (width 0.12)) 20 | (fp_line (start 0.9 -3.15) (end 0.9 0.35) (layer F.Fab) (width 0.12)) 21 | (fp_line (start 0.1 0.35) (end 0.3 0.35) (layer F.Fab) (width 0.12)) 22 | (fp_line (start 0.3 0.35) (end 0.3 -3.15) (layer F.Fab) (width 0.12)) 23 | (fp_line (start 0.3 -3.15) (end 0.5 -3.15) (layer F.Fab) (width 0.12)) 24 | (fp_line (start 0.5 -3.15) (end 0.5 0.35) (layer F.Fab) (width 0.12)) 25 | (fp_line (start -0.3 0.35) (end -0.1 0.35) (layer F.Fab) (width 0.12)) 26 | (fp_line (start -0.1 0.35) (end -0.1 -3.15) (layer F.Fab) (width 0.12)) 27 | (fp_line (start -0.1 -3.15) (end 0.1 -3.15) (layer F.Fab) (width 0.12)) 28 | (fp_line (start 0.1 -3.15) (end 0.1 0.35) (layer F.Fab) (width 0.12)) 29 | (fp_line (start -0.7 0.35) (end -0.5 0.35) (layer F.Fab) (width 0.12)) 30 | (fp_line (start -0.5 0.35) (end -0.5 -3.15) (layer F.Fab) (width 0.12)) 31 | (fp_line (start -0.5 -3.15) (end -0.3 -3.15) (layer F.Fab) (width 0.12)) 32 | (fp_line (start -0.3 -3.15) (end -0.3 0.35) (layer F.Fab) (width 0.12)) 33 | (fp_line (start -1.1 0.35) (end -0.9 0.35) (layer F.Fab) (width 0.12)) 34 | (fp_line (start -0.9 0.35) (end -0.9 -3.15) (layer F.Fab) (width 0.12)) 35 | (fp_line (start -0.9 -3.15) (end -0.7 -3.15) (layer F.Fab) (width 0.12)) 36 | (fp_line (start -0.7 -3.15) (end -0.7 0.35) (layer F.Fab) (width 0.12)) 37 | (fp_line (start -1.1 -3.15) (end -1.1 0.35) (layer F.Fab) (width 0.12)) 38 | (fp_line (start -1.3 -3.15) (end -1.1 -3.15) (layer F.Fab) (width 0.12)) 39 | (fp_line (start -1.3 0.35) (end -1.3 -3.15) (layer F.Fab) (width 0.12)) 40 | (fp_line (start -1.5 0.35) (end -1.3 0.35) (layer F.Fab) (width 0.12)) 41 | (fp_line (start -1.5 -3.15) (end -1.5 0.35) (layer F.Fab) (width 0.12)) 42 | (fp_line (start -1.7 -3.15) (end -1.5 -3.15) (layer F.Fab) (width 0.12)) 43 | (fp_line (start -1.7 1.05) (end -1.7 -3.15) (layer F.Fab) (width 0.12)) 44 | (fp_poly (pts (xy 1.7 3.2) (xy 0.3 3.2) (xy 0.3 1.05) (xy 1.7 1.05)) (layer F.Fab) (width 0.12)) 45 | (fp_poly (pts (xy -0.3 3.2) (xy -1.7 3.2) (xy -1.7 1.05) (xy -0.3 1.05)) (layer F.Fab) (width 0.12)) 46 | (fp_line (start 2.05 3.55) (end -2.05 3.55) (layer F.Fab) (width 0.12)) 47 | (fp_line (start 2.05 -3.55) (end 2.05 3.55) (layer F.Fab) (width 0.12)) 48 | (fp_line (start -2.05 -3.55) (end 2.05 -3.55) (layer F.Fab) (width 0.12)) 49 | (fp_line (start -2.05 3.55) (end -2.05 -3.55) (layer F.Fab) (width 0.12)) 50 | (fp_poly (pts (xy 2.5 -4) (xy 2.5 4) (xy -2.5 4) (xy -2.5 -4)) (layer F.Mask) (width 0.1)) 51 | (fp_line (start -2.5 -4) (end -1.5 -4) (layer F.SilkS) (width 0.15)) 52 | (fp_line (start -2.5 -4) (end -2.5 -3) (layer F.SilkS) (width 0.15)) 53 | (fp_line (start 2.5 -4) (end 2.5 -3) (layer F.SilkS) (width 0.15)) 54 | (fp_line (start 2.5 -4) (end 1.5 -4) (layer F.SilkS) (width 0.15)) 55 | ) 56 | -------------------------------------------------------------------------------- /electronics/LevelShifterBreakout/LevelShifterBreakout-cache.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.4 2 | #encoding utf-8 3 | # 4 | # Connector_Conn_01x08_Male 5 | # 6 | DEF Connector_Conn_01x08_Male J 0 40 Y N 1 F N 7 | F0 "J" 0 400 50 H V C CNN 8 | F1 "Connector_Conn_01x08_Male" 0 -500 50 H V C CNN 9 | F2 "" 0 0 50 H I C CNN 10 | F3 "" 0 0 50 H I C CNN 11 | $FPLIST 12 | Connector*:*_1x??_* 13 | $ENDFPLIST 14 | DRAW 15 | S 34 -395 0 -405 1 1 6 F 16 | S 34 -295 0 -305 1 1 6 F 17 | S 34 -195 0 -205 1 1 6 F 18 | S 34 -95 0 -105 1 1 6 F 19 | S 34 5 0 -5 1 1 6 F 20 | S 34 105 0 95 1 1 6 F 21 | S 34 205 0 195 1 1 6 F 22 | S 34 305 0 295 1 1 6 F 23 | P 2 1 1 6 50 -400 34 -400 N 24 | P 2 1 1 6 50 -300 34 -300 N 25 | P 2 1 1 6 50 -200 34 -200 N 26 | P 2 1 1 6 50 -100 34 -100 N 27 | P 2 1 1 6 50 0 34 0 N 28 | P 2 1 1 6 50 100 34 100 N 29 | P 2 1 1 6 50 200 34 200 N 30 | P 2 1 1 6 50 300 34 300 N 31 | X Pin_1 1 200 300 150 L 50 50 1 1 P 32 | X Pin_2 2 200 200 150 L 50 50 1 1 P 33 | X Pin_3 3 200 100 150 L 50 50 1 1 P 34 | X Pin_4 4 200 0 150 L 50 50 1 1 P 35 | X Pin_5 5 200 -100 150 L 50 50 1 1 P 36 | X Pin_6 6 200 -200 150 L 50 50 1 1 P 37 | X Pin_7 7 200 -300 150 L 50 50 1 1 P 38 | X Pin_8 8 200 -400 150 L 50 50 1 1 P 39 | ENDDRAW 40 | ENDDEF 41 | # 42 | # Device_C_Small 43 | # 44 | DEF Device_C_Small C 0 10 N N 1 F N 45 | F0 "C" 10 70 50 H V L CNN 46 | F1 "Device_C_Small" 10 -80 50 H V L CNN 47 | F2 "" 0 0 50 H I C CNN 48 | F3 "" 0 0 50 H I C CNN 49 | $FPLIST 50 | C_* 51 | $ENDFPLIST 52 | DRAW 53 | P 2 0 1 13 -60 -20 60 -20 N 54 | P 2 0 1 12 -60 20 60 20 N 55 | X ~ 1 0 100 80 D 50 50 1 1 P 56 | X ~ 2 0 -100 80 U 50 50 1 1 P 57 | ENDDRAW 58 | ENDDEF 59 | # 60 | # SN74AVC4T774_SN74AVC4T774RSVR 61 | # 62 | DEF SN74AVC4T774_SN74AVC4T774RSVR U 0 40 Y Y 1 L N 63 | F0 "U" 0 200 50 H V L CNN 64 | F1 "SN74AVC4T774_SN74AVC4T774RSVR" 0 300 50 H V L CNN 65 | F2 "Texas_Instruments-RSV_R-PUQFN-N16-0-0-*" 0 400 50 H I L CNN 66 | F3 "http://www.ti.com/lit/ds/symlink/sn74avc4t774.pdf" 0 500 50 H I L CNN 67 | F4 "380Mbps" 0 600 50 H I L CNN "Data Rate" 68 | F5 "1.2V ~ 3.6V" 0 700 50 H I L CNN "Voltage - VCCA" 69 | F6 "1.2V ~ 3.6V" 0 800 50 H I L CNN "Voltage - VCCB" 70 | F7 "IC" 0 900 50 H I L CNN "category" 71 | F8 "Voltage Level Translator Bidirectional 1 Circuit 4 Channel 380Mbps 16-UQFN (2.6x1.8)" 0 1000 50 H I L CNN "digikey description" 72 | F9 "296-24741-1-ND" 0 1100 50 H I L CNN "digikey part number" 73 | F10 "yes" 0 1200 50 H I L CNN "lead free" 74 | F11 "e3c229e32d4c5fe7" 0 1300 50 H I L CNN "library id" 75 | F12 "Texas Instruments" 0 1400 50 H I L CNN "manufacturer" 76 | F13 "595-SN74AVC4T774RSVR" 0 1500 50 H I L CNN "mouser part number" 77 | F14 "16-UFQFN" 0 1600 50 H I L CNN "package" 78 | F15 "yes" 0 1700 50 H I L CNN "rohs" 79 | F16 "+85°C" 0 1800 50 H I L CNN "temperature range high" 80 | F17 "-40°C" 0 1900 50 H I L CNN "temperature range low" 81 | DRAW 82 | S 200 100 900 -1400 1 1 0 f 83 | X A1 1 100 -300 100 R 40 40 1 1 B 84 | X B3 10 1000 -200 100 L 40 40 1 1 B 85 | X B2 11 1000 -100 100 L 40 40 1 1 B 86 | X B1 12 1000 0 100 L 40 40 1 1 B 87 | X VCCB 13 100 -100 100 R 40 40 1 1 W 88 | X VCCA 14 100 0 100 R 40 40 1 1 W 89 | X DIR1 15 100 -800 100 R 40 40 1 1 I 90 | X DIR2 16 100 -900 100 R 40 40 1 1 I 91 | X A2 2 100 -400 100 R 40 40 1 1 B 92 | X A3 3 100 -500 100 R 40 40 1 1 B 93 | X A4 4 100 -600 100 R 40 40 1 1 B 94 | X DIR3 5 100 -1000 100 R 40 40 1 1 I 95 | X DIR4 6 100 -1100 100 R 40 40 1 1 I 96 | X ~OE~ 7 100 -1300 100 R 40 40 1 1 I 97 | X GND 8 1000 -1300 100 L 40 40 1 1 W 98 | X B4 9 1000 -300 100 L 40 40 1 1 B 99 | ENDDRAW 100 | ENDDEF 101 | # 102 | # power_GND 103 | # 104 | DEF power_GND #PWR 0 0 Y Y 1 F P 105 | F0 "#PWR" 0 -250 50 H I C CNN 106 | F1 "power_GND" 0 -150 50 H V C CNN 107 | F2 "" 0 0 50 H I C CNN 108 | F3 "" 0 0 50 H I C CNN 109 | DRAW 110 | P 6 0 1 0 0 0 0 -50 50 -50 0 -100 -50 -50 0 -50 N 111 | X GND 1 0 0 0 D 50 50 1 1 W N 112 | ENDDRAW 113 | ENDDEF 114 | # 115 | #End Library 116 | -------------------------------------------------------------------------------- /firmware/src/mt6701_sensor.cpp: -------------------------------------------------------------------------------- 1 | #include "mt6701_sensor.h" 2 | #include "driver/spi_master.h" 3 | 4 | static const float ALPHA = 0.4; 5 | 6 | 7 | static uint8_t tableCRC6[64] = { 8 | 0x00, 0x03, 0x06, 0x05, 0x0C, 0x0F, 0x0A, 0x09, 9 | 0x18, 0x1B, 0x1E, 0x1D, 0x14, 0x17, 0x12, 0x11, 10 | 0x30, 0x33, 0x36, 0x35, 0x3C, 0x3F, 0x3A, 0x39, 11 | 0x28, 0x2B, 0x2E, 0x2D, 0x24, 0x27, 0x22, 0x21, 12 | 0x23, 0x20, 0x25, 0x26, 0x2F, 0x2C, 0x29, 0x2A, 13 | 0x3B, 0x38, 0x3D, 0x3E, 0x37, 0x34, 0x31, 0x32, 14 | 0x13, 0x10, 0x15, 0x16, 0x1F, 0x1C, 0x19, 0x1A, 15 | 0x0B, 0x08, 0x0D, 0x0E, 0x07, 0x04, 0x01, 0x02 16 | }; 17 | 18 | /*32-bit input data, right alignment, Calculation over 18 bits (mult. of 6) */ 19 | static uint8_t CRC6_43_18bit (uint32_t w_InputData) 20 | { 21 | uint8_t b_Index = 0; 22 | uint8_t b_CRC = 0; 23 | 24 | b_Index = (uint8_t )(((uint32_t)w_InputData >> 12u) & 0x0000003Fu); 25 | 26 | b_CRC = (uint8_t )(((uint32_t)w_InputData >> 6u) & 0x0000003Fu); 27 | b_Index = b_CRC ^ tableCRC6[b_Index]; 28 | 29 | b_CRC = (uint8_t )((uint32_t)w_InputData & 0x0000003Fu); 30 | b_Index = b_CRC ^ tableCRC6[b_Index]; 31 | 32 | b_CRC = tableCRC6[b_Index]; 33 | 34 | return b_CRC; 35 | } 36 | 37 | #if SENSOR_MT6701 38 | 39 | MT6701Sensor::MT6701Sensor() {} 40 | 41 | void MT6701Sensor::init() { 42 | 43 | pinMode(PIN_MT_CSN, OUTPUT); 44 | digitalWrite(PIN_MT_CSN, HIGH); 45 | 46 | spi_bus_config_t tx_bus_config = { 47 | .mosi_io_num = -1, 48 | .miso_io_num = PIN_MT_DATA, 49 | .sclk_io_num = PIN_MT_CLOCK, 50 | .quadwp_io_num = -1, 51 | .quadhd_io_num = -1, 52 | .max_transfer_sz = 1000, 53 | }; 54 | esp_err_t ret = spi_bus_initialize(HSPI_HOST, &tx_bus_config, 1); 55 | ESP_ERROR_CHECK(ret); 56 | 57 | spi_device_interface_config_t tx_device_config = { 58 | .command_bits=0, 59 | .address_bits=0, 60 | .dummy_bits=0, 61 | .mode=1, 62 | .duty_cycle_pos=0, 63 | .cs_ena_pretrans=4, 64 | .cs_ena_posttrans=0, 65 | .clock_speed_hz=4000000, 66 | .input_delay_ns=0, 67 | .spics_io_num=PIN_MT_CSN, 68 | .flags = 0, 69 | .queue_size=1, 70 | .pre_cb=NULL, 71 | .post_cb=NULL, 72 | }; 73 | ret=spi_bus_add_device(HSPI_HOST, &tx_device_config, &spi_device_); 74 | ESP_ERROR_CHECK(ret); 75 | 76 | 77 | spi_transaction_.flags = SPI_TRANS_USE_RXDATA; 78 | spi_transaction_.length = 24; 79 | spi_transaction_.rxlength = 24; 80 | spi_transaction_.tx_buffer = NULL; 81 | spi_transaction_.rx_buffer = NULL; 82 | } 83 | 84 | float MT6701Sensor::getSensorAngle() { 85 | uint32_t now = micros(); 86 | if (now - last_update_ > 100) { 87 | 88 | esp_err_t ret=spi_device_polling_transmit(spi_device_, &spi_transaction_); 89 | assert(ret==ESP_OK); 90 | 91 | uint32_t spi_32 = (spi_transaction_.rx_data[0] << 16) | (spi_transaction_.rx_data[1] << 8) | spi_transaction_.rx_data[2]; 92 | uint32_t angle_spi = spi_32 >> 10; 93 | 94 | uint8_t field_status = (spi_32 >> 6) & 0x3; 95 | uint8_t push_status = (spi_32 >> 8) & 0x1; 96 | uint8_t loss_status = (spi_32 >> 9) & 0x1; 97 | 98 | uint8_t received_crc = spi_32 & 0x3F; 99 | uint8_t calculated_crc = CRC6_43_18bit(spi_32 >> 6); 100 | 101 | if (received_crc == calculated_crc) { 102 | float new_angle = (float)angle_spi * 2 * PI / 16384; 103 | float new_x = cosf(new_angle); 104 | float new_y = sinf(new_angle); 105 | x_ = new_x * ALPHA + x_ * (1-ALPHA); 106 | y_ = new_y * ALPHA + y_ * (1-ALPHA); 107 | } else { 108 | Serial.printf("Bad CRC. expected %d, actual %d\n", calculated_crc, received_crc); 109 | } 110 | 111 | last_update_ = now; 112 | } 113 | float rad = -atan2f(y_, x_); 114 | if (rad < 0) { 115 | rad += 2*PI; 116 | } 117 | return rad; 118 | } 119 | 120 | #endif -------------------------------------------------------------------------------- /firmware/lib/tlv/src/util/BusInterface.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * BusInterface.cpp - Part of the library for Arduino to control the TLV493D-A1B6 3D magnetic sensor. 3 | * 4 | * The 3D magnetic sensor TLV493D-A1B6 offers accurate three dimensional sensing with extremely low power consumption 5 | * in a small 6-pin package. With an opportunity to detect the magnetic field in x, y, and z-direction the sensor is 6 | * ideally suited for the measurement of 3D movements, linear movements and rotation movements. 7 | * 8 | * Have a look at the application note/reference manual for more information. 9 | * 10 | * Copyright (c) 2018 Infineon Technologies AG 11 | * 12 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 13 | * following conditions are met: 14 | * 15 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following 16 | * disclaimer. 17 | * 18 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following 19 | * disclaimer in the documentation and/or other materials provided with the distribution. 20 | * 21 | * Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote 22 | * products derived from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 25 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 27 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #include "BusInterface2.h" 34 | 35 | void tlv493d::initInterface(BusInterface_t *interface, TwoWire *bus, uint8_t adress) 36 | { 37 | uint8_t i; 38 | interface->bus = bus; 39 | interface->adress = adress; 40 | for(i = 0; i < TLV493D_BUSIF_READSIZE; i++) { 41 | interface->regReadData[i] = 0x00;; 42 | } 43 | for(i = 0; i < TLV493D_BUSIF_WRITESIZE; i++) { 44 | interface->regWriteData[i] = 0x00;; 45 | } 46 | } 47 | 48 | bool tlv493d::readOut(BusInterface_t *interface) 49 | { 50 | return readOut(interface, TLV493D_BUSIF_READSIZE); 51 | } 52 | 53 | bool tlv493d::readOut(BusInterface_t *interface, uint8_t count) 54 | { 55 | bool ret = BUS_ERROR; 56 | int i; 57 | if(count > TLV493D_BUSIF_READSIZE) 58 | { 59 | count = TLV493D_BUSIF_READSIZE; 60 | } 61 | uint8_t received_bytes = interface->bus->requestFrom(interface->adress,count); 62 | if (received_bytes == count) 63 | { 64 | for(i = 0; i < count; i++) 65 | { 66 | interface->regReadData[i] = interface->bus->read(); 67 | } 68 | ret = BUS_OK; 69 | } 70 | return ret; 71 | } 72 | 73 | bool tlv493d::writeOut(BusInterface_t *interface) 74 | { 75 | return writeOut(interface, TLV493D_BUSIF_WRITESIZE); 76 | } 77 | 78 | bool tlv493d::writeOut(BusInterface_t *interface, uint8_t count) 79 | { 80 | bool ret = BUS_ERROR; 81 | int i; 82 | if(count > TLV493D_BUSIF_WRITESIZE) 83 | { 84 | count = TLV493D_BUSIF_WRITESIZE; 85 | } 86 | interface->bus->beginTransmission(interface->adress); 87 | for(i = 0; i < count; i++) 88 | { 89 | interface->bus->write(interface->regWriteData[i]); 90 | } 91 | if (interface->bus->endTransmission() == 0) 92 | { 93 | ret = BUS_OK; 94 | } 95 | return ret; 96 | } 97 | 98 | -------------------------------------------------------------------------------- /electronics/BM28B0.6-24DSBreakout/BM28B0.6-24DSBreakout-cache.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.4 2 | #encoding utf-8 3 | # 4 | # Connector_Conn_01x14_Male 5 | # 6 | DEF Connector_Conn_01x14_Male J 0 40 Y N 1 F N 7 | F0 "J" 0 700 50 H V C CNN 8 | F1 "Connector_Conn_01x14_Male" 0 -800 50 H V C CNN 9 | F2 "" 0 0 50 H I C CNN 10 | F3 "" 0 0 50 H I C CNN 11 | $FPLIST 12 | Connector*:*_1x??_* 13 | $ENDFPLIST 14 | DRAW 15 | S 34 -695 0 -705 1 1 6 F 16 | S 34 -595 0 -605 1 1 6 F 17 | S 34 -495 0 -505 1 1 6 F 18 | S 34 -395 0 -405 1 1 6 F 19 | S 34 -295 0 -305 1 1 6 F 20 | S 34 -195 0 -205 1 1 6 F 21 | S 34 -95 0 -105 1 1 6 F 22 | S 34 5 0 -5 1 1 6 F 23 | S 34 105 0 95 1 1 6 F 24 | S 34 205 0 195 1 1 6 F 25 | S 34 305 0 295 1 1 6 F 26 | S 34 405 0 395 1 1 6 F 27 | S 34 505 0 495 1 1 6 F 28 | S 34 605 0 595 1 1 6 F 29 | P 2 1 1 6 50 -700 34 -700 N 30 | P 2 1 1 6 50 -600 34 -600 N 31 | P 2 1 1 6 50 -500 34 -500 N 32 | P 2 1 1 6 50 -400 34 -400 N 33 | P 2 1 1 6 50 -300 34 -300 N 34 | P 2 1 1 6 50 -200 34 -200 N 35 | P 2 1 1 6 50 -100 34 -100 N 36 | P 2 1 1 6 50 0 34 0 N 37 | P 2 1 1 6 50 100 34 100 N 38 | P 2 1 1 6 50 200 34 200 N 39 | P 2 1 1 6 50 300 34 300 N 40 | P 2 1 1 6 50 400 34 400 N 41 | P 2 1 1 6 50 500 34 500 N 42 | P 2 1 1 6 50 600 34 600 N 43 | X Pin_1 1 200 600 150 L 50 50 1 1 P 44 | X Pin_10 10 200 -300 150 L 50 50 1 1 P 45 | X Pin_11 11 200 -400 150 L 50 50 1 1 P 46 | X Pin_12 12 200 -500 150 L 50 50 1 1 P 47 | X Pin_13 13 200 -600 150 L 50 50 1 1 P 48 | X Pin_14 14 200 -700 150 L 50 50 1 1 P 49 | X Pin_2 2 200 500 150 L 50 50 1 1 P 50 | X Pin_3 3 200 400 150 L 50 50 1 1 P 51 | X Pin_4 4 200 300 150 L 50 50 1 1 P 52 | X Pin_5 5 200 200 150 L 50 50 1 1 P 53 | X Pin_6 6 200 100 150 L 50 50 1 1 P 54 | X Pin_7 7 200 0 150 L 50 50 1 1 P 55 | X Pin_8 8 200 -100 150 L 50 50 1 1 P 56 | X Pin_9 9 200 -200 150 L 50 50 1 1 P 57 | ENDDRAW 58 | ENDDEF 59 | # 60 | # Connector_Generic_Conn_02x14_Odd_Even 61 | # 62 | DEF Connector_Generic_Conn_02x14_Odd_Even J 0 40 Y N 1 F N 63 | F0 "J" 50 700 50 H V C CNN 64 | F1 "Connector_Generic_Conn_02x14_Odd_Even" 50 -800 50 H V C CNN 65 | F2 "" 0 0 50 H I C CNN 66 | F3 "" 0 0 50 H I C CNN 67 | $FPLIST 68 | Connector*:*_2x??_* 69 | $ENDFPLIST 70 | DRAW 71 | S -50 -695 0 -705 1 1 6 N 72 | S -50 -595 0 -605 1 1 6 N 73 | S -50 -495 0 -505 1 1 6 N 74 | S -50 -395 0 -405 1 1 6 N 75 | S -50 -295 0 -305 1 1 6 N 76 | S -50 -195 0 -205 1 1 6 N 77 | S -50 -95 0 -105 1 1 6 N 78 | S -50 5 0 -5 1 1 6 N 79 | S -50 105 0 95 1 1 6 N 80 | S -50 205 0 195 1 1 6 N 81 | S -50 305 0 295 1 1 6 N 82 | S -50 405 0 395 1 1 6 N 83 | S -50 505 0 495 1 1 6 N 84 | S -50 605 0 595 1 1 6 N 85 | S -50 650 150 -750 1 1 10 f 86 | S 150 -695 100 -705 1 1 6 N 87 | S 150 -595 100 -605 1 1 6 N 88 | S 150 -495 100 -505 1 1 6 N 89 | S 150 -395 100 -405 1 1 6 N 90 | S 150 -295 100 -305 1 1 6 N 91 | S 150 -195 100 -205 1 1 6 N 92 | S 150 -95 100 -105 1 1 6 N 93 | S 150 5 100 -5 1 1 6 N 94 | S 150 105 100 95 1 1 6 N 95 | S 150 205 100 195 1 1 6 N 96 | S 150 305 100 295 1 1 6 N 97 | S 150 405 100 395 1 1 6 N 98 | S 150 505 100 495 1 1 6 N 99 | S 150 605 100 595 1 1 6 N 100 | X Pin_1 1 -200 600 150 R 50 50 1 1 P 101 | X Pin_10 10 300 200 150 L 50 50 1 1 P 102 | X Pin_11 11 -200 100 150 R 50 50 1 1 P 103 | X Pin_12 12 300 100 150 L 50 50 1 1 P 104 | X Pin_13 13 -200 0 150 R 50 50 1 1 P 105 | X Pin_14 14 300 0 150 L 50 50 1 1 P 106 | X Pin_15 15 -200 -100 150 R 50 50 1 1 P 107 | X Pin_16 16 300 -100 150 L 50 50 1 1 P 108 | X Pin_17 17 -200 -200 150 R 50 50 1 1 P 109 | X Pin_18 18 300 -200 150 L 50 50 1 1 P 110 | X Pin_19 19 -200 -300 150 R 50 50 1 1 P 111 | X Pin_2 2 300 600 150 L 50 50 1 1 P 112 | X Pin_20 20 300 -300 150 L 50 50 1 1 P 113 | X Pin_21 21 -200 -400 150 R 50 50 1 1 P 114 | X Pin_22 22 300 -400 150 L 50 50 1 1 P 115 | X Pin_23 23 -200 -500 150 R 50 50 1 1 P 116 | X Pin_24 24 300 -500 150 L 50 50 1 1 P 117 | X Pin_25 25 -200 -600 150 R 50 50 1 1 P 118 | X Pin_26 26 300 -600 150 L 50 50 1 1 P 119 | X Pin_27 27 -200 -700 150 R 50 50 1 1 P 120 | X Pin_28 28 300 -700 150 L 50 50 1 1 P 121 | X Pin_3 3 -200 500 150 R 50 50 1 1 P 122 | X Pin_4 4 300 500 150 L 50 50 1 1 P 123 | X Pin_5 5 -200 400 150 R 50 50 1 1 P 124 | X Pin_6 6 300 400 150 L 50 50 1 1 P 125 | X Pin_7 7 -200 300 150 R 50 50 1 1 P 126 | X Pin_8 8 300 300 150 L 50 50 1 1 P 127 | X Pin_9 9 -200 200 150 R 50 50 1 1 P 128 | ENDDRAW 129 | ENDDEF 130 | # 131 | #End Library 132 | -------------------------------------------------------------------------------- /firmware/platformio.ini: -------------------------------------------------------------------------------- 1 | ; PlatformIO Project Configuration File 2 | ; 3 | ; Build options: build flags, source filter 4 | ; Upload options: custom upload port, speed and extra flags 5 | ; Library options: dependencies, extra library storages 6 | ; Advanced options: extra scripting 7 | ; 8 | ; Please visit documentation for the other options and examples 9 | ; https://docs.platformio.org/page/projectconf.html 10 | 11 | [platformio] 12 | default_envs = view 13 | 14 | [base_config] 15 | platform = espressif32@3.4 16 | framework = arduino 17 | monitor_speed = 115200 18 | monitor_flags = 19 | --eol=CRLF 20 | --echo 21 | --filter=esp32_exception_decoder 22 | lib_deps = 23 | askuric/Simple FOC @ 2.2.0 24 | infineon/TLV493D-Magnetic-Sensor @ 1.0.3 25 | bxparks/AceButton @ 1.9.1 26 | 27 | build_flags = 28 | -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG 29 | 30 | [env:view] 31 | extends = base_config 32 | ; platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream 33 | ; platform_packages = 34 | ; framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32#master 35 | board = esp32doit-devkit-v1 36 | lib_deps = 37 | ; askuric/Simple FOC @ 2.2.1 38 | ; bxparks/AceButton @ 1.9.1 39 | ${base_config.lib_deps} 40 | bodmer/TFT_eSPI@2.4.25 41 | fastled/FastLED @ 3.5.0 42 | bogde/HX711 @ 0.7.5 43 | adafruit/Adafruit VEML7700 Library @ 1.1.1 44 | 45 | build_flags = 46 | ${base_config.build_flags} 47 | -DSK_DISPLAY=1 48 | -DSK_LEDS=1 49 | -DNUM_LEDS=8 50 | -DSENSOR_MT6701=1 51 | -DSK_STRAIN=1 52 | -DSK_INVERT_ROTATION=1 53 | -DSK_ALS=1 54 | 55 | -DPIN_UH=26 56 | -DPIN_UL=25 57 | -DPIN_VH=27 58 | -DPIN_VL=32 59 | -DPIN_WH=12 60 | -DPIN_WL=33 61 | -DPIN_BUTTON_NEXT=-1 62 | -DPIN_BUTTON_PREV=-1 63 | -DPIN_SDA=15 64 | -DPIN_SCL=8 65 | -DPIN_MT_DATA=37 66 | -DPIN_MT_CLOCK=13 67 | -DPIN_MT_CSN=14 68 | -DPIN_LED_DATA=7 69 | -DPIN_LCD_BACKLIGHT=19 70 | 71 | -DDESCRIPTION_FONT=Roboto_Thin_24 72 | -DDESCRIPTION_Y_OFFSET=20 73 | -DVALUE_OFFSET=30 74 | -DDRAW_ARC=0 75 | 76 | -DUSER_SETUP_LOADED=1 77 | -DGC9A01_DRIVER=1 78 | -DCGRAM_OFFSET=1 79 | -DTFT_WIDTH=240 80 | -DTFT_HEIGHT=240 81 | -DTFT_MISO=-1 82 | -DTFT_MOSI=5 83 | -DTFT_SCLK=20 84 | -DTFT_CS=21 85 | -DTFT_DC=22 86 | -DTFT_RST=4 87 | -DTFT_BL=-1 88 | -DLOAD_GLCD=1 89 | -DLOAD_GFXFF=1 90 | -DSPI_FREQUENCY=40000000 91 | 92 | ; Reduce loop task stack size (only works on newer IDF Arduino core) 93 | ; -DARDUINO_LOOP_STACK_SIZE=2048 94 | 95 | ; Modify the default unusable pin mask to allow GPIO 7 (allowed to use on ESP32-PICO-V3-02) 96 | ; Unusable bits: 6, 8, 9, 10, 20 97 | ; (0ULL | _FL_BIT(6) | _FL_BIT(8) | _FL_BIT(9) | _FL_BIT(10) | _FL_BIT(20)) 98 | -DFASTLED_UNUSABLE_PIN_MASK=0x100740LL 99 | 100 | ; 0~39 except from 24, 28~31 are valid 101 | ; (0xFFFFFFFFFFULL & ~(0ULL | _FL_BIT(24) | _FL_BIT(28) | _FL_BIT(29) | _FL_BIT(30) | _FL_BIT(31))) 102 | -DSOC_GPIO_VALID_GPIO_MASK=0xFF0EFFFFFF 103 | ; GPIO >= 34 are input only 104 | ; (SOC_GPIO_VALID_GPIO_MASK & ~(0ULL | _FL_BIT(34) | _FL_BIT(35) | _FL_BIT(36) | _FL_BIT(37) | _FL_BIT(38) | _FL_BIT(39))) 105 | -DSOC_GPIO_VALID_OUTPUT_GPIO_MASK=0x30EFFFFFF 106 | 107 | 108 | [env:handheld_tdisplay] 109 | extends = base_config 110 | board = esp32doit-devkit-v1 111 | lib_deps = 112 | ${base_config.lib_deps} 113 | bodmer/TFT_eSPI@2.4.25 114 | 115 | build_flags = 116 | ${base_config.build_flags} 117 | -DSK_DISPLAY=1 118 | -DSK_STRAIN=0 119 | -DSK_LEDS=0 120 | 121 | -DPIN_UH=17 122 | -DPIN_UL=2 123 | -DPIN_VH=13 124 | -DPIN_VL=32 125 | -DPIN_WH=33 126 | -DPIN_WL=25 127 | -DPIN_BUTTON_NEXT=35 128 | -DPIN_BUTTON_PREV=0 129 | -DPIN_SDA=-1 130 | -DPIN_SCL=-1 131 | -DSENSOR_MT6701=1 132 | -DPIN_MT_DATA=21 133 | -DPIN_MT_CLOCK=22 134 | -DPIN_MT_CSN=12 135 | -DPIN_LCD_BACKLIGHT=4 136 | 137 | -DDESCRIPTION_FONT=FreeSans9pt7b 138 | -DDESCRIPTION_Y_OFFSET=80 139 | -DVALUE_OFFSET=0 140 | -DDRAW_ARC=1 141 | 142 | -DUSER_SETUP_LOADED=1 143 | -DST7789_DRIVER=1 144 | -DCGRAM_OFFSET=1 145 | -DTFT_WIDTH=135 146 | -DTFT_HEIGHT=240 147 | -DTFT_MISO=-1 148 | -DTFT_MOSI=19 149 | -DTFT_SCLK=18 150 | -DTFT_CS=5 151 | -DTFT_DC=16 152 | -DTFT_RST=23 153 | -DTFT_BL=-1 154 | -DLOAD_GLCD=1 155 | -DLOAD_GFXFF=1 156 | -DSPI_FREQUENCY=40000000 -------------------------------------------------------------------------------- /electronics/scripts/pcb_util.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright 2015-2021 Scott Bezek and the splitflap contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | import argparse 17 | import logging 18 | import os 19 | import pcbnew 20 | import tempfile 21 | 22 | from contextlib import contextmanager 23 | 24 | from export_util import ( 25 | get_versioned_contents 26 | ) 27 | 28 | logging.basicConfig(level=logging.DEBUG) 29 | logger = logging.getLogger(__name__) 30 | 31 | @contextmanager 32 | def versioned_board(filename, release_search_prefix): 33 | _, versioned_contents = get_versioned_contents(filename, release_search_prefix) 34 | with tempfile.NamedTemporaryFile(suffix='.kicad_pcb', mode='w') as temp_pcb: 35 | logger.debug('Writing to %s', temp_pcb.name) 36 | temp_pcb.write(versioned_contents) 37 | temp_pcb.flush() 38 | 39 | logger.debug('Load board') 40 | board = pcbnew.LoadBoard(temp_pcb.name) 41 | yield board 42 | 43 | @contextmanager 44 | def get_plotter(pcb_filename, build_directory, release_prefix): 45 | with versioned_board(pcb_filename, release_prefix) as board: 46 | yield Plotter(board, build_directory) 47 | 48 | 49 | class Plotter(object): 50 | def __init__(self, board, build_directory): 51 | self.board = board 52 | self.build_directory = build_directory 53 | self.plot_controller = pcbnew.PLOT_CONTROLLER(board) 54 | self.plot_options = self.plot_controller.GetPlotOptions() 55 | self.plot_options.SetOutputDirectory(build_directory) 56 | 57 | self.plot_options.SetPlotFrameRef(False) 58 | self.plot_options.SetLineWidth(pcbnew.FromMM(0.35)) 59 | self.plot_options.SetScale(1) 60 | self.plot_options.SetUseAuxOrigin(True) 61 | self.plot_options.SetMirror(False) 62 | self.plot_options.SetExcludeEdgeLayer(True) 63 | 64 | def plot(self, layer, plot_format): 65 | layer_name = self.board.GetLayerName(layer) 66 | logger.info('Plotting layer %s (kicad layer=%r)', layer_name, layer) 67 | self.plot_controller.SetLayer(layer) 68 | self.plot_controller.OpenPlotfile(layer_name, plot_format , 'Plot') 69 | output_filename = self.plot_controller.GetPlotFileName() 70 | self.plot_controller.PlotLayer() 71 | self.plot_controller.ClosePlot() 72 | return output_filename 73 | 74 | def plot_drill(self): 75 | board_name = os.path.splitext(os.path.basename(self.board.GetFileName()))[0] 76 | logger.info('Plotting drill file') 77 | drill_writer = pcbnew.EXCELLON_WRITER(self.board) 78 | drill_writer.SetMapFileFormat(pcbnew.PLOT_FORMAT_PDF) 79 | 80 | mirror = False 81 | minimalHeader = False 82 | offset = pcbnew.wxPoint(0, 0) 83 | merge_npth = True 84 | drill_writer.SetOptions(mirror, minimalHeader, offset, merge_npth) 85 | 86 | metric_format = True 87 | drill_writer.SetFormat(metric_format) 88 | 89 | generate_drill = True 90 | generate_map = True 91 | drill_writer.CreateDrillandMapFilesSet(self.build_directory, generate_drill, generate_map) 92 | 93 | drill_file_name = os.path.join( 94 | self.build_directory, 95 | '%s.drl' % (board_name,) 96 | ) 97 | 98 | map_file_name = os.path.join( 99 | self.build_directory, 100 | '%s-drl_map.pdf' % (board_name,) 101 | ) 102 | return drill_file_name, map_file_name 103 | 104 | 105 | if __name__ == '__main__': 106 | parser = argparse.ArgumentParser(description='Test pcb util') 107 | parser.add_argument('--release-prefix', type=str, required=True, help='Tag prefix to check if this is a tagged/versioned release. E.g. "releases/" for tags like "releases/v1.0"') 108 | parser.add_argument('input_file', help='Input .kicad_pcb file') 109 | args = parser.parse_args() 110 | with versioned_board(args.input_file, args.release_prefix) as board: 111 | logger.info('Loaded %s', board.GetFileName()) 112 | for module in board.GetModules(): 113 | logger.info('Module %s: %s', module.GetReference(), module.GetValue()) 114 | -------------------------------------------------------------------------------- /electronics/LevelShifterBreakout/LevelShifterBreakout.pro: -------------------------------------------------------------------------------- 1 | update=Mon 01 Nov 2021 06:02:37 PM PDT 2 | version=1 3 | last_client=kicad 4 | [general] 5 | version=1 6 | RootSch= 7 | BoardNm= 8 | [cvpcb] 9 | version=1 10 | NetIExt=net 11 | [eeschema] 12 | version=1 13 | LibDir= 14 | [eeschema/libraries] 15 | [pcbnew] 16 | version=1 17 | PageLayoutDescrFile= 18 | LastNetListRead= 19 | CopperLayerCount=2 20 | BoardThickness=1.6 21 | AllowMicroVias=0 22 | AllowBlindVias=0 23 | RequireCourtyardDefinitions=0 24 | ProhibitOverlappingCourtyards=1 25 | MinTrackWidth=0.127 26 | MinViaDiameter=0.4 27 | MinViaDrill=0.3 28 | MinMicroViaDiameter=0.2 29 | MinMicroViaDrill=0.09999999999999999 30 | MinHoleToHole=0.25 31 | TrackWidth1=0.18 32 | ViaDiameter1=0.8 33 | ViaDrill1=0.4 34 | dPairWidth1=0.2 35 | dPairGap1=0.25 36 | dPairViaGap1=0.25 37 | SilkLineWidth=0.12 38 | SilkTextSizeV=1 39 | SilkTextSizeH=1 40 | SilkTextSizeThickness=0.15 41 | SilkTextItalic=0 42 | SilkTextUpright=1 43 | CopperLineWidth=0.2 44 | CopperTextSizeV=1.5 45 | CopperTextSizeH=1.5 46 | CopperTextThickness=0.3 47 | CopperTextItalic=0 48 | CopperTextUpright=1 49 | EdgeCutLineWidth=0.05 50 | CourtyardLineWidth=0.05 51 | OthersLineWidth=0.15 52 | OthersTextSizeV=1 53 | OthersTextSizeH=1 54 | OthersTextSizeThickness=0.15 55 | OthersTextItalic=0 56 | OthersTextUpright=1 57 | SolderMaskClearance=0 58 | SolderMaskMinWidth=0 59 | SolderPasteClearance=0 60 | SolderPasteRatio=-0 61 | [pcbnew/Layer.F.Cu] 62 | Name=F.Cu 63 | Type=0 64 | Enabled=1 65 | [pcbnew/Layer.In1.Cu] 66 | Name=In1.Cu 67 | Type=0 68 | Enabled=0 69 | [pcbnew/Layer.In2.Cu] 70 | Name=In2.Cu 71 | Type=0 72 | Enabled=0 73 | [pcbnew/Layer.In3.Cu] 74 | Name=In3.Cu 75 | Type=0 76 | Enabled=0 77 | [pcbnew/Layer.In4.Cu] 78 | Name=In4.Cu 79 | Type=0 80 | Enabled=0 81 | [pcbnew/Layer.In5.Cu] 82 | Name=In5.Cu 83 | Type=0 84 | Enabled=0 85 | [pcbnew/Layer.In6.Cu] 86 | Name=In6.Cu 87 | Type=0 88 | Enabled=0 89 | [pcbnew/Layer.In7.Cu] 90 | Name=In7.Cu 91 | Type=0 92 | Enabled=0 93 | [pcbnew/Layer.In8.Cu] 94 | Name=In8.Cu 95 | Type=0 96 | Enabled=0 97 | [pcbnew/Layer.In9.Cu] 98 | Name=In9.Cu 99 | Type=0 100 | Enabled=0 101 | [pcbnew/Layer.In10.Cu] 102 | Name=In10.Cu 103 | Type=0 104 | Enabled=0 105 | [pcbnew/Layer.In11.Cu] 106 | Name=In11.Cu 107 | Type=0 108 | Enabled=0 109 | [pcbnew/Layer.In12.Cu] 110 | Name=In12.Cu 111 | Type=0 112 | Enabled=0 113 | [pcbnew/Layer.In13.Cu] 114 | Name=In13.Cu 115 | Type=0 116 | Enabled=0 117 | [pcbnew/Layer.In14.Cu] 118 | Name=In14.Cu 119 | Type=0 120 | Enabled=0 121 | [pcbnew/Layer.In15.Cu] 122 | Name=In15.Cu 123 | Type=0 124 | Enabled=0 125 | [pcbnew/Layer.In16.Cu] 126 | Name=In16.Cu 127 | Type=0 128 | Enabled=0 129 | [pcbnew/Layer.In17.Cu] 130 | Name=In17.Cu 131 | Type=0 132 | Enabled=0 133 | [pcbnew/Layer.In18.Cu] 134 | Name=In18.Cu 135 | Type=0 136 | Enabled=0 137 | [pcbnew/Layer.In19.Cu] 138 | Name=In19.Cu 139 | Type=0 140 | Enabled=0 141 | [pcbnew/Layer.In20.Cu] 142 | Name=In20.Cu 143 | Type=0 144 | Enabled=0 145 | [pcbnew/Layer.In21.Cu] 146 | Name=In21.Cu 147 | Type=0 148 | Enabled=0 149 | [pcbnew/Layer.In22.Cu] 150 | Name=In22.Cu 151 | Type=0 152 | Enabled=0 153 | [pcbnew/Layer.In23.Cu] 154 | Name=In23.Cu 155 | Type=0 156 | Enabled=0 157 | [pcbnew/Layer.In24.Cu] 158 | Name=In24.Cu 159 | Type=0 160 | Enabled=0 161 | [pcbnew/Layer.In25.Cu] 162 | Name=In25.Cu 163 | Type=0 164 | Enabled=0 165 | [pcbnew/Layer.In26.Cu] 166 | Name=In26.Cu 167 | Type=0 168 | Enabled=0 169 | [pcbnew/Layer.In27.Cu] 170 | Name=In27.Cu 171 | Type=0 172 | Enabled=0 173 | [pcbnew/Layer.In28.Cu] 174 | Name=In28.Cu 175 | Type=0 176 | Enabled=0 177 | [pcbnew/Layer.In29.Cu] 178 | Name=In29.Cu 179 | Type=0 180 | Enabled=0 181 | [pcbnew/Layer.In30.Cu] 182 | Name=In30.Cu 183 | Type=0 184 | Enabled=0 185 | [pcbnew/Layer.B.Cu] 186 | Name=B.Cu 187 | Type=0 188 | Enabled=1 189 | [pcbnew/Layer.B.Adhes] 190 | Enabled=1 191 | [pcbnew/Layer.F.Adhes] 192 | Enabled=1 193 | [pcbnew/Layer.B.Paste] 194 | Enabled=1 195 | [pcbnew/Layer.F.Paste] 196 | Enabled=1 197 | [pcbnew/Layer.B.SilkS] 198 | Enabled=1 199 | [pcbnew/Layer.F.SilkS] 200 | Enabled=1 201 | [pcbnew/Layer.B.Mask] 202 | Enabled=1 203 | [pcbnew/Layer.F.Mask] 204 | Enabled=1 205 | [pcbnew/Layer.Dwgs.User] 206 | Enabled=1 207 | [pcbnew/Layer.Cmts.User] 208 | Enabled=1 209 | [pcbnew/Layer.Eco1.User] 210 | Enabled=1 211 | [pcbnew/Layer.Eco2.User] 212 | Enabled=1 213 | [pcbnew/Layer.Edge.Cuts] 214 | Enabled=1 215 | [pcbnew/Layer.Margin] 216 | Enabled=1 217 | [pcbnew/Layer.B.CrtYd] 218 | Enabled=1 219 | [pcbnew/Layer.F.CrtYd] 220 | Enabled=1 221 | [pcbnew/Layer.B.Fab] 222 | Enabled=1 223 | [pcbnew/Layer.F.Fab] 224 | Enabled=1 225 | [pcbnew/Layer.Rescue] 226 | Enabled=0 227 | [pcbnew/Netclasses] 228 | [pcbnew/Netclasses/Default] 229 | Name=Default 230 | Clearance=0.127 231 | TrackWidth=0.18 232 | ViaDiameter=0.8 233 | ViaDrill=0.4 234 | uViaDiameter=0.3 235 | uViaDrill=0.1 236 | dPairWidth=0.2 237 | dPairGap=0.25 238 | dPairViaGap=0.25 239 | -------------------------------------------------------------------------------- /electronics/view_screen/view_screen.pro: -------------------------------------------------------------------------------- 1 | update=Sat 12 Feb 2022 08:52:40 PM PST 2 | version=1 3 | last_client=kicad 4 | [general] 5 | version=1 6 | RootSch= 7 | BoardNm= 8 | [cvpcb] 9 | version=1 10 | NetIExt=net 11 | [eeschema] 12 | version=1 13 | LibDir= 14 | [eeschema/libraries] 15 | [pcbnew] 16 | version=1 17 | PageLayoutDescrFile= 18 | LastNetListRead= 19 | CopperLayerCount=2 20 | BoardThickness=1.2 21 | AllowMicroVias=0 22 | AllowBlindVias=0 23 | RequireCourtyardDefinitions=0 24 | ProhibitOverlappingCourtyards=1 25 | MinTrackWidth=0.2 26 | MinViaDiameter=0.4 27 | MinViaDrill=0.3 28 | MinMicroViaDiameter=0.2 29 | MinMicroViaDrill=0.09999999999999999 30 | MinHoleToHole=0.25 31 | TrackWidth1=0.25 32 | TrackWidth2=0.4 33 | ViaDiameter1=0.8 34 | ViaDrill1=0.4 35 | dPairWidth1=0.2 36 | dPairGap1=0.25 37 | dPairViaGap1=0.25 38 | SilkLineWidth=0.12 39 | SilkTextSizeV=1 40 | SilkTextSizeH=1 41 | SilkTextSizeThickness=0.15 42 | SilkTextItalic=0 43 | SilkTextUpright=1 44 | CopperLineWidth=0.2 45 | CopperTextSizeV=1.5 46 | CopperTextSizeH=1.5 47 | CopperTextThickness=0.3 48 | CopperTextItalic=0 49 | CopperTextUpright=1 50 | EdgeCutLineWidth=0.05 51 | CourtyardLineWidth=0.05 52 | OthersLineWidth=0.15 53 | OthersTextSizeV=1 54 | OthersTextSizeH=1 55 | OthersTextSizeThickness=0.15 56 | OthersTextItalic=0 57 | OthersTextUpright=1 58 | SolderMaskClearance=0 59 | SolderMaskMinWidth=0 60 | SolderPasteClearance=0 61 | SolderPasteRatio=-0 62 | [pcbnew/Layer.F.Cu] 63 | Name=F.Cu 64 | Type=0 65 | Enabled=1 66 | [pcbnew/Layer.In1.Cu] 67 | Name=In1.Cu 68 | Type=0 69 | Enabled=0 70 | [pcbnew/Layer.In2.Cu] 71 | Name=In2.Cu 72 | Type=0 73 | Enabled=0 74 | [pcbnew/Layer.In3.Cu] 75 | Name=In3.Cu 76 | Type=0 77 | Enabled=0 78 | [pcbnew/Layer.In4.Cu] 79 | Name=In4.Cu 80 | Type=0 81 | Enabled=0 82 | [pcbnew/Layer.In5.Cu] 83 | Name=In5.Cu 84 | Type=0 85 | Enabled=0 86 | [pcbnew/Layer.In6.Cu] 87 | Name=In6.Cu 88 | Type=0 89 | Enabled=0 90 | [pcbnew/Layer.In7.Cu] 91 | Name=In7.Cu 92 | Type=0 93 | Enabled=0 94 | [pcbnew/Layer.In8.Cu] 95 | Name=In8.Cu 96 | Type=0 97 | Enabled=0 98 | [pcbnew/Layer.In9.Cu] 99 | Name=In9.Cu 100 | Type=0 101 | Enabled=0 102 | [pcbnew/Layer.In10.Cu] 103 | Name=In10.Cu 104 | Type=0 105 | Enabled=0 106 | [pcbnew/Layer.In11.Cu] 107 | Name=In11.Cu 108 | Type=0 109 | Enabled=0 110 | [pcbnew/Layer.In12.Cu] 111 | Name=In12.Cu 112 | Type=0 113 | Enabled=0 114 | [pcbnew/Layer.In13.Cu] 115 | Name=In13.Cu 116 | Type=0 117 | Enabled=0 118 | [pcbnew/Layer.In14.Cu] 119 | Name=In14.Cu 120 | Type=0 121 | Enabled=0 122 | [pcbnew/Layer.In15.Cu] 123 | Name=In15.Cu 124 | Type=0 125 | Enabled=0 126 | [pcbnew/Layer.In16.Cu] 127 | Name=In16.Cu 128 | Type=0 129 | Enabled=0 130 | [pcbnew/Layer.In17.Cu] 131 | Name=In17.Cu 132 | Type=0 133 | Enabled=0 134 | [pcbnew/Layer.In18.Cu] 135 | Name=In18.Cu 136 | Type=0 137 | Enabled=0 138 | [pcbnew/Layer.In19.Cu] 139 | Name=In19.Cu 140 | Type=0 141 | Enabled=0 142 | [pcbnew/Layer.In20.Cu] 143 | Name=In20.Cu 144 | Type=0 145 | Enabled=0 146 | [pcbnew/Layer.In21.Cu] 147 | Name=In21.Cu 148 | Type=0 149 | Enabled=0 150 | [pcbnew/Layer.In22.Cu] 151 | Name=In22.Cu 152 | Type=0 153 | Enabled=0 154 | [pcbnew/Layer.In23.Cu] 155 | Name=In23.Cu 156 | Type=0 157 | Enabled=0 158 | [pcbnew/Layer.In24.Cu] 159 | Name=In24.Cu 160 | Type=0 161 | Enabled=0 162 | [pcbnew/Layer.In25.Cu] 163 | Name=In25.Cu 164 | Type=0 165 | Enabled=0 166 | [pcbnew/Layer.In26.Cu] 167 | Name=In26.Cu 168 | Type=0 169 | Enabled=0 170 | [pcbnew/Layer.In27.Cu] 171 | Name=In27.Cu 172 | Type=0 173 | Enabled=0 174 | [pcbnew/Layer.In28.Cu] 175 | Name=In28.Cu 176 | Type=0 177 | Enabled=0 178 | [pcbnew/Layer.In29.Cu] 179 | Name=In29.Cu 180 | Type=0 181 | Enabled=0 182 | [pcbnew/Layer.In30.Cu] 183 | Name=In30.Cu 184 | Type=0 185 | Enabled=0 186 | [pcbnew/Layer.B.Cu] 187 | Name=B.Cu 188 | Type=0 189 | Enabled=1 190 | [pcbnew/Layer.B.Adhes] 191 | Enabled=1 192 | [pcbnew/Layer.F.Adhes] 193 | Enabled=1 194 | [pcbnew/Layer.B.Paste] 195 | Enabled=1 196 | [pcbnew/Layer.F.Paste] 197 | Enabled=1 198 | [pcbnew/Layer.B.SilkS] 199 | Enabled=1 200 | [pcbnew/Layer.F.SilkS] 201 | Enabled=1 202 | [pcbnew/Layer.B.Mask] 203 | Enabled=1 204 | [pcbnew/Layer.F.Mask] 205 | Enabled=1 206 | [pcbnew/Layer.Dwgs.User] 207 | Enabled=1 208 | [pcbnew/Layer.Cmts.User] 209 | Enabled=1 210 | [pcbnew/Layer.Eco1.User] 211 | Enabled=1 212 | [pcbnew/Layer.Eco2.User] 213 | Enabled=1 214 | [pcbnew/Layer.Edge.Cuts] 215 | Enabled=1 216 | [pcbnew/Layer.Margin] 217 | Enabled=1 218 | [pcbnew/Layer.B.CrtYd] 219 | Enabled=1 220 | [pcbnew/Layer.F.CrtYd] 221 | Enabled=1 222 | [pcbnew/Layer.B.Fab] 223 | Enabled=1 224 | [pcbnew/Layer.F.Fab] 225 | Enabled=1 226 | [pcbnew/Layer.Rescue] 227 | Enabled=0 228 | [pcbnew/Netclasses] 229 | [pcbnew/Netclasses/Default] 230 | Name=Default 231 | Clearance=0.2 232 | TrackWidth=0.25 233 | ViaDiameter=0.8 234 | ViaDrill=0.4 235 | uViaDiameter=0.3 236 | uViaDrill=0.1 237 | dPairWidth=0.2 238 | dPairGap=0.25 239 | dPairViaGap=0.25 240 | -------------------------------------------------------------------------------- /electronics/BM28B0.6-24DSBreakout/BM28B0.6-24DSBreakout.pro: -------------------------------------------------------------------------------- 1 | update=Mon 01 Nov 2021 03:41:48 PM PDT 2 | version=1 3 | last_client=kicad 4 | [general] 5 | version=1 6 | RootSch= 7 | BoardNm= 8 | [cvpcb] 9 | version=1 10 | NetIExt=net 11 | [eeschema] 12 | version=1 13 | LibDir= 14 | [eeschema/libraries] 15 | [pcbnew] 16 | version=1 17 | PageLayoutDescrFile= 18 | LastNetListRead= 19 | CopperLayerCount=2 20 | BoardThickness=1.6 21 | AllowMicroVias=0 22 | AllowBlindVias=0 23 | RequireCourtyardDefinitions=0 24 | ProhibitOverlappingCourtyards=1 25 | MinTrackWidth=0.127 26 | MinViaDiameter=0.4 27 | MinViaDrill=0.3 28 | MinMicroViaDiameter=0.2 29 | MinMicroViaDrill=0.09999999999999999 30 | MinHoleToHole=0.25 31 | TrackWidth1=0.18 32 | ViaDiameter1=0.8 33 | ViaDrill1=0.4 34 | dPairWidth1=0.2 35 | dPairGap1=0.25 36 | dPairViaGap1=0.25 37 | SilkLineWidth=0.12 38 | SilkTextSizeV=1 39 | SilkTextSizeH=1 40 | SilkTextSizeThickness=0.15 41 | SilkTextItalic=0 42 | SilkTextUpright=1 43 | CopperLineWidth=0.2 44 | CopperTextSizeV=1.5 45 | CopperTextSizeH=1.5 46 | CopperTextThickness=0.3 47 | CopperTextItalic=0 48 | CopperTextUpright=1 49 | EdgeCutLineWidth=0.05 50 | CourtyardLineWidth=0.05 51 | OthersLineWidth=0.15 52 | OthersTextSizeV=1 53 | OthersTextSizeH=1 54 | OthersTextSizeThickness=0.15 55 | OthersTextItalic=0 56 | OthersTextUpright=1 57 | SolderMaskClearance=0 58 | SolderMaskMinWidth=0 59 | SolderPasteClearance=0 60 | SolderPasteRatio=-0 61 | [pcbnew/Layer.F.Cu] 62 | Name=F.Cu 63 | Type=0 64 | Enabled=1 65 | [pcbnew/Layer.In1.Cu] 66 | Name=In1.Cu 67 | Type=0 68 | Enabled=0 69 | [pcbnew/Layer.In2.Cu] 70 | Name=In2.Cu 71 | Type=0 72 | Enabled=0 73 | [pcbnew/Layer.In3.Cu] 74 | Name=In3.Cu 75 | Type=0 76 | Enabled=0 77 | [pcbnew/Layer.In4.Cu] 78 | Name=In4.Cu 79 | Type=0 80 | Enabled=0 81 | [pcbnew/Layer.In5.Cu] 82 | Name=In5.Cu 83 | Type=0 84 | Enabled=0 85 | [pcbnew/Layer.In6.Cu] 86 | Name=In6.Cu 87 | Type=0 88 | Enabled=0 89 | [pcbnew/Layer.In7.Cu] 90 | Name=In7.Cu 91 | Type=0 92 | Enabled=0 93 | [pcbnew/Layer.In8.Cu] 94 | Name=In8.Cu 95 | Type=0 96 | Enabled=0 97 | [pcbnew/Layer.In9.Cu] 98 | Name=In9.Cu 99 | Type=0 100 | Enabled=0 101 | [pcbnew/Layer.In10.Cu] 102 | Name=In10.Cu 103 | Type=0 104 | Enabled=0 105 | [pcbnew/Layer.In11.Cu] 106 | Name=In11.Cu 107 | Type=0 108 | Enabled=0 109 | [pcbnew/Layer.In12.Cu] 110 | Name=In12.Cu 111 | Type=0 112 | Enabled=0 113 | [pcbnew/Layer.In13.Cu] 114 | Name=In13.Cu 115 | Type=0 116 | Enabled=0 117 | [pcbnew/Layer.In14.Cu] 118 | Name=In14.Cu 119 | Type=0 120 | Enabled=0 121 | [pcbnew/Layer.In15.Cu] 122 | Name=In15.Cu 123 | Type=0 124 | Enabled=0 125 | [pcbnew/Layer.In16.Cu] 126 | Name=In16.Cu 127 | Type=0 128 | Enabled=0 129 | [pcbnew/Layer.In17.Cu] 130 | Name=In17.Cu 131 | Type=0 132 | Enabled=0 133 | [pcbnew/Layer.In18.Cu] 134 | Name=In18.Cu 135 | Type=0 136 | Enabled=0 137 | [pcbnew/Layer.In19.Cu] 138 | Name=In19.Cu 139 | Type=0 140 | Enabled=0 141 | [pcbnew/Layer.In20.Cu] 142 | Name=In20.Cu 143 | Type=0 144 | Enabled=0 145 | [pcbnew/Layer.In21.Cu] 146 | Name=In21.Cu 147 | Type=0 148 | Enabled=0 149 | [pcbnew/Layer.In22.Cu] 150 | Name=In22.Cu 151 | Type=0 152 | Enabled=0 153 | [pcbnew/Layer.In23.Cu] 154 | Name=In23.Cu 155 | Type=0 156 | Enabled=0 157 | [pcbnew/Layer.In24.Cu] 158 | Name=In24.Cu 159 | Type=0 160 | Enabled=0 161 | [pcbnew/Layer.In25.Cu] 162 | Name=In25.Cu 163 | Type=0 164 | Enabled=0 165 | [pcbnew/Layer.In26.Cu] 166 | Name=In26.Cu 167 | Type=0 168 | Enabled=0 169 | [pcbnew/Layer.In27.Cu] 170 | Name=In27.Cu 171 | Type=0 172 | Enabled=0 173 | [pcbnew/Layer.In28.Cu] 174 | Name=In28.Cu 175 | Type=0 176 | Enabled=0 177 | [pcbnew/Layer.In29.Cu] 178 | Name=In29.Cu 179 | Type=0 180 | Enabled=0 181 | [pcbnew/Layer.In30.Cu] 182 | Name=In30.Cu 183 | Type=0 184 | Enabled=0 185 | [pcbnew/Layer.B.Cu] 186 | Name=B.Cu 187 | Type=0 188 | Enabled=1 189 | [pcbnew/Layer.B.Adhes] 190 | Enabled=1 191 | [pcbnew/Layer.F.Adhes] 192 | Enabled=1 193 | [pcbnew/Layer.B.Paste] 194 | Enabled=1 195 | [pcbnew/Layer.F.Paste] 196 | Enabled=1 197 | [pcbnew/Layer.B.SilkS] 198 | Enabled=1 199 | [pcbnew/Layer.F.SilkS] 200 | Enabled=1 201 | [pcbnew/Layer.B.Mask] 202 | Enabled=1 203 | [pcbnew/Layer.F.Mask] 204 | Enabled=1 205 | [pcbnew/Layer.Dwgs.User] 206 | Enabled=1 207 | [pcbnew/Layer.Cmts.User] 208 | Enabled=1 209 | [pcbnew/Layer.Eco1.User] 210 | Enabled=1 211 | [pcbnew/Layer.Eco2.User] 212 | Enabled=1 213 | [pcbnew/Layer.Edge.Cuts] 214 | Enabled=1 215 | [pcbnew/Layer.Margin] 216 | Enabled=1 217 | [pcbnew/Layer.B.CrtYd] 218 | Enabled=1 219 | [pcbnew/Layer.F.CrtYd] 220 | Enabled=1 221 | [pcbnew/Layer.B.Fab] 222 | Enabled=1 223 | [pcbnew/Layer.F.Fab] 224 | Enabled=1 225 | [pcbnew/Layer.Rescue] 226 | Enabled=0 227 | [pcbnew/Netclasses] 228 | [pcbnew/Netclasses/Default] 229 | Name=Default 230 | Clearance=0.127 231 | TrackWidth=0.18 232 | ViaDiameter=0.8 233 | ViaDrill=0.4 234 | uViaDiameter=0.3 235 | uViaDrill=0.1 236 | dPairWidth=0.2 237 | dPairGap=0.25 238 | dPairViaGap=0.25 239 | -------------------------------------------------------------------------------- /electronics/scripts/config/policy.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | ]> 10 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /electronics/view_base/view_base.pro: -------------------------------------------------------------------------------- 1 | update=Thu 10 Feb 2022 12:35:10 PM PST 2 | version=1 3 | last_client=kicad 4 | [general] 5 | version=1 6 | RootSch= 7 | BoardNm= 8 | [cvpcb] 9 | version=1 10 | NetIExt=net 11 | [eeschema] 12 | version=1 13 | LibDir= 14 | [eeschema/libraries] 15 | [pcbnew] 16 | version=1 17 | PageLayoutDescrFile= 18 | LastNetListRead= 19 | CopperLayerCount=2 20 | BoardThickness=1.2 21 | AllowMicroVias=0 22 | AllowBlindVias=0 23 | RequireCourtyardDefinitions=0 24 | ProhibitOverlappingCourtyards=1 25 | MinTrackWidth=0.127 26 | MinViaDiameter=0.4 27 | MinViaDrill=0.3 28 | MinMicroViaDiameter=0.2 29 | MinMicroViaDrill=0.09999999999999999 30 | MinHoleToHole=0.25 31 | TrackWidth1=0.15 32 | TrackWidth2=0.25 33 | TrackWidth3=0.4 34 | TrackWidth4=0.65 35 | ViaDiameter1=0.8 36 | ViaDrill1=0.4 37 | dPairWidth1=0.2 38 | dPairGap1=0.25 39 | dPairViaGap1=0.25 40 | SilkLineWidth=0.12 41 | SilkTextSizeV=1 42 | SilkTextSizeH=1 43 | SilkTextSizeThickness=0.15 44 | SilkTextItalic=0 45 | SilkTextUpright=1 46 | CopperLineWidth=0.2 47 | CopperTextSizeV=1.5 48 | CopperTextSizeH=1.5 49 | CopperTextThickness=0.3 50 | CopperTextItalic=0 51 | CopperTextUpright=1 52 | EdgeCutLineWidth=0.05 53 | CourtyardLineWidth=0.05 54 | OthersLineWidth=0.15 55 | OthersTextSizeV=1 56 | OthersTextSizeH=1 57 | OthersTextSizeThickness=0.15 58 | OthersTextItalic=0 59 | OthersTextUpright=1 60 | SolderMaskClearance=0 61 | SolderMaskMinWidth=0 62 | SolderPasteClearance=0 63 | SolderPasteRatio=-0 64 | [pcbnew/Layer.F.Cu] 65 | Name=F.Cu 66 | Type=0 67 | Enabled=1 68 | [pcbnew/Layer.In1.Cu] 69 | Name=In1.Cu 70 | Type=0 71 | Enabled=0 72 | [pcbnew/Layer.In2.Cu] 73 | Name=In2.Cu 74 | Type=0 75 | Enabled=0 76 | [pcbnew/Layer.In3.Cu] 77 | Name=In3.Cu 78 | Type=0 79 | Enabled=0 80 | [pcbnew/Layer.In4.Cu] 81 | Name=In4.Cu 82 | Type=0 83 | Enabled=0 84 | [pcbnew/Layer.In5.Cu] 85 | Name=In5.Cu 86 | Type=0 87 | Enabled=0 88 | [pcbnew/Layer.In6.Cu] 89 | Name=In6.Cu 90 | Type=0 91 | Enabled=0 92 | [pcbnew/Layer.In7.Cu] 93 | Name=In7.Cu 94 | Type=0 95 | Enabled=0 96 | [pcbnew/Layer.In8.Cu] 97 | Name=In8.Cu 98 | Type=0 99 | Enabled=0 100 | [pcbnew/Layer.In9.Cu] 101 | Name=In9.Cu 102 | Type=0 103 | Enabled=0 104 | [pcbnew/Layer.In10.Cu] 105 | Name=In10.Cu 106 | Type=0 107 | Enabled=0 108 | [pcbnew/Layer.In11.Cu] 109 | Name=In11.Cu 110 | Type=0 111 | Enabled=0 112 | [pcbnew/Layer.In12.Cu] 113 | Name=In12.Cu 114 | Type=0 115 | Enabled=0 116 | [pcbnew/Layer.In13.Cu] 117 | Name=In13.Cu 118 | Type=0 119 | Enabled=0 120 | [pcbnew/Layer.In14.Cu] 121 | Name=In14.Cu 122 | Type=0 123 | Enabled=0 124 | [pcbnew/Layer.In15.Cu] 125 | Name=In15.Cu 126 | Type=0 127 | Enabled=0 128 | [pcbnew/Layer.In16.Cu] 129 | Name=In16.Cu 130 | Type=0 131 | Enabled=0 132 | [pcbnew/Layer.In17.Cu] 133 | Name=In17.Cu 134 | Type=0 135 | Enabled=0 136 | [pcbnew/Layer.In18.Cu] 137 | Name=In18.Cu 138 | Type=0 139 | Enabled=0 140 | [pcbnew/Layer.In19.Cu] 141 | Name=In19.Cu 142 | Type=0 143 | Enabled=0 144 | [pcbnew/Layer.In20.Cu] 145 | Name=In20.Cu 146 | Type=0 147 | Enabled=0 148 | [pcbnew/Layer.In21.Cu] 149 | Name=In21.Cu 150 | Type=0 151 | Enabled=0 152 | [pcbnew/Layer.In22.Cu] 153 | Name=In22.Cu 154 | Type=0 155 | Enabled=0 156 | [pcbnew/Layer.In23.Cu] 157 | Name=In23.Cu 158 | Type=0 159 | Enabled=0 160 | [pcbnew/Layer.In24.Cu] 161 | Name=In24.Cu 162 | Type=0 163 | Enabled=0 164 | [pcbnew/Layer.In25.Cu] 165 | Name=In25.Cu 166 | Type=0 167 | Enabled=0 168 | [pcbnew/Layer.In26.Cu] 169 | Name=In26.Cu 170 | Type=0 171 | Enabled=0 172 | [pcbnew/Layer.In27.Cu] 173 | Name=In27.Cu 174 | Type=0 175 | Enabled=0 176 | [pcbnew/Layer.In28.Cu] 177 | Name=In28.Cu 178 | Type=0 179 | Enabled=0 180 | [pcbnew/Layer.In29.Cu] 181 | Name=In29.Cu 182 | Type=0 183 | Enabled=0 184 | [pcbnew/Layer.In30.Cu] 185 | Name=In30.Cu 186 | Type=0 187 | Enabled=0 188 | [pcbnew/Layer.B.Cu] 189 | Name=B.Cu 190 | Type=0 191 | Enabled=1 192 | [pcbnew/Layer.B.Adhes] 193 | Enabled=1 194 | [pcbnew/Layer.F.Adhes] 195 | Enabled=1 196 | [pcbnew/Layer.B.Paste] 197 | Enabled=1 198 | [pcbnew/Layer.F.Paste] 199 | Enabled=1 200 | [pcbnew/Layer.B.SilkS] 201 | Enabled=1 202 | [pcbnew/Layer.F.SilkS] 203 | Enabled=1 204 | [pcbnew/Layer.B.Mask] 205 | Enabled=1 206 | [pcbnew/Layer.F.Mask] 207 | Enabled=1 208 | [pcbnew/Layer.Dwgs.User] 209 | Enabled=1 210 | [pcbnew/Layer.Cmts.User] 211 | Enabled=1 212 | [pcbnew/Layer.Eco1.User] 213 | Enabled=1 214 | [pcbnew/Layer.Eco2.User] 215 | Enabled=1 216 | [pcbnew/Layer.Edge.Cuts] 217 | Enabled=1 218 | [pcbnew/Layer.Margin] 219 | Enabled=1 220 | [pcbnew/Layer.B.CrtYd] 221 | Enabled=1 222 | [pcbnew/Layer.F.CrtYd] 223 | Enabled=1 224 | [pcbnew/Layer.B.Fab] 225 | Enabled=1 226 | [pcbnew/Layer.F.Fab] 227 | Enabled=1 228 | [pcbnew/Layer.Rescue] 229 | Enabled=0 230 | [pcbnew/Netclasses] 231 | [pcbnew/Netclasses/Default] 232 | Name=Default 233 | Clearance=0.15 234 | TrackWidth=0.15 235 | ViaDiameter=0.8 236 | ViaDrill=0.4 237 | uViaDiameter=0.3 238 | uViaDrill=0.1 239 | dPairWidth=0.2 240 | dPairGap=0.25 241 | dPairViaGap=0.25 242 | -------------------------------------------------------------------------------- /electronics/lib/lilygo_micro32.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.4 2 | #encoding utf-8 3 | # 4 | # T-Micro32 5 | # 6 | DEF T-Micro32 U 0 40 Y Y 1 F N 7 | F0 "U" -600 850 50 H V C CNN 8 | F1 "T-Micro32" 0 700 50 H V C CNN 9 | F2 "" 0 0 50 H I C CNN 10 | F3 "" 0 0 50 H I C CNN 11 | DRAW 12 | S 650 -800 -650 800 0 1 0 f 13 | X GND 1 -750 700 100 R 50 50 1 1 W 14 | X IO25 10 -750 -200 100 R 50 50 1 1 B 15 | X IO26 11 -750 -300 100 R 50 50 1 1 B 16 | X IO27 12 -750 -400 100 R 50 50 1 1 B 17 | X IO14 13 -750 -500 100 R 50 50 1 1 B 18 | X IO12 14 -750 -600 100 R 50 50 1 1 B 19 | X GND 15 -750 -700 100 R 50 50 1 1 W 20 | X IO13 16 -350 -900 100 U 50 50 1 1 B 21 | X IO9 17 -250 -900 100 U 50 50 1 1 I 22 | X IO10 18 -150 -900 100 U 50 50 1 1 I 23 | X SD2 19 -50 -900 100 U 50 50 1 1 N 24 | X 3V3 2 -750 600 100 R 50 50 1 1 W 25 | X CLK 20 50 -900 100 U 50 50 1 1 N 26 | X SD3 21 150 -900 100 U 50 50 1 1 B 27 | X SD1 22 250 -900 100 U 50 50 1 1 B 28 | X IO15 23 350 -900 100 U 50 50 1 1 B 29 | X IO2 24 750 -700 100 L 50 50 1 1 B 30 | X IO0 25 750 -600 100 L 50 50 1 1 B 31 | X IO4 26 750 -500 100 L 50 50 1 1 B 32 | X CS 27 750 -400 100 L 50 50 1 1 N 33 | X SD0 28 750 -300 100 L 50 50 1 1 B 34 | X IO5 29 750 -200 100 L 50 50 1 1 B 35 | X EN 3 -750 500 100 R 50 50 1 1 I 36 | X IO18 30 750 -100 100 L 50 50 1 1 N 37 | X IO19 31 750 0 100 L 50 50 1 1 B 38 | X NC 32 750 100 100 L 50 50 1 1 P 39 | X IO21 33 750 200 100 L 50 50 1 1 B 40 | X RXD 34 750 300 100 L 50 50 1 1 I 41 | X TXD 35 750 400 100 L 50 50 1 1 O 42 | X IO22 36 750 500 100 L 50 50 1 1 B 43 | X IO23/VSPI_MOSI 37 750 600 100 L 50 50 1 1 N 44 | X GND 38 750 700 100 L 50 50 1 1 W 45 | X IO36/SVP 4 -750 400 100 R 50 50 1 1 I 46 | X IO39/SVN 5 -750 300 100 R 50 50 1 1 I 47 | X IO34 6 -750 200 100 R 50 50 1 1 I 48 | X IO35 7 -750 100 100 R 50 50 1 1 I 49 | X IO32 8 -750 0 100 R 50 50 1 1 B 50 | X IO33 9 -750 -100 100 R 50 50 1 1 B 51 | ENDDRAW 52 | ENDDEF 53 | # 54 | # T-Micro32_Plus 55 | # 56 | DEF T-Micro32_Plus U 0 40 Y Y 1 F N 57 | F0 "U" -600 850 50 H V C CNN 58 | F1 "T-Micro32_Plus" 0 700 50 H V C CNN 59 | F2 "" 0 -100 50 H I C CNN 60 | F3 "" 0 -100 50 H I C CNN 61 | DRAW 62 | C -410 -610 0 1 1 0 N 63 | C -410 -510 0 1 1 0 N 64 | C 340 -560 0 1 1 0 N 65 | C 440 -710 0 1 1 0 N 66 | C 440 -610 0 1 1 0 N 67 | C 440 -210 0 1 1 0 N 68 | T 0 -350 -50 26 0 0 0 "IO0: def=PU, 1=run, 0=download" Normal 0 L C 69 | T 0 -350 -200 26 0 0 0 "IO12: def=PD, must be 0 on boot" Normal 0 L C 70 | T 0 -350 -250 26 0 0 0 "IO14: outputs signal on boot" Normal 0 L C 71 | T 0 -350 -300 26 0 0 0 "IO15: def=PU, 1=debug log, 0=silent" Normal 0 L C 72 | T 0 -350 -100 26 0 0 0 "IO2: def=PD, must be 0 to download" Normal 0 L C 73 | T 0 -350 -150 26 0 0 0 "IO5: outputs signal on boot?" Normal 0 L C 74 | T 0 -250 -350 26 0 0 0 "outputs signal at boot" Normal 0 L C 75 | S 650 -800 -650 800 0 1 0 f 76 | P 2 1 1 0 -410 -590 -410 -600 N 77 | P 2 1 1 0 -410 -490 -410 -500 N 78 | P 2 1 1 0 340 -540 340 -550 N 79 | P 2 1 1 0 440 -690 440 -700 N 80 | P 2 1 1 0 440 -590 440 -600 N 81 | P 2 1 1 0 440 -190 440 -200 N 82 | P 4 1 1 0 -410 -570 -440 -620 -380 -620 -410 -570 N 83 | P 4 1 1 0 -410 -470 -440 -520 -380 -520 -410 -470 N 84 | P 4 1 1 0 340 -520 310 -570 370 -570 340 -520 N 85 | P 4 1 1 0 440 -670 410 -720 470 -720 440 -670 N 86 | P 4 1 1 0 440 -570 410 -620 470 -620 440 -570 N 87 | P 4 1 1 0 440 -170 410 -220 470 -220 440 -170 N 88 | X GND 1 -750 700 100 R 50 50 1 1 W 89 | X IO25 10 -750 -200 100 R 50 50 1 1 B 90 | X IO26 11 -750 -300 100 R 50 50 1 1 B 91 | X IO27 12 -750 -400 100 R 50 50 1 1 B 92 | X IO14 13 -750 -500 100 R 50 50 1 1 B 93 | X IO12 14 -750 -600 100 R 50 50 1 1 B 94 | X GND 15 -750 -700 100 R 50 50 1 1 W 95 | X IO13 16 -350 -900 100 U 50 50 1 1 B 96 | X IO37 17 -250 -900 100 U 50 50 1 1 I 97 | X IO38 18 -150 -900 100 U 50 50 1 1 I 98 | X NC 19 -50 -900 100 U 50 50 1 1 N 99 | X 3V3 2 -750 600 100 R 50 50 1 1 W 100 | X NC 20 50 -900 100 U 50 50 1 1 N 101 | X IO7 21 150 -900 100 U 50 50 1 1 B 102 | X IO8 22 250 -900 100 U 50 50 1 1 B 103 | X IO15 23 350 -900 100 U 50 50 1 1 B 104 | X IO2 24 750 -700 100 L 50 50 1 1 B 105 | X IO0 25 750 -600 100 L 50 50 1 1 B 106 | X IO4 26 750 -500 100 L 50 50 1 1 B 107 | X NC 27 750 -400 100 L 50 50 1 1 N 108 | X IO20 28 750 -300 100 L 50 50 1 1 B 109 | X IO5 29 750 -200 100 L 50 50 1 1 B 110 | X EN 3 -750 500 100 R 50 50 1 1 I 111 | X NC 30 750 -100 100 L 50 50 1 1 N 112 | X IO19 31 750 0 100 L 50 50 1 1 B 113 | X VDD_SDIO 32 750 100 100 L 50 50 1 1 P 114 | X IO21 33 750 200 100 L 50 50 1 1 B 115 | X RXD 34 750 300 100 L 50 50 1 1 I 116 | X TXD 35 750 400 100 L 50 50 1 1 O 117 | X IO22 36 750 500 100 L 50 50 1 1 B 118 | X NC 37 750 600 100 L 50 50 1 1 N 119 | X GND 38 750 700 100 L 50 50 1 1 W 120 | X IO36/SVP 4 -750 400 100 R 50 50 1 1 I 121 | X IO39/SVN 5 -750 300 100 R 50 50 1 1 I 122 | X IO34 6 -750 200 100 R 50 50 1 1 I 123 | X IO35 7 -750 100 100 R 50 50 1 1 I 124 | X IO32 8 -750 0 100 R 50 50 1 1 B 125 | X IO33 9 -750 -100 100 R 50 50 1 1 B 126 | ENDDRAW 127 | ENDDEF 128 | # 129 | #End Library 130 | -------------------------------------------------------------------------------- /electronics/view_screen/view_screen-cache.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.4 2 | #encoding utf-8 3 | # 4 | # Connector_Generic_Conn_01x04 5 | # 6 | DEF Connector_Generic_Conn_01x04 J 0 40 Y N 1 F N 7 | F0 "J" 0 200 50 H V C CNN 8 | F1 "Connector_Generic_Conn_01x04" 0 -300 50 H V C CNN 9 | F2 "" 0 0 50 H I C CNN 10 | F3 "" 0 0 50 H I C CNN 11 | $FPLIST 12 | Connector*:*_1x??_* 13 | $ENDFPLIST 14 | DRAW 15 | S -50 -195 0 -205 1 1 6 N 16 | S -50 -95 0 -105 1 1 6 N 17 | S -50 5 0 -5 1 1 6 N 18 | S -50 105 0 95 1 1 6 N 19 | S -50 150 50 -250 1 1 10 f 20 | X Pin_1 1 -200 100 150 R 50 50 1 1 P 21 | X Pin_2 2 -200 0 150 R 50 50 1 1 P 22 | X Pin_3 3 -200 -100 150 R 50 50 1 1 P 23 | X Pin_4 4 -200 -200 150 R 50 50 1 1 P 24 | ENDDRAW 25 | ENDDEF 26 | # 27 | # Connector_Generic_Conn_01x12 28 | # 29 | DEF Connector_Generic_Conn_01x12 J 0 40 Y N 1 F N 30 | F0 "J" 0 600 50 H V C CNN 31 | F1 "Connector_Generic_Conn_01x12" 0 -700 50 H V C CNN 32 | F2 "" 0 0 50 H I C CNN 33 | F3 "" 0 0 50 H I C CNN 34 | $FPLIST 35 | Connector*:*_1x??_* 36 | $ENDFPLIST 37 | DRAW 38 | S -50 -595 0 -605 1 1 6 N 39 | S -50 -495 0 -505 1 1 6 N 40 | S -50 -395 0 -405 1 1 6 N 41 | S -50 -295 0 -305 1 1 6 N 42 | S -50 -195 0 -205 1 1 6 N 43 | S -50 -95 0 -105 1 1 6 N 44 | S -50 5 0 -5 1 1 6 N 45 | S -50 105 0 95 1 1 6 N 46 | S -50 205 0 195 1 1 6 N 47 | S -50 305 0 295 1 1 6 N 48 | S -50 405 0 395 1 1 6 N 49 | S -50 505 0 495 1 1 6 N 50 | S -50 550 50 -650 1 1 10 f 51 | X Pin_1 1 -200 500 150 R 50 50 1 1 P 52 | X Pin_10 10 -200 -400 150 R 50 50 1 1 P 53 | X Pin_11 11 -200 -500 150 R 50 50 1 1 P 54 | X Pin_12 12 -200 -600 150 R 50 50 1 1 P 55 | X Pin_2 2 -200 400 150 R 50 50 1 1 P 56 | X Pin_3 3 -200 300 150 R 50 50 1 1 P 57 | X Pin_4 4 -200 200 150 R 50 50 1 1 P 58 | X Pin_5 5 -200 100 150 R 50 50 1 1 P 59 | X Pin_6 6 -200 0 150 R 50 50 1 1 P 60 | X Pin_7 7 -200 -100 150 R 50 50 1 1 P 61 | X Pin_8 8 -200 -200 150 R 50 50 1 1 P 62 | X Pin_9 9 -200 -300 150 R 50 50 1 1 P 63 | ENDDRAW 64 | ENDDEF 65 | # 66 | # Device_C_Small 67 | # 68 | DEF Device_C_Small C 0 10 N N 1 F N 69 | F0 "C" 10 70 50 H V L CNN 70 | F1 "Device_C_Small" 10 -80 50 H V L CNN 71 | F2 "" 0 0 50 H I C CNN 72 | F3 "" 0 0 50 H I C CNN 73 | $FPLIST 74 | C_* 75 | $ENDFPLIST 76 | DRAW 77 | P 2 0 1 13 -60 -20 60 -20 N 78 | P 2 0 1 12 -60 20 60 20 N 79 | X ~ 1 0 100 80 D 50 50 1 1 P 80 | X ~ 2 0 -100 80 U 50 50 1 1 P 81 | ENDDRAW 82 | ENDDEF 83 | # 84 | # Device_R_Small 85 | # 86 | DEF Device_R_Small R 0 10 N N 1 F N 87 | F0 "R" 30 20 50 H V L CNN 88 | F1 "Device_R_Small" 30 -40 50 H V L CNN 89 | F2 "" 0 0 50 H I C CNN 90 | F3 "" 0 0 50 H I C CNN 91 | $FPLIST 92 | R_* 93 | $ENDFPLIST 94 | DRAW 95 | S -30 70 30 -70 0 1 8 N 96 | X ~ 1 0 100 30 D 50 50 1 1 P 97 | X ~ 2 0 -100 30 U 50 50 1 1 P 98 | ENDDRAW 99 | ENDDEF 100 | # 101 | # Mechanical_MountingHole_Pad 102 | # 103 | DEF Mechanical_MountingHole_Pad H 0 40 N N 1 F N 104 | F0 "H" 0 250 50 H V C CNN 105 | F1 "Mechanical_MountingHole_Pad" 0 175 50 H V C CNN 106 | F2 "" 0 0 50 H I C CNN 107 | F3 "" 0 0 50 H I C CNN 108 | $FPLIST 109 | MountingHole*Pad* 110 | $ENDFPLIST 111 | DRAW 112 | C 0 50 50 0 1 50 N 113 | X 1 1 0 -100 100 U 50 50 1 1 I 114 | ENDDRAW 115 | ENDDEF 116 | # 117 | # Transistor_FET_2N7002 118 | # 119 | DEF Transistor_FET_2N7002 Q 0 20 Y N 1 F N 120 | F0 "Q" 200 75 50 H V L CNN 121 | F1 "Transistor_FET_2N7002" 200 0 50 H V L CNN 122 | F2 "Package_TO_SOT_SMD:SOT-23" 200 -75 50 H I L CIN 123 | F3 "" 0 0 50 H I L CNN 124 | ALIAS 2N7002 2N7002E 2N7002H 2N7002K BS170F BS870 BSN20 BSS123 BSS127S DMG2302U DMG3402L DMG3404L DMG3406L DMG3414U DMG3418L DMN10H220L DMN10H700S DMN13H750S DMN2041L DMN2050L DMN2056U DMN2058U DMN2075U DMN2230U DMN24H11DS DMN24H3D5L DMN3042L DMN3051L DMN30H4D0L DMN3110S DMN3150L DMN3300U DMN3404L DMN6075S DMN6140L DMN67D7L DMN67D8L MMBF170 VN10LF ZVN3306F ZVN3310F ZVN3320F ZVN4106F ZXM61N02F ZXM61N03F ZXMN10A07F ZXMN2A01F ZXMN2A14F ZXMN2B01F ZXMN2B14FH ZXMN2F30FH ZXMN2F34FH ZXMN3A01F ZXMN3A14F ZXMN3B01F ZXMN3B14F ZXMN3F30FH ZXMN6A07F IRLML0030 IRLML2060 TSM2302CX AO3400A 125 | $FPLIST 126 | SOT?23* 127 | $ENDFPLIST 128 | DRAW 129 | C 65 0 110 0 1 10 N 130 | C 100 -70 10 0 1 0 F 131 | C 100 70 10 0 1 0 F 132 | P 2 0 1 0 10 0 -100 0 N 133 | P 2 0 1 10 10 75 10 -75 N 134 | P 2 0 1 10 30 -50 30 -90 N 135 | P 2 0 1 10 30 20 30 -20 N 136 | P 2 0 1 10 30 90 30 50 N 137 | P 2 0 1 0 100 100 100 70 N 138 | P 3 0 1 0 100 -100 100 0 30 0 N 139 | P 4 0 1 0 30 -70 130 -70 130 70 30 70 N 140 | P 4 0 1 0 40 0 80 15 80 -15 40 0 F 141 | P 4 0 1 0 110 20 115 15 145 15 150 10 N 142 | P 4 0 1 0 130 15 115 -10 145 -10 130 15 N 143 | X G 1 -200 0 100 R 50 50 1 1 I 144 | X S 2 100 -200 100 U 50 50 1 1 P 145 | X D 3 100 200 100 D 50 50 1 1 P 146 | ENDDRAW 147 | ENDDEF 148 | # 149 | # power_GND 150 | # 151 | DEF power_GND #PWR 0 0 Y Y 1 F P 152 | F0 "#PWR" 0 -250 50 H I C CNN 153 | F1 "power_GND" 0 -150 50 H V C CNN 154 | F2 "" 0 0 50 H I C CNN 155 | F3 "" 0 0 50 H I C CNN 156 | DRAW 157 | P 6 0 1 0 0 0 0 -50 50 -50 0 -100 -50 -50 0 -50 N 158 | X GND 1 0 0 0 D 50 50 1 1 W N 159 | ENDDRAW 160 | ENDDEF 161 | # 162 | #End Library 163 | -------------------------------------------------------------------------------- /firmware/lib/tlv/src/util/Tlv493d_conf.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Tlv493d_conf.h - Part of the library for Arduino to control the TLV493D-A1B6 3D magnetic sensor. 3 | * 4 | * The 3D magnetic sensor TLV493D-A1B6 offers accurate three dimensional sensing with extremely low power consumption 5 | * in a small 6-pin package. With an opportunity to detect the magnetic field in x, y, and z-direction the sensor is 6 | * ideally suited for the measurement of 3D movements, linear movements and rotation movements. 7 | * 8 | * Have a look at the application note/reference manual for more information. 9 | * 10 | * Copyright (c) 2018 Infineon Technologies AG 11 | * 12 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 13 | * following conditions are met: 14 | * 15 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following 16 | * disclaimer. 17 | * 18 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following 19 | * disclaimer in the documentation and/or other materials provided with the distribution. 20 | * 21 | * Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote 22 | * products derived from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 25 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 27 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef TLV493D_CONF_H_INCLUDED 34 | #define TLV493D_CONF_H_INCLUDED 35 | 36 | #include "RegMask.h" 37 | #include "Tlv493d.h" 38 | 39 | 40 | #define TLV493D_DEFAULTMODE POWERDOWNMODE 41 | 42 | #define TLV493D_STARTUPDELAY 40 43 | #define TLV493D_RESETDELAY 60 44 | 45 | #define TLV493D_NUM_OF_REGMASKS 25 46 | #define TLV493D_NUM_OF_ACCMODES 5 47 | 48 | #define TLV493D_MEASUREMENT_READOUT 7 49 | #define TLV493D_FAST_READOUT 3 50 | 51 | #define TLV493D_B_MULT 0.098 52 | #define TLV493D_TEMP_MULT 1.1 53 | #define TLV493D_TEMP_OFFSET 315 54 | 55 | 56 | namespace tlv493d 57 | { 58 | 59 | typedef struct 60 | { 61 | uint8_t fast; 62 | uint8_t lp; 63 | uint8_t lpPeriod; 64 | uint16_t measurementTime; 65 | } AccessMode_t; 66 | 67 | enum Registers_e 68 | { 69 | R_BX1 = 0, 70 | R_BX2, 71 | R_BY1, 72 | R_BY2, 73 | R_BZ1, 74 | R_BZ2, 75 | R_TEMP1, 76 | R_TEMP2, 77 | R_FRAMECOUNTER, 78 | R_CHANNEL, 79 | R_POWERDOWNFLAG, 80 | R_RES1, 81 | R_RES2, 82 | R_RES3, 83 | W_PARITY, 84 | W_ADDR, 85 | W_INT, 86 | W_FAST, 87 | W_LOWPOWER, 88 | W_TEMP_NEN, 89 | W_LP_PERIOD, 90 | W_PARITY_EN, 91 | W_RES1, 92 | W_RES2, 93 | W_RES3 94 | }; 95 | 96 | const RegMask_t regMasks[] = { 97 | { REGMASK_READ, 0, 0xFF, 0 }, // R_BX1 98 | { REGMASK_READ, 4, 0xF0, 4 }, // R_BX2 99 | { REGMASK_READ, 1, 0xFF, 0 }, // R_BY1 100 | { REGMASK_READ, 4, 0x0F, 0 }, // R_BY2 101 | { REGMASK_READ, 2, 0xFF, 0 }, // R_BZ1 102 | { REGMASK_READ, 5, 0x0F, 0 }, // R_BZ2 103 | { REGMASK_READ, 3, 0xF0, 4 }, // R_TEMP1 104 | { REGMASK_READ, 6, 0xFF, 0 }, // R_TEMP2 105 | { REGMASK_READ, 3, 0x0C, 2 }, // R_FRAMECOUNTER 106 | { REGMASK_READ, 3, 0x03, 0 }, // R_CHANNEL 107 | { REGMASK_READ, 5, 0x10, 4 }, // R_POWERDOWNFLAG 108 | { REGMASK_READ, 7, 0x18, 3 }, // R_RES1 109 | { REGMASK_READ, 8, 0xFF, 0 }, // R_RES2 110 | { REGMASK_READ, 9, 0x1F, 0 }, // R_RES3 111 | { REGMASK_WRITE, 1, 0x80, 7 }, // W_PARITY 112 | { REGMASK_WRITE, 1, 0x60, 5 }, // W_ADDR 113 | { REGMASK_WRITE, 1, 0x04, 2 }, // W_INT 114 | { REGMASK_WRITE, 1, 0x02, 1 }, // W_FAST 115 | { REGMASK_WRITE, 1, 0x01, 0 }, // W_LOWPOWER 116 | { REGMASK_WRITE, 3, 0x80, 7 }, // W_TEMP_EN 117 | { REGMASK_WRITE, 3, 0x40, 6 }, // W_LOWPOWER 118 | { REGMASK_WRITE, 3, 0x20, 5 }, // W_POWERDOWN 119 | { REGMASK_WRITE, 1, 0x18, 3 }, // W_RES1 120 | { REGMASK_WRITE, 2, 0xFF, 0 }, // W_RES2 121 | { REGMASK_WRITE, 3, 0x1F, 0 } // W_RES3 122 | }; 123 | 124 | const AccessMode_t accModes[] = { 125 | { 0, 0, 0, 1000 }, // POWERDOWNMODE 126 | { 1, 0, 0, 0 }, // FASTMODE 127 | { 0, 1, 1, 10 }, // LOWPOWERMODE 128 | { 0, 1, 0, 100 }, // ULTRALOWPOWERMODE 129 | { 1, 1, 1, 10 } // MASTERCONTROLLEDMODE 130 | }; 131 | 132 | } 133 | 134 | #endif 135 | -------------------------------------------------------------------------------- /electronics/lib/Modified.pretty/QFN-20-1EP_3x3mm_P0.4mm_EP1.65x1.65mm_ThermalVias_LargerViaHoles.kicad_mod: -------------------------------------------------------------------------------- 1 | (module QFN-20-1EP_3x3mm_P0.4mm_EP1.65x1.65mm_ThermalVias_LargerViaHoles (layer F.Cu) (tedit 6206B69C) 2 | (descr "QFN, 20 Pin (https://www.analog.com/media/en/technical-documentation/data-sheets/3553fc.pdf#page=34), generated with kicad-footprint-generator ipc_noLead_generator.py") 3 | (tags "QFN NoLead") 4 | (attr smd) 5 | (fp_text reference U5 (at 0 -2.82) (layer F.SilkS) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value TMC6300 (at 0 2.82) (layer F.Fab) 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (fp_line (start 2.12 -2.12) (end -2.12 -2.12) (layer F.CrtYd) (width 0.05)) 12 | (fp_line (start 2.12 2.12) (end 2.12 -2.12) (layer F.CrtYd) (width 0.05)) 13 | (fp_line (start -2.12 2.12) (end 2.12 2.12) (layer F.CrtYd) (width 0.05)) 14 | (fp_line (start -2.12 -2.12) (end -2.12 2.12) (layer F.CrtYd) (width 0.05)) 15 | (fp_line (start -1.5 -0.75) (end -0.75 -1.5) (layer F.Fab) (width 0.1)) 16 | (fp_line (start -1.5 1.5) (end -1.5 -0.75) (layer F.Fab) (width 0.1)) 17 | (fp_line (start 1.5 1.5) (end -1.5 1.5) (layer F.Fab) (width 0.1)) 18 | (fp_line (start 1.5 -1.5) (end 1.5 1.5) (layer F.Fab) (width 0.1)) 19 | (fp_line (start -0.75 -1.5) (end 1.5 -1.5) (layer F.Fab) (width 0.1)) 20 | (fp_line (start -1.16 -1.61) (end -1.61 -1.61) (layer F.SilkS) (width 0.12)) 21 | (fp_line (start 1.61 1.61) (end 1.61 1.16) (layer F.SilkS) (width 0.12)) 22 | (fp_line (start 1.16 1.61) (end 1.61 1.61) (layer F.SilkS) (width 0.12)) 23 | (fp_line (start -1.61 1.61) (end -1.61 1.16) (layer F.SilkS) (width 0.12)) 24 | (fp_line (start -1.16 1.61) (end -1.61 1.61) (layer F.SilkS) (width 0.12)) 25 | (fp_line (start 1.61 -1.61) (end 1.61 -1.16) (layer F.SilkS) (width 0.12)) 26 | (fp_line (start 1.16 -1.61) (end 1.61 -1.61) (layer F.SilkS) (width 0.12)) 27 | (fp_text user %R (at 0 0) (layer F.Fab) 28 | (effects (font (size 0.75 0.75) (thickness 0.11))) 29 | ) 30 | (pad "" smd roundrect (at 0.41 0.41) (size 0.6 0.6) (layers F.Paste) (roundrect_rratio 0.25)) 31 | (pad "" smd roundrect (at 0.41 -0.41) (size 0.6 0.6) (layers F.Paste) (roundrect_rratio 0.25)) 32 | (pad "" smd roundrect (at -0.41 0.41) (size 0.6 0.6) (layers F.Paste) (roundrect_rratio 0.25)) 33 | (pad "" smd roundrect (at -0.41 -0.41) (size 0.6 0.6) (layers F.Paste) (roundrect_rratio 0.25)) 34 | (pad PAD smd rect (at 0 0) (size 1.65 1.65) (layers B.Cu) 35 | (zone_connect 2)) 36 | (pad PAD thru_hole circle (at -0.5 -0.5) (size 0.6 0.6) (drill 0.3) (layers *.Cu) 37 | (zone_connect 2)) 38 | (pad PAD smd rect (at 0 0) (size 1.5 1.5) (layers F.Cu F.Mask) 39 | (zone_connect 2)) 40 | (pad 20 smd roundrect (at -0.8 -1.45) (size 0.2 0.7) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 41 | (pad 19 smd roundrect (at -0.4 -1.45) (size 0.2 0.7) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 42 | (pad 18 smd roundrect (at 0 -1.45) (size 0.2 0.7) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 43 | (pad 17 smd roundrect (at 0.4 -1.45) (size 0.2 0.7) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 44 | (pad 16 smd roundrect (at 0.8 -1.45) (size 0.2 0.7) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 45 | (pad 15 smd roundrect (at 1.45 -0.8) (size 0.7 0.2) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 46 | (pad 14 smd roundrect (at 1.45 -0.4) (size 0.7 0.2) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 47 | (pad 13 smd roundrect (at 1.45 0) (size 0.7 0.2) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 48 | (pad 12 smd roundrect (at 1.45 0.4) (size 0.7 0.2) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 49 | (pad 11 smd roundrect (at 1.45 0.8) (size 0.7 0.2) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 50 | (pad 10 smd roundrect (at 0.8 1.45) (size 0.2 0.7) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 51 | (pad 9 smd roundrect (at 0.4 1.45) (size 0.2 0.7) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 52 | (pad 8 smd roundrect (at 0 1.45) (size 0.2 0.7) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 53 | (pad 7 smd roundrect (at -0.4 1.45) (size 0.2 0.7) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 54 | (pad 6 smd roundrect (at -0.8 1.45) (size 0.2 0.7) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 55 | (pad 5 smd roundrect (at -1.45 0.8) (size 0.7 0.2) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 56 | (pad 4 smd roundrect (at -1.45 0.4) (size 0.7 0.2) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 57 | (pad 3 smd roundrect (at -1.45 0) (size 0.7 0.2) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 58 | (pad 2 smd roundrect (at -1.45 -0.4) (size 0.7 0.2) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 59 | (pad 1 smd roundrect (at -1.45 -0.8) (size 0.7 0.2) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) 60 | (pad PAD thru_hole circle (at 0.5 -0.5) (size 0.6 0.6) (drill 0.3) (layers *.Cu) 61 | (zone_connect 2)) 62 | (pad PAD thru_hole circle (at 0.5 0.5) (size 0.6 0.6) (drill 0.3) (layers *.Cu) 63 | (zone_connect 2)) 64 | (pad PAD thru_hole circle (at -0.5 0.5) (size 0.6 0.6) (drill 0.3) (layers *.Cu) 65 | (zone_connect 2)) 66 | (model ${KISYS3DMOD}/Package_DFN_QFN.3dshapes/UQFN-20-1EP_3x3mm_P0.4mm_EP1.85x1.85mm.step 67 | (at (xyz 0 0 0)) 68 | (scale (xyz 1 1 1)) 69 | (rotate (xyz 0 0 0)) 70 | ) 71 | ) 72 | -------------------------------------------------------------------------------- /electronics/scripts/export_util.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright 2015-2016 Scott Bezek and the splitflap contributors 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | import logging 18 | import os 19 | import re 20 | import subprocess 21 | import sys 22 | import tempfile 23 | import time 24 | 25 | from contextlib import contextmanager 26 | 27 | electronics_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 28 | repo_root = os.path.dirname(electronics_root) 29 | sys.path.append(repo_root) 30 | 31 | from xvfbwrapper import Xvfb 32 | from util import file_util, rev_info 33 | 34 | logging.basicConfig(level=logging.DEBUG) 35 | logger = logging.getLogger(__name__) 36 | 37 | class PopenContext(subprocess.Popen): 38 | def __enter__(self): 39 | return self 40 | def __exit__(self, type, value, traceback): 41 | if self.stdout: 42 | self.stdout.close() 43 | if self.stderr: 44 | self.stderr.close() 45 | if self.stdin: 46 | self.stdin.close() 47 | if type: 48 | self.terminate() 49 | # Wait for the process to terminate, to avoid zombies. 50 | self.wait() 51 | 52 | def xdotool(command): 53 | return subprocess.check_output(['xdotool'] + command) 54 | 55 | def wait_for_window(name, window_regex, additional_commands=None, timeout=10): 56 | if additional_commands is not None: 57 | commands = additional_commands 58 | else: 59 | commands = [] 60 | 61 | DELAY = 0.5 62 | logger.info('Waiting for %s window...', name) 63 | for i in range(int(timeout/DELAY)): 64 | try: 65 | xdotool(['search', '--name', window_regex] + commands) 66 | logger.info('Found %s window', name) 67 | return 68 | except subprocess.CalledProcessError: 69 | pass 70 | time.sleep(DELAY) 71 | raise RuntimeError('Timed out waiting for %s window' % name) 72 | 73 | @contextmanager 74 | def recorded_xvfb(video_filename, **xvfb_args): 75 | with Xvfb(**xvfb_args): 76 | with PopenContext([ 77 | 'recordmydesktop', 78 | '--no-sound', 79 | '--no-frame', 80 | '--on-the-fly-encoding', 81 | '-o', video_filename], close_fds=True) as screencast_proc: 82 | yield 83 | screencast_proc.terminate() 84 | 85 | 86 | def get_versioned_contents(filename, release_search_prefix): 87 | with open(filename, 'r') as f: 88 | original_contents = f.read() 89 | date = rev_info.git_date() 90 | date_long = rev_info.git_date(short=False) 91 | rev = rev_info.git_short_rev() 92 | logger.info('Replacing placeholders with %s and %s' % (date, rev)) 93 | release_version = 'v#.#' 94 | if release_search_prefix: 95 | tag_version = rev_info.git_release_version(release_search_prefix) 96 | if tag_version: 97 | release_version = tag_version 98 | return original_contents, original_contents \ 99 | .replace('Date ""', 'Date "%s"' % date_long) \ 100 | .replace('DATE: YYYY-MM-DD TIME TZ', 'DATE: %s' % date_long) \ 101 | .replace('DATE: YYYY-MM-DD', 'DATE: %s' % date) \ 102 | .replace('Rev ""', 'Rev "%s"' % rev) \ 103 | .replace('COMMIT: deadbeef', 'COMMIT: %s' % rev) \ 104 | .replace('v#.#', release_version) 105 | 106 | 107 | @contextmanager 108 | def versioned_file(filename, release_search_prefix): 109 | original_contents, versioned_contents = get_versioned_contents(filename, release_search_prefix) 110 | with open(filename, 'w') as temp_schematic: 111 | logger.debug('Writing to %s', filename) 112 | temp_schematic.write(versioned_contents) 113 | try: 114 | yield 115 | finally: 116 | with open(filename, 'w') as temp_schematic: 117 | logger.debug('Restoring %s', filename) 118 | temp_schematic.write(original_contents) 119 | 120 | 121 | @contextmanager 122 | def patch_config(filename, replacements): 123 | if not os.path.exists(filename): 124 | yield 125 | return 126 | 127 | with open(filename, 'r') as f: 128 | original_contents = f.read() 129 | 130 | new_contents = original_contents 131 | for (key, value) in replacements.items(): 132 | pattern = '^' + re.escape(key) + '=(.*)$' 133 | new_contents = re.sub(pattern, key + '=' + value, new_contents, flags=re.MULTILINE) 134 | 135 | with open(filename, 'w') as f: 136 | logger.debug('Writing to %s', filename) 137 | f.write(new_contents) 138 | try: 139 | yield 140 | finally: 141 | with open(filename, 'w') as f: 142 | logger.debug('Restoring %s', filename) 143 | f.write(original_contents) 144 | 145 | -------------------------------------------------------------------------------- /.github/workflows/electronics.yml: -------------------------------------------------------------------------------- 1 | name: Export Electronics 2 | 3 | on: 4 | push: 5 | pull_request: 6 | 7 | jobs: 8 | export-electronics: 9 | name: Export Electronics 10 | runs-on: ubuntu-20.04 11 | 12 | steps: 13 | - name: Checkout code 14 | uses: actions/checkout@v2 15 | 16 | - name: Set up outputs directory 17 | run: mkdir -p electronics/build/outputs 18 | 19 | - name: Install dependencies 20 | run: ./electronics/scripts/dependencies.sh 21 | 22 | - name: Export JLCPCB fabrication files [view_base] 23 | run: | 24 | ./electronics/scripts/export_jlcpcb.py --release-prefix releases/view_base/ electronics/view_base/view_base.kicad_pcb 25 | cp -r electronics/build/view_base-jlc electronics/build/outputs 26 | 27 | - name: Export PCB overview PDF [view_base] 28 | run: | 29 | ./electronics/scripts/generate_pdf.py --release-prefix releases/view_base/ electronics/view_base/view_base.kicad_pcb 30 | cp electronics/build/view_base-pcb-packet.pdf electronics/build/outputs 31 | env: 32 | PYTHONUNBUFFERED: 1 33 | 34 | - name: Render PCB 3D [view_base] 35 | run: | 36 | ./electronics/scripts/export_3d.py electronics/view_base/view_base.kicad_pcb --suffix front --width 1024 --height 1024 --skip-virtual --color-soldermask 1 1 1 --color-silk 0.1 0.1 0.1 --release-prefix releases/view_base/ transform z+ z+ rx+ rx+ rz- ry- ry- mu 37 | cp electronics/build/view_base-front-3d.png electronics/build/outputs 38 | ./scripts/annotate_image.sh electronics/build/outputs/view_base-front-3d.png 39 | ./electronics/scripts/export_3d.py electronics/view_base/view_base.kicad_pcb --suffix back --width 1024 --height 1024 --skip-virtual --color-soldermask 1 1 1 --color-silk 0.1 0.1 0.1 --release-prefix releases/view_base/ transform z+ z+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ rx+ rx+ rz- ry+ ry+ mu 40 | cp electronics/build/view_base-back-3d.png electronics/build/outputs 41 | ./scripts/annotate_image.sh electronics/build/outputs/view_base-back-3d.png 42 | env: 43 | PYTHONUNBUFFERED: 1 44 | 45 | - name: Export JLCPCB fabrication files [view_screen] 46 | run: | 47 | ./electronics/scripts/export_jlcpcb.py --release-prefix releases/view_screen/ electronics/view_screen/view_screen.kicad_pcb 48 | cp -r electronics/build/view_screen-jlc electronics/build/outputs 49 | 50 | - name: Export PCB overview PDF [view_screen] 51 | run: | 52 | ./electronics/scripts/generate_pdf.py --release-prefix releases/view_screen/ electronics/view_screen/view_screen.kicad_pcb 53 | cp electronics/build/view_screen-pcb-packet.pdf electronics/build/outputs 54 | env: 55 | PYTHONUNBUFFERED: 1 56 | 57 | - name: Render PCB 3D [view_screen] 58 | run: | 59 | ./electronics/scripts/export_3d.py electronics/view_screen/view_screen.kicad_pcb --suffix front --width 1024 --height 1024 --skip-virtual --release-prefix releases/view_screen/ transform z+ z+ rx+ rx+ rz- ry- ry- mu 60 | cp electronics/build/view_screen-front-3d.png electronics/build/outputs 61 | ./scripts/annotate_image.sh electronics/build/outputs/view_screen-front-3d.png 62 | ./electronics/scripts/export_3d.py electronics/view_screen/view_screen.kicad_pcb --suffix back --width 1024 --height 1024 --skip-virtual --release-prefix releases/view_screen/ transform z+ z+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ ry+ rx+ rx+ rz- ry+ ry+ mu 63 | cp electronics/build/view_screen-back-3d.png electronics/build/outputs 64 | ./scripts/annotate_image.sh electronics/build/outputs/view_screen-back-3d.png 65 | env: 66 | PYTHONUNBUFFERED: 1 67 | 68 | - name: Export artifacts (KiBot) [view_base] 69 | uses: INTI-CMNB/KiBot@fb6d637c17fbba2daf005a9a7972e4c02c1c997c 70 | with: 71 | config: electronics/view_base/view_base.kibot.yml 72 | dir: electronics/build/outputs 73 | schema: 'electronics/view_base/view_base.sch' 74 | board: 'electronics/view_base/view_base.kicad_pcb' 75 | 76 | - name: Export artifacts (KiBot) [view_screen] 77 | uses: INTI-CMNB/KiBot@fb6d637c17fbba2daf005a9a7972e4c02c1c997c 78 | with: 79 | config: electronics/view_screen/view_screen.kibot.yml 80 | dir: electronics/build/outputs 81 | schema: 'electronics/view_screen/view_screen.sch' 82 | board: 'electronics/view_screen/view_screen.kicad_pcb' 83 | 84 | - name: Archive artifacts 85 | uses: actions/upload-artifact@v2 86 | if: always() 87 | with: 88 | name: electronics 89 | path: | 90 | electronics/build 91 | 92 | - name: Configure AWS Credentials 93 | if: github.event_name == 'push' && github.repository_owner == 'scottbez1' 94 | uses: aws-actions/configure-aws-credentials@v1 95 | with: 96 | aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} 97 | aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 98 | aws-region: us-east-1 99 | 100 | - name: Sync artifacts to S3 101 | if: github.event_name == 'push' && github.repository_owner == 'scottbez1' 102 | run: | 103 | aws s3 sync electronics/build/outputs s3://smartknob-artifacts/${GITHUB_REF#refs/heads/}/electronics --delete --cache-control max-age=0,no-cache 104 | 105 | -------------------------------------------------------------------------------- /electronics/lib/lilygo_micro32.pretty/T-Micro32.kicad_mod: -------------------------------------------------------------------------------- 1 | (module T-Micro32 (layer F.Cu) (tedit 618DED80) 2 | (fp_text reference REF** (at 2 -4.5) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value T-Micro32 (at 6.5 3) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_line (start 3 5.5) (end 3 12.5) (layer F.Fab) (width 0.15)) 9 | (fp_line (start 10 5.5) (end 3 5.5) (layer F.Fab) (width 0.15)) 10 | (fp_line (start 10 12.5) (end 10 5.5) (layer F.Fab) (width 0.15)) 11 | (fp_line (start 3 12.5) (end 10 12.5) (layer F.Fab) (width 0.15)) 12 | (fp_line (start 12 -1.5) (end 13 -2) (layer F.SilkS) (width 0.15)) 13 | (fp_line (start 10 -1.5) (end 13 -3) (layer F.SilkS) (width 0.15)) 14 | (fp_line (start 8 -1.5) (end 12 -3.5) (layer F.SilkS) (width 0.15)) 15 | (fp_line (start 6 -1.5) (end 10 -3.5) (layer F.SilkS) (width 0.15)) 16 | (fp_line (start 8 -3.5) (end 4 -1.5) (layer F.SilkS) (width 0.15)) 17 | (fp_line (start 2 -1.5) (end 6 -3.5) (layer F.SilkS) (width 0.15)) 18 | (fp_line (start 0 -1.5) (end 4 -3.5) (layer F.SilkS) (width 0.15)) 19 | (fp_line (start 0 -2.5) (end 2 -3.5) (layer F.SilkS) (width 0.15)) 20 | (fp_line (start 13 15.5) (end 13 15) (layer F.SilkS) (width 0.15)) 21 | (fp_line (start 11 15.5) (end 13 15.5) (layer F.SilkS) (width 0.15)) 22 | (fp_line (start 0 15.5) (end 2 15.5) (layer F.SilkS) (width 0.15)) 23 | (fp_line (start 0 15) (end 0 15.5) (layer F.SilkS) (width 0.15)) 24 | (fp_line (start 13 -3.5) (end 13 -1) (layer F.SilkS) (width 0.15)) 25 | (fp_line (start 0 -3.5) (end 13 -3.5) (layer F.SilkS) (width 0.15)) 26 | (fp_line (start 0 -1) (end 0 -3.5) (layer F.SilkS) (width 0.15)) 27 | (fp_line (start 3 12.5) (end 10 5.5) (layer F.Fab) (width 0.12)) 28 | (fp_line (start 3 5.5) (end 10 12.5) (layer F.Fab) (width 0.12)) 29 | (pad 1 smd rect (at 0 0) (size 2.1 0.7) (drill (offset -0.3 0)) (layers F.Cu F.Paste F.Mask)) 30 | (pad 2 smd rect (at 0 1) (size 2.1 0.7) (drill (offset -0.3 0)) (layers F.Cu F.Paste F.Mask)) 31 | (pad 3 smd rect (at 0 2) (size 2.1 0.7) (drill (offset -0.3 0)) (layers F.Cu F.Paste F.Mask)) 32 | (pad 4 smd rect (at 0 3) (size 2.1 0.7) (drill (offset -0.3 0)) (layers F.Cu F.Paste F.Mask)) 33 | (pad 5 smd rect (at 0 4) (size 2.1 0.7) (drill (offset -0.3 0)) (layers F.Cu F.Paste F.Mask)) 34 | (pad 6 smd rect (at 0 5) (size 2.1 0.7) (drill (offset -0.3 0)) (layers F.Cu F.Paste F.Mask)) 35 | (pad 7 smd rect (at 0 6) (size 2.1 0.7) (drill (offset -0.3 0)) (layers F.Cu F.Paste F.Mask)) 36 | (pad 8 smd rect (at 0 7) (size 2.1 0.7) (drill (offset -0.3 0)) (layers F.Cu F.Paste F.Mask)) 37 | (pad 9 smd rect (at 0 8) (size 2.1 0.7) (drill (offset -0.3 0)) (layers F.Cu F.Paste F.Mask)) 38 | (pad 10 smd rect (at 0 9) (size 2.1 0.7) (drill (offset -0.3 0)) (layers F.Cu F.Paste F.Mask)) 39 | (pad 11 smd rect (at 0 10) (size 2.1 0.7) (drill (offset -0.3 0)) (layers F.Cu F.Paste F.Mask)) 40 | (pad 12 smd rect (at 0 11) (size 2.1 0.7) (drill (offset -0.3 0)) (layers F.Cu F.Paste F.Mask)) 41 | (pad 13 smd rect (at 0 12) (size 2.1 0.7) (drill (offset -0.3 0)) (layers F.Cu F.Paste F.Mask)) 42 | (pad 14 smd rect (at 0 13) (size 2.1 0.7) (drill (offset -0.3 0)) (layers F.Cu F.Paste F.Mask)) 43 | (pad 15 smd rect (at 0 14) (size 2.1 0.7) (drill (offset -0.3 0)) (layers F.Cu F.Paste F.Mask)) 44 | (pad 16 smd rect (at 3 15.5) (size 0.7 2.1) (drill (offset 0 0.3)) (layers F.Cu F.Paste F.Mask)) 45 | (pad 17 smd rect (at 4 15.5) (size 0.7 2.1) (drill (offset 0 0.3)) (layers F.Cu F.Paste F.Mask)) 46 | (pad 18 smd rect (at 5 15.5) (size 0.7 2.1) (drill (offset 0 0.3)) (layers F.Cu F.Paste F.Mask)) 47 | (pad 19 smd rect (at 6 15.5) (size 0.7 2.1) (drill (offset 0 0.3)) (layers F.Cu F.Paste F.Mask)) 48 | (pad 20 smd rect (at 7 15.5) (size 0.7 2.1) (drill (offset 0 0.3)) (layers F.Cu F.Paste F.Mask)) 49 | (pad 21 smd rect (at 8 15.5) (size 0.7 2.1) (drill (offset 0 0.3)) (layers F.Cu F.Paste F.Mask)) 50 | (pad 22 smd rect (at 9 15.5) (size 0.7 2.1) (drill (offset 0 0.3)) (layers F.Cu F.Paste F.Mask)) 51 | (pad 23 smd rect (at 10 15.5) (size 0.7 2.1) (drill (offset 0 0.3)) (layers F.Cu F.Paste F.Mask)) 52 | (pad 24 smd rect (at 13 14) (size 2.1 0.7) (drill (offset 0.3 0)) (layers F.Cu F.Paste F.Mask)) 53 | (pad 25 smd rect (at 13 13) (size 2.1 0.7) (drill (offset 0.3 0)) (layers F.Cu F.Paste F.Mask)) 54 | (pad 26 smd rect (at 13 12) (size 2.1 0.7) (drill (offset 0.3 0)) (layers F.Cu F.Paste F.Mask)) 55 | (pad 27 smd rect (at 13 11) (size 2.1 0.7) (drill (offset 0.3 0)) (layers F.Cu F.Paste F.Mask)) 56 | (pad 28 smd rect (at 13 10) (size 2.1 0.7) (drill (offset 0.3 0)) (layers F.Cu F.Paste F.Mask)) 57 | (pad 29 smd rect (at 13 9) (size 2.1 0.7) (drill (offset 0.3 0)) (layers F.Cu F.Paste F.Mask)) 58 | (pad 30 smd rect (at 13 8) (size 2.1 0.7) (drill (offset 0.3 0)) (layers F.Cu F.Paste F.Mask)) 59 | (pad 31 smd rect (at 13 7) (size 2.1 0.7) (drill (offset 0.3 0)) (layers F.Cu F.Paste F.Mask)) 60 | (pad 32 smd rect (at 13 6) (size 2.1 0.7) (drill (offset 0.3 0)) (layers F.Cu F.Paste F.Mask)) 61 | (pad 33 smd rect (at 13 5) (size 2.1 0.7) (drill (offset 0.3 0)) (layers F.Cu F.Paste F.Mask)) 62 | (pad 34 smd rect (at 13 4) (size 2.1 0.7) (drill (offset 0.3 0)) (layers F.Cu F.Paste F.Mask)) 63 | (pad 35 smd rect (at 13 3) (size 2.1 0.7) (drill (offset 0.3 0)) (layers F.Cu F.Paste F.Mask)) 64 | (pad 36 smd rect (at 13 2) (size 2.1 0.7) (drill (offset 0.3 0)) (layers F.Cu F.Paste F.Mask)) 65 | (pad 37 smd rect (at 13 1) (size 2.1 0.7) (drill (offset 0.3 0)) (layers F.Cu F.Paste F.Mask)) 66 | (pad 38 smd rect (at 13 0) (size 2.1 0.7) (drill (offset 0.3 0)) (layers F.Cu F.Paste F.Mask)) 67 | (model ${KIPRJMOD}/../lib/lilygo_micro32.3dshapes/ap-700.stp 68 | (offset (xyz 6.5 -15.55 1)) 69 | (scale (xyz 1 1 1)) 70 | (rotate (xyz 0 0 0)) 71 | ) 72 | ) 73 | -------------------------------------------------------------------------------- /firmware/lib/tlv/src/Tlv493d.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Tlv493d.h - Library for Arduino to control the TLV493D-A1B6 3D magnetic sensor. 3 | * 4 | * The 3D magnetic sensor TLV493D-A1B6 offers accurate three dimensional sensing with extremely low power consumption 5 | * in a small 6-pin package. With an opportunity to detect the magnetic field in x, y, and z-direction the sensor is 6 | * ideally suited for the measurement of 3D movements, linear movements and rotation movements. 7 | * 8 | * Have a look at the application note/reference manual for more information. 9 | * 10 | * Copyright (c) 2018 Infineon Technologies AG 11 | * 12 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 13 | * following conditions are met: 14 | * 15 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following 16 | * disclaimer. 17 | * 18 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following 19 | * disclaimer in the documentation and/or other materials provided with the distribution. 20 | * 21 | * Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote 22 | * products derived from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 25 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 27 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef TLV493D_H_INCLUDED 34 | #define TLV493D_H_INCLUDED 35 | 36 | 37 | #include 38 | #include 39 | #include "./util/BusInterface.h" 40 | #include "./util/Tlv493d_conf.h" 41 | 42 | typedef enum Tlv493d_Address 43 | { 44 | TLV493D_ADDRESS1 = 0x5E, 45 | TLV493D_ADDRESS2 = 0x1F 46 | }Tlv493d_Address_t; 47 | 48 | 49 | typedef enum Tlv493d_Error 50 | { 51 | TLV493D_NO_ERROR = 0, 52 | TLV493D_BUS_ERROR = 1, 53 | TLV493D_FRAME_ERROR = 2 54 | }Tlv493d_Error_t; 55 | 56 | 57 | /* 58 | * TLV493D_ACCELERATE_READOUT lets the controller just read out the first 3 bytes when in fast mode. 59 | * This makes the readout faster (half of usual transfer duration), but there is no way to get 60 | * temperature, current channel or high precision (only 8 instead of 12 bits for x, y, z) 61 | * It is necessary for slow I2C busses to read the last result before the new measurement is completed. 62 | * It only takes effect in FASTMODE, not in other modes. 63 | * 64 | * Feel free to undefine this and increase your I2C bus speed if you need to. 65 | */ 66 | // SBEZEK 67 | // #define TLV493D_ACCELERATE_READOUT 68 | 69 | 70 | class Tlv493d 71 | { 72 | public: 73 | 74 | Tlv493d(void); 75 | ~Tlv493d(void); 76 | void begin(void); 77 | void begin(TwoWire &bus); 78 | void begin(TwoWire &bus, Tlv493d_Address_t slaveAddress, bool reset); 79 | void end(void); 80 | 81 | // sensor configuration 82 | /* sets the data access mode for TLE493D 83 | * Tle493d is initially in POWERDOWNMODE 84 | * use POWERDOWNMODE for rare and infrequent measurements 85 | * Tle493d will automatically switch to MASTERCONTROLLEDMODE for one measurement if on a readout 86 | * measurements are quite slow in this mode. The power consumption is very low between measurements. 87 | * use MASTERCONTROLLEDMODE for low measurement frequencies where results do not have to be up-to-date 88 | * In this mode a new measurement starts directly after the last result has been read out. 89 | * use LOWPOWERMODE and ULTRALOWPOWERMODE for continuous measurements 90 | * each readout returns the latest measurement results 91 | * use FASTMODE for for continuous measurements on high frequencies 92 | * measurement time might be higher than the time necessary for I2C-readouts in this mode. 93 | * Note: Thus, this mode requires a non-standard 1MHz I2C clock to be used to read the data fast enough. 94 | */ 95 | enum AccessMode_e 96 | { 97 | POWERDOWNMODE = 0, 98 | FASTMODE, 99 | LOWPOWERMODE, 100 | ULTRALOWPOWERMODE, 101 | MASTERCONTROLLEDMODE, 102 | }; 103 | bool setAccessMode(AccessMode_e mode); 104 | // interrupt is disabled by default 105 | // it is recommended for FASTMODE, LOWPOWERMODE and ULTRALOWPOWERMODE 106 | // the interrupt is indicated with a short(1.5 us) low pulse on SCL 107 | // you need to capture and react(read the new results) to it by yourself 108 | void enableInterrupt(void); 109 | void disableInterrupt(void); 110 | // temperature measurement is enabled by default 111 | // it can be disabled to reduce power consumption 112 | void enableTemp(void); 113 | void disableTemp(void); 114 | 115 | // returns the recommended time between two readouts for the sensor's current configuration 116 | uint16_t getMeasurementDelay(void); 117 | // read measurement results from sensor 118 | Tlv493d_Error_t updateData(void); 119 | 120 | // fieldvector in Cartesian coordinates 121 | float getX(void); 122 | float getY(void); 123 | float getZ(void); 124 | 125 | // fieldvector in spherical coordinates 126 | float getAmount(void); 127 | float getAzimuth(void); 128 | float getPolar(void); 129 | 130 | // temperature 131 | float getTemp(void); 132 | 133 | // SBEZEK 134 | uint8_t getExpectedFrameCount(void); 135 | 136 | private: 137 | tlv493d::BusInterface_t mInterface; 138 | AccessMode_e mMode; 139 | int16_t mXdata; 140 | int16_t mYdata; 141 | int16_t mZdata; 142 | int16_t mTempdata; 143 | uint8_t mExpectedFrameCount; 144 | 145 | 146 | void resetSensor(uint8_t adr); 147 | void setRegBits(uint8_t regMaskIndex, uint8_t data); 148 | uint8_t getRegBits(uint8_t regMaskIndex); 149 | void calcParity(void); 150 | int16_t concatResults(uint8_t upperByte, uint8_t lowerByte, bool upperFull); 151 | }; 152 | 153 | #endif /* TLV493D_H_INCLUDED */ 154 | -------------------------------------------------------------------------------- /firmware/lib/tlv/README.md: -------------------------------------------------------------------------------- 1 | # TLV493D-A1B6-3DMagnetic-Sensor 2 | 3 | [![Build Status](https://travis-ci.org/Infineon/TLV493D-A1B6-3DMagnetic-Sensor.svg?branch=master)](https://travis-ci.org/Infineon/TLV493D-A1B6-3DMagnetic-Sensor) 4 | 5 | 6 | 7 | Library of Infineon's [TLV493D-A1B6 3D magnetic sensor](https://www.infineon.com/cms/en/product/sensor/magnetic-sensors/magnetic-position-sensors/3d-magnetics/tlv493d-a1b6/) for Arduino. 8 | 9 | ## Summary 10 | The 3D magnetic sensor TLV493D-A1B6 offers accurate three-dimensional sensing with extremely low power consumption in a small 6-pin package. With its magnetic field detection in x, y, and z-direction the sensor reliably measures three-dimensional, linear and rotation movements. Applications include joysticks, control elements (white goods, multifunction knops), or electric meters (anti tampering) and any other application that requires accurate angular measurements or low power consumptions. 11 | The integrated temperature sensor can furthermore be used for plausibility checks. 12 | 13 | Key features are 3D magnetic sensing with a very low power consumption during operations. The sensor has a digital output via 2-wire based standard I2C interface up to 1 MBit/sec and 12 bit data resolution for each measurement direction (Bx, By and Bz linear field measurement up to +-130mT). 14 | 15 | ## Key Features and Benefits 16 | * Integrated temperature sensing 17 | * Low current consumption of 0.007 µA in power down mode and 10 µA in ultra low power mode 18 | * 2.7 to 3.5 V operating supply voltage 19 | * Digital output via 2-wire standard I2C interface 20 | * Bx, By and Bz linear field measurement up to ±130 mT 21 | * 12-bit data resolution for each measurement direction 22 | * Resolution 98 µT/LSB 23 | * Operating temperature range from -40 °C to 125 °C 24 | * [GUI](https://www.infineon.com/dgdl/Infineon-Software-for-3D-Magnetic-Sensor-2Go%20incl.%20out-of-shaft_05_06-SW-v05_06-EN.zip?fileId=5546d4626102d35a01614626f9644e4e) for free download as well as integration in Arduino IDE with this repository 25 | 26 | ## Installation 27 | 28 | ### Integration of Library 29 | Please download this repository from GitHub by clicking on the following field in the [releases](https://github.com/Infineon/TLV493D-A1B6-3DMagnetic-Sensor/releases) of this repository. 30 | 31 | ![Download Library](https://raw.githubusercontent.com/infineon/assets/master/Pictures/Releases_Generic.jpg) 32 | 33 | To install the 3D magnetic sensor 2GO library in the Arduino IDE, please go now to **Sketch** > **Include Library** > **Add .ZIP Library...** in the Arduino IDE and navigate to the downloaded .ZIP file of this repository. The library will be installed in your Arduino sketch folder in libraries and you can select as well as include this one to your project under **Sketch** > **Include Library** > **TLV493D-A1B6**. 34 | 35 | ![Install Library](https://raw.githubusercontent.com/infineon/assets/master/Pictures/Library_Install_ZIP.png) 36 | 37 | ## Usage 38 | Please see the example sketches in the `/examples` directory in this library to learn more about the usage of the library. 39 | 40 | Currently, there exist two separate evaluation boards: 41 | 42 | * [TLV493D-A1B6 MS2GO](https://www.infineon.com/cms/de/product/evaluation-boards/tlv493d-a1b6-ms2go/) 43 | * [TLV493D-A1B6 3DMagnetic Shield2Go](https://www.infineon.com/cms/en/product/evaluation-boards/s2go_3d-sense_tlv493d/) 44 | 45 | ### Usage with TLV493D-A1B6 MS2GO 46 | The 3D Magnetic Sensor 2GO is an evaluation board equipped with the magnetic sensor [TLV493D-A1B6](https://www.infineon.com/cms/en/product/evaluation-boards/tlv493d-a1b6-ms2go/) for three dimensional measurement combined with an ARM® Cortex™-M0 CPU. The 3D Magnetic Sensor 2GO has a complete set of on-board devices, including an on-board debugger. A PDF summarizing the features and layout of the 3D magnetic sensor 2GO board is stored on the Infineon homepage [here](https://www.infineon.com/dgdl/Infineon-3D-Magnetic-Sensor_EvalKit_UM-UM-v01_01-EN.pdf?fileId=5546d462525dbac40152ac4ca1d318c2). 47 | 48 | Please note that base of the Sensors 2GO is the XMC 2Go from Infineon. Therefore, please install (if not already done) also the [XMC-for-Arduino](https://github.com/Infineon/XMC-for-Arduino) implementation and choose afterwards **XMC1100 XMC2Go** from the **Tools**>**Board** menu in the Arduino IDE if working with this evaluation board. 49 | 50 | ### TLV493D-A1B6 3DSense Shield2Go 51 | The TLV493D-A1B6 3DMagnetic Shield2Go is a standalone break out board with Infineon's Shield2Go formfactor and pin out. You can connect it easily to any microcontroller of your choice which is Arduino compatible and has 3.3V logic level (please note that the Arduino UNO has 5V logic level and cannot be used without level shifting). 52 | 53 | * [Link](https://github.com/Infineon/TLV493D-A1B6-3DMagnetic-Sensor/wiki) to the wiki with more information 54 | 55 | However, every Shield2Go is directly compatible with Infineon's XMC2Go and the recommended quick start is to use an XMC2Go for evaluation. Therefore, please install (if not already done) also the [XMC-for-Arduino](https://github.com/Infineon/XMC-for-Arduino) implementation and choose afterwards **XMC1100 XMC2Go** from the **Tools**>**Board** menu in the Arduino IDE if working with this evaluation board. To use it, please plug the TLV493D-A1B6 3DMagnetic Shield2Go onto the XMC2Go as shown below. 56 | 57 | 58 | 59 | ## Processing 60 | This library supports the open-source software [Processing](https://processing.org/) for creating GUIs. It allows you to connect your evaluation board to a PC over serial communication and visualisation of the embedded system. Find out more on the Arduino homepage [here](http://playground.arduino.cc/Interfacing/Processing). The respective files are stored in the /processing folder of this repository. 61 | 62 | ## Printables 63 | The TLx493D 3D magnetic sensor family has additional tools which can be directly mounted on top of the evaluation boards. The 3D print data of the [joystick](https://www.infineon.com/cms/en/product/promopages/sensors-2go/#Add-ons-3D-Magnetic-2GO), the [rotate knob](https://www.infineon.com/cms/en/product/promopages/sensors-2go/#Add-ons-3D-Magnetic-2GO) and the [linear slider](https://www.infineon.com/cms/en/product/promopages/sensors-2go/#Add-ons-3D-Magnetic-2GO) can be found in the folder `printables`. 64 | 65 | 66 | 67 | ## Board Information, Datasheet and Additional Information 68 | 69 | The datasheet for the TLV493D-A1B6 can be found here [TLV493D-A1B6 Datasheet](https://www.infineon.com/dgdl/Infineon-TLV493D-A1B6-DS-v01_00-EN.pdf?fileId=5546d462525dbac40152a6b85c760e80) while respective application notes are located here [Application Notes](https://www.infineon.com/dgdl/Infineon-TLV493D-A1B6_3DMagnetic-UM-v01_03-EN.pdf?fileId=5546d46261d5e6820161e75721903ddd). 70 | 71 | Please check the [wiki](https://github.com/Infineon/TLV493D-A1B6-3DMagnetic-Sensor/wiki) with more information for the TLV493D-A1B6 3DSense Shield2Go as well. 72 | 73 | -------------------------------------------------------------------------------- /electronics/lib/Modified.pretty/CP_Radial_D5.0mm_P2.00mm_HorizontalCutout.kicad_mod: -------------------------------------------------------------------------------- 1 | (module CP_Radial_D5.0mm_P2.00mm_HorizontalCutout (layer F.Cu) (tedit 61FE1CC0) 2 | (descr "CP, Radial series, Radial, pin pitch=2.00mm, , diameter=5mm, Electrolytic Capacitor") 3 | (tags "CP Radial series Radial pin pitch 2.00mm diameter 5mm Electrolytic Capacitor") 4 | (fp_text reference REF** (at -3.25 -4 90) (layer F.SilkS) 5 | (effects (font (size 1 1) (thickness 0.15))) 6 | ) 7 | (fp_text value CP_Radial_D5.0mm_P2.00mm_HorizontalCutout (at 1 3.75) (layer F.Fab) 8 | (effects (font (size 1 1) (thickness 0.15))) 9 | ) 10 | (fp_line (start -2.5 -14.75) (end -2.5 -2.25) (layer Edge.Cuts) (width 0.12)) 11 | (fp_line (start 3.75 -15.5) (end -1.75 -15.5) (layer Edge.Cuts) (width 0.12)) 12 | (fp_line (start 4.5 -2.25) (end 4.5 -14.75) (layer Edge.Cuts) (width 0.12)) 13 | (fp_line (start -1.75 -1.5) (end 3.75 -1.5) (layer Edge.Cuts) (width 0.12)) 14 | (fp_circle (center 1 0) (end 3.5 0) (layer F.Fab) (width 0.1)) 15 | (fp_circle (center 1 0) (end 3.75 0) (layer F.CrtYd) (width 0.05)) 16 | (fp_line (start -1.133605 -1.0875) (end -0.633605 -1.0875) (layer F.Fab) (width 0.1)) 17 | (fp_line (start -0.883605 -1.3375) (end -0.883605 -0.8375) (layer F.Fab) (width 0.1)) 18 | (fp_line (start 1 1.04) (end 1 2.58) (layer F.SilkS) (width 0.12)) 19 | (fp_line (start 1.04 1.04) (end 1.04 2.58) (layer F.SilkS) (width 0.12)) 20 | (fp_line (start 1.08 1.04) (end 1.08 2.579) (layer F.SilkS) (width 0.12)) 21 | (fp_line (start 1.12 1.04) (end 1.12 2.578) (layer F.SilkS) (width 0.12)) 22 | (fp_line (start 1.16 1.04) (end 1.16 2.576) (layer F.SilkS) (width 0.12)) 23 | (fp_line (start 1.2 1.04) (end 1.2 2.573) (layer F.SilkS) (width 0.12)) 24 | (fp_line (start 1.24 1.04) (end 1.24 2.569) (layer F.SilkS) (width 0.12)) 25 | (fp_line (start 1.28 1.04) (end 1.28 2.565) (layer F.SilkS) (width 0.12)) 26 | (fp_line (start 1.32 1.04) (end 1.32 2.561) (layer F.SilkS) (width 0.12)) 27 | (fp_line (start 1.36 1.04) (end 1.36 2.556) (layer F.SilkS) (width 0.12)) 28 | (fp_line (start 1.4 1.04) (end 1.4 2.55) (layer F.SilkS) (width 0.12)) 29 | (fp_line (start 1.44 1.04) (end 1.44 2.543) (layer F.SilkS) (width 0.12)) 30 | (fp_line (start 1.48 1.04) (end 1.48 2.536) (layer F.SilkS) (width 0.12)) 31 | (fp_line (start 1.52 1.04) (end 1.52 2.528) (layer F.SilkS) (width 0.12)) 32 | (fp_line (start 1.56 1.04) (end 1.56 2.52) (layer F.SilkS) (width 0.12)) 33 | (fp_line (start 1.6 1.04) (end 1.6 2.511) (layer F.SilkS) (width 0.12)) 34 | (fp_line (start 1.64 1.04) (end 1.64 2.501) (layer F.SilkS) (width 0.12)) 35 | (fp_line (start 1.68 1.04) (end 1.68 2.491) (layer F.SilkS) (width 0.12)) 36 | (fp_line (start 1.721 1.04) (end 1.721 2.48) (layer F.SilkS) (width 0.12)) 37 | (fp_line (start 1.761 1.04) (end 1.761 2.468) (layer F.SilkS) (width 0.12)) 38 | (fp_line (start 1.801 1.04) (end 1.801 2.455) (layer F.SilkS) (width 0.12)) 39 | (fp_line (start 1.841 1.04) (end 1.841 2.442) (layer F.SilkS) (width 0.12)) 40 | (fp_line (start 1.881 1.04) (end 1.881 2.428) (layer F.SilkS) (width 0.12)) 41 | (fp_line (start 1.921 1.04) (end 1.921 2.414) (layer F.SilkS) (width 0.12)) 42 | (fp_line (start 1.961 1.04) (end 1.961 2.398) (layer F.SilkS) (width 0.12)) 43 | (fp_line (start 2.001 1.04) (end 2.001 2.382) (layer F.SilkS) (width 0.12)) 44 | (fp_line (start 2.041 1.04) (end 2.041 2.365) (layer F.SilkS) (width 0.12)) 45 | (fp_line (start 2.081 1.04) (end 2.081 2.348) (layer F.SilkS) (width 0.12)) 46 | (fp_line (start 2.121 1.04) (end 2.121 2.329) (layer F.SilkS) (width 0.12)) 47 | (fp_line (start 2.161 1.04) (end 2.161 2.31) (layer F.SilkS) (width 0.12)) 48 | (fp_line (start 2.201 1.04) (end 2.201 2.29) (layer F.SilkS) (width 0.12)) 49 | (fp_line (start 2.241 1.04) (end 2.241 2.268) (layer F.SilkS) (width 0.12)) 50 | (fp_line (start 2.281 1.04) (end 2.281 2.247) (layer F.SilkS) (width 0.12)) 51 | (fp_line (start 2.321 1.04) (end 2.321 2.224) (layer F.SilkS) (width 0.12)) 52 | (fp_line (start 2.361 1.04) (end 2.361 2.2) (layer F.SilkS) (width 0.12)) 53 | (fp_line (start 2.401 1.04) (end 2.401 2.175) (layer F.SilkS) (width 0.12)) 54 | (fp_line (start 2.441 1.04) (end 2.441 2.149) (layer F.SilkS) (width 0.12)) 55 | (fp_line (start 2.481 1.04) (end 2.481 2.122) (layer F.SilkS) (width 0.12)) 56 | (fp_line (start 2.521 1.04) (end 2.521 2.095) (layer F.SilkS) (width 0.12)) 57 | (fp_line (start 2.561 1.04) (end 2.561 2.065) (layer F.SilkS) (width 0.12)) 58 | (fp_line (start 2.601 1.04) (end 2.601 2.035) (layer F.SilkS) (width 0.12)) 59 | (fp_line (start 2.641 1.04) (end 2.641 2.004) (layer F.SilkS) (width 0.12)) 60 | (fp_line (start 2.681 1.04) (end 2.681 1.971) (layer F.SilkS) (width 0.12)) 61 | (fp_line (start 2.721 1.04) (end 2.721 1.937) (layer F.SilkS) (width 0.12)) 62 | (fp_line (start 2.761 1.04) (end 2.761 1.901) (layer F.SilkS) (width 0.12)) 63 | (fp_line (start 2.801 1.04) (end 2.801 1.864) (layer F.SilkS) (width 0.12)) 64 | (fp_line (start 2.841 1.04) (end 2.841 1.826) (layer F.SilkS) (width 0.12)) 65 | (fp_line (start 2.881 1.04) (end 2.881 1.785) (layer F.SilkS) (width 0.12)) 66 | (fp_line (start 2.921 1.04) (end 2.921 1.743) (layer F.SilkS) (width 0.12)) 67 | (fp_line (start 2.961 1.04) (end 2.961 1.699) (layer F.SilkS) (width 0.12)) 68 | (fp_line (start 3.001 1.04) (end 3.001 1.653) (layer F.SilkS) (width 0.12)) 69 | (fp_line (start 3.041 -1.5) (end 3.041 1.605) (layer F.SilkS) (width 0.12)) 70 | (fp_line (start 3.081 -1.5) (end 3.081 1.554) (layer F.SilkS) (width 0.12)) 71 | (fp_line (start 3.121 -1.5) (end 3.121 1.5) (layer F.SilkS) (width 0.12)) 72 | (fp_line (start 3.161 -1.443) (end 3.161 1.443) (layer F.SilkS) (width 0.12)) 73 | (fp_line (start 3.201 -1.383) (end 3.201 1.383) (layer F.SilkS) (width 0.12)) 74 | (fp_line (start 3.241 -1.319) (end 3.241 1.319) (layer F.SilkS) (width 0.12)) 75 | (fp_line (start 3.281 -1.251) (end 3.281 1.251) (layer F.SilkS) (width 0.12)) 76 | (fp_line (start 3.321 -1.178) (end 3.321 1.178) (layer F.SilkS) (width 0.12)) 77 | (fp_line (start 3.361 -1.098) (end 3.361 1.098) (layer F.SilkS) (width 0.12)) 78 | (fp_line (start 3.401 -1.011) (end 3.401 1.011) (layer F.SilkS) (width 0.12)) 79 | (fp_line (start 3.441 -0.915) (end 3.441 0.915) (layer F.SilkS) (width 0.12)) 80 | (fp_line (start 3.481 -0.805) (end 3.481 0.805) (layer F.SilkS) (width 0.12)) 81 | (fp_line (start 3.521 -0.677) (end 3.521 0.677) (layer F.SilkS) (width 0.12)) 82 | (fp_line (start 3.561 -0.518) (end 3.561 0.518) (layer F.SilkS) (width 0.12)) 83 | (fp_line (start 3.601 -0.284) (end 3.601 0.284) (layer F.SilkS) (width 0.12)) 84 | (fp_arc (start 1 0) (end -1.15 -1.499999) (angle -249.8) (layer F.SilkS) (width 0.15)) 85 | (fp_text user %R (at 1 0) (layer F.Fab) 86 | (effects (font (size 1 1) (thickness 0.15))) 87 | ) 88 | (fp_arc (start -1.75 -14.75) (end -1.75 -15.5) (angle -90) (layer Edge.Cuts) (width 0.12)) 89 | (fp_arc (start 3.75 -14.75) (end 4.5 -14.75) (angle -90) (layer Edge.Cuts) (width 0.12)) 90 | (fp_arc (start 3.75 -2.25) (end 3.75 -1.5) (angle -90) (layer Edge.Cuts) (width 0.12)) 91 | (fp_arc (start -1.75 -2.25) (end -2.5 -2.25) (angle -90) (layer Edge.Cuts) (width 0.12)) 92 | (pad 2 thru_hole circle (at 2 0) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask)) 93 | (pad 1 thru_hole rect (at 0 0) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask)) 94 | (model ${KISYS3DMOD}/Capacitor_THT.3dshapes/CP_Radial_D5.0mm_P2.00mm.wrl 95 | (at (xyz 0 0 0)) 96 | (scale (xyz 1 1 1)) 97 | (rotate (xyz 0 0 0)) 98 | ) 99 | ) 100 | -------------------------------------------------------------------------------- /electronics/LevelShifterBreakout/LevelShifterBreakout.sch: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 4 2 | EELAYER 30 0 3 | EELAYER END 4 | $Descr A4 11693 8268 5 | encoding utf-8 6 | Sheet 1 1 7 | Title "" 8 | Date "" 9 | Rev "" 10 | Comp "" 11 | Comment1 "" 12 | Comment2 "" 13 | Comment3 "" 14 | Comment4 "" 15 | $EndDescr 16 | $Comp 17 | L SN74AVC4T774:SN74AVC4T774RSVR U1 18 | U 1 1 61B8BFB7 19 | P 3600 2650 20 | F 0 "U1" H 4150 2915 50 0000 C CNN 21 | F 1 "SN74AVC4T774RSVR" H 4150 2824 50 0000 C CNN 22 | F 2 "SN74AVC4T774:Texas_Instruments-RSV_R-PUQFN-N16-0-0-0" H 3600 3050 50 0001 L CNN 23 | F 3 "http://www.ti.com/lit/ds/symlink/sn74avc4t774.pdf" H 3600 3150 50 0001 L CNN 24 | F 4 "380Mbps" H 3600 3250 50 0001 L CNN "Data Rate" 25 | F 5 "1.2V ~ 3.6V" H 3600 3350 50 0001 L CNN "Voltage - VCCA" 26 | F 6 "1.2V ~ 3.6V" H 3600 3450 50 0001 L CNN "Voltage - VCCB" 27 | F 7 "IC" H 3600 3550 50 0001 L CNN "category" 28 | F 8 "Voltage Level Translator Bidirectional 1 Circuit 4 Channel 380Mbps 16-UQFN (2.6x1.8)" H 3600 3650 50 0001 L CNN "digikey description" 29 | F 9 "296-24741-1-ND" H 3600 3750 50 0001 L CNN "digikey part number" 30 | F 10 "yes" H 3600 3850 50 0001 L CNN "lead free" 31 | F 11 "e3c229e32d4c5fe7" H 3600 3950 50 0001 L CNN "library id" 32 | F 12 "Texas Instruments" H 3600 4050 50 0001 L CNN "manufacturer" 33 | F 13 "595-SN74AVC4T774RSVR" H 3600 4150 50 0001 L CNN "mouser part number" 34 | F 14 "16-UFQFN" H 3600 4250 50 0001 L CNN "package" 35 | F 15 "yes" H 3600 4350 50 0001 L CNN "rohs" 36 | F 16 "+85°C" H 3600 4450 50 0001 L CNN "temperature range high" 37 | F 17 "-40°C" H 3600 4550 50 0001 L CNN "temperature range low" 38 | 1 3600 2650 39 | 1 0 0 -1 40 | $EndComp 41 | Wire Wire Line 42 | 3700 2650 3000 2650 43 | Wire Wire Line 44 | 3700 2750 3000 2750 45 | Wire Wire Line 46 | 3700 2950 3000 2950 47 | Wire Wire Line 48 | 3700 3050 3000 3050 49 | Wire Wire Line 50 | 3700 3150 3000 3150 51 | Wire Wire Line 52 | 3700 3250 3000 3250 53 | Wire Wire Line 54 | 3700 3450 3000 3450 55 | Wire Wire Line 56 | 3700 3550 3000 3550 57 | Wire Wire Line 58 | 3700 3650 3000 3650 59 | Wire Wire Line 60 | 3700 3750 3000 3750 61 | Wire Wire Line 62 | 5300 2650 4600 2650 63 | Wire Wire Line 64 | 5300 2750 4600 2750 65 | Wire Wire Line 66 | 5300 2850 4600 2850 67 | Wire Wire Line 68 | 5300 2950 4600 2950 69 | Wire Wire Line 70 | 3700 3950 3000 3950 71 | Text Label 3000 2650 0 50 ~ 0 72 | VCCA 73 | Text Label 3000 2750 0 50 ~ 0 74 | VCCB 75 | Text Label 3000 2950 0 50 ~ 0 76 | A1 77 | Text Label 3000 3050 0 50 ~ 0 78 | A2 79 | Text Label 3000 3150 0 50 ~ 0 80 | A3 81 | Text Label 3000 3250 0 50 ~ 0 82 | A4 83 | Text Label 3000 3450 0 50 ~ 0 84 | DIR1 85 | Text Label 3000 3550 0 50 ~ 0 86 | DIR2 87 | Text Label 3000 3650 0 50 ~ 0 88 | DIR3 89 | Text Label 3000 3750 0 50 ~ 0 90 | DIR4 91 | Text Label 3000 3950 0 50 ~ 0 92 | nOE 93 | Text Label 5300 2650 2 50 ~ 0 94 | B1 95 | Text Label 5300 2750 2 50 ~ 0 96 | B2 97 | Text Label 5300 2850 2 50 ~ 0 98 | B3 99 | Text Label 5300 2950 2 50 ~ 0 100 | B4 101 | $Comp 102 | L Connector:Conn_01x08_Male J1 103 | U 1 1 61B8EE53 104 | P 3150 5300 105 | F 0 "J1" H 3258 5781 50 0000 C CNN 106 | F 1 "Conn_01x08_Male" H 3258 5690 50 0000 C CNN 107 | F 2 "Connector_PinHeader_2.54mm:PinHeader_1x08_P2.54mm_Vertical" H 3150 5300 50 0001 C CNN 108 | F 3 "~" H 3150 5300 50 0001 C CNN 109 | 1 3150 5300 110 | 1 0 0 -1 111 | $EndComp 112 | $Comp 113 | L Connector:Conn_01x08_Male J2 114 | U 1 1 61B90C78 115 | P 4300 5300 116 | F 0 "J2" H 4272 5274 50 0000 R CNN 117 | F 1 "Conn_01x08_Male" H 4272 5183 50 0000 R CNN 118 | F 2 "Connector_PinHeader_2.54mm:PinHeader_1x08_P2.54mm_Vertical" H 4300 5300 50 0001 C CNN 119 | F 3 "~" H 4300 5300 50 0001 C CNN 120 | 1 4300 5300 121 | -1 0 0 -1 122 | $EndComp 123 | Wire Wire Line 124 | 3350 5000 3600 5000 125 | Wire Wire Line 126 | 3350 5100 3600 5100 127 | Wire Wire Line 128 | 3350 5200 3600 5200 129 | Wire Wire Line 130 | 3350 5300 3600 5300 131 | Wire Wire Line 132 | 3350 5400 3600 5400 133 | Wire Wire Line 134 | 3350 5500 3600 5500 135 | Wire Wire Line 136 | 3350 5600 3600 5600 137 | Wire Wire Line 138 | 3350 5700 3600 5700 139 | Wire Wire Line 140 | 3850 5000 4100 5000 141 | Wire Wire Line 142 | 3850 5100 4100 5100 143 | Wire Wire Line 144 | 3850 5200 4100 5200 145 | Wire Wire Line 146 | 3850 5300 4100 5300 147 | Wire Wire Line 148 | 3850 5400 4100 5400 149 | Wire Wire Line 150 | 3850 5500 4100 5500 151 | Wire Wire Line 152 | 3850 5600 4100 5600 153 | Wire Wire Line 154 | 3850 5700 4100 5700 155 | Text Label 3600 5000 2 50 ~ 0 156 | VCCA 157 | Text Label 3600 5100 2 50 ~ 0 158 | A1 159 | Text Label 3600 5200 2 50 ~ 0 160 | A2 161 | Text Label 3600 5300 2 50 ~ 0 162 | A3 163 | Text Label 3600 5400 2 50 ~ 0 164 | A4 165 | Text Label 3600 5500 2 50 ~ 0 166 | DIR1 167 | Text Label 3600 5600 2 50 ~ 0 168 | DIR2 169 | Text Label 3600 5700 2 50 ~ 0 170 | nOE 171 | Text Label 3850 5000 0 50 ~ 0 172 | VCCB 173 | Text Label 3850 5100 0 50 ~ 0 174 | B1 175 | Text Label 3850 5200 0 50 ~ 0 176 | B2 177 | Text Label 3850 5300 0 50 ~ 0 178 | B3 179 | Text Label 3850 5400 0 50 ~ 0 180 | B4 181 | Text Label 3850 5500 0 50 ~ 0 182 | DIR3 183 | Text Label 3850 5600 0 50 ~ 0 184 | DIR4 185 | $Comp 186 | L Device:C_Small C1 187 | U 1 1 61B9E2DF 188 | P 1100 2350 189 | F 0 "C1" H 1192 2396 50 0000 L CNN 190 | F 1 "0.1uF" H 1192 2305 50 0000 L CNN 191 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder" H 1100 2350 50 0001 C CNN 192 | F 3 "~" H 1100 2350 50 0001 C CNN 193 | 1 1100 2350 194 | 1 0 0 -1 195 | $EndComp 196 | $Comp 197 | L Device:C_Small C2 198 | U 1 1 61B9E689 199 | P 1650 2350 200 | F 0 "C2" H 1742 2396 50 0000 L CNN 201 | F 1 "0.1uF" H 1742 2305 50 0000 L CNN 202 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder" H 1650 2350 50 0001 C CNN 203 | F 3 "~" H 1650 2350 50 0001 C CNN 204 | 1 1650 2350 205 | 1 0 0 -1 206 | $EndComp 207 | Text Label 850 2250 0 50 ~ 0 208 | VCCA 209 | Text Label 1400 2250 0 50 ~ 0 210 | VCCB 211 | Wire Wire Line 212 | 1100 2250 850 2250 213 | Wire Wire Line 214 | 1650 2250 1400 2250 215 | $Comp 216 | L power:GND #PWR0101 217 | U 1 1 61BA2A63 218 | P 1100 2550 219 | F 0 "#PWR0101" H 1100 2300 50 0001 C CNN 220 | F 1 "GND" H 1105 2377 50 0000 C CNN 221 | F 2 "" H 1100 2550 50 0001 C CNN 222 | F 3 "" H 1100 2550 50 0001 C CNN 223 | 1 1100 2550 224 | 1 0 0 -1 225 | $EndComp 226 | $Comp 227 | L power:GND #PWR0102 228 | U 1 1 61BA2CD6 229 | P 1650 2550 230 | F 0 "#PWR0102" H 1650 2300 50 0001 C CNN 231 | F 1 "GND" H 1655 2377 50 0000 C CNN 232 | F 2 "" H 1650 2550 50 0001 C CNN 233 | F 3 "" H 1650 2550 50 0001 C CNN 234 | 1 1650 2550 235 | 1 0 0 -1 236 | $EndComp 237 | Wire Wire Line 238 | 1100 2450 1100 2550 239 | Wire Wire Line 240 | 1650 2450 1650 2550 241 | $Comp 242 | L power:GND #PWR0103 243 | U 1 1 61BA58DF 244 | P 4700 4050 245 | F 0 "#PWR0103" H 4700 3800 50 0001 C CNN 246 | F 1 "GND" H 4705 3877 50 0000 C CNN 247 | F 2 "" H 4700 4050 50 0001 C CNN 248 | F 3 "" H 4700 4050 50 0001 C CNN 249 | 1 4700 4050 250 | 1 0 0 -1 251 | $EndComp 252 | Wire Wire Line 253 | 4600 3950 4700 3950 254 | Wire Wire Line 255 | 4700 3950 4700 4050 256 | $Comp 257 | L power:GND #PWR0104 258 | U 1 1 61BA6EDB 259 | P 3850 5700 260 | F 0 "#PWR0104" H 3850 5450 50 0001 C CNN 261 | F 1 "GND" H 3855 5527 50 0000 C CNN 262 | F 2 "" H 3850 5700 50 0001 C CNN 263 | F 3 "" H 3850 5700 50 0001 C CNN 264 | 1 3850 5700 265 | 1 0 0 -1 266 | $EndComp 267 | $EndSCHEMATC 268 | --------------------------------------------------------------------------------