├── .gitignore ├── LICENSE ├── Makefile ├── Makefile.include ├── README.md ├── assets ├── bolt.png ├── bolt.svg ├── external_thread.png ├── external_thread_l.png ├── infeed-dia-l.png ├── infeed-dia.png ├── infeed-st.png ├── internal_thread.png └── internal_thread.xcf ├── changelog.txt ├── docs ├── els.md └── images │ ├── boring-hole.png │ ├── boring-pocket.png │ ├── concave-ext-r.png │ ├── concave.png │ ├── convex-ext-l.png │ ├── convex-ext-r.png │ ├── convex.png │ ├── els.jpg │ ├── facing.png │ ├── functions.png │ ├── keypad.png │ ├── keypad.svg │ ├── knurling.png │ ├── manual-threading-l.png │ ├── manual-threading-r.png │ ├── manual-turning.png │ ├── parting.png │ ├── settings.png │ ├── taper-ext-l.png │ ├── taper-ext-r.png │ ├── taper-int.png │ ├── threading-ext-l.png │ ├── threading-ext.png │ ├── threading-int.png │ ├── turning-dro.png │ └── turning.png ├── hw ├── .gitignore ├── .tool-versions ├── buffer │ ├── buffer-cache.lib │ ├── buffer.kicad_pcb │ ├── buffer.kicad_pcb-bak │ ├── buffer.pro │ ├── buffer.sch │ ├── buffer.sch-bak │ ├── fp-info-cache │ └── gerber │ │ ├── buffer-B_Cu.gbr │ │ ├── buffer-B_Mask.gbr │ │ ├── buffer-Dwgs_User.gbr │ │ ├── buffer-Edge_Cuts.gbr │ │ ├── buffer-F_Cu.gbr │ │ ├── buffer-F_Mask.gbr │ │ ├── buffer-NPTH-drl.gbr │ │ ├── buffer-PTH-drl.gbr │ │ ├── buffer-job.gbrjob │ │ └── buffer.drl ├── demo-driver │ ├── demo-driver-cache.lib │ ├── demo-driver.kicad_pcb │ ├── demo-driver.kicad_pcb-bak │ ├── demo-driver.pro │ ├── demo-driver.sch │ ├── demo-driver.sch-bak │ ├── fp-info-cache │ └── gerber │ │ ├── demo-driver-B_Cu.gbr │ │ ├── demo-driver-B_Mask.gbr │ │ ├── demo-driver-B_Paste.gbr │ │ ├── demo-driver-B_SilkS.gbr │ │ ├── demo-driver-Edge_Cuts.gbr │ │ ├── demo-driver-F_Cu.gbr │ │ ├── demo-driver-F_Mask.gbr │ │ ├── demo-driver-F_Paste.gbr │ │ ├── demo-driver-F_SilkS.gbr │ │ ├── demo-driver-job.gbrjob │ │ └── demo-driver.drl ├── els │ ├── els-backups │ │ ├── els-2022-10-13_122106.zip │ │ └── els-2022-10-13_124146.zip │ ├── els-cache.lib │ ├── els-rescue.dcm │ ├── els-rescue.lib │ ├── els.kicad_pcb │ ├── els.kicad_pcb-bak │ ├── els.kicad_prl │ ├── els.kicad_pro │ ├── els.kicad_sch │ ├── els.pdf │ ├── els.pro │ ├── els.sch │ ├── els.sch-bak │ ├── fp-info-cache │ ├── gerber │ │ ├── els-B_Cu.gbr │ │ ├── els-B_Mask.gbr │ │ ├── els-B_Paste.gbr │ │ ├── els-B_SilkS.gbr │ │ ├── els-Edge_Cuts.gbr │ │ ├── els-F_Cu.gbr │ │ ├── els-F_Mask.gbr │ │ ├── els-F_Paste.gbr │ │ ├── els-F_SilkS.gbr │ │ ├── els-job.gbrjob │ │ └── els.drl │ └── sym-lib-table ├── lcd │ ├── fp-info-cache │ ├── gerber │ │ ├── lcd-B_Cu.gbr │ │ ├── lcd-B_Mask.gbr │ │ ├── lcd-B_Paste.gbr │ │ ├── lcd-B_SilkS.gbr │ │ ├── lcd-Edge_Cuts.gbr │ │ ├── lcd-F_Cu.gbr │ │ ├── lcd-F_Mask.gbr │ │ ├── lcd-F_Paste.gbr │ │ ├── lcd-F_SilkS.gbr │ │ ├── lcd-job.gbrjob │ │ └── lcd.drl │ ├── lcd-cache.lib │ ├── lcd.kicad_pcb │ ├── lcd.kicad_pcb-bak │ ├── lcd.pro │ ├── lcd.sch │ └── lcd.sch-bak └── power-clamp │ ├── fp-info-cache │ ├── gerber │ ├── power-clamp-B_Cu.gbr │ ├── power-clamp-B_Mask.gbr │ ├── power-clamp-B_Paste.gbr │ ├── power-clamp-B_SilkS.gbr │ ├── power-clamp-Edge_Cuts.gbr │ ├── power-clamp-F_Cu.gbr │ ├── power-clamp-F_Mask.gbr │ ├── power-clamp-F_Paste.gbr │ ├── power-clamp-F_SilkS.gbr │ ├── power-clamp-job.gbrjob │ └── power-clamp.drl │ ├── power-clamp-cache.lib │ ├── power-clamp.kicad_pcb │ ├── power-clamp.kicad_pcb-bak │ ├── power-clamp.pro │ ├── power-clamp.sch │ └── power-clamp.sch-bak ├── jlink ├── flash.cmd └── reset.cmd ├── linker └── stm32f446re.ld ├── rules.mk ├── src ├── bitmaps │ ├── external_thread.c │ ├── external_thread_l.c │ ├── infeed_image.c │ └── internal_thread.c ├── bore_dimension.c ├── bore_dimension.h ├── bore_hole.c ├── bore_hole.h ├── clock.c ├── clock.h ├── concave_ext_r.c ├── concave_ext_r.h ├── config.c ├── config.h ├── constants.h ├── convex_ext_l.c ├── convex_ext_l.h ├── convex_ext_r.c ├── convex_ext_r.h ├── delay.c ├── delay.h ├── dro.c ├── dro.h ├── eeprom.c ├── eeprom.h ├── encoder.c ├── encoder.h ├── facing.c ├── facing.h ├── function.c ├── function.h ├── gpio.c ├── gpio.h ├── keypad.c ├── keypad.h ├── knurling.c ├── knurling.h ├── kv.c ├── kv.h ├── main.c ├── nvic.c ├── nvic.h ├── parting.c ├── parting.h ├── rcc_config.h ├── ringbuffer.c ├── ringbuffer.h ├── ringbuffer_token.c ├── ringbuffer_token.h ├── spindle.c ├── spindle.h ├── stepper.c ├── stepper.h ├── taper_ext_l.c ├── taper_ext_l.h ├── taper_ext_r.c ├── taper_ext_r.h ├── taper_int.c ├── taper_int.h ├── tft │ ├── drivers │ │ └── ili948x.c │ ├── fonts │ │ ├── fonts.c │ │ ├── fonts.h │ │ ├── gears_regular_32.c │ │ ├── gears_regular_50.c │ │ ├── inconsolata_lgc_bold_14.c │ │ ├── noto_sans_mono_bold_10.c │ │ ├── noto_sans_mono_bold_14.c │ │ ├── noto_sans_mono_bold_20.c │ │ ├── noto_sans_mono_bold_26.c │ │ └── noto_sans_mono_bold_arrows_24.c │ ├── image.c │ ├── image.h │ ├── tft.c │ ├── tft.h │ └── tft_platform.h ├── threading.c ├── threading.h ├── threading_ext.c ├── threading_ext.h ├── threading_int.c ├── threading_int.h ├── timer.c ├── timer.h ├── turn_dimension.c ├── turn_dimension.h ├── turning.c ├── turning.h ├── usart.c ├── usart.h ├── utils.c └── utils.h └── tools ├── Morse.Taper.Dimensions.png ├── color-map-556 ├── color-map-565 ├── colors.txt ├── concave-r.plot ├── convex-l.plot ├── convex-r.plot ├── embed-font ├── embed-image ├── fonts ├── gear_icon.png ├── gear_icon.svg ├── gears_regular_32.json ├── gears_regular_32.png ├── gears_regular_50.json ├── gears_regular_50.png ├── inconsolata_lgc_bold_14.json ├── inconsolata_lgc_bold_14.png ├── noto_sans_mono_bold_10.json ├── noto_sans_mono_bold_10.png ├── noto_sans_mono_bold_14.json ├── noto_sans_mono_bold_14.png ├── noto_sans_mono_bold_20.json ├── noto_sans_mono_bold_20.png ├── noto_sans_mono_bold_26.json ├── noto_sans_mono_bold_26.png ├── noto_sans_mono_bold_arrows_24.json ├── noto_sans_mono_bold_arrows_24.png └── spindle_chuck_50.png ├── jacobs-taper-calculator ├── knurling.plot ├── morse-taper-calculator └── screenshot /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.hex 3 | *.bin 4 | *.d 5 | *.map 6 | *.elf 7 | *.flatcam 8 | *.nc 9 | obj/ 10 | tmp/ 11 | hw/els/els-backups/* 12 | *.log 13 | debug/ 14 | Makefile.tft 15 | Makefile.defines 16 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | GIT_SHA = $(shell git rev-parse --short HEAD) 2 | BUILD_TS = $(shell date +%Y-%m-%dT%H:%M:%S) 3 | BINARY = els 4 | 5 | ################################################################################ 6 | # TFT 7 | # ------------------------------------------------------------------------------ 8 | # 9 | # Set the TFT to the display used. Some ILITEK ICs use a non-standard 556 16-bit 10 | # colorspace. 11 | # 12 | # You can define the TFT and COLORS in Makefile.tft if needed. 13 | # 14 | ################################################################################ 15 | -include Makefile.tft 16 | TFT ?= ILI9481 # supported values ILI9481, ILI9486, ILI9488 17 | COLORS ?= TFT_RGB_565 18 | 19 | SRCS = $(wildcard src/*.c) $(wildcard src/tft/*.c) $(wildcard src/tft/fonts/*.c) 20 | SRCS += $(wildcard src/bitmaps/*.c) 21 | 22 | ifneq (, $(findstring ILI9481, $(TFT))) 23 | SRCS += $(wildcard src/tft/drivers/ili948x.c) 24 | CFLAGS += -DTFT_ILI9481 -D$(COLORS) 25 | endif 26 | 27 | ifneq (, $(findstring ILI9486, $(TFT))) 28 | SRCS += $(wildcard src/tft/drivers/ili948x.c) 29 | CFLAGS += -DTFT_ILI9486 -D$(COLORS) 30 | endif 31 | 32 | ifneq (, $(findstring ILI9488, $(TFT))) 33 | SRCS += $(wildcard src/tft/drivers/ili948x.c) 34 | CFLAGS += -DTFT_ILI9488 -D$(COLORS) 35 | endif 36 | 37 | -include Makefile.defines 38 | 39 | OBJS = $(addprefix obj/, $(SRCS:.c=.o)) 40 | VERBOSE ?= 0 41 | 42 | STLINK ?= 0 43 | STM32F446 = 1 44 | 45 | CFLAGS += -DGIT_SHA=\"$(GIT_SHA)\" -DBUILD_TS=\"$(BUILD_TS)\" 46 | CFLAGS += -Isrc -DVERBOSE=$(VERBOSE) 47 | CFLAGS += -std=gnu99 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 48 | CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Os 49 | 50 | #CFLAGS += -DELS_DEBUG=1 51 | #CFLAGS += -ffast-math 52 | #CFLAGS += -frounding-math -fsignaling-nans -ffloat-store -ffp-contract=off 53 | 54 | LDFLAGS += -u _printf_float -lnosys --specs=nano.specs 55 | LDFLAGS += -Wl,--gc-sections,--sort-section=alignment 56 | LDLIBS += -lm 57 | V ?= 1 58 | 59 | STM32F4xx = 1 60 | CFLAGS += -DSTM32F446 -DSTM32F4xx 61 | LDSCRIPT = linker/stm32f446re.ld 62 | 63 | include Makefile.include 64 | 65 | .DEFAULT_GOAL := default 66 | 67 | default: $(BINARY).hex size 68 | 69 | ifeq ($(STLINK), 1) 70 | flash: $(BINARY).hex 71 | st-flash --freq=4m --format=ihex write $(BINARY).hex 72 | else 73 | flash: $(BINARY).hex 74 | JLinkExe -if swd -device stm32f446re -speed 4000 jlink/flash.cmd 75 | endif 76 | 77 | ifneq ($(STLINK), 1) 78 | reset: 79 | JLinkExe -if swd -device stm32f446re -speed 4000 jlink/reset.cmd 80 | endif 81 | 82 | size: $(BINARY).elf 83 | $(SIZE) $< 84 | 85 | .PHONY: flash size default 86 | -------------------------------------------------------------------------------- /Makefile.include: -------------------------------------------------------------------------------- 1 | ## vi: filetype=make 2 | ## This file is part of the libopencm3 project. 3 | ## 4 | ## Copyright (C) 2009 Uwe Hermann 5 | ## Copyright (C) 2010 Piotr Esden-Tempski 6 | ## 7 | ## This library is free software: you can redistribute it and/or modify 8 | ## it under the terms of the GNU Lesser General Public License as published by 9 | ## the Free Software Foundation, either version 3 of the License, or 10 | ## (at your option) any later version. 11 | ## 12 | ## This library is distributed in the hope that it will be useful, 13 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ## GNU Lesser General Public License for more details. 16 | ## 17 | ## You should have received a copy of the GNU Lesser General Public License 18 | ## along with this library. If not, see . 19 | ## 20 | 21 | LIBNAME = opencm3_stm32f4 22 | DEFS += -DSTM32F4 23 | FP_FLAGS ?= -mfloat-abi=hard -mfpu=fpv4-sp-d16 24 | ARCH_FLAGS = -mthumb -mcpu=cortex-m4 $(FP_FLAGS) 25 | 26 | include rules.mk 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # STM32 - Electronic Leadscrew 2 | 3 | Electronic Leadscrew with STM32 4 | 5 | ## Demos 6 | 7 | Some short demos available on YouTube 8 | 9 | https://www.youtube.com/channel/UCVE05OvPm0yVd1yQSVZ0YSA/videos 10 | 11 | ## Building 12 | 13 | ``` 14 | git clone https://github.com/libopencm3/libopencm3 15 | export OPENCM3_DIR=$PWD/libopencm3 16 | 17 | cd libopencm3 18 | make 19 | 20 | cd ../ 21 | git clone 22 | cd els 23 | 24 | # edit Makefile to pick target and a TFT version 25 | make TFT=ILI9481 26 | 27 | # or 28 | make TFT=ILI9486 29 | 30 | # or 31 | make TFT=ILI9488 32 | ``` 33 | 34 | Some ILITEK ICs use a non-standard 556 16-bit colorspace, use `COLORS=TFT_RGB_556` option in that case. 35 | 36 | ``` 37 | make TFT=ILI9488 COLORS=TFT_RGB_556 38 | ``` 39 | 40 | ## Technical documentation 41 | 42 | See [Technical Documentation](docs/els.md) 43 | 44 | ## Design ideas & Reference 45 | 46 | - https://github.com/clough42/electronic-leadscrew 47 | - https://github.com/prototypicall/Didge 48 | 49 | ## Goals / Features 50 | 51 | 1. The initial software is going to focus on being functional. 52 | 2. There is huge scope for optimisation, which can be something I might look into down the track. 53 | 3. Eventually, I'd like to add a G-code parser and motion controller to enable optional CNC control. 54 | 55 | ### Working with limited testing 56 | 57 | * Z axis control for manual turning and threading operations 58 | * Soft limits on Z & X 59 | * Hard limits on Z & X 60 | * Backlash compensation for leadscrews 61 | * Semi automated cycles: 62 | - Turning 63 | - Threading 64 | - External Tapers 65 | - Internal Tapers 66 | - External Arcs 67 | * Optional DRO support for: 68 | - TTL optical scales 69 | 70 | ### Wishlist / TO DO 71 | 72 | * Semi automated cycles: 73 | - Internal Arc 74 | - External groove 75 | - Internal groove 76 | * Tool radius compensation 77 | 78 | ## Pull Requests 79 | 80 | Please reach out to discuss any major rewrites or changes if you wish to merge the changes upstream. 81 | 82 | A lot of the firmware was developed over a few years on and off when I could find time to code and think about how I'd use it. 83 | I don't want to disappoint or stop anyone from improving the software or hardware design but the primary focus of this work is 84 | for my own personal use and don't want anything to distract me from that in a significant fashion. I don't have plenty of spare 85 | time to review design changes or major software changes. 86 | 87 | ## IMPORTANT - PLEASE READ 88 | 89 | Lathes are not toys, you can get injured or hurt someone else if you're not careful. Use this software at your 90 | own risk. 91 | 92 | This software is not provided with any warranty or support. It has only had limited testing in a home / hobby use setting 93 | and may result in you getting injured or your equipment getting damaged due to errors in programming. 94 | 95 | The author does not take any responsibility for the use of this software by others and cannot be held liable for any damages 96 | that may result from its use. 97 | 98 | ## LICENSE 99 | 100 | https://opensource.org/licenses/GPL-3.0 101 | 102 | Free to be used in any fashion without royalty but any changes to hardware or software should be attributed and publicly shared 103 | for the benefit of others. 104 | 105 | Some of the code in this project uses snippets of code from [Adafruit GFX](https://github.com/adafruit/Adafruit-GFX-Library/) 106 | -------------------------------------------------------------------------------- /assets/bolt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/assets/bolt.png -------------------------------------------------------------------------------- /assets/bolt.svg: -------------------------------------------------------------------------------- 1 | 2 | 20 | 22 | 23 | 25 | image/svg+xml 26 | 28 | 29 | 30 | 31 | 32 | 34 | 59 | 64 | 65 | 67 | Exported by the ArtWorks SVGExport module. 68 | Source document: Untitled1 69 | 70 | 75 | 83 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /assets/external_thread.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/assets/external_thread.png -------------------------------------------------------------------------------- /assets/external_thread_l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/assets/external_thread_l.png -------------------------------------------------------------------------------- /assets/infeed-dia-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/assets/infeed-dia-l.png -------------------------------------------------------------------------------- /assets/infeed-dia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/assets/infeed-dia.png -------------------------------------------------------------------------------- /assets/infeed-st.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/assets/infeed-st.png -------------------------------------------------------------------------------- /assets/internal_thread.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/assets/internal_thread.png -------------------------------------------------------------------------------- /assets/internal_thread.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/assets/internal_thread.xcf -------------------------------------------------------------------------------- /changelog.txt: -------------------------------------------------------------------------------- 1 | 2022-04-16 2 | 3 | * increase stepper position resolution display 4 | * add a new function for diamond cut knurling 5 | 6 | 2022-04-09 7 | 8 | * replaced encoder acceleration with manual multiplier selection (1, 10, 100) 9 | * added support for closed loop linear moves on Z & X axes 10 | * updated convex turning to specify arbitrary convex arcs 11 | * implementation for right handed concave arc 12 | * reduced spindle encoder resolution for threading, improves responsiveness 13 | -------------------------------------------------------------------------------- /docs/images/boring-hole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/boring-hole.png -------------------------------------------------------------------------------- /docs/images/boring-pocket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/boring-pocket.png -------------------------------------------------------------------------------- /docs/images/concave-ext-r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/concave-ext-r.png -------------------------------------------------------------------------------- /docs/images/concave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/concave.png -------------------------------------------------------------------------------- /docs/images/convex-ext-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/convex-ext-l.png -------------------------------------------------------------------------------- /docs/images/convex-ext-r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/convex-ext-r.png -------------------------------------------------------------------------------- /docs/images/convex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/convex.png -------------------------------------------------------------------------------- /docs/images/els.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/els.jpg -------------------------------------------------------------------------------- /docs/images/facing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/facing.png -------------------------------------------------------------------------------- /docs/images/functions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/functions.png -------------------------------------------------------------------------------- /docs/images/keypad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/keypad.png -------------------------------------------------------------------------------- /docs/images/knurling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/knurling.png -------------------------------------------------------------------------------- /docs/images/manual-threading-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/manual-threading-l.png -------------------------------------------------------------------------------- /docs/images/manual-threading-r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/manual-threading-r.png -------------------------------------------------------------------------------- /docs/images/manual-turning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/manual-turning.png -------------------------------------------------------------------------------- /docs/images/parting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/parting.png -------------------------------------------------------------------------------- /docs/images/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/settings.png -------------------------------------------------------------------------------- /docs/images/taper-ext-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/taper-ext-l.png -------------------------------------------------------------------------------- /docs/images/taper-ext-r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/taper-ext-r.png -------------------------------------------------------------------------------- /docs/images/taper-int.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/taper-int.png -------------------------------------------------------------------------------- /docs/images/threading-ext-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/threading-ext-l.png -------------------------------------------------------------------------------- /docs/images/threading-ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/threading-ext.png -------------------------------------------------------------------------------- /docs/images/threading-int.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/threading-int.png -------------------------------------------------------------------------------- /docs/images/turning-dro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/turning-dro.png -------------------------------------------------------------------------------- /docs/images/turning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/docs/images/turning.png -------------------------------------------------------------------------------- /hw/.gitignore: -------------------------------------------------------------------------------- 1 | *.nc 2 | *.flatcam 3 | -------------------------------------------------------------------------------- /hw/.tool-versions: -------------------------------------------------------------------------------- 1 | python system 2 | -------------------------------------------------------------------------------- /hw/buffer/fp-info-cache: -------------------------------------------------------------------------------- 1 | 0 2 | -------------------------------------------------------------------------------- /hw/buffer/gerber/buffer-B_Mask.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-11-03T18:54:38+11:00*% 3 | %TF.ProjectId,buffer,62756666-6572-42e6-9b69-6361645f7063,rev?*% 4 | %TF.SameCoordinates,PX2faf080PY5f5e100*% 5 | %TF.FileFunction,Soldermask,Bot*% 6 | %TF.FilePolarity,Negative*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-11-03 18:54:38* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | %ADD10R,1.500000X2.000000*% 15 | %ADD11O,1.500000X2.000000*% 16 | %ADD12O,2.400000X1.600000*% 17 | %ADD13R,2.400000X1.600000*% 18 | %ADD14R,3.000000X4.000000*% 19 | %ADD15O,3.000000X4.000000*% 20 | %ADD16O,4.000000X3.000000*% 21 | %ADD17R,4.000000X3.000000*% 22 | G04 APERTURE END LIST* 23 | D10* 24 | %TO.C,U2*% 25 | X42600000Y7300000D03* 26 | D11* 27 | X40060000Y7300000D03* 28 | X37520000Y7300000D03* 29 | X34980000Y7300000D03* 30 | %TD*% 31 | D12* 32 | %TO.C,U1*% 33 | X27130000Y16350000D03* 34 | D13* 35 | X34750000Y34130000D03* 36 | D12* 37 | X27130000Y18890000D03* 38 | X34750000Y31590000D03* 39 | X27130000Y21430000D03* 40 | X34750000Y29050000D03* 41 | X27130000Y23970000D03* 42 | X34750000Y26510000D03* 43 | X27130000Y26510000D03* 44 | X34750000Y23970000D03* 45 | X27130000Y29050000D03* 46 | X34750000Y21430000D03* 47 | X27130000Y31590000D03* 48 | X34750000Y18890000D03* 49 | X27130000Y34130000D03* 50 | X34750000Y16350000D03* 51 | %TD*% 52 | D14* 53 | %TO.C,J5*% 54 | X18320000Y4800000D03* 55 | D15* 56 | X23400000Y4800000D03* 57 | %TD*% 58 | D16* 59 | %TO.C,J4*% 60 | X4250000Y24760000D03* 61 | D17* 62 | X4250000Y40000000D03* 63 | D16* 64 | X4250000Y29840000D03* 65 | X4250000Y34920000D03* 66 | %TD*% 67 | %TO.C,J3*% 68 | X4250000Y2760000D03* 69 | D17* 70 | X4250000Y18000000D03* 71 | D16* 72 | X4250000Y7840000D03* 73 | X4250000Y12920000D03* 74 | %TD*% 75 | %TO.C,J2*% 76 | X65500000Y24760000D03* 77 | D17* 78 | X65500000Y40000000D03* 79 | D16* 80 | X65500000Y29840000D03* 81 | X65500000Y34920000D03* 82 | %TD*% 83 | %TO.C,J1*% 84 | X65500000Y2760000D03* 85 | D17* 86 | X65500000Y18000000D03* 87 | D16* 88 | X65500000Y7840000D03* 89 | X65500000Y12920000D03* 90 | %TD*% 91 | %TO.C,C1*% 92 | G36* 93 | G01* 94 | X41450001Y17800000D02* 95 | X40549999Y17800000D01* 96 | G75* 97 | G02* 98 | X40300000Y18049999I0J249999D01* 99 | G01* 100 | X40300000Y18700001D01* 101 | G75* 102 | G02* 103 | X40549999Y18950000I249999J0D01* 104 | G01* 105 | X41450001Y18950000D01* 106 | G75* 107 | G02* 108 | X41700000Y18700001I0J-249999D01* 109 | G01* 110 | X41700000Y18049999D01* 111 | G75* 112 | G02* 113 | X41450001Y17800000I-249999J0D01* 114 | G01* 115 | G37* 116 | G36* 117 | G01* 118 | X41450001Y15750000D02* 119 | X40549999Y15750000D01* 120 | G75* 121 | G02* 122 | X40300000Y15999999I0J249999D01* 123 | G01* 124 | X40300000Y16650001D01* 125 | G75* 126 | G02* 127 | X40549999Y16900000I249999J0D01* 128 | G01* 129 | X41450001Y16900000D01* 130 | G75* 131 | G02* 132 | X41700000Y16650001I0J-249999D01* 133 | G01* 134 | X41700000Y15999999D01* 135 | G75* 136 | G02* 137 | X41450001Y15750000I-249999J0D01* 138 | G01* 139 | G37* 140 | %TD*% 141 | M02* 142 | -------------------------------------------------------------------------------- /hw/buffer/gerber/buffer-Edge_Cuts.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-11-04T11:29:56+11:00*% 3 | %TF.ProjectId,buffer,62756666-6572-42e6-9b69-6361645f7063,rev?*% 4 | %TF.SameCoordinates,PX2faf080PY5f5e100*% 5 | %TF.FileFunction,Profile,NP*% 6 | %FSLAX46Y46*% 7 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 8 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-11-04 11:29:56* 9 | %MOMM*% 10 | %LPD*% 11 | G01* 12 | G04 APERTURE LIST* 13 | %TA.AperFunction,Profile*% 14 | %ADD10C,0.050000*% 15 | %TD*% 16 | G04 APERTURE END LIST* 17 | D10* 18 | X70000000Y50000000D02* 19 | X0Y50000000D01* 20 | X70000000Y0D02* 21 | X70000000Y50000000D01* 22 | X0Y0D02* 23 | X70000000Y0D01* 24 | X0Y50000000D02* 25 | X0Y0D01* 26 | M02* 27 | -------------------------------------------------------------------------------- /hw/buffer/gerber/buffer-F_Mask.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-11-03T18:54:38+11:00*% 3 | %TF.ProjectId,buffer,62756666-6572-42e6-9b69-6361645f7063,rev?*% 4 | %TF.SameCoordinates,PX2faf080PY5f5e100*% 5 | %TF.FileFunction,Soldermask,Top*% 6 | %TF.FilePolarity,Negative*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-11-03 18:54:38* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | %ADD10R,1.500000X2.000000*% 15 | %ADD11O,1.500000X2.000000*% 16 | %ADD12O,2.400000X1.600000*% 17 | %ADD13R,2.400000X1.600000*% 18 | %ADD14R,3.000000X4.000000*% 19 | %ADD15O,3.000000X4.000000*% 20 | %ADD16O,4.000000X3.000000*% 21 | %ADD17R,4.000000X3.000000*% 22 | G04 APERTURE END LIST* 23 | D10* 24 | %TO.C,U2*% 25 | X42600000Y7300000D03* 26 | D11* 27 | X40060000Y7300000D03* 28 | X37520000Y7300000D03* 29 | X34980000Y7300000D03* 30 | %TD*% 31 | D12* 32 | %TO.C,U1*% 33 | X27130000Y16350000D03* 34 | D13* 35 | X34750000Y34130000D03* 36 | D12* 37 | X27130000Y18890000D03* 38 | X34750000Y31590000D03* 39 | X27130000Y21430000D03* 40 | X34750000Y29050000D03* 41 | X27130000Y23970000D03* 42 | X34750000Y26510000D03* 43 | X27130000Y26510000D03* 44 | X34750000Y23970000D03* 45 | X27130000Y29050000D03* 46 | X34750000Y21430000D03* 47 | X27130000Y31590000D03* 48 | X34750000Y18890000D03* 49 | X27130000Y34130000D03* 50 | X34750000Y16350000D03* 51 | %TD*% 52 | D14* 53 | %TO.C,J5*% 54 | X18320000Y4800000D03* 55 | D15* 56 | X23400000Y4800000D03* 57 | %TD*% 58 | D16* 59 | %TO.C,J4*% 60 | X4250000Y24760000D03* 61 | D17* 62 | X4250000Y40000000D03* 63 | D16* 64 | X4250000Y29840000D03* 65 | X4250000Y34920000D03* 66 | %TD*% 67 | %TO.C,J3*% 68 | X4250000Y2760000D03* 69 | D17* 70 | X4250000Y18000000D03* 71 | D16* 72 | X4250000Y7840000D03* 73 | X4250000Y12920000D03* 74 | %TD*% 75 | %TO.C,J2*% 76 | X65500000Y24760000D03* 77 | D17* 78 | X65500000Y40000000D03* 79 | D16* 80 | X65500000Y29840000D03* 81 | X65500000Y34920000D03* 82 | %TD*% 83 | %TO.C,J1*% 84 | X65500000Y2760000D03* 85 | D17* 86 | X65500000Y18000000D03* 87 | D16* 88 | X65500000Y7840000D03* 89 | X65500000Y12920000D03* 90 | %TD*% 91 | M02* 92 | -------------------------------------------------------------------------------- /hw/buffer/gerber/buffer-NPTH-drl.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-11-02T22:02:19+11:00*% 3 | %TF.ProjectId,buffer,62756666-6572-42e6-9b69-6361645f7063,rev?*% 4 | %TF.SameCoordinates,PX2faf080PY5f5e100*% 5 | %TF.FileFunction,NonPlated,1,2,NPTH*% 6 | %TF.FilePolarity,Positive*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-11-02 22:02:19* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | G04 APERTURE END LIST* 15 | M02* 16 | -------------------------------------------------------------------------------- /hw/buffer/gerber/buffer-PTH-drl.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-11-02T22:02:19+11:00*% 3 | %TF.ProjectId,buffer,62756666-6572-42e6-9b69-6361645f7063,rev?*% 4 | %TF.SameCoordinates,PX2faf080PY5f5e100*% 5 | %TF.FileFunction,Plated,1,2,PTH,Drill*% 6 | %TF.FilePolarity,Positive*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-11-02 22:02:19* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | %TA.AperFunction,ComponentDrill*% 15 | %ADD10C,0.700000*% 16 | %TD*% 17 | %TA.AperFunction,ComponentDrill*% 18 | %ADD11C,0.800000*% 19 | %TD*% 20 | %TA.AperFunction,ViaDrill*% 21 | %ADD12C,0.800000*% 22 | %TD*% 23 | %TA.AperFunction,ComponentDrill*% 24 | %ADD13C,1.520000*% 25 | %TD*% 26 | G04 APERTURE END LIST* 27 | D10* 28 | %TO.C,U2*% 29 | X34980000Y7300000D03* 30 | X37520000Y7300000D03* 31 | X40060000Y7300000D03* 32 | X42600000Y7300000D03* 33 | D11* 34 | %TO.C,U1*% 35 | X27130000Y34130000D03* 36 | X27130000Y31590000D03* 37 | X27130000Y29050000D03* 38 | X27130000Y26510000D03* 39 | X27130000Y23970000D03* 40 | X27130000Y21430000D03* 41 | X27130000Y18890000D03* 42 | X27130000Y16350000D03* 43 | X34750000Y34130000D03* 44 | X34750000Y31590000D03* 45 | X34750000Y29050000D03* 46 | X34750000Y26510000D03* 47 | X34750000Y23970000D03* 48 | X34750000Y21430000D03* 49 | X34750000Y18890000D03* 50 | X34750000Y16350000D03* 51 | %TD*% 52 | D12* 53 | X38200000Y18400000D03* 54 | X38270000Y34130000D03* 55 | D13* 56 | %TO.C,J4*% 57 | X4250000Y40000000D03* 58 | X4250000Y34920000D03* 59 | X4250000Y29840000D03* 60 | X4250000Y24760000D03* 61 | %TO.C,J3*% 62 | X4250000Y18000000D03* 63 | X4250000Y12920000D03* 64 | X4250000Y7840000D03* 65 | X4250000Y2760000D03* 66 | %TO.C,J5*% 67 | X18320000Y4800000D03* 68 | X23400000Y4800000D03* 69 | %TO.C,J2*% 70 | X65500000Y40000000D03* 71 | X65500000Y34920000D03* 72 | X65500000Y29840000D03* 73 | X65500000Y24760000D03* 74 | %TO.C,J1*% 75 | X65500000Y18000000D03* 76 | X65500000Y12920000D03* 77 | X65500000Y7840000D03* 78 | X65500000Y2760000D03* 79 | M02* 80 | -------------------------------------------------------------------------------- /hw/buffer/gerber/buffer-job.gbrjob: -------------------------------------------------------------------------------- 1 | { 2 | "Header": 3 | { 4 | "GenerationSoftware": 5 | { 6 | "Vendor": "KiCad", 7 | "Application": "Pcbnew", 8 | "Version": "5.99.0+really5.1.10+dfsg1-1" 9 | }, 10 | "CreationDate": "2021-11-04T11:29:56+11:00" 11 | }, 12 | "GeneralSpecs": 13 | { 14 | "ProjectId": 15 | { 16 | "Name": "buffer", 17 | "GUID": "62756666-6572-42e6-9b69-6361645f7063", 18 | "Revision": "rev?" 19 | }, 20 | "Size": 21 | { 22 | "X": 70.050, 23 | "Y": 50.050 24 | }, 25 | "LayerNumber": 2, 26 | "BoardThickness": 1.600 27 | }, 28 | "DesignRules": 29 | [ 30 | { 31 | "Layers": "Outer", 32 | "PadToPad": 0.200, 33 | "PadToTrack": 0.200, 34 | "TrackToTrack": 0.200, 35 | "MinLineWidth": 0.508, 36 | "TrackToRegion": 0.508, 37 | "RegionToRegion": 0.508 38 | } 39 | ], 40 | "FilesAttributes": 41 | [ 42 | { 43 | "Path": "buffer-F_Cu.gbr", 44 | "FileFunction": "Copper,L1,Top", 45 | "FilePolarity": "Positive" 46 | }, 47 | { 48 | "Path": "buffer-B_Cu.gbr", 49 | "FileFunction": "Copper,L2,Bot", 50 | "FilePolarity": "Positive" 51 | }, 52 | { 53 | "Path": "buffer-Edge_Cuts.gbr", 54 | "FileFunction": "Profile", 55 | "FilePolarity": "Positive" 56 | } 57 | ], 58 | "MaterialStackup": 59 | [ 60 | { 61 | "Type": "Copper", 62 | "Notes": "Layer F.Cu" 63 | }, 64 | { 65 | "Type": "Dielectric", 66 | "Material": "FR4", 67 | "Notes": "Layers L1/L2" 68 | }, 69 | { 70 | "Type": "Copper", 71 | "Notes": "Layer B.Cu" 72 | } 73 | ] 74 | } 75 | -------------------------------------------------------------------------------- /hw/buffer/gerber/buffer.drl: -------------------------------------------------------------------------------- 1 | M48 2 | METRIC,TZ 3 | T1C0.700 4 | T2C0.800 5 | T3C1.520 6 | % 7 | G90 8 | G05 9 | T1 10 | X34980Y7300 11 | X37520Y7300 12 | X40060Y7300 13 | X42600Y7300 14 | T2 15 | X27130Y34130 16 | X27130Y31590 17 | X27130Y29050 18 | X27130Y26510 19 | X27130Y23970 20 | X27130Y21430 21 | X27130Y18890 22 | X27130Y16350 23 | X34750Y34130 24 | X34750Y31590 25 | X34750Y29050 26 | X34750Y26510 27 | X34750Y23970 28 | X34750Y21430 29 | X34750Y18890 30 | X34750Y16350 31 | X38200Y18400 32 | X38270Y34130 33 | T3 34 | X4250Y40000 35 | X4250Y34920 36 | X4250Y29840 37 | X4250Y24760 38 | X4250Y18000 39 | X4250Y12920 40 | X4250Y7840 41 | X4250Y2760 42 | X18320Y4800 43 | X23400Y4800 44 | X65500Y40000 45 | X65500Y34920 46 | X65500Y29840 47 | X65500Y24760 48 | X65500Y18000 49 | X65500Y12920 50 | X65500Y7840 51 | X65500Y2760 52 | T0 53 | M30 54 | -------------------------------------------------------------------------------- /hw/demo-driver/demo-driver.pro: -------------------------------------------------------------------------------- 1 | update=Fri 03 Sep 2021 19:21:22 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 | [schematic_editor] 16 | version=1 17 | PageLayoutDescrFile= 18 | PlotDirectoryName= 19 | SubpartIdSeparator=0 20 | SubpartFirstId=65 21 | NetFmtName=Pcbnew 22 | SpiceAjustPassiveValues=0 23 | LabSize=50 24 | ERC_TestSimilarLabels=1 25 | [pcbnew] 26 | version=1 27 | PageLayoutDescrFile= 28 | LastNetListRead= 29 | CopperLayerCount=2 30 | BoardThickness=1.6 31 | AllowMicroVias=0 32 | AllowBlindVias=0 33 | RequireCourtyardDefinitions=0 34 | ProhibitOverlappingCourtyards=1 35 | MinTrackWidth=0.2 36 | MinViaDiameter=0.4 37 | MinViaDrill=0.3 38 | MinMicroViaDiameter=0.2 39 | MinMicroViaDrill=0.09999999999999999 40 | MinHoleToHole=0.25 41 | TrackWidth1=0.25 42 | TrackWidth2=0.3048 43 | TrackWidth3=0.4064 44 | TrackWidth4=0.508 45 | TrackWidth5=0.762 46 | TrackWidth6=1.016 47 | TrackWidth7=1.27 48 | ViaDiameter1=0.8 49 | ViaDrill1=0.4 50 | dPairWidth1=0.2 51 | dPairGap1=0.25 52 | dPairViaGap1=0.25 53 | SilkLineWidth=0.12 54 | SilkTextSizeV=1 55 | SilkTextSizeH=1 56 | SilkTextSizeThickness=0.15 57 | SilkTextItalic=0 58 | SilkTextUpright=1 59 | CopperLineWidth=0.2 60 | CopperTextSizeV=1.5 61 | CopperTextSizeH=1.5 62 | CopperTextThickness=0.3 63 | CopperTextItalic=0 64 | CopperTextUpright=1 65 | EdgeCutLineWidth=0.05 66 | CourtyardLineWidth=0.05 67 | OthersLineWidth=0.15 68 | OthersTextSizeV=1 69 | OthersTextSizeH=1 70 | OthersTextSizeThickness=0.15 71 | OthersTextItalic=0 72 | OthersTextUpright=1 73 | SolderMaskClearance=0 74 | SolderMaskMinWidth=0 75 | SolderPasteClearance=0 76 | SolderPasteRatio=-0 77 | [pcbnew/Layer.F.Cu] 78 | Name=F.Cu 79 | Type=0 80 | Enabled=1 81 | [pcbnew/Layer.In1.Cu] 82 | Name=In1.Cu 83 | Type=0 84 | Enabled=0 85 | [pcbnew/Layer.In2.Cu] 86 | Name=In2.Cu 87 | Type=0 88 | Enabled=0 89 | [pcbnew/Layer.In3.Cu] 90 | Name=In3.Cu 91 | Type=0 92 | Enabled=0 93 | [pcbnew/Layer.In4.Cu] 94 | Name=In4.Cu 95 | Type=0 96 | Enabled=0 97 | [pcbnew/Layer.In5.Cu] 98 | Name=In5.Cu 99 | Type=0 100 | Enabled=0 101 | [pcbnew/Layer.In6.Cu] 102 | Name=In6.Cu 103 | Type=0 104 | Enabled=0 105 | [pcbnew/Layer.In7.Cu] 106 | Name=In7.Cu 107 | Type=0 108 | Enabled=0 109 | [pcbnew/Layer.In8.Cu] 110 | Name=In8.Cu 111 | Type=0 112 | Enabled=0 113 | [pcbnew/Layer.In9.Cu] 114 | Name=In9.Cu 115 | Type=0 116 | Enabled=0 117 | [pcbnew/Layer.In10.Cu] 118 | Name=In10.Cu 119 | Type=0 120 | Enabled=0 121 | [pcbnew/Layer.In11.Cu] 122 | Name=In11.Cu 123 | Type=0 124 | Enabled=0 125 | [pcbnew/Layer.In12.Cu] 126 | Name=In12.Cu 127 | Type=0 128 | Enabled=0 129 | [pcbnew/Layer.In13.Cu] 130 | Name=In13.Cu 131 | Type=0 132 | Enabled=0 133 | [pcbnew/Layer.In14.Cu] 134 | Name=In14.Cu 135 | Type=0 136 | Enabled=0 137 | [pcbnew/Layer.In15.Cu] 138 | Name=In15.Cu 139 | Type=0 140 | Enabled=0 141 | [pcbnew/Layer.In16.Cu] 142 | Name=In16.Cu 143 | Type=0 144 | Enabled=0 145 | [pcbnew/Layer.In17.Cu] 146 | Name=In17.Cu 147 | Type=0 148 | Enabled=0 149 | [pcbnew/Layer.In18.Cu] 150 | Name=In18.Cu 151 | Type=0 152 | Enabled=0 153 | [pcbnew/Layer.In19.Cu] 154 | Name=In19.Cu 155 | Type=0 156 | Enabled=0 157 | [pcbnew/Layer.In20.Cu] 158 | Name=In20.Cu 159 | Type=0 160 | Enabled=0 161 | [pcbnew/Layer.In21.Cu] 162 | Name=In21.Cu 163 | Type=0 164 | Enabled=0 165 | [pcbnew/Layer.In22.Cu] 166 | Name=In22.Cu 167 | Type=0 168 | Enabled=0 169 | [pcbnew/Layer.In23.Cu] 170 | Name=In23.Cu 171 | Type=0 172 | Enabled=0 173 | [pcbnew/Layer.In24.Cu] 174 | Name=In24.Cu 175 | Type=0 176 | Enabled=0 177 | [pcbnew/Layer.In25.Cu] 178 | Name=In25.Cu 179 | Type=0 180 | Enabled=0 181 | [pcbnew/Layer.In26.Cu] 182 | Name=In26.Cu 183 | Type=0 184 | Enabled=0 185 | [pcbnew/Layer.In27.Cu] 186 | Name=In27.Cu 187 | Type=0 188 | Enabled=0 189 | [pcbnew/Layer.In28.Cu] 190 | Name=In28.Cu 191 | Type=0 192 | Enabled=0 193 | [pcbnew/Layer.In29.Cu] 194 | Name=In29.Cu 195 | Type=0 196 | Enabled=0 197 | [pcbnew/Layer.In30.Cu] 198 | Name=In30.Cu 199 | Type=0 200 | Enabled=0 201 | [pcbnew/Layer.B.Cu] 202 | Name=B.Cu 203 | Type=0 204 | Enabled=1 205 | [pcbnew/Layer.B.Adhes] 206 | Enabled=1 207 | [pcbnew/Layer.F.Adhes] 208 | Enabled=1 209 | [pcbnew/Layer.B.Paste] 210 | Enabled=1 211 | [pcbnew/Layer.F.Paste] 212 | Enabled=1 213 | [pcbnew/Layer.B.SilkS] 214 | Enabled=1 215 | [pcbnew/Layer.F.SilkS] 216 | Enabled=1 217 | [pcbnew/Layer.B.Mask] 218 | Enabled=1 219 | [pcbnew/Layer.F.Mask] 220 | Enabled=1 221 | [pcbnew/Layer.Dwgs.User] 222 | Enabled=1 223 | [pcbnew/Layer.Cmts.User] 224 | Enabled=1 225 | [pcbnew/Layer.Eco1.User] 226 | Enabled=1 227 | [pcbnew/Layer.Eco2.User] 228 | Enabled=1 229 | [pcbnew/Layer.Edge.Cuts] 230 | Enabled=1 231 | [pcbnew/Layer.Margin] 232 | Enabled=1 233 | [pcbnew/Layer.B.CrtYd] 234 | Enabled=1 235 | [pcbnew/Layer.F.CrtYd] 236 | Enabled=1 237 | [pcbnew/Layer.B.Fab] 238 | Enabled=1 239 | [pcbnew/Layer.F.Fab] 240 | Enabled=1 241 | [pcbnew/Layer.Rescue] 242 | Enabled=0 243 | [pcbnew/Netclasses] 244 | [pcbnew/Netclasses/Default] 245 | Name=Default 246 | Clearance=0.2 247 | TrackWidth=0.25 248 | ViaDiameter=0.8 249 | ViaDrill=0.4 250 | uViaDiameter=0.3 251 | uViaDrill=0.1 252 | dPairWidth=0.2 253 | dPairGap=0.25 254 | dPairViaGap=0.25 255 | -------------------------------------------------------------------------------- /hw/demo-driver/gerber/demo-driver-B_Paste.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-09-03T20:55:11+10:00*% 3 | %TF.ProjectId,demo-driver,64656d6f-2d64-4726-9976-65722e6b6963,rev?*% 4 | %TF.SameCoordinates,PX1c9c380PY7270e00*% 5 | %TF.FileFunction,Paste,Bot*% 6 | %TF.FilePolarity,Positive*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-09-03 20:55:11* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | G04 APERTURE END LIST* 15 | %TO.C,R2*% 16 | G36* 17 | G01* 18 | X50830000Y27740001D02* 19 | X50830000Y26839999D01* 20 | G75* 21 | G02* 22 | X50580001Y26590000I-249999J0D01* 23 | G01* 24 | X49929999Y26590000D01* 25 | G75* 26 | G02* 27 | X49680000Y26839999I0J249999D01* 28 | G01* 29 | X49680000Y27740001D01* 30 | G75* 31 | G02* 32 | X49929999Y27990000I249999J0D01* 33 | G01* 34 | X50580001Y27990000D01* 35 | G75* 36 | G02* 37 | X50830000Y27740001I0J-249999D01* 38 | G01* 39 | G37* 40 | G36* 41 | G01* 42 | X52880000Y27740001D02* 43 | X52880000Y26839999D01* 44 | G75* 45 | G02* 46 | X52630001Y26590000I-249999J0D01* 47 | G01* 48 | X51979999Y26590000D01* 49 | G75* 50 | G02* 51 | X51730000Y26839999I0J249999D01* 52 | G01* 53 | X51730000Y27740001D01* 54 | G75* 55 | G02* 56 | X51979999Y27990000I249999J0D01* 57 | G01* 58 | X52630001Y27990000D01* 59 | G75* 60 | G02* 61 | X52880000Y27740001I0J-249999D01* 62 | G01* 63 | G37* 64 | %TD*% 65 | %TO.C,R1*% 66 | G36* 67 | G01* 68 | X50830000Y58220001D02* 69 | X50830000Y57319999D01* 70 | G75* 71 | G02* 72 | X50580001Y57070000I-249999J0D01* 73 | G01* 74 | X49929999Y57070000D01* 75 | G75* 76 | G02* 77 | X49680000Y57319999I0J249999D01* 78 | G01* 79 | X49680000Y58220001D01* 80 | G75* 81 | G02* 82 | X49929999Y58470000I249999J0D01* 83 | G01* 84 | X50580001Y58470000D01* 85 | G75* 86 | G02* 87 | X50830000Y58220001I0J-249999D01* 88 | G01* 89 | G37* 90 | G36* 91 | G01* 92 | X52880000Y58220001D02* 93 | X52880000Y57319999D01* 94 | G75* 95 | G02* 96 | X52630001Y57070000I-249999J0D01* 97 | G01* 98 | X51979999Y57070000D01* 99 | G75* 100 | G02* 101 | X51730000Y57319999I0J249999D01* 102 | G01* 103 | X51730000Y58220001D01* 104 | G75* 105 | G02* 106 | X51979999Y58470000I249999J0D01* 107 | G01* 108 | X52630001Y58470000D01* 109 | G75* 110 | G02* 111 | X52880000Y58220001I0J-249999D01* 112 | G01* 113 | G37* 114 | %TD*% 115 | M02* 116 | -------------------------------------------------------------------------------- /hw/demo-driver/gerber/demo-driver-B_SilkS.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-09-03T20:55:11+10:00*% 3 | %TF.ProjectId,demo-driver,64656d6f-2d64-4726-9976-65722e6b6963,rev?*% 4 | %TF.SameCoordinates,PX1c9c380PY7270e00*% 5 | %TF.FileFunction,Legend,Bot*% 6 | %TF.FilePolarity,Positive*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-09-03 20:55:11* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | %ADD10C,0.120000*% 15 | %ADD11C,0.150000*% 16 | G04 APERTURE END LIST* 17 | D10* 18 | %TO.C,R2*% 19 | X51541252Y26580000D02* 20 | X51018748Y26580000D01* 21 | X51541252Y28000000D02* 22 | X51018748Y28000000D01* 23 | %TO.C,R1*% 24 | X51541252Y57060000D02* 25 | X51018748Y57060000D01* 26 | X51541252Y58480000D02* 27 | X51018748Y58480000D01* 28 | %TO.C,R2*% 29 | D11* 30 | X51446666Y28487620D02* 31 | X51780000Y28963810D01* 32 | X52018095Y28487620D02* 33 | X52018095Y29487620D01* 34 | X51637142Y29487620D01* 35 | X51541904Y29440000D01* 36 | X51494285Y29392381D01* 37 | X51446666Y29297143D01* 38 | X51446666Y29154286D01* 39 | X51494285Y29059048D01* 40 | X51541904Y29011429D01* 41 | X51637142Y28963810D01* 42 | X52018095Y28963810D01* 43 | X51065714Y29392381D02* 44 | X51018095Y29440000D01* 45 | X50922857Y29487620D01* 46 | X50684761Y29487620D01* 47 | X50589523Y29440000D01* 48 | X50541904Y29392381D01* 49 | X50494285Y29297143D01* 50 | X50494285Y29201905D01* 51 | X50541904Y29059048D01* 52 | X51113333Y28487620D01* 53 | X50494285Y28487620D01* 54 | %TO.C,R1*% 55 | X51446666Y58967620D02* 56 | X51780000Y59443810D01* 57 | X52018095Y58967620D02* 58 | X52018095Y59967620D01* 59 | X51637142Y59967620D01* 60 | X51541904Y59920000D01* 61 | X51494285Y59872381D01* 62 | X51446666Y59777143D01* 63 | X51446666Y59634286D01* 64 | X51494285Y59539048D01* 65 | X51541904Y59491429D01* 66 | X51637142Y59443810D01* 67 | X52018095Y59443810D01* 68 | X50494285Y58967620D02* 69 | X51065714Y58967620D01* 70 | X50780000Y58967620D02* 71 | X50780000Y59967620D01* 72 | X50875238Y59824762D01* 73 | X50970476Y59729524D01* 74 | X51065714Y59681905D01* 75 | %TD*% 76 | M02* 77 | -------------------------------------------------------------------------------- /hw/demo-driver/gerber/demo-driver-Edge_Cuts.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-09-03T20:55:11+10:00*% 3 | %TF.ProjectId,demo-driver,64656d6f-2d64-4726-9976-65722e6b6963,rev?*% 4 | %TF.SameCoordinates,PX1c9c380PY7270e00*% 5 | %TF.FileFunction,Profile,NP*% 6 | %FSLAX46Y46*% 7 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 8 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-09-03 20:55:11* 9 | %MOMM*% 10 | %LPD*% 11 | G01* 12 | G04 APERTURE LIST* 13 | %TA.AperFunction,Profile*% 14 | %ADD10C,0.050000*% 15 | %TD*% 16 | G04 APERTURE END LIST* 17 | D10* 18 | X0Y0D02* 19 | X0Y80000000D01* 20 | X60000000Y0D02* 21 | X0Y0D01* 22 | X60000000Y80000000D02* 23 | X60000000Y0D01* 24 | X0Y80000000D02* 25 | X60000000Y80000000D01* 26 | M02* 27 | -------------------------------------------------------------------------------- /hw/demo-driver/gerber/demo-driver-F_Mask.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-09-03T20:55:11+10:00*% 3 | %TF.ProjectId,demo-driver,64656d6f-2d64-4726-9976-65722e6b6963,rev?*% 4 | %TF.SameCoordinates,PX1c9c380PY7270e00*% 5 | %TF.FileFunction,Soldermask,Top*% 6 | %TF.FilePolarity,Negative*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-09-03 20:55:11* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | %ADD10C,3.000000*% 15 | %ADD11R,3.000000X3.000000*% 16 | %ADD12O,1.700000X1.700000*% 17 | %ADD13R,1.700000X1.700000*% 18 | %ADD14C,6.400000*% 19 | %ADD15O,1.600000X1.600000*% 20 | %ADD16R,1.600000X1.600000*% 21 | G04 APERTURE END LIST* 22 | D10* 23 | %TO.C,J3*% 24 | X38920000Y74280000D03* 25 | D11* 26 | X44000000Y74280000D03* 27 | %TD*% 28 | D10* 29 | %TO.C,J1*% 30 | X16920000Y74000000D03* 31 | D11* 32 | X22000000Y74000000D03* 33 | %TD*% 34 | D12* 35 | %TO.C,J6*% 36 | X46200000Y36180000D03* 37 | X46200000Y33640000D03* 38 | X46200000Y31100000D03* 39 | D13* 40 | X46200000Y28560000D03* 41 | %TD*% 42 | D12* 43 | %TO.C,J5*% 44 | X46200000Y66660000D03* 45 | X46200000Y64120000D03* 46 | X46200000Y61580000D03* 47 | D13* 48 | X46200000Y59040000D03* 49 | %TD*% 50 | D14* 51 | %TO.C,REF\u002A\u002A*% 52 | X4000000Y4000000D03* 53 | %TD*% 54 | %TO.C,REF\u002A\u002A*% 55 | X56000000Y4000000D03* 56 | %TD*% 57 | %TO.C,REF\u002A\u002A*% 58 | X56000000Y76000000D03* 59 | %TD*% 60 | %TO.C,REF\u002A\u002A*% 61 | X4000000Y76000000D03* 62 | %TD*% 63 | D15* 64 | %TO.C,SW2*% 65 | X46200000Y13320000D03* 66 | X53820000Y20940000D03* 67 | X46200000Y15860000D03* 68 | X53820000Y18400000D03* 69 | X46200000Y18400000D03* 70 | X53820000Y15860000D03* 71 | X46200000Y20940000D03* 72 | D16* 73 | X53820000Y13320000D03* 74 | %TD*% 75 | D15* 76 | %TO.C,SW1*% 77 | X46200000Y43800000D03* 78 | X53820000Y51420000D03* 79 | X46200000Y46340000D03* 80 | X53820000Y48880000D03* 81 | X46200000Y48880000D03* 82 | X53820000Y46340000D03* 83 | X46200000Y51420000D03* 84 | D16* 85 | X53820000Y43800000D03* 86 | %TD*% 87 | D12* 88 | %TO.C,J4*% 89 | X15720000Y15860000D03* 90 | X15720000Y18400000D03* 91 | X15720000Y20940000D03* 92 | D13* 93 | X15720000Y23480000D03* 94 | %TD*% 95 | D12* 96 | %TO.C,J2*% 97 | X15720000Y46340000D03* 98 | X15720000Y48880000D03* 99 | X15720000Y51420000D03* 100 | D13* 101 | X15720000Y53960000D03* 102 | %TD*% 103 | D15* 104 | %TO.C,A2*% 105 | X36040000Y28560000D03* 106 | X23340000Y10780000D03* 107 | X36040000Y26020000D03* 108 | X23340000Y13320000D03* 109 | X36040000Y23480000D03* 110 | X23340000Y15860000D03* 111 | X36040000Y20940000D03* 112 | X23340000Y18400000D03* 113 | X36040000Y18400000D03* 114 | X23340000Y20940000D03* 115 | X36040000Y15860000D03* 116 | X23340000Y23480000D03* 117 | X36040000Y13320000D03* 118 | X23340000Y26020000D03* 119 | X36040000Y10780000D03* 120 | D16* 121 | X23340000Y28560000D03* 122 | %TD*% 123 | D15* 124 | %TO.C,A1*% 125 | X36040000Y59040000D03* 126 | X23340000Y41260000D03* 127 | X36040000Y56500000D03* 128 | X23340000Y43800000D03* 129 | X36040000Y53960000D03* 130 | X23340000Y46340000D03* 131 | X36040000Y51420000D03* 132 | X23340000Y48880000D03* 133 | X36040000Y48880000D03* 134 | X23340000Y51420000D03* 135 | X36040000Y46340000D03* 136 | X23340000Y53960000D03* 137 | X36040000Y43800000D03* 138 | X23340000Y56500000D03* 139 | X36040000Y41260000D03* 140 | D16* 141 | X23340000Y59040000D03* 142 | %TD*% 143 | M02* 144 | -------------------------------------------------------------------------------- /hw/demo-driver/gerber/demo-driver-F_Paste.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-09-03T20:55:11+10:00*% 3 | %TF.ProjectId,demo-driver,64656d6f-2d64-4726-9976-65722e6b6963,rev?*% 4 | %TF.SameCoordinates,PX1c9c380PY7270e00*% 5 | %TF.FileFunction,Paste,Top*% 6 | %TF.FilePolarity,Positive*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-09-03 20:55:11* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | G04 APERTURE END LIST* 15 | M02* 16 | -------------------------------------------------------------------------------- /hw/demo-driver/gerber/demo-driver-job.gbrjob: -------------------------------------------------------------------------------- 1 | { 2 | "Header": 3 | { 4 | "GenerationSoftware": 5 | { 6 | "Vendor": "KiCad", 7 | "Application": "Pcbnew", 8 | "Version": "5.99.0+really5.1.10+dfsg1-1" 9 | }, 10 | "CreationDate": "2021-09-03T20:55:11+10:00" 11 | }, 12 | "GeneralSpecs": 13 | { 14 | "ProjectId": 15 | { 16 | "Name": "demo-driver", 17 | "GUID": "64656d6f-2d64-4726-9976-65722e6b6963", 18 | "Revision": "rev?" 19 | }, 20 | "Size": 21 | { 22 | "X": 60.050, 23 | "Y": 80.050 24 | }, 25 | "LayerNumber": 2, 26 | "BoardThickness": 1.600 27 | }, 28 | "DesignRules": 29 | [ 30 | { 31 | "Layers": "Outer", 32 | "PadToPad": 0.200, 33 | "PadToTrack": 0.200, 34 | "TrackToTrack": 0.200, 35 | "MinLineWidth": 0.762, 36 | "TrackToRegion": 0.200, 37 | "RegionToRegion": 0.200 38 | } 39 | ], 40 | "FilesAttributes": 41 | [ 42 | { 43 | "Path": "demo-driver-F_Cu.gbr", 44 | "FileFunction": "Copper,L1,Top", 45 | "FilePolarity": "Positive" 46 | }, 47 | { 48 | "Path": "demo-driver-B_Cu.gbr", 49 | "FileFunction": "Copper,L2,Bot", 50 | "FilePolarity": "Positive" 51 | }, 52 | { 53 | "Path": "demo-driver-F_Paste.gbr", 54 | "FileFunction": "SolderPaste,Top", 55 | "FilePolarity": "Positive" 56 | }, 57 | { 58 | "Path": "demo-driver-B_Paste.gbr", 59 | "FileFunction": "SolderPaste,Bot", 60 | "FilePolarity": "Positive" 61 | }, 62 | { 63 | "Path": "demo-driver-F_SilkS.gbr", 64 | "FileFunction": "Legend,Top", 65 | "FilePolarity": "Positive" 66 | }, 67 | { 68 | "Path": "demo-driver-B_SilkS.gbr", 69 | "FileFunction": "Legend,Bot", 70 | "FilePolarity": "Positive" 71 | }, 72 | { 73 | "Path": "demo-driver-F_Mask.gbr", 74 | "FileFunction": "SolderMask,Top", 75 | "FilePolarity": "Negative" 76 | }, 77 | { 78 | "Path": "demo-driver-B_Mask.gbr", 79 | "FileFunction": "SolderMask,Bot", 80 | "FilePolarity": "Negative" 81 | }, 82 | { 83 | "Path": "demo-driver-Edge_Cuts.gbr", 84 | "FileFunction": "Profile", 85 | "FilePolarity": "Positive" 86 | } 87 | ], 88 | "MaterialStackup": 89 | [ 90 | { 91 | "Type": "Legend", 92 | "Notes": "Layer F.SilkS" 93 | }, 94 | { 95 | "Type": "SolderPaste", 96 | "Notes": "Layer F.Paste" 97 | }, 98 | { 99 | "Type": "SolderMask", 100 | "Notes": "Layer F.Mask" 101 | }, 102 | { 103 | "Type": "Copper", 104 | "Notes": "Layer F.Cu" 105 | }, 106 | { 107 | "Type": "Dielectric", 108 | "Material": "FR4", 109 | "Notes": "Layers L1/L2" 110 | }, 111 | { 112 | "Type": "Copper", 113 | "Notes": "Layer B.Cu" 114 | }, 115 | { 116 | "Type": "SolderMask", 117 | "Notes": "Layer B.Mask" 118 | }, 119 | { 120 | "Type": "SolderPaste", 121 | "Notes": "Layer B.Paste" 122 | }, 123 | { 124 | "Type": "Legend", 125 | "Notes": "Layer B.SilkS" 126 | } 127 | ] 128 | } 129 | -------------------------------------------------------------------------------- /hw/demo-driver/gerber/demo-driver.drl: -------------------------------------------------------------------------------- 1 | M48 2 | METRIC,TZ 3 | T1C0.800 4 | T2C1.000 5 | T3C1.520 6 | T4C3.200 7 | % 8 | G90 9 | G05 10 | T1 11 | X23340Y59040 12 | X23340Y56500 13 | X23340Y53960 14 | X23340Y51420 15 | X23340Y48880 16 | X23340Y46340 17 | X23340Y43800 18 | X23340Y41260 19 | X23340Y28560 20 | X23340Y26020 21 | X23340Y23480 22 | X23340Y20940 23 | X23340Y18400 24 | X23340Y15860 25 | X23340Y13320 26 | X23340Y10780 27 | X36040Y59040 28 | X36040Y56500 29 | X36040Y53960 30 | X36040Y51420 31 | X36040Y48880 32 | X36040Y46340 33 | X36040Y43800 34 | X36040Y41260 35 | X36040Y28560 36 | X36040Y26020 37 | X36040Y23480 38 | X36040Y20940 39 | X36040Y18400 40 | X36040Y15860 41 | X36040Y13320 42 | X36040Y10780 43 | X46200Y51420 44 | X46200Y48880 45 | X46200Y46340 46 | X46200Y43800 47 | X46200Y20940 48 | X46200Y18400 49 | X46200Y15860 50 | X46200Y13320 51 | X53820Y51420 52 | X53820Y48880 53 | X53820Y46340 54 | X53820Y43800 55 | X53820Y20940 56 | X53820Y18400 57 | X53820Y15860 58 | X53820Y13320 59 | T2 60 | X15720Y53960 61 | X15720Y51420 62 | X15720Y48880 63 | X15720Y46340 64 | X15720Y23480 65 | X15720Y20940 66 | X15720Y18400 67 | X15720Y15860 68 | X46200Y66660 69 | X46200Y64120 70 | X46200Y61580 71 | X46200Y59040 72 | X46200Y36180 73 | X46200Y33640 74 | X46200Y31100 75 | X46200Y28560 76 | T3 77 | X16920Y74000 78 | X22000Y74000 79 | X38920Y74280 80 | X44000Y74280 81 | T4 82 | X4000Y76000 83 | X4000Y4000 84 | X56000Y76000 85 | X56000Y4000 86 | T0 87 | M30 88 | -------------------------------------------------------------------------------- /hw/els/els-backups/els-2022-10-13_122106.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/hw/els/els-backups/els-2022-10-13_122106.zip -------------------------------------------------------------------------------- /hw/els/els-backups/els-2022-10-13_124146.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/hw/els/els-backups/els-2022-10-13_124146.zip -------------------------------------------------------------------------------- /hw/els/els-rescue.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/els/els.kicad_prl: -------------------------------------------------------------------------------- 1 | { 2 | "board": { 3 | "active_layer": 0, 4 | "active_layer_preset": "", 5 | "auto_track_width": true, 6 | "hidden_nets": [], 7 | "high_contrast_mode": 0, 8 | "net_color_mode": 1, 9 | "opacity": { 10 | "pads": 1.0, 11 | "tracks": 1.0, 12 | "vias": 1.0, 13 | "zones": 0.6 14 | }, 15 | "ratsnest_display_mode": 0, 16 | "selection_filter": { 17 | "dimensions": true, 18 | "footprints": true, 19 | "graphics": true, 20 | "keepouts": true, 21 | "lockedItems": true, 22 | "otherItems": true, 23 | "pads": true, 24 | "text": true, 25 | "tracks": true, 26 | "vias": true, 27 | "zones": true 28 | }, 29 | "visible_items": [ 30 | 0, 31 | 1, 32 | 2, 33 | 3, 34 | 4, 35 | 5, 36 | 8, 37 | 9, 38 | 10, 39 | 11, 40 | 12, 41 | 13, 42 | 14, 43 | 15, 44 | 16, 45 | 17, 46 | 18, 47 | 19, 48 | 20, 49 | 21, 50 | 22, 51 | 23, 52 | 24, 53 | 25, 54 | 26, 55 | 27, 56 | 28, 57 | 29, 58 | 30, 59 | 32, 60 | 33, 61 | 34, 62 | 35, 63 | 36 64 | ], 65 | "visible_layers": "000ffff_80000001", 66 | "zone_display_mode": 0 67 | }, 68 | "meta": { 69 | "filename": "els.kicad_prl", 70 | "version": 3 71 | }, 72 | "project": { 73 | "files": [] 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /hw/els/els.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/hw/els/els.pdf -------------------------------------------------------------------------------- /hw/els/gerber/els-B_Paste.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2022-01-03T15:11:42+11:00*% 3 | %TF.ProjectId,els,656c732e-6b69-4636-9164-5f7063625858,v0.1*% 4 | %TF.SameCoordinates,PX3938700PY8a48640*% 5 | %TF.FileFunction,Paste,Bot*% 6 | %TF.FilePolarity,Positive*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2022-01-03 15:11:42* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | G04 APERTURE END LIST* 15 | M02* 16 | -------------------------------------------------------------------------------- /hw/els/gerber/els-B_SilkS.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2022-01-03T15:11:42+11:00*% 3 | %TF.ProjectId,els,656c732e-6b69-4636-9164-5f7063625858,v0.1*% 4 | %TF.SameCoordinates,PX3938700PY8a48640*% 5 | %TF.FileFunction,Legend,Bot*% 6 | %TF.FilePolarity,Positive*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2022-01-03 15:11:42* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | G04 APERTURE END LIST* 15 | M02* 16 | -------------------------------------------------------------------------------- /hw/els/gerber/els-Edge_Cuts.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2022-01-03T15:11:42+11:00*% 3 | %TF.ProjectId,els,656c732e-6b69-4636-9164-5f7063625858,v0.1*% 4 | %TF.SameCoordinates,PX3938700PY8a48640*% 5 | %TF.FileFunction,Profile,NP*% 6 | %FSLAX46Y46*% 7 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 8 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2022-01-03 15:11:42* 9 | %MOMM*% 10 | %LPD*% 11 | G01* 12 | G04 APERTURE LIST* 13 | %TA.AperFunction,Profile*% 14 | %ADD10C,0.050000*% 15 | %TD*% 16 | G04 APERTURE END LIST* 17 | D10* 18 | X144978000Y-2447000D02* 19 | G75* 20 | G02* 21 | X142438000Y-4987000I-2540000J0D01* 22 | G01* 23 | X142438000Y109948000D02* 24 | G75* 25 | G02* 26 | X144978000Y107408000I0J-2540000D01* 27 | G01* 28 | X-5009000Y107408000D02* 29 | G75* 30 | G02* 31 | X-2469000Y109948000I2540000J0D01* 32 | G01* 33 | X-2469000Y-4987000D02* 34 | G75* 35 | G02* 36 | X-5009000Y-2447000I0J2540000D01* 37 | G01* 38 | X-5009000Y-2447000D02* 39 | X-5009000Y107408000D01* 40 | X142438000Y-4987000D02* 41 | X-2469000Y-4987000D01* 42 | X144978000Y107408000D02* 43 | X144978000Y-2447000D01* 44 | X-2469000Y109948000D02* 45 | X142438000Y109948000D01* 46 | M02* 47 | -------------------------------------------------------------------------------- /hw/els/gerber/els-job.gbrjob: -------------------------------------------------------------------------------- 1 | { 2 | "Header": 3 | { 4 | "GenerationSoftware": 5 | { 6 | "Vendor": "KiCad", 7 | "Application": "Pcbnew", 8 | "Version": "5.99.0+really5.1.10+dfsg1-1" 9 | }, 10 | "CreationDate": "2022-01-03T15:11:42+11:00" 11 | }, 12 | "GeneralSpecs": 13 | { 14 | "ProjectId": 15 | { 16 | "Name": "els", 17 | "GUID": "656c732e-6b69-4636-9164-5f7063625858", 18 | "Revision": "v0.1" 19 | }, 20 | "Size": 21 | { 22 | "X": 150.037, 23 | "Y": 114.985 24 | }, 25 | "LayerNumber": 2, 26 | "BoardThickness": 1.600 27 | }, 28 | "DesignRules": 29 | [ 30 | { 31 | "Layers": "Outer", 32 | "PadToPad": 0.127, 33 | "PadToTrack": 0.127, 34 | "TrackToTrack": 0.127, 35 | "MinLineWidth": 0.203, 36 | "TrackToRegion": 0.508, 37 | "RegionToRegion": 0.508 38 | } 39 | ], 40 | "FilesAttributes": 41 | [ 42 | { 43 | "Path": "els-F_Cu.gbr", 44 | "FileFunction": "Copper,L1,Top", 45 | "FilePolarity": "Positive" 46 | }, 47 | { 48 | "Path": "els-B_Cu.gbr", 49 | "FileFunction": "Copper,L2,Bot", 50 | "FilePolarity": "Positive" 51 | }, 52 | { 53 | "Path": "els-F_Paste.gbr", 54 | "FileFunction": "SolderPaste,Top", 55 | "FilePolarity": "Positive" 56 | }, 57 | { 58 | "Path": "els-B_Paste.gbr", 59 | "FileFunction": "SolderPaste,Bot", 60 | "FilePolarity": "Positive" 61 | }, 62 | { 63 | "Path": "els-F_SilkS.gbr", 64 | "FileFunction": "Legend,Top", 65 | "FilePolarity": "Positive" 66 | }, 67 | { 68 | "Path": "els-B_SilkS.gbr", 69 | "FileFunction": "Legend,Bot", 70 | "FilePolarity": "Positive" 71 | }, 72 | { 73 | "Path": "els-F_Mask.gbr", 74 | "FileFunction": "SolderMask,Top", 75 | "FilePolarity": "Negative" 76 | }, 77 | { 78 | "Path": "els-B_Mask.gbr", 79 | "FileFunction": "SolderMask,Bot", 80 | "FilePolarity": "Negative" 81 | }, 82 | { 83 | "Path": "els-Edge_Cuts.gbr", 84 | "FileFunction": "Profile", 85 | "FilePolarity": "Positive" 86 | } 87 | ], 88 | "MaterialStackup": 89 | [ 90 | { 91 | "Type": "Legend", 92 | "Notes": "Layer F.SilkS" 93 | }, 94 | { 95 | "Type": "SolderPaste", 96 | "Notes": "Layer F.Paste" 97 | }, 98 | { 99 | "Type": "SolderMask", 100 | "Notes": "Layer F.Mask" 101 | }, 102 | { 103 | "Type": "Copper", 104 | "Notes": "Layer F.Cu" 105 | }, 106 | { 107 | "Type": "Dielectric", 108 | "Material": "FR4", 109 | "Notes": "Layers L1/L2" 110 | }, 111 | { 112 | "Type": "Copper", 113 | "Notes": "Layer B.Cu" 114 | }, 115 | { 116 | "Type": "SolderMask", 117 | "Notes": "Layer B.Mask" 118 | }, 119 | { 120 | "Type": "SolderPaste", 121 | "Notes": "Layer B.Paste" 122 | }, 123 | { 124 | "Type": "Legend", 125 | "Notes": "Layer B.SilkS" 126 | } 127 | ] 128 | } 129 | -------------------------------------------------------------------------------- /hw/els/gerber/els.drl: -------------------------------------------------------------------------------- 1 | M48 2 | METRIC,TZ 3 | T1C0.381 4 | T2C0.800 5 | T3C0.920 6 | T4C1.000 7 | T5C1.016 8 | T6C1.020 9 | T7C1.520 10 | T8C2.300 11 | T9C2.330 12 | T10C3.200 13 | % 14 | G90 15 | G05 16 | T1 17 | X11247Y43781 18 | X14295Y28287 19 | X16327Y27525 20 | X16835Y25620 21 | X24582Y55846 22 | X25217Y90263 23 | X26614Y82897 24 | X27122Y56735 25 | X27630Y75277 26 | X27757Y55719 27 | X28011Y90263 28 | X28392Y61561 29 | X30170Y55592 30 | X30424Y63593 31 | X30424Y57116 32 | X31694Y55846 33 | X31948Y31081 34 | X35885Y81627 35 | X40965Y77690 36 | X42235Y73880 37 | X42743Y63593 38 | X44140Y83024 39 | X44140Y78452 40 | X44394Y93819 41 | X44648Y31462 42 | X45156Y95216 43 | X47061Y83024 44 | X48331Y81754 45 | X48331Y22572 46 | X50871Y31462 47 | X50871Y28287 48 | X51633Y79468 49 | X52649Y82262 50 | X57729Y66133 51 | X58745Y75277 52 | X60015Y68419 53 | X63698Y20413 54 | X66111Y95216 55 | X69159Y93819 56 | X71318Y79722 57 | X71572Y59402 58 | X74112Y30954 59 | X74620Y32478 60 | X76334Y32161 61 | X76779Y66514 62 | X78557Y81246 63 | X78938Y30319 64 | X80589Y79722 65 | X82113Y32478 66 | X84399Y78960 67 | X85542Y61815 68 | X85542Y38193 69 | X85542Y35907 70 | X86812Y62831 71 | X91130Y78706 72 | X93289Y80865 73 | X101163Y78452 74 | X102687Y33113 75 | X120340Y45686 76 | X129865Y78579 77 | X131643Y78579 78 | X132913Y64482 79 | T2 80 | X95448Y47645 81 | X95448Y42765 82 | T3 83 | X130500Y31300 84 | X130500Y28800 85 | X132500Y31300 86 | X132500Y28800 87 | X133040Y56750 88 | X133040Y54250 89 | X133040Y52250 90 | X133040Y49750 91 | T4 92 | X6040Y82770 93 | X6040Y80230 94 | X6040Y77690 95 | X6040Y75150 96 | X6040Y60672 97 | X6040Y58132 98 | X6040Y55592 99 | X6040Y53052 100 | X6040Y38320 101 | X6040Y35780 102 | X6040Y33240 103 | X6040Y30700 104 | X75890Y98010 105 | X78430Y98010 106 | X80970Y98010 107 | X83510Y98010 108 | X92400Y98010 109 | X94940Y98010 110 | X97480Y98010 111 | X100020Y98010 112 | T5 113 | X138120Y91660 114 | X138120Y89120 115 | X138120Y86580 116 | X138120Y84040 117 | X138120Y81500 118 | X138120Y78960 119 | X138120Y76420 120 | X138120Y73880 121 | X140660Y91660 122 | X140660Y89120 123 | X140660Y86580 124 | X140660Y84040 125 | X140660Y81500 126 | X140660Y78960 127 | X140660Y76420 128 | X140660Y73880 129 | T6 130 | X26750Y88050 131 | X26750Y85510 132 | X26750Y27090 133 | X26750Y24550 134 | X29290Y88050 135 | X29290Y85510 136 | X29290Y27090 137 | X29290Y24550 138 | X31830Y88050 139 | X31830Y85510 140 | X31830Y27090 141 | X31830Y24550 142 | X34370Y88050 143 | X34370Y85510 144 | X34370Y27090 145 | X34370Y24550 146 | X36910Y88050 147 | X36910Y85510 148 | X36910Y27090 149 | X36910Y24550 150 | X39450Y88050 151 | X39450Y85510 152 | X39450Y27090 153 | X39450Y24550 154 | X41990Y88050 155 | X41990Y85510 156 | X41990Y27090 157 | X41990Y24550 158 | X44530Y88050 159 | X44530Y85510 160 | X44530Y27090 161 | X44530Y24550 162 | X47070Y88050 163 | X47070Y85510 164 | X47070Y27090 165 | X47070Y24550 166 | X49610Y88050 167 | X49610Y85510 168 | X49610Y27090 169 | X49610Y24550 170 | X52150Y88050 171 | X52150Y85510 172 | X52150Y27090 173 | X52150Y24550 174 | X54690Y88050 175 | X54690Y85510 176 | X54690Y27090 177 | X54690Y24550 178 | X57230Y88050 179 | X57230Y85510 180 | X57230Y27090 181 | X57230Y24550 182 | X59770Y88050 183 | X59770Y85510 184 | X59770Y27090 185 | X59770Y24550 186 | X62310Y88050 187 | X62310Y85510 188 | X62310Y27090 189 | X62310Y24550 190 | X64850Y88050 191 | X64850Y85510 192 | X64850Y27090 193 | X64850Y24550 194 | X67390Y88050 195 | X67390Y85510 196 | X67390Y27090 197 | X67390Y24550 198 | X69930Y88050 199 | X69930Y85510 200 | X69930Y27090 201 | X69930Y24550 202 | X72470Y88050 203 | X72470Y85510 204 | X72470Y27090 205 | X72470Y24550 206 | T7 207 | X8326Y94835 208 | X8326Y89755 209 | X9215Y11650 210 | X9215Y6570 211 | X16200Y7840 212 | X19375Y101693 213 | X21280Y7840 214 | X24455Y101693 215 | X26360Y7840 216 | X31440Y7840 217 | X36520Y7840 218 | X37536Y101820 219 | X41600Y7840 220 | X42616Y101820 221 | X46680Y7840 222 | X51760Y7840 223 | X56840Y7840 224 | X61920Y7840 225 | X67000Y7840 226 | X72080Y7840 227 | X77160Y7840 228 | X82240Y7840 229 | X87320Y7840 230 | X92400Y7840 231 | X97480Y7840 232 | X102560Y7840 233 | X107513Y7840 234 | X112593Y7840 235 | X117800Y7840 236 | X122880Y7840 237 | X129865Y11650 238 | X129865Y6570 239 | T8 240 | X135750Y59820 241 | X135750Y46680 242 | T9 243 | X135210Y36070 244 | X135210Y24030 245 | T10 246 | X0Y105000 247 | X0Y0 248 | X140000Y105000 249 | X140000Y0 250 | T0 251 | M30 252 | -------------------------------------------------------------------------------- /hw/els/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (lib (name "els-rescue")(type "Legacy")(uri "${KIPRJMOD}/els-rescue.lib")(options "")(descr "")) 3 | ) 4 | -------------------------------------------------------------------------------- /hw/lcd/gerber/lcd-B_Mask.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-08-18T19:38:37+10:00*% 3 | %TF.ProjectId,lcd,6c63642e-6b69-4636-9164-5f7063625858,rev?*% 4 | %TF.SameCoordinates,Original*% 5 | %TF.FileFunction,Soldermask,Bot*% 6 | %TF.FilePolarity,Negative*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-08-18 19:38:37* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | %ADD10O,1.600000X1.600000*% 15 | %ADD11R,1.600000X1.600000*% 16 | %ADD12C,6.400000*% 17 | %ADD13R,1.727200X1.727200*% 18 | %ADD14O,1.727200X1.727200*% 19 | G04 APERTURE END LIST* 20 | D10* 21 | %TO.C,A1*% 22 | X120900000Y-35560000D03* 23 | X118360000Y-35560000D03* 24 | D11* 25 | X111760000Y-83820000D03* 26 | D10* 27 | X81280000Y-35560000D03* 28 | X109220000Y-83820000D03* 29 | X83820000Y-35560000D03* 30 | X106680000Y-83820000D03* 31 | X86360000Y-35560000D03* 32 | X104140000Y-83820000D03* 33 | X88900000Y-35560000D03* 34 | X101600000Y-83820000D03* 35 | X91440000Y-35560000D03* 36 | X99060000Y-83820000D03* 37 | X93980000Y-35560000D03* 38 | X96520000Y-83820000D03* 39 | X98040000Y-35560000D03* 40 | X93980000Y-83820000D03* 41 | X100580000Y-35560000D03* 42 | X88900000Y-83820000D03* 43 | X103120000Y-35560000D03* 44 | X86360000Y-83820000D03* 45 | X105660000Y-35560000D03* 46 | X83820000Y-83820000D03* 47 | X108200000Y-35560000D03* 48 | X81280000Y-83820000D03* 49 | X110740000Y-35560000D03* 50 | X78740000Y-83820000D03* 51 | X113280000Y-35560000D03* 52 | X76200000Y-83820000D03* 53 | X115820000Y-35560000D03* 54 | X76200000Y-35560000D03* 55 | X78740000Y-35560000D03* 56 | %TD*% 57 | D12* 58 | %TO.C,REF\u002A\u002A*% 59 | X145000000Y-82500000D03* 60 | %TD*% 61 | %TO.C,REF\u002A\u002A*% 62 | X145000000Y-35000000D03* 63 | %TD*% 64 | %TO.C,REF\u002A\u002A*% 65 | X65000000Y-82500000D03* 66 | %TD*% 67 | %TO.C,REF\u002A\u002A*% 68 | X65000000Y-35000000D03* 69 | %TD*% 70 | D13* 71 | %TO.C,J1*% 72 | X76700000Y-50700000D03* 73 | D14* 74 | X79240000Y-50700000D03* 75 | X76700000Y-53240000D03* 76 | X79240000Y-53240000D03* 77 | X76700000Y-55780000D03* 78 | X79240000Y-55780000D03* 79 | X76700000Y-58320000D03* 80 | X79240000Y-58320000D03* 81 | X76700000Y-60860000D03* 82 | X79240000Y-60860000D03* 83 | X76700000Y-63400000D03* 84 | X79240000Y-63400000D03* 85 | X76700000Y-65940000D03* 86 | X79240000Y-65940000D03* 87 | X76700000Y-68480000D03* 88 | X79240000Y-68480000D03* 89 | %TD*% 90 | M02* 91 | -------------------------------------------------------------------------------- /hw/lcd/gerber/lcd-B_Paste.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-08-18T19:38:37+10:00*% 3 | %TF.ProjectId,lcd,6c63642e-6b69-4636-9164-5f7063625858,rev?*% 4 | %TF.SameCoordinates,Original*% 5 | %TF.FileFunction,Paste,Bot*% 6 | %TF.FilePolarity,Positive*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-08-18 19:38:37* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | G04 APERTURE END LIST* 15 | M02* 16 | -------------------------------------------------------------------------------- /hw/lcd/gerber/lcd-B_SilkS.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-08-18T19:38:37+10:00*% 3 | %TF.ProjectId,lcd,6c63642e-6b69-4636-9164-5f7063625858,rev?*% 4 | %TF.SameCoordinates,Original*% 5 | %TF.FileFunction,Legend,Bot*% 6 | %TF.FilePolarity,Positive*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-08-18 19:38:37* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | G04 APERTURE END LIST* 15 | M02* 16 | -------------------------------------------------------------------------------- /hw/lcd/gerber/lcd-Edge_Cuts.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-08-18T19:38:37+10:00*% 3 | %TF.ProjectId,lcd,6c63642e-6b69-4636-9164-5f7063625858,rev?*% 4 | %TF.SameCoordinates,Original*% 5 | %TF.FileFunction,Profile,NP*% 6 | %FSLAX46Y46*% 7 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 8 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-08-18 19:38:37* 9 | %MOMM*% 10 | %LPD*% 11 | G01* 12 | G04 APERTURE LIST* 13 | %TA.AperFunction,Profile*% 14 | %ADD10C,0.050000*% 15 | %TD*% 16 | G04 APERTURE END LIST* 17 | D10* 18 | X150000000Y-30000000D02* 19 | X150000000Y-87500000D01* 20 | X60000000Y-87500000D02* 21 | X60000000Y-30000000D01* 22 | X150000000Y-87500000D02* 23 | X60000000Y-87500000D01* 24 | X60000000Y-30000000D02* 25 | X150000000Y-30000000D01* 26 | M02* 27 | -------------------------------------------------------------------------------- /hw/lcd/gerber/lcd-F_Mask.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-08-18T19:38:37+10:00*% 3 | %TF.ProjectId,lcd,6c63642e-6b69-4636-9164-5f7063625858,rev?*% 4 | %TF.SameCoordinates,Original*% 5 | %TF.FileFunction,Soldermask,Top*% 6 | %TF.FilePolarity,Negative*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-08-18 19:38:37* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | %ADD10O,1.600000X1.600000*% 15 | %ADD11R,1.600000X1.600000*% 16 | %ADD12C,6.400000*% 17 | %ADD13R,1.727200X1.727200*% 18 | %ADD14O,1.727200X1.727200*% 19 | G04 APERTURE END LIST* 20 | D10* 21 | %TO.C,A1*% 22 | X120900000Y-35560000D03* 23 | X118360000Y-35560000D03* 24 | D11* 25 | X111760000Y-83820000D03* 26 | D10* 27 | X81280000Y-35560000D03* 28 | X109220000Y-83820000D03* 29 | X83820000Y-35560000D03* 30 | X106680000Y-83820000D03* 31 | X86360000Y-35560000D03* 32 | X104140000Y-83820000D03* 33 | X88900000Y-35560000D03* 34 | X101600000Y-83820000D03* 35 | X91440000Y-35560000D03* 36 | X99060000Y-83820000D03* 37 | X93980000Y-35560000D03* 38 | X96520000Y-83820000D03* 39 | X98040000Y-35560000D03* 40 | X93980000Y-83820000D03* 41 | X100580000Y-35560000D03* 42 | X88900000Y-83820000D03* 43 | X103120000Y-35560000D03* 44 | X86360000Y-83820000D03* 45 | X105660000Y-35560000D03* 46 | X83820000Y-83820000D03* 47 | X108200000Y-35560000D03* 48 | X81280000Y-83820000D03* 49 | X110740000Y-35560000D03* 50 | X78740000Y-83820000D03* 51 | X113280000Y-35560000D03* 52 | X76200000Y-83820000D03* 53 | X115820000Y-35560000D03* 54 | X76200000Y-35560000D03* 55 | X78740000Y-35560000D03* 56 | %TD*% 57 | D12* 58 | %TO.C,REF\u002A\u002A*% 59 | X145000000Y-82500000D03* 60 | %TD*% 61 | %TO.C,REF\u002A\u002A*% 62 | X145000000Y-35000000D03* 63 | %TD*% 64 | %TO.C,REF\u002A\u002A*% 65 | X65000000Y-82500000D03* 66 | %TD*% 67 | %TO.C,REF\u002A\u002A*% 68 | X65000000Y-35000000D03* 69 | %TD*% 70 | D13* 71 | %TO.C,J1*% 72 | X76700000Y-50700000D03* 73 | D14* 74 | X79240000Y-50700000D03* 75 | X76700000Y-53240000D03* 76 | X79240000Y-53240000D03* 77 | X76700000Y-55780000D03* 78 | X79240000Y-55780000D03* 79 | X76700000Y-58320000D03* 80 | X79240000Y-58320000D03* 81 | X76700000Y-60860000D03* 82 | X79240000Y-60860000D03* 83 | X76700000Y-63400000D03* 84 | X79240000Y-63400000D03* 85 | X76700000Y-65940000D03* 86 | X79240000Y-65940000D03* 87 | X76700000Y-68480000D03* 88 | X79240000Y-68480000D03* 89 | %TD*% 90 | M02* 91 | -------------------------------------------------------------------------------- /hw/lcd/gerber/lcd-F_Paste.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-08-18T19:38:37+10:00*% 3 | %TF.ProjectId,lcd,6c63642e-6b69-4636-9164-5f7063625858,rev?*% 4 | %TF.SameCoordinates,Original*% 5 | %TF.FileFunction,Paste,Top*% 6 | %TF.FilePolarity,Positive*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-08-18 19:38:37* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | G04 APERTURE END LIST* 15 | M02* 16 | -------------------------------------------------------------------------------- /hw/lcd/gerber/lcd-F_SilkS.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-08-18T19:38:37+10:00*% 3 | %TF.ProjectId,lcd,6c63642e-6b69-4636-9164-5f7063625858,rev?*% 4 | %TF.SameCoordinates,Original*% 5 | %TF.FileFunction,Legend,Top*% 6 | %TF.FilePolarity,Positive*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-08-18 19:38:37* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | %ADD10C,0.120000*% 15 | %ADD11C,0.150000*% 16 | G04 APERTURE END LIST* 17 | D10* 18 | %TO.C,A1*% 19 | X70990000Y-48510000D02* 20 | X70990000Y-81280000D01* 21 | X70990000Y-81280000D02* 22 | X73530000Y-83820000D01* 23 | X73530000Y-83820000D02* 24 | X73530000Y-86490000D01* 25 | X73530000Y-86490000D02* 26 | X139830000Y-86490000D01* 27 | X139830000Y-86490000D02* 28 | X139830000Y-83310000D01* 29 | X139830000Y-83310000D02* 30 | X139830000Y-74170000D01* 31 | X139830000Y-74170000D02* 32 | X139830000Y-54100000D01* 33 | X139830000Y-54100000D02* 34 | X139830000Y-42420000D01* 35 | X139830000Y-42420000D02* 36 | X139830000Y-32890000D01* 37 | X139830000Y-32890000D02* 38 | X75180000Y-32890000D01* 39 | X75180000Y-32890000D02* 40 | X73530000Y-34540000D01* 41 | X73530000Y-34540000D02* 42 | X73530000Y-45970000D01* 43 | X73530000Y-45970000D02* 44 | X70990000Y-48510000D01* 45 | %TO.C,J1*% 46 | X82645000Y-45350000D02* 47 | X82645000Y-73830000D01* 48 | X82645000Y-73830000D02* 49 | X73295000Y-73830000D01* 50 | X73295000Y-73830000D02* 51 | X73295000Y-45350000D01* 52 | X73295000Y-45350000D02* 53 | X82645000Y-45350000D01* 54 | X73045000Y-45100000D02* 55 | X73045000Y-47640000D01* 56 | X73045000Y-45100000D02* 57 | X75585000Y-45100000D01* 58 | %TO.C,A1*% 59 | D11* 60 | X109775714Y-87796666D02* 61 | X110251904Y-87796666D01* 62 | X109680476Y-88082380D02* 63 | X110013809Y-87082380D01* 64 | X110347142Y-88082380D01* 65 | X111204285Y-88082380D02* 66 | X110632857Y-88082380D01* 67 | X110918571Y-88082380D02* 68 | X110918571Y-87082380D01* 69 | X110823333Y-87225238D01* 70 | X110728095Y-87320476D01* 71 | X110632857Y-87368095D01* 72 | %TO.C,J1*% 73 | X77636666Y-43548380D02* 74 | X77636666Y-44262666D01* 75 | X77589047Y-44405523D01* 76 | X77493809Y-44500761D01* 77 | X77350952Y-44548380D01* 78 | X77255714Y-44548380D01* 79 | X78636666Y-44548380D02* 80 | X78065238Y-44548380D01* 81 | X78350952Y-44548380D02* 82 | X78350952Y-43548380D01* 83 | X78255714Y-43691238D01* 84 | X78160476Y-43786476D01* 85 | X78065238Y-43834095D01* 86 | %TD*% 87 | M02* 88 | -------------------------------------------------------------------------------- /hw/lcd/gerber/lcd-job.gbrjob: -------------------------------------------------------------------------------- 1 | { 2 | "Header": 3 | { 4 | "GenerationSoftware": 5 | { 6 | "Vendor": "KiCad", 7 | "Application": "Pcbnew", 8 | "Version": "5.99.0+really5.1.10+dfsg1-1" 9 | }, 10 | "CreationDate": "2021-08-18T19:38:37+10:00" 11 | }, 12 | "GeneralSpecs": 13 | { 14 | "ProjectId": 15 | { 16 | "Name": "lcd", 17 | "GUID": "6c63642e-6b69-4636-9164-5f7063625858", 18 | "Revision": "rev?" 19 | }, 20 | "Size": 21 | { 22 | "X": 90.050, 23 | "Y": 57.550 24 | }, 25 | "LayerNumber": 2, 26 | "BoardThickness": 1.600 27 | }, 28 | "DesignRules": 29 | [ 30 | { 31 | "Layers": "Outer", 32 | "PadToPad": 0.203, 33 | "PadToTrack": 0.203, 34 | "TrackToTrack": 0.203, 35 | "MinLineWidth": 0.305, 36 | "TrackToRegion": 0.508, 37 | "RegionToRegion": 0.508 38 | } 39 | ], 40 | "FilesAttributes": 41 | [ 42 | { 43 | "Path": "lcd-F_Cu.gbr", 44 | "FileFunction": "Copper,L1,Top", 45 | "FilePolarity": "Positive" 46 | }, 47 | { 48 | "Path": "lcd-B_Cu.gbr", 49 | "FileFunction": "Copper,L2,Bot", 50 | "FilePolarity": "Positive" 51 | }, 52 | { 53 | "Path": "lcd-F_Paste.gbr", 54 | "FileFunction": "SolderPaste,Top", 55 | "FilePolarity": "Positive" 56 | }, 57 | { 58 | "Path": "lcd-B_Paste.gbr", 59 | "FileFunction": "SolderPaste,Bot", 60 | "FilePolarity": "Positive" 61 | }, 62 | { 63 | "Path": "lcd-F_SilkS.gbr", 64 | "FileFunction": "Legend,Top", 65 | "FilePolarity": "Positive" 66 | }, 67 | { 68 | "Path": "lcd-B_SilkS.gbr", 69 | "FileFunction": "Legend,Bot", 70 | "FilePolarity": "Positive" 71 | }, 72 | { 73 | "Path": "lcd-F_Mask.gbr", 74 | "FileFunction": "SolderMask,Top", 75 | "FilePolarity": "Negative" 76 | }, 77 | { 78 | "Path": "lcd-B_Mask.gbr", 79 | "FileFunction": "SolderMask,Bot", 80 | "FilePolarity": "Negative" 81 | }, 82 | { 83 | "Path": "lcd-Edge_Cuts.gbr", 84 | "FileFunction": "Profile", 85 | "FilePolarity": "Positive" 86 | } 87 | ], 88 | "MaterialStackup": 89 | [ 90 | { 91 | "Type": "Legend", 92 | "Notes": "Layer F.SilkS" 93 | }, 94 | { 95 | "Type": "SolderPaste", 96 | "Notes": "Layer F.Paste" 97 | }, 98 | { 99 | "Type": "SolderMask", 100 | "Notes": "Layer F.Mask" 101 | }, 102 | { 103 | "Type": "Copper", 104 | "Notes": "Layer F.Cu" 105 | }, 106 | { 107 | "Type": "Dielectric", 108 | "Material": "FR4", 109 | "Notes": "Layers L1/L2" 110 | }, 111 | { 112 | "Type": "Copper", 113 | "Notes": "Layer B.Cu" 114 | }, 115 | { 116 | "Type": "SolderMask", 117 | "Notes": "Layer B.Mask" 118 | }, 119 | { 120 | "Type": "SolderPaste", 121 | "Notes": "Layer B.Paste" 122 | }, 123 | { 124 | "Type": "Legend", 125 | "Notes": "Layer B.SilkS" 126 | } 127 | ] 128 | } 129 | -------------------------------------------------------------------------------- /hw/lcd/gerber/lcd.drl: -------------------------------------------------------------------------------- 1 | M48 2 | METRIC,TZ 3 | T1C0.800 4 | T2C1.016 5 | T3C3.200 6 | % 7 | G90 8 | G05 9 | T1 10 | X76200Y-35560 11 | X76200Y-83820 12 | X78740Y-35560 13 | X78740Y-83820 14 | X81280Y-35560 15 | X81280Y-83820 16 | X83820Y-35560 17 | X83820Y-83820 18 | X86360Y-35560 19 | X86360Y-83820 20 | X88900Y-35560 21 | X88900Y-83820 22 | X91440Y-35560 23 | X93980Y-35560 24 | X93980Y-83820 25 | X96520Y-83820 26 | X98040Y-35560 27 | X99060Y-83820 28 | X100580Y-35560 29 | X101600Y-83820 30 | X103120Y-35560 31 | X104140Y-83820 32 | X105660Y-35560 33 | X106680Y-83820 34 | X108200Y-35560 35 | X109220Y-83820 36 | X110740Y-35560 37 | X111760Y-83820 38 | X113280Y-35560 39 | X115820Y-35560 40 | X118360Y-35560 41 | X120900Y-35560 42 | T2 43 | X76700Y-50700 44 | X76700Y-53240 45 | X76700Y-55780 46 | X76700Y-58320 47 | X76700Y-60860 48 | X76700Y-63400 49 | X76700Y-65940 50 | X76700Y-68480 51 | X79240Y-50700 52 | X79240Y-53240 53 | X79240Y-55780 54 | X79240Y-58320 55 | X79240Y-60860 56 | X79240Y-63400 57 | X79240Y-65940 58 | X79240Y-68480 59 | T3 60 | X65000Y-35000 61 | X65000Y-82500 62 | X145000Y-35000 63 | X145000Y-82500 64 | T0 65 | M30 66 | -------------------------------------------------------------------------------- /hw/lcd/lcd-cache.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.4 2 | #encoding utf-8 3 | # 4 | # Connector_Generic_Conn_02x08_Top_Bottom 5 | # 6 | DEF Connector_Generic_Conn_02x08_Top_Bottom J 0 40 Y N 1 F N 7 | F0 "J" 50 400 50 H V C CNN 8 | F1 "Connector_Generic_Conn_02x08_Top_Bottom" 50 -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*:*_2x??_* 13 | $ENDFPLIST 14 | DRAW 15 | S -50 -395 0 -405 1 1 6 N 16 | S -50 -295 0 -305 1 1 6 N 17 | S -50 -195 0 -205 1 1 6 N 18 | S -50 -95 0 -105 1 1 6 N 19 | S -50 5 0 -5 1 1 6 N 20 | S -50 105 0 95 1 1 6 N 21 | S -50 205 0 195 1 1 6 N 22 | S -50 305 0 295 1 1 6 N 23 | S -50 350 150 -450 1 1 10 f 24 | S 150 -395 100 -405 1 1 6 N 25 | S 150 -295 100 -305 1 1 6 N 26 | S 150 -195 100 -205 1 1 6 N 27 | S 150 -95 100 -105 1 1 6 N 28 | S 150 5 100 -5 1 1 6 N 29 | S 150 105 100 95 1 1 6 N 30 | S 150 205 100 195 1 1 6 N 31 | S 150 305 100 295 1 1 6 N 32 | X Pin_1 1 -200 300 150 R 50 50 1 1 P 33 | X Pin_10 10 300 200 150 L 50 50 1 1 P 34 | X Pin_11 11 300 100 150 L 50 50 1 1 P 35 | X Pin_12 12 300 0 150 L 50 50 1 1 P 36 | X Pin_13 13 300 -100 150 L 50 50 1 1 P 37 | X Pin_14 14 300 -200 150 L 50 50 1 1 P 38 | X Pin_15 15 300 -300 150 L 50 50 1 1 P 39 | X Pin_16 16 300 -400 150 L 50 50 1 1 P 40 | X Pin_2 2 -200 200 150 R 50 50 1 1 P 41 | X Pin_3 3 -200 100 150 R 50 50 1 1 P 42 | X Pin_4 4 -200 0 150 R 50 50 1 1 P 43 | X Pin_5 5 -200 -100 150 R 50 50 1 1 P 44 | X Pin_6 6 -200 -200 150 R 50 50 1 1 P 45 | X Pin_7 7 -200 -300 150 R 50 50 1 1 P 46 | X Pin_8 8 -200 -400 150 R 50 50 1 1 P 47 | X Pin_9 9 300 300 150 L 50 50 1 1 P 48 | ENDDRAW 49 | ENDDEF 50 | # 51 | # MCU_Module_Arduino_UNO_R3 52 | # 53 | DEF MCU_Module_Arduino_UNO_R3 A 0 40 Y Y 1 F N 54 | F0 "A" -200 1050 50 H V R CNN 55 | F1 "MCU_Module_Arduino_UNO_R3" -200 950 50 H V R CNN 56 | F2 "Module:Arduino_UNO_R3" 150 -1050 50 H I L CNN 57 | F3 "" -200 1050 50 H I C CNN 58 | $FPLIST 59 | Arduino*UNO*R3* 60 | $ENDFPLIST 61 | DRAW 62 | S -400 900 400 -1000 0 1 10 f 63 | X NC 1 -500 -800 100 R 50 50 1 1 N N 64 | X A1 10 500 -100 100 L 50 50 1 1 B 65 | X A2 11 500 -200 100 L 50 50 1 1 B 66 | X A3 12 500 -300 100 L 50 50 1 1 B 67 | X A4/SDA 13 500 -400 100 L 50 50 1 1 B 68 | X A5/SCL 14 500 -500 100 L 50 50 1 1 B 69 | X D0/RX 15 -500 600 100 R 50 50 1 1 B 70 | X D1/TX 16 -500 500 100 R 50 50 1 1 B 71 | X D2 17 -500 400 100 R 50 50 1 1 B 72 | X D3 18 -500 300 100 R 50 50 1 1 B 73 | X D4 19 -500 200 100 R 50 50 1 1 B 74 | X IOREF 2 500 400 100 L 50 50 1 1 O 75 | X D5 20 -500 100 100 R 50 50 1 1 B 76 | X D6 21 -500 0 100 R 50 50 1 1 B 77 | X D7 22 -500 -100 100 R 50 50 1 1 B 78 | X D8 23 -500 -200 100 R 50 50 1 1 B 79 | X D9 24 -500 -300 100 R 50 50 1 1 B 80 | X D10 25 -500 -400 100 R 50 50 1 1 B 81 | X D11 26 -500 -500 100 R 50 50 1 1 B 82 | X D12 27 -500 -600 100 R 50 50 1 1 B 83 | X D13 28 -500 -700 100 R 50 50 1 1 B 84 | X GND 29 -100 -1100 100 U 50 50 1 1 W 85 | X RESET 3 500 600 100 L 50 50 1 1 I 86 | X AREF 30 500 200 100 L 50 50 1 1 I 87 | X SDA 31 500 -700 100 L 50 50 1 1 B 88 | X SCL 32 500 -800 100 L 50 50 1 1 B 89 | X 3V3 4 100 1000 100 D 50 50 1 1 w 90 | X +5V 5 200 1000 100 D 50 50 1 1 w 91 | X GND 6 0 -1100 100 U 50 50 1 1 W 92 | X GND 7 100 -1100 100 U 50 50 1 1 W 93 | X VIN 8 -100 1000 100 D 50 50 1 1 W 94 | X A0 9 500 0 100 L 50 50 1 1 B 95 | ENDDRAW 96 | ENDDEF 97 | # 98 | #End Library 99 | -------------------------------------------------------------------------------- /hw/lcd/lcd.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 | Text GLabel 3400 2500 2 50 Input ~ 0 17 | CS 18 | Wire Wire Line 19 | 3400 2500 3300 2500 20 | Text GLabel 3400 2400 2 50 Input ~ 0 21 | RS 22 | Wire Wire Line 23 | 3400 2400 3300 2400 24 | Text GLabel 3400 2300 2 50 Input ~ 0 25 | WR 26 | Wire Wire Line 27 | 3400 2300 3300 2300 28 | Text GLabel 3400 2200 2 50 Input ~ 0 29 | RD 30 | Wire Wire Line 31 | 3400 2200 3300 2200 32 | Text GLabel 3400 2600 2 50 Input ~ 0 33 | RST 34 | Wire Wire Line 35 | 3400 2600 3300 2600 36 | Text GLabel 2200 2400 0 50 Input ~ 0 37 | D0 38 | Wire Wire Line 39 | 2200 2400 2300 2400 40 | Text GLabel 2200 2500 0 50 Input ~ 0 41 | D1 42 | Wire Wire Line 43 | 2200 2500 2300 2500 44 | Text GLabel 2200 2000 0 50 Input ~ 0 45 | D4 46 | Wire Wire Line 47 | 2200 2000 2300 2000 48 | Text GLabel 2200 2100 0 50 Input ~ 0 49 | D5 50 | Wire Wire Line 51 | 2200 2100 2300 2100 52 | Text GLabel 2200 2200 0 50 Input ~ 0 53 | D6 54 | Wire Wire Line 55 | 2200 2200 2300 2200 56 | Text GLabel 2200 2300 0 50 Input ~ 0 57 | D7 58 | Wire Wire Line 59 | 2200 2300 2300 2300 60 | Text GLabel 2200 1800 0 50 Input ~ 0 61 | D2 62 | Wire Wire Line 63 | 2200 1800 2300 1800 64 | Text GLabel 2200 1900 0 50 Input ~ 0 65 | D3 66 | Wire Wire Line 67 | 2200 1900 2300 1900 68 | Text GLabel 2400 4300 0 50 Input ~ 0 69 | D0 70 | Wire Wire Line 71 | 2400 4300 2500 4300 72 | Text GLabel 2400 4400 0 50 Input ~ 0 73 | D1 74 | Wire Wire Line 75 | 2400 4400 2500 4400 76 | Text GLabel 2400 4700 0 50 Input ~ 0 77 | D4 78 | Wire Wire Line 79 | 2400 4700 2500 4700 80 | Text GLabel 2400 4800 0 50 Input ~ 0 81 | D5 82 | Wire Wire Line 83 | 2400 4800 2500 4800 84 | Text GLabel 2400 4900 0 50 Input ~ 0 85 | D6 86 | Wire Wire Line 87 | 2400 4900 2500 4900 88 | Text GLabel 2400 5000 0 50 Input ~ 0 89 | D7 90 | Wire Wire Line 91 | 2400 5000 2500 5000 92 | Text GLabel 2400 4500 0 50 Input ~ 0 93 | D2 94 | Wire Wire Line 95 | 2400 4500 2500 4500 96 | Text GLabel 2400 4600 0 50 Input ~ 0 97 | D3 98 | Wire Wire Line 99 | 2400 4600 2500 4600 100 | $Comp 101 | L Connector_Generic:Conn_02x08_Top_Bottom J1 102 | U 1 1 611CDF80 103 | P 2700 4600 104 | F 0 "J1" H 2750 5117 50 0000 C CNN 105 | F 1 "Conn_02x08_Top_Bottom" H 2750 5026 50 0000 C CNN 106 | F 2 "Connector_IDC:IDC-Header_2x08_P2.54mm_Vertical" H 2700 4600 50 0001 C CNN 107 | F 3 "~" H 2700 4600 50 0001 C CNN 108 | 1 2700 4600 109 | 1 0 0 -1 110 | $EndComp 111 | Text GLabel 3100 4600 2 50 Input ~ 0 112 | CS 113 | Wire Wire Line 114 | 3100 4600 3000 4600 115 | Text GLabel 3100 4500 2 50 Input ~ 0 116 | RS 117 | Wire Wire Line 118 | 3100 4500 3000 4500 119 | Text GLabel 3100 4400 2 50 Input ~ 0 120 | WR 121 | Wire Wire Line 122 | 3100 4400 3000 4400 123 | Text GLabel 3100 4300 2 50 Input ~ 0 124 | RD 125 | Wire Wire Line 126 | 3100 4300 3000 4300 127 | Text GLabel 3100 4700 2 50 Input ~ 0 128 | RST 129 | Wire Wire Line 130 | 3100 4700 3000 4700 131 | Text GLabel 3100 4800 2 50 Input ~ 0 132 | GND 133 | Text GLabel 3100 4900 2 50 Input ~ 0 134 | GND 135 | Text GLabel 3100 5000 2 50 Input ~ 0 136 | 5V 137 | Wire Wire Line 138 | 3000 4800 3100 4800 139 | Wire Wire Line 140 | 3000 4900 3100 4900 141 | Wire Wire Line 142 | 3000 5000 3100 5000 143 | $Comp 144 | L MCU_Module:Arduino_UNO_R3 A1 145 | U 1 1 611E16A6 146 | P 2800 2200 147 | F 0 "A1" H 2000 3200 50 0000 C CNN 148 | F 1 "Arduino_UNO_R3" H 2000 3100 50 0000 C CNN 149 | F 2 "Module:Arduino_UNO_R3" H 2950 1150 50 0001 L CNN 150 | F 3 "https://www.arduino.cc/en/Main/arduinoBoardUno" H 2600 3250 50 0001 C CNN 151 | 1 2800 2200 152 | 1 0 0 -1 153 | $EndComp 154 | Text GLabel 3000 900 1 50 Input ~ 0 155 | 5V 156 | Wire Wire Line 157 | 3000 900 3000 1200 158 | Text GLabel 2800 3500 3 50 Input ~ 0 159 | GND 160 | Wire Wire Line 161 | 2700 3300 2700 3400 162 | Wire Wire Line 163 | 2700 3400 2800 3400 164 | Wire Wire Line 165 | 2800 3400 2800 3500 166 | Wire Wire Line 167 | 2800 3400 2800 3300 168 | Connection ~ 2800 3400 169 | Wire Wire Line 170 | 2800 3400 2900 3400 171 | Wire Wire Line 172 | 2900 3400 2900 3300 173 | Text GLabel 2900 900 1 50 Input ~ 0 174 | 3V3 175 | Wire Wire Line 176 | 2900 900 2900 1200 177 | $EndSCHEMATC 178 | -------------------------------------------------------------------------------- /hw/lcd/lcd.sch-bak: -------------------------------------------------------------------------------- 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 | Text GLabel 3400 2500 2 50 Input ~ 0 17 | CS 18 | Wire Wire Line 19 | 3400 2500 3300 2500 20 | Text GLabel 3400 2400 2 50 Input ~ 0 21 | RS 22 | Wire Wire Line 23 | 3400 2400 3300 2400 24 | Text GLabel 3400 2300 2 50 Input ~ 0 25 | WR 26 | Wire Wire Line 27 | 3400 2300 3300 2300 28 | Text GLabel 3400 2200 2 50 Input ~ 0 29 | RD 30 | Wire Wire Line 31 | 3400 2200 3300 2200 32 | Text GLabel 3400 2600 2 50 Input ~ 0 33 | RST 34 | Wire Wire Line 35 | 3400 2600 3300 2600 36 | Text GLabel 2200 2400 0 50 Input ~ 0 37 | D0 38 | Wire Wire Line 39 | 2200 2400 2300 2400 40 | Text GLabel 2200 2500 0 50 Input ~ 0 41 | D1 42 | Wire Wire Line 43 | 2200 2500 2300 2500 44 | Text GLabel 2200 2000 0 50 Input ~ 0 45 | D4 46 | Wire Wire Line 47 | 2200 2000 2300 2000 48 | Text GLabel 2200 2100 0 50 Input ~ 0 49 | D5 50 | Wire Wire Line 51 | 2200 2100 2300 2100 52 | Text GLabel 2200 2200 0 50 Input ~ 0 53 | D6 54 | Wire Wire Line 55 | 2200 2200 2300 2200 56 | Text GLabel 2200 2300 0 50 Input ~ 0 57 | D7 58 | Wire Wire Line 59 | 2200 2300 2300 2300 60 | Text GLabel 2200 1800 0 50 Input ~ 0 61 | D2 62 | Wire Wire Line 63 | 2200 1800 2300 1800 64 | Text GLabel 2200 1900 0 50 Input ~ 0 65 | D3 66 | Wire Wire Line 67 | 2200 1900 2300 1900 68 | Text GLabel 2400 4300 0 50 Input ~ 0 69 | D0 70 | Wire Wire Line 71 | 2400 4300 2500 4300 72 | Text GLabel 2400 4400 0 50 Input ~ 0 73 | D1 74 | Wire Wire Line 75 | 2400 4400 2500 4400 76 | Text GLabel 2400 4700 0 50 Input ~ 0 77 | D4 78 | Wire Wire Line 79 | 2400 4700 2500 4700 80 | Text GLabel 2400 4800 0 50 Input ~ 0 81 | D5 82 | Wire Wire Line 83 | 2400 4800 2500 4800 84 | Text GLabel 2400 4900 0 50 Input ~ 0 85 | D6 86 | Wire Wire Line 87 | 2400 4900 2500 4900 88 | Text GLabel 2400 5000 0 50 Input ~ 0 89 | D7 90 | Wire Wire Line 91 | 2400 5000 2500 5000 92 | Text GLabel 2400 4500 0 50 Input ~ 0 93 | D2 94 | Wire Wire Line 95 | 2400 4500 2500 4500 96 | Text GLabel 2400 4600 0 50 Input ~ 0 97 | D3 98 | Wire Wire Line 99 | 2400 4600 2500 4600 100 | $Comp 101 | L Connector_Generic:Conn_02x08_Top_Bottom J3 102 | U 1 1 611CDF80 103 | P 2700 4600 104 | F 0 "J3" H 2750 5117 50 0000 C CNN 105 | F 1 "Conn_02x08_Top_Bottom" H 2750 5026 50 0000 C CNN 106 | F 2 "Connector_IDC:IDC-Header_2x08_P2.54mm_Vertical" H 2700 4600 50 0001 C CNN 107 | F 3 "~" H 2700 4600 50 0001 C CNN 108 | 1 2700 4600 109 | 1 0 0 -1 110 | $EndComp 111 | Text GLabel 3100 4600 2 50 Input ~ 0 112 | CS 113 | Wire Wire Line 114 | 3100 4600 3000 4600 115 | Text GLabel 3100 4500 2 50 Input ~ 0 116 | RS 117 | Wire Wire Line 118 | 3100 4500 3000 4500 119 | Text GLabel 3100 4400 2 50 Input ~ 0 120 | WR 121 | Wire Wire Line 122 | 3100 4400 3000 4400 123 | Text GLabel 3100 4300 2 50 Input ~ 0 124 | RD 125 | Wire Wire Line 126 | 3100 4300 3000 4300 127 | Text GLabel 3100 4700 2 50 Input ~ 0 128 | RST 129 | Wire Wire Line 130 | 3100 4700 3000 4700 131 | Text GLabel 3100 4800 2 50 Input ~ 0 132 | GND 133 | Text GLabel 3100 4900 2 50 Input ~ 0 134 | GND 135 | Text GLabel 3100 5000 2 50 Input ~ 0 136 | 5V 137 | Wire Wire Line 138 | 3000 4800 3100 4800 139 | Wire Wire Line 140 | 3000 4900 3100 4900 141 | Wire Wire Line 142 | 3000 5000 3100 5000 143 | $Comp 144 | L MCU_Module:Arduino_UNO_R3 A1 145 | U 1 1 611E16A6 146 | P 2800 2200 147 | F 0 "A1" H 2000 3200 50 0000 C CNN 148 | F 1 "Arduino_UNO_R3" H 2000 3100 50 0000 C CNN 149 | F 2 "Module:Arduino_UNO_R3" H 2950 1150 50 0001 L CNN 150 | F 3 "https://www.arduino.cc/en/Main/arduinoBoardUno" H 2600 3250 50 0001 C CNN 151 | 1 2800 2200 152 | 1 0 0 -1 153 | $EndComp 154 | Text GLabel 3000 900 1 50 Input ~ 0 155 | 5V 156 | Wire Wire Line 157 | 3000 900 3000 1200 158 | Text GLabel 2800 3500 3 50 Input ~ 0 159 | GND 160 | Wire Wire Line 161 | 2700 3300 2700 3400 162 | Wire Wire Line 163 | 2700 3400 2800 3400 164 | Wire Wire Line 165 | 2800 3400 2800 3500 166 | Wire Wire Line 167 | 2800 3400 2800 3300 168 | Connection ~ 2800 3400 169 | Wire Wire Line 170 | 2800 3400 2900 3400 171 | Wire Wire Line 172 | 2900 3400 2900 3300 173 | Text GLabel 2900 900 1 50 Input ~ 0 174 | 3V3 175 | Wire Wire Line 176 | 2900 900 2900 1200 177 | $EndSCHEMATC 178 | -------------------------------------------------------------------------------- /hw/power-clamp/gerber/power-clamp-B_Cu.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-08-26T21:24:32+10:00*% 3 | %TF.ProjectId,power-clamp,706f7765-722d-4636-9c61-6d702e6b6963,rev?*% 4 | %TF.SameCoordinates,Original*% 5 | %TF.FileFunction,Copper,L2,Bot*% 6 | %TF.FilePolarity,Positive*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-08-26 21:24:32* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | %TA.AperFunction,ComponentPad*% 15 | %ADD10O,1.700000X1.700000*% 16 | %TD*% 17 | %TA.AperFunction,ComponentPad*% 18 | %ADD11R,1.700000X1.700000*% 19 | %TD*% 20 | G04 APERTURE END LIST* 21 | D10* 22 | %TO.P,J2,2*% 23 | %TO.N,GNDA*% 24 | X70620000Y-83955000D03* 25 | D11* 26 | %TO.P,J2,1*% 27 | %TO.N,VCC*% 28 | X73160000Y-83955000D03* 29 | %TD*% 30 | D10* 31 | %TO.P,J1,2*% 32 | %TO.N,GNDA*% 33 | X70620000Y-41156000D03* 34 | D11* 35 | %TO.P,J1,1*% 36 | %TO.N,+5V*% 37 | X73160000Y-41156000D03* 38 | %TD*% 39 | M02* 40 | -------------------------------------------------------------------------------- /hw/power-clamp/gerber/power-clamp-B_Mask.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-08-26T21:24:32+10:00*% 3 | %TF.ProjectId,power-clamp,706f7765-722d-4636-9c61-6d702e6b6963,rev?*% 4 | %TF.SameCoordinates,Original*% 5 | %TF.FileFunction,Soldermask,Bot*% 6 | %TF.FilePolarity,Negative*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-08-26 21:24:32* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | %ADD10O,1.700000X1.700000*% 15 | %ADD11R,1.700000X1.700000*% 16 | G04 APERTURE END LIST* 17 | D10* 18 | %TO.C,J2*% 19 | X70620000Y-83955000D03* 20 | D11* 21 | X73160000Y-83955000D03* 22 | %TD*% 23 | D10* 24 | %TO.C,J1*% 25 | X70620000Y-41156000D03* 26 | D11* 27 | X73160000Y-41156000D03* 28 | %TD*% 29 | M02* 30 | -------------------------------------------------------------------------------- /hw/power-clamp/gerber/power-clamp-B_Paste.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-08-26T21:24:32+10:00*% 3 | %TF.ProjectId,power-clamp,706f7765-722d-4636-9c61-6d702e6b6963,rev?*% 4 | %TF.SameCoordinates,Original*% 5 | %TF.FileFunction,Paste,Bot*% 6 | %TF.FilePolarity,Positive*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-08-26 21:24:32* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | G04 APERTURE END LIST* 15 | M02* 16 | -------------------------------------------------------------------------------- /hw/power-clamp/gerber/power-clamp-B_SilkS.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-08-26T21:24:32+10:00*% 3 | %TF.ProjectId,power-clamp,706f7765-722d-4636-9c61-6d702e6b6963,rev?*% 4 | %TF.SameCoordinates,Original*% 5 | %TF.FileFunction,Legend,Bot*% 6 | %TF.FilePolarity,Positive*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-08-26 21:24:32* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | G04 APERTURE END LIST* 15 | M02* 16 | -------------------------------------------------------------------------------- /hw/power-clamp/gerber/power-clamp-Edge_Cuts.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-08-26T21:24:32+10:00*% 3 | %TF.ProjectId,power-clamp,706f7765-722d-4636-9c61-6d702e6b6963,rev?*% 4 | %TF.SameCoordinates,Original*% 5 | %TF.FileFunction,Profile,NP*% 6 | %FSLAX46Y46*% 7 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 8 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-08-26 21:24:32* 9 | %MOMM*% 10 | %LPD*% 11 | G01* 12 | G04 APERTURE LIST* 13 | %TA.AperFunction,Profile*% 14 | %ADD10C,0.050000*% 15 | %TD*% 16 | G04 APERTURE END LIST* 17 | D10* 18 | X86000000Y-38000000D02* 19 | X60000000Y-38000000D01* 20 | X86000000Y-90000000D02* 21 | X86000000Y-38000000D01* 22 | X60000000Y-90000000D02* 23 | X86000000Y-90000000D01* 24 | X60000000Y-38000000D02* 25 | X60000000Y-90000000D01* 26 | M02* 27 | -------------------------------------------------------------------------------- /hw/power-clamp/gerber/power-clamp-F_Mask.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-08-26T21:24:32+10:00*% 3 | %TF.ProjectId,power-clamp,706f7765-722d-4636-9c61-6d702e6b6963,rev?*% 4 | %TF.SameCoordinates,Original*% 5 | %TF.FileFunction,Soldermask,Top*% 6 | %TF.FilePolarity,Negative*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-08-26 21:24:32* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | %ADD10R,10.800000X9.400000*% 15 | %ADD11R,1.100000X8.000000*% 16 | %ADD12R,4.000000X2.800000*% 17 | %ADD13R,0.800000X1.900000*% 18 | %ADD14O,1.700000X1.700000*% 19 | %ADD15R,1.700000X1.700000*% 20 | %ADD16R,1.500000X2.700000*% 21 | G04 APERTURE END LIST* 22 | D10* 23 | %TO.C,Q2*% 24 | X70620000Y-52005000D03* 25 | D11* 26 | X73120000Y-62880000D03* 27 | X70620000Y-62880000D03* 28 | X68080000Y-62880000D03* 29 | %TD*% 30 | D12* 31 | %TO.C,D1*% 32 | X77000000Y-78000000D03* 33 | X65500000Y-78000000D03* 34 | %TD*% 35 | %TO.C,R3*% 36 | G36* 37 | G01* 38 | X63350000Y-68549999D02* 39 | X63350000Y-69450001D01* 40 | G75* 41 | G02* 42 | X63100001Y-69700000I-249999J0D01* 43 | G01* 44 | X62449999Y-69700000D01* 45 | G75* 46 | G02* 47 | X62200000Y-69450001I0J249999D01* 48 | G01* 49 | X62200000Y-68549999D01* 50 | G75* 51 | G02* 52 | X62449999Y-68300000I249999J0D01* 53 | G01* 54 | X63100001Y-68300000D01* 55 | G75* 56 | G02* 57 | X63350000Y-68549999I0J-249999D01* 58 | G01* 59 | G37* 60 | G36* 61 | G01* 62 | X65400000Y-68549999D02* 63 | X65400000Y-69450001D01* 64 | G75* 65 | G02* 66 | X65150001Y-69700000I-249999J0D01* 67 | G01* 68 | X64499999Y-69700000D01* 69 | G75* 70 | G02* 71 | X64250000Y-69450001I0J249999D01* 72 | G01* 73 | X64250000Y-68549999D01* 74 | G75* 75 | G02* 76 | X64499999Y-68300000I249999J0D01* 77 | G01* 78 | X65150001Y-68300000D01* 79 | G75* 80 | G02* 81 | X65400000Y-68549999I0J-249999D01* 82 | G01* 83 | G37* 84 | %TD*% 85 | %TO.C,R2*% 86 | G36* 87 | G01* 88 | X74880000Y-73570001D02* 89 | X74880000Y-72669999D01* 90 | G75* 91 | G02* 92 | X75129999Y-72420000I249999J0D01* 93 | G01* 94 | X75780001Y-72420000D01* 95 | G75* 96 | G02* 97 | X76030000Y-72669999I0J-249999D01* 98 | G01* 99 | X76030000Y-73570001D01* 100 | G75* 101 | G02* 102 | X75780001Y-73820000I-249999J0D01* 103 | G01* 104 | X75129999Y-73820000D01* 105 | G75* 106 | G02* 107 | X74880000Y-73570001I0J249999D01* 108 | G01* 109 | G37* 110 | G36* 111 | G01* 112 | X72830000Y-73570001D02* 113 | X72830000Y-72669999D01* 114 | G75* 115 | G02* 116 | X73079999Y-72420000I249999J0D01* 117 | G01* 118 | X73730001Y-72420000D01* 119 | G75* 120 | G02* 121 | X73980000Y-72669999I0J-249999D01* 122 | G01* 123 | X73980000Y-73570001D01* 124 | G75* 125 | G02* 126 | X73730001Y-73820000I-249999J0D01* 127 | G01* 128 | X73079999Y-73820000D01* 129 | G75* 130 | G02* 131 | X72830000Y-73570001I0J249999D01* 132 | G01* 133 | G37* 134 | %TD*% 135 | %TO.C,R1*% 136 | G36* 137 | G01* 138 | X79350000Y-72749999D02* 139 | X79350000Y-73650001D01* 140 | G75* 141 | G02* 142 | X79100001Y-73900000I-249999J0D01* 143 | G01* 144 | X78449999Y-73900000D01* 145 | G75* 146 | G02* 147 | X78200000Y-73650001I0J249999D01* 148 | G01* 149 | X78200000Y-72749999D01* 150 | G75* 151 | G02* 152 | X78449999Y-72500000I249999J0D01* 153 | G01* 154 | X79100001Y-72500000D01* 155 | G75* 156 | G02* 157 | X79350000Y-72749999I0J-249999D01* 158 | G01* 159 | G37* 160 | G36* 161 | G01* 162 | X81400000Y-72749999D02* 163 | X81400000Y-73650001D01* 164 | G75* 165 | G02* 166 | X81150001Y-73900000I-249999J0D01* 167 | G01* 168 | X80499999Y-73900000D01* 169 | G75* 170 | G02* 171 | X80250000Y-73650001I0J249999D01* 172 | G01* 173 | X80250000Y-72749999D01* 174 | G75* 175 | G02* 176 | X80499999Y-72500000I249999J0D01* 177 | G01* 178 | X81150001Y-72500000D01* 179 | G75* 180 | G02* 181 | X81400000Y-72749999I0J-249999D01* 182 | G01* 183 | G37* 184 | %TD*% 185 | D13* 186 | %TO.C,Q1*% 187 | X68080000Y-69080000D03* 188 | X69030000Y-72080000D03* 189 | X67130000Y-72080000D03* 190 | %TD*% 191 | D14* 192 | %TO.C,J2*% 193 | X70620000Y-83955000D03* 194 | D15* 195 | X73160000Y-83955000D03* 196 | %TD*% 197 | D14* 198 | %TO.C,J1*% 199 | X70620000Y-41156000D03* 200 | D15* 201 | X73160000Y-41156000D03* 202 | %TD*% 203 | D16* 204 | %TO.C,D4*% 205 | X78100000Y-69310000D03* 206 | X73300000Y-69310000D03* 207 | %TD*% 208 | %TO.C,D3*% 209 | X82900000Y-63000000D03* 210 | X78100000Y-63000000D03* 211 | %TD*% 212 | %TO.C,D2*% 213 | X78100000Y-59190000D03* 214 | X82900000Y-59190000D03* 215 | %TD*% 216 | M02* 217 | -------------------------------------------------------------------------------- /hw/power-clamp/gerber/power-clamp-F_Paste.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.99.0+really5.1.10+dfsg1-1*% 2 | %TF.CreationDate,2021-08-26T21:24:32+10:00*% 3 | %TF.ProjectId,power-clamp,706f7765-722d-4636-9c61-6d702e6b6963,rev?*% 4 | %TF.SameCoordinates,Original*% 5 | %TF.FileFunction,Paste,Top*% 6 | %TF.FilePolarity,Positive*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.99.0+really5.1.10+dfsg1-1) date 2021-08-26 21:24:32* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | %ADD10R,5.250000X4.550000*% 15 | %ADD11R,1.100000X8.000000*% 16 | %ADD12R,4.000000X2.800000*% 17 | %ADD13R,0.800000X1.900000*% 18 | %ADD14R,1.500000X2.700000*% 19 | G04 APERTURE END LIST* 20 | D10* 21 | %TO.C,Q2*% 22 | X73395000Y-54430000D03* 23 | X67845000Y-49580000D03* 24 | X67845000Y-54430000D03* 25 | X73395000Y-49580000D03* 26 | D11* 27 | X73120000Y-62880000D03* 28 | X70620000Y-62880000D03* 29 | X68080000Y-62880000D03* 30 | %TD*% 31 | D12* 32 | %TO.C,D1*% 33 | X77000000Y-78000000D03* 34 | X65500000Y-78000000D03* 35 | %TD*% 36 | %TO.C,R3*% 37 | G36* 38 | G01* 39 | X63350000Y-68549999D02* 40 | X63350000Y-69450001D01* 41 | G75* 42 | G02* 43 | X63100001Y-69700000I-249999J0D01* 44 | G01* 45 | X62449999Y-69700000D01* 46 | G75* 47 | G02* 48 | X62200000Y-69450001I0J249999D01* 49 | G01* 50 | X62200000Y-68549999D01* 51 | G75* 52 | G02* 53 | X62449999Y-68300000I249999J0D01* 54 | G01* 55 | X63100001Y-68300000D01* 56 | G75* 57 | G02* 58 | X63350000Y-68549999I0J-249999D01* 59 | G01* 60 | G37* 61 | G36* 62 | G01* 63 | X65400000Y-68549999D02* 64 | X65400000Y-69450001D01* 65 | G75* 66 | G02* 67 | X65150001Y-69700000I-249999J0D01* 68 | G01* 69 | X64499999Y-69700000D01* 70 | G75* 71 | G02* 72 | X64250000Y-69450001I0J249999D01* 73 | G01* 74 | X64250000Y-68549999D01* 75 | G75* 76 | G02* 77 | X64499999Y-68300000I249999J0D01* 78 | G01* 79 | X65150001Y-68300000D01* 80 | G75* 81 | G02* 82 | X65400000Y-68549999I0J-249999D01* 83 | G01* 84 | G37* 85 | %TD*% 86 | %TO.C,R2*% 87 | G36* 88 | G01* 89 | X74880000Y-73570001D02* 90 | X74880000Y-72669999D01* 91 | G75* 92 | G02* 93 | X75129999Y-72420000I249999J0D01* 94 | G01* 95 | X75780001Y-72420000D01* 96 | G75* 97 | G02* 98 | X76030000Y-72669999I0J-249999D01* 99 | G01* 100 | X76030000Y-73570001D01* 101 | G75* 102 | G02* 103 | X75780001Y-73820000I-249999J0D01* 104 | G01* 105 | X75129999Y-73820000D01* 106 | G75* 107 | G02* 108 | X74880000Y-73570001I0J249999D01* 109 | G01* 110 | G37* 111 | G36* 112 | G01* 113 | X72830000Y-73570001D02* 114 | X72830000Y-72669999D01* 115 | G75* 116 | G02* 117 | X73079999Y-72420000I249999J0D01* 118 | G01* 119 | X73730001Y-72420000D01* 120 | G75* 121 | G02* 122 | X73980000Y-72669999I0J-249999D01* 123 | G01* 124 | X73980000Y-73570001D01* 125 | G75* 126 | G02* 127 | X73730001Y-73820000I-249999J0D01* 128 | G01* 129 | X73079999Y-73820000D01* 130 | G75* 131 | G02* 132 | X72830000Y-73570001I0J249999D01* 133 | G01* 134 | G37* 135 | %TD*% 136 | %TO.C,R1*% 137 | G36* 138 | G01* 139 | X79350000Y-72749999D02* 140 | X79350000Y-73650001D01* 141 | G75* 142 | G02* 143 | X79100001Y-73900000I-249999J0D01* 144 | G01* 145 | X78449999Y-73900000D01* 146 | G75* 147 | G02* 148 | X78200000Y-73650001I0J249999D01* 149 | G01* 150 | X78200000Y-72749999D01* 151 | G75* 152 | G02* 153 | X78449999Y-72500000I249999J0D01* 154 | G01* 155 | X79100001Y-72500000D01* 156 | G75* 157 | G02* 158 | X79350000Y-72749999I0J-249999D01* 159 | G01* 160 | G37* 161 | G36* 162 | G01* 163 | X81400000Y-72749999D02* 164 | X81400000Y-73650001D01* 165 | G75* 166 | G02* 167 | X81150001Y-73900000I-249999J0D01* 168 | G01* 169 | X80499999Y-73900000D01* 170 | G75* 171 | G02* 172 | X80250000Y-73650001I0J249999D01* 173 | G01* 174 | X80250000Y-72749999D01* 175 | G75* 176 | G02* 177 | X80499999Y-72500000I249999J0D01* 178 | G01* 179 | X81150001Y-72500000D01* 180 | G75* 181 | G02* 182 | X81400000Y-72749999I0J-249999D01* 183 | G01* 184 | G37* 185 | %TD*% 186 | D13* 187 | %TO.C,Q1*% 188 | X68080000Y-69080000D03* 189 | X69030000Y-72080000D03* 190 | X67130000Y-72080000D03* 191 | %TD*% 192 | D14* 193 | %TO.C,D4*% 194 | X78100000Y-69310000D03* 195 | X73300000Y-69310000D03* 196 | %TD*% 197 | %TO.C,D3*% 198 | X82900000Y-63000000D03* 199 | X78100000Y-63000000D03* 200 | %TD*% 201 | %TO.C,D2*% 202 | X78100000Y-59190000D03* 203 | X82900000Y-59190000D03* 204 | %TD*% 205 | M02* 206 | -------------------------------------------------------------------------------- /hw/power-clamp/gerber/power-clamp-job.gbrjob: -------------------------------------------------------------------------------- 1 | { 2 | "Header": 3 | { 4 | "GenerationSoftware": 5 | { 6 | "Vendor": "KiCad", 7 | "Application": "Pcbnew", 8 | "Version": "5.99.0+really5.1.10+dfsg1-1" 9 | }, 10 | "CreationDate": "2021-08-26T21:24:32+10:00" 11 | }, 12 | "GeneralSpecs": 13 | { 14 | "ProjectId": 15 | { 16 | "Name": "power-clamp", 17 | "GUID": "706f7765-722d-4636-9c61-6d702e6b6963", 18 | "Revision": "rev?" 19 | }, 20 | "Size": 21 | { 22 | "X": 26.050, 23 | "Y": 52.050 24 | }, 25 | "LayerNumber": 2, 26 | "BoardThickness": 1.600 27 | }, 28 | "DesignRules": 29 | [ 30 | { 31 | "Layers": "Outer", 32 | "PadToPad": 0.200, 33 | "PadToTrack": 0.200, 34 | "TrackToTrack": 0.200, 35 | "MinLineWidth": 0.762, 36 | "TrackToRegion": 0.508, 37 | "RegionToRegion": 0.508 38 | } 39 | ], 40 | "FilesAttributes": 41 | [ 42 | { 43 | "Path": "power-clamp-F_Cu.gbr", 44 | "FileFunction": "Copper,L1,Top", 45 | "FilePolarity": "Positive" 46 | }, 47 | { 48 | "Path": "power-clamp-B_Cu.gbr", 49 | "FileFunction": "Copper,L2,Bot", 50 | "FilePolarity": "Positive" 51 | }, 52 | { 53 | "Path": "power-clamp-F_Paste.gbr", 54 | "FileFunction": "SolderPaste,Top", 55 | "FilePolarity": "Positive" 56 | }, 57 | { 58 | "Path": "power-clamp-B_Paste.gbr", 59 | "FileFunction": "SolderPaste,Bot", 60 | "FilePolarity": "Positive" 61 | }, 62 | { 63 | "Path": "power-clamp-F_SilkS.gbr", 64 | "FileFunction": "Legend,Top", 65 | "FilePolarity": "Positive" 66 | }, 67 | { 68 | "Path": "power-clamp-B_SilkS.gbr", 69 | "FileFunction": "Legend,Bot", 70 | "FilePolarity": "Positive" 71 | }, 72 | { 73 | "Path": "power-clamp-F_Mask.gbr", 74 | "FileFunction": "SolderMask,Top", 75 | "FilePolarity": "Negative" 76 | }, 77 | { 78 | "Path": "power-clamp-B_Mask.gbr", 79 | "FileFunction": "SolderMask,Bot", 80 | "FilePolarity": "Negative" 81 | }, 82 | { 83 | "Path": "power-clamp-Edge_Cuts.gbr", 84 | "FileFunction": "Profile", 85 | "FilePolarity": "Positive" 86 | } 87 | ], 88 | "MaterialStackup": 89 | [ 90 | { 91 | "Type": "Legend", 92 | "Notes": "Layer F.SilkS" 93 | }, 94 | { 95 | "Type": "SolderPaste", 96 | "Notes": "Layer F.Paste" 97 | }, 98 | { 99 | "Type": "SolderMask", 100 | "Notes": "Layer F.Mask" 101 | }, 102 | { 103 | "Type": "Copper", 104 | "Notes": "Layer F.Cu" 105 | }, 106 | { 107 | "Type": "Dielectric", 108 | "Material": "FR4", 109 | "Notes": "Layers L1/L2" 110 | }, 111 | { 112 | "Type": "Copper", 113 | "Notes": "Layer B.Cu" 114 | }, 115 | { 116 | "Type": "SolderMask", 117 | "Notes": "Layer B.Mask" 118 | }, 119 | { 120 | "Type": "SolderPaste", 121 | "Notes": "Layer B.Paste" 122 | }, 123 | { 124 | "Type": "Legend", 125 | "Notes": "Layer B.SilkS" 126 | } 127 | ] 128 | } 129 | -------------------------------------------------------------------------------- /hw/power-clamp/gerber/power-clamp.drl: -------------------------------------------------------------------------------- 1 | M48 2 | METRIC,TZ 3 | T1C1.000 4 | % 5 | G90 6 | G05 7 | T1 8 | X70620Y-41156 9 | X70620Y-83955 10 | X73160Y-41156 11 | X73160Y-83955 12 | T0 13 | M30 14 | -------------------------------------------------------------------------------- /hw/power-clamp/power-clamp-cache.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.4 2 | #encoding utf-8 3 | # 4 | # Connector_Conn_01x02_Male 5 | # 6 | DEF Connector_Conn_01x02_Male J 0 40 Y N 1 F N 7 | F0 "J" 0 100 50 H V C CNN 8 | F1 "Connector_Conn_01x02_Male" 0 -200 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 -95 0 -105 1 1 6 F 16 | S 34 5 0 -5 1 1 6 F 17 | P 2 1 1 6 50 -100 34 -100 N 18 | P 2 1 1 6 50 0 34 0 N 19 | X Pin_1 1 200 0 150 L 50 50 1 1 P 20 | X Pin_2 2 200 -100 150 L 50 50 1 1 P 21 | ENDDRAW 22 | ENDDEF 23 | # 24 | # Device_D_Small_ALT 25 | # 26 | DEF Device_D_Small_ALT D 0 10 N N 1 F N 27 | F0 "D" -50 80 50 H V L CNN 28 | F1 "Device_D_Small_ALT" -150 -80 50 H V L CNN 29 | F2 "" 0 0 50 V I C CNN 30 | F3 "" 0 0 50 V I C CNN 31 | $FPLIST 32 | TO-???* 33 | *_Diode_* 34 | *SingleDiode* 35 | D_* 36 | $ENDFPLIST 37 | DRAW 38 | P 2 0 1 0 -30 -40 -30 40 N 39 | P 2 0 1 0 -30 0 30 0 N 40 | P 4 0 1 0 30 -40 -30 0 30 40 30 -40 F 41 | X K 1 -100 0 70 R 50 50 1 1 P 42 | X A 2 100 0 70 L 50 50 1 1 P 43 | ENDDRAW 44 | ENDDEF 45 | # 46 | # Device_D_Zener_Small_ALT 47 | # 48 | DEF Device_D_Zener_Small_ALT D 0 10 N N 1 F N 49 | F0 "D" 0 90 50 H V C CNN 50 | F1 "Device_D_Zener_Small_ALT" 0 -90 50 H V C CNN 51 | F2 "" 0 0 50 V I C CNN 52 | F3 "" 0 0 50 V I C CNN 53 | $FPLIST 54 | TO-???* 55 | *_Diode_* 56 | *SingleDiode* 57 | D_* 58 | $ENDFPLIST 59 | DRAW 60 | P 2 0 1 0 30 0 -30 0 N 61 | P 3 0 1 0 -10 40 -30 40 -30 -40 N 62 | P 4 0 1 0 30 40 -30 0 30 -40 30 40 F 63 | X K 1 -100 0 70 R 50 50 1 1 P 64 | X A 2 100 0 70 L 50 50 1 1 P 65 | ENDDRAW 66 | ENDDEF 67 | # 68 | # Device_Polyfuse_Small 69 | # 70 | DEF Device_Polyfuse_Small F 0 0 N Y 1 F N 71 | F0 "F" -75 0 50 V V C CNN 72 | F1 "Device_Polyfuse_Small" 75 0 50 V V C CNN 73 | F2 "" 50 -200 50 H I L CNN 74 | F3 "" 0 0 50 H I C CNN 75 | $FPLIST 76 | *polyfuse* 77 | *PTC* 78 | $ENDFPLIST 79 | DRAW 80 | S -20 50 20 -50 0 1 0 N 81 | P 2 0 1 0 0 100 0 -100 N 82 | P 4 0 1 0 -40 50 -40 30 40 -30 40 -50 N 83 | X ~ 1 0 100 25 D 50 50 1 1 P 84 | X ~ 2 0 -100 25 U 50 50 1 1 P 85 | ENDDRAW 86 | ENDDEF 87 | # 88 | # Device_Q_PMOS_GDS 89 | # 90 | DEF Device_Q_PMOS_GDS Q 0 0 Y N 1 F N 91 | F0 "Q" 200 50 50 H V L CNN 92 | F1 "Device_Q_PMOS_GDS" 200 -50 50 H V L CNN 93 | F2 "" 200 100 50 H I C CNN 94 | F3 "" 0 0 50 H I C CNN 95 | DRAW 96 | C 65 0 111 0 1 10 N 97 | C 100 -70 11 0 1 0 F 98 | C 100 70 11 0 1 0 F 99 | P 2 0 1 0 2 0 10 0 N 100 | P 2 0 1 0 30 -70 100 -70 N 101 | P 2 0 1 10 30 -50 30 -90 N 102 | P 2 0 1 0 30 0 100 0 N 103 | P 2 0 1 10 30 20 30 -20 N 104 | P 2 0 1 0 30 70 100 70 N 105 | P 2 0 1 10 30 90 30 50 N 106 | P 2 0 1 0 100 -70 100 -100 N 107 | P 2 0 1 0 100 -70 100 0 N 108 | P 2 0 1 0 100 100 100 70 N 109 | P 3 0 1 10 10 75 10 -75 10 -75 N 110 | P 4 0 1 0 90 0 50 -15 50 15 90 0 F 111 | P 4 0 1 0 100 -70 130 -70 130 70 100 70 N 112 | P 4 0 1 0 110 -20 115 -15 145 -15 150 -10 N 113 | P 4 0 1 0 130 -15 115 10 145 10 130 -15 N 114 | X G 1 -200 0 200 R 50 50 1 1 I 115 | X D 2 100 200 100 D 50 50 1 1 P 116 | X S 3 100 -200 100 U 50 50 1 1 P 117 | ENDDRAW 118 | ENDDEF 119 | # 120 | # Device_Q_PNP_BEC 121 | # 122 | DEF Device_Q_PNP_BEC Q 0 0 Y N 1 F N 123 | F0 "Q" 200 50 50 H V L CNN 124 | F1 "Device_Q_PNP_BEC" 200 -50 50 H V L CNN 125 | F2 "" 200 100 50 H I C CNN 126 | F3 "" 0 0 50 H I C CNN 127 | DRAW 128 | C 50 0 111 0 1 10 N 129 | P 2 0 1 0 25 25 100 100 N 130 | P 3 0 1 0 25 -25 100 -100 100 -100 N 131 | P 3 0 1 20 25 75 25 -75 25 -75 N 132 | P 5 0 1 0 90 -70 70 -90 50 -50 90 -70 90 -70 F 133 | X B 1 -200 0 225 R 50 50 1 1 I 134 | X E 2 100 -200 100 U 50 50 1 1 P 135 | X C 3 100 200 100 D 50 50 1 1 P 136 | ENDDRAW 137 | ENDDEF 138 | # 139 | # Device_R_Small 140 | # 141 | DEF Device_R_Small R 0 10 N N 1 F N 142 | F0 "R" 30 20 50 H V L CNN 143 | F1 "Device_R_Small" 30 -40 50 H V L CNN 144 | F2 "" 0 0 50 H I C CNN 145 | F3 "" 0 0 50 H I C CNN 146 | $FPLIST 147 | R_* 148 | $ENDFPLIST 149 | DRAW 150 | S -30 70 30 -70 0 1 8 N 151 | X ~ 1 0 100 30 D 50 50 1 1 P 152 | X ~ 2 0 -100 30 U 50 50 1 1 P 153 | ENDDRAW 154 | ENDDEF 155 | # 156 | # power_+5V 157 | # 158 | DEF power_+5V #PWR 0 0 Y Y 1 F P 159 | F0 "#PWR" 0 -150 50 H I C CNN 160 | F1 "power_+5V" 0 140 50 H V C CNN 161 | F2 "" 0 0 50 H I C CNN 162 | F3 "" 0 0 50 H I C CNN 163 | DRAW 164 | P 2 0 1 0 -30 50 0 100 N 165 | P 2 0 1 0 0 0 0 100 N 166 | P 2 0 1 0 0 100 30 50 N 167 | X +5V 1 0 0 0 U 50 50 1 1 W N 168 | ENDDRAW 169 | ENDDEF 170 | # 171 | # power_GNDA 172 | # 173 | DEF power_GNDA #PWR 0 0 Y Y 1 F P 174 | F0 "#PWR" 0 -250 50 H I C CNN 175 | F1 "power_GNDA" 0 -150 50 H V C CNN 176 | F2 "" 0 0 50 H I C CNN 177 | F3 "" 0 0 50 H I C CNN 178 | DRAW 179 | P 6 0 1 0 0 0 0 -50 50 -50 0 -100 -50 -50 0 -50 N 180 | X GNDA 1 0 0 0 D 50 50 1 1 W N 181 | ENDDRAW 182 | ENDDEF 183 | # 184 | # power_VCC 185 | # 186 | DEF power_VCC #PWR 0 0 Y Y 1 F P 187 | F0 "#PWR" 0 -150 50 H I C CNN 188 | F1 "power_VCC" 0 150 50 H V C CNN 189 | F2 "" 0 0 50 H I C CNN 190 | F3 "" 0 0 50 H I C CNN 191 | DRAW 192 | C 0 75 25 0 1 0 N 193 | P 2 0 1 0 0 0 0 50 N 194 | X VCC 1 0 0 0 U 50 50 1 1 W N 195 | ENDDRAW 196 | ENDDEF 197 | # 198 | #End Library 199 | -------------------------------------------------------------------------------- /hw/power-clamp/power-clamp.pro: -------------------------------------------------------------------------------- 1 | update=Fri 27 Aug 2021 18:19:49 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 | [schematic_editor] 16 | version=1 17 | PageLayoutDescrFile= 18 | PlotDirectoryName= 19 | SubpartIdSeparator=0 20 | SubpartFirstId=65 21 | NetFmtName=Pcbnew 22 | SpiceAjustPassiveValues=0 23 | LabSize=50 24 | ERC_TestSimilarLabels=1 25 | [pcbnew] 26 | version=1 27 | PageLayoutDescrFile= 28 | LastNetListRead=power-clamp.net 29 | CopperLayerCount=2 30 | BoardThickness=1.6 31 | AllowMicroVias=0 32 | AllowBlindVias=0 33 | RequireCourtyardDefinitions=0 34 | ProhibitOverlappingCourtyards=1 35 | MinTrackWidth=0.2 36 | MinViaDiameter=0.4 37 | MinViaDrill=0.3 38 | MinMicroViaDiameter=0.2 39 | MinMicroViaDrill=0.09999999999999999 40 | MinHoleToHole=0.25 41 | TrackWidth1=0.25 42 | TrackWidth2=0.3048 43 | TrackWidth3=0.4064 44 | TrackWidth4=0.508 45 | TrackWidth5=0.762 46 | TrackWidth6=1.016 47 | ViaDiameter1=0.8 48 | ViaDrill1=0.4 49 | dPairWidth1=0.2 50 | dPairGap1=0.25 51 | dPairViaGap1=0.25 52 | SilkLineWidth=0.12 53 | SilkTextSizeV=1 54 | SilkTextSizeH=1 55 | SilkTextSizeThickness=0.15 56 | SilkTextItalic=0 57 | SilkTextUpright=1 58 | CopperLineWidth=0.2 59 | CopperTextSizeV=1.5 60 | CopperTextSizeH=1.5 61 | CopperTextThickness=0.3 62 | CopperTextItalic=0 63 | CopperTextUpright=1 64 | EdgeCutLineWidth=0.05 65 | CourtyardLineWidth=0.05 66 | OthersLineWidth=0.15 67 | OthersTextSizeV=1 68 | OthersTextSizeH=1 69 | OthersTextSizeThickness=0.15 70 | OthersTextItalic=0 71 | OthersTextUpright=1 72 | SolderMaskClearance=0 73 | SolderMaskMinWidth=0 74 | SolderPasteClearance=0 75 | SolderPasteRatio=0 76 | [pcbnew/Layer.F.Cu] 77 | Name=F.Cu 78 | Type=0 79 | Enabled=1 80 | [pcbnew/Layer.In1.Cu] 81 | Name=In1.Cu 82 | Type=0 83 | Enabled=0 84 | [pcbnew/Layer.In2.Cu] 85 | Name=In2.Cu 86 | Type=0 87 | Enabled=0 88 | [pcbnew/Layer.In3.Cu] 89 | Name=In3.Cu 90 | Type=0 91 | Enabled=0 92 | [pcbnew/Layer.In4.Cu] 93 | Name=In4.Cu 94 | Type=0 95 | Enabled=0 96 | [pcbnew/Layer.In5.Cu] 97 | Name=In5.Cu 98 | Type=0 99 | Enabled=0 100 | [pcbnew/Layer.In6.Cu] 101 | Name=In6.Cu 102 | Type=0 103 | Enabled=0 104 | [pcbnew/Layer.In7.Cu] 105 | Name=In7.Cu 106 | Type=0 107 | Enabled=0 108 | [pcbnew/Layer.In8.Cu] 109 | Name=In8.Cu 110 | Type=0 111 | Enabled=0 112 | [pcbnew/Layer.In9.Cu] 113 | Name=In9.Cu 114 | Type=0 115 | Enabled=0 116 | [pcbnew/Layer.In10.Cu] 117 | Name=In10.Cu 118 | Type=0 119 | Enabled=0 120 | [pcbnew/Layer.In11.Cu] 121 | Name=In11.Cu 122 | Type=0 123 | Enabled=0 124 | [pcbnew/Layer.In12.Cu] 125 | Name=In12.Cu 126 | Type=0 127 | Enabled=0 128 | [pcbnew/Layer.In13.Cu] 129 | Name=In13.Cu 130 | Type=0 131 | Enabled=0 132 | [pcbnew/Layer.In14.Cu] 133 | Name=In14.Cu 134 | Type=0 135 | Enabled=0 136 | [pcbnew/Layer.In15.Cu] 137 | Name=In15.Cu 138 | Type=0 139 | Enabled=0 140 | [pcbnew/Layer.In16.Cu] 141 | Name=In16.Cu 142 | Type=0 143 | Enabled=0 144 | [pcbnew/Layer.In17.Cu] 145 | Name=In17.Cu 146 | Type=0 147 | Enabled=0 148 | [pcbnew/Layer.In18.Cu] 149 | Name=In18.Cu 150 | Type=0 151 | Enabled=0 152 | [pcbnew/Layer.In19.Cu] 153 | Name=In19.Cu 154 | Type=0 155 | Enabled=0 156 | [pcbnew/Layer.In20.Cu] 157 | Name=In20.Cu 158 | Type=0 159 | Enabled=0 160 | [pcbnew/Layer.In21.Cu] 161 | Name=In21.Cu 162 | Type=0 163 | Enabled=0 164 | [pcbnew/Layer.In22.Cu] 165 | Name=In22.Cu 166 | Type=0 167 | Enabled=0 168 | [pcbnew/Layer.In23.Cu] 169 | Name=In23.Cu 170 | Type=0 171 | Enabled=0 172 | [pcbnew/Layer.In24.Cu] 173 | Name=In24.Cu 174 | Type=0 175 | Enabled=0 176 | [pcbnew/Layer.In25.Cu] 177 | Name=In25.Cu 178 | Type=0 179 | Enabled=0 180 | [pcbnew/Layer.In26.Cu] 181 | Name=In26.Cu 182 | Type=0 183 | Enabled=0 184 | [pcbnew/Layer.In27.Cu] 185 | Name=In27.Cu 186 | Type=0 187 | Enabled=0 188 | [pcbnew/Layer.In28.Cu] 189 | Name=In28.Cu 190 | Type=0 191 | Enabled=0 192 | [pcbnew/Layer.In29.Cu] 193 | Name=In29.Cu 194 | Type=0 195 | Enabled=0 196 | [pcbnew/Layer.In30.Cu] 197 | Name=In30.Cu 198 | Type=0 199 | Enabled=0 200 | [pcbnew/Layer.B.Cu] 201 | Name=B.Cu 202 | Type=0 203 | Enabled=1 204 | [pcbnew/Layer.B.Adhes] 205 | Enabled=1 206 | [pcbnew/Layer.F.Adhes] 207 | Enabled=1 208 | [pcbnew/Layer.B.Paste] 209 | Enabled=1 210 | [pcbnew/Layer.F.Paste] 211 | Enabled=1 212 | [pcbnew/Layer.B.SilkS] 213 | Enabled=1 214 | [pcbnew/Layer.F.SilkS] 215 | Enabled=1 216 | [pcbnew/Layer.B.Mask] 217 | Enabled=1 218 | [pcbnew/Layer.F.Mask] 219 | Enabled=1 220 | [pcbnew/Layer.Dwgs.User] 221 | Enabled=1 222 | [pcbnew/Layer.Cmts.User] 223 | Enabled=1 224 | [pcbnew/Layer.Eco1.User] 225 | Enabled=1 226 | [pcbnew/Layer.Eco2.User] 227 | Enabled=1 228 | [pcbnew/Layer.Edge.Cuts] 229 | Enabled=1 230 | [pcbnew/Layer.Margin] 231 | Enabled=1 232 | [pcbnew/Layer.B.CrtYd] 233 | Enabled=1 234 | [pcbnew/Layer.F.CrtYd] 235 | Enabled=1 236 | [pcbnew/Layer.B.Fab] 237 | Enabled=1 238 | [pcbnew/Layer.F.Fab] 239 | Enabled=1 240 | [pcbnew/Layer.Rescue] 241 | Enabled=0 242 | [pcbnew/Netclasses] 243 | [pcbnew/Netclasses/Default] 244 | Name=Default 245 | Clearance=0.2 246 | TrackWidth=0.25 247 | ViaDiameter=0.8 248 | ViaDrill=0.4 249 | uViaDiameter=0.3 250 | uViaDrill=0.1 251 | dPairWidth=0.2 252 | dPairGap=0.25 253 | dPairViaGap=0.25 254 | -------------------------------------------------------------------------------- /jlink/flash.cmd: -------------------------------------------------------------------------------- 1 | connect 2 | RSetType 0 3 | h 4 | r 5 | loadfile els.hex 6 | r 7 | writeDP 1 0 8 | writeDP 1 0 9 | q 10 | -------------------------------------------------------------------------------- /jlink/reset.cmd: -------------------------------------------------------------------------------- 1 | f 2 | h 3 | r 4 | Sleep 200 5 | writeDP 1 0 6 | writeDP 1 0 7 | q 8 | -------------------------------------------------------------------------------- /linker/stm32f446re.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the libopencm3 project. 3 | * 4 | * Copyright (C) 2009 Uwe Hermann 5 | * 6 | * This library is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with this library. If not, see . 18 | */ 19 | 20 | /* Linker script for Lisa-M (STM32F446RET6, 512K flash, 128K RAM). */ 21 | 22 | /* Define memory regions. */ 23 | MEMORY 24 | { 25 | rom (rx) : ORIGIN = 0x08000000, LENGTH = 512K 26 | ram (rwx) : ORIGIN = 0x20000000, LENGTH = 128K 27 | } 28 | 29 | /* Include the common ld script. */ 30 | INCLUDE cortex-m-generic.ld 31 | -------------------------------------------------------------------------------- /src/bitmaps/infeed_image.c: -------------------------------------------------------------------------------- 1 | #include "tft/image.h" 2 | 3 | const tft_image_t infeed_dia = { 4 | .width = 38, 5 | .height = 38, 6 | .data = (const uint8_t[]){ 7 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 8 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 9 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 10 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 11 | 0x00, 0x00, 0x00, 0x01, 0xff, 0xfc, 0x00, 0x00, 0x07, 0xff, 12 | 0xe0, 0x00, 0x00, 0x1f, 0xff, 0x00, 0x00, 0x00, 0x7f, 0xf8, 13 | 0x00, 0x00, 0x01, 0xff, 0xc0, 0x00, 0x00, 0x07, 0xfe, 0x00, 14 | 0x00, 0x00, 0x1f, 0xfc, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 15 | 0x00, 0x01, 0xff, 0x80, 0x00, 0x00, 0x07, 0xfc, 0x40, 0x00, 16 | 0x00, 0x1f, 0x63, 0x80, 0x00, 0x00, 0x78, 0x1c, 0x00, 0x00, 17 | 0x01, 0xc0, 0xe2, 0x00, 0x00, 0x06, 0x01, 0x1c, 0x00, 0x00, 18 | 0x10, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x07, 0x10, 0x00, 0x00, 19 | 0x00, 0x08, 0xe0, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 20 | 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 21 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 22 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 23 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 24 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 25 | 0x00 26 | } 27 | }; 28 | 29 | const tft_image_t infeed_dia_l = { 30 | .width = 38, 31 | .height = 38, 32 | .data = (const uint8_t[]){ 33 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 34 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 35 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 36 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xe0, 0x00, 0x00, 0x1f, 38 | 0xff, 0x80, 0x00, 0x00, 0x3f, 0xfe, 0x00, 0x00, 0x00, 0x7f, 39 | 0xf8, 0x00, 0x00, 0x00, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, 40 | 0x80, 0x00, 0x00, 0x0f, 0xfe, 0x00, 0x00, 0x00, 0x3f, 0xf8, 41 | 0x00, 0x00, 0x00, 0x7f, 0xe0, 0x00, 0x00, 0x08, 0xff, 0x80, 42 | 0x00, 0x00, 0x71, 0xbe, 0x00, 0x00, 0x00, 0xe0, 0x78, 0x00, 43 | 0x00, 0x11, 0xc0, 0xe0, 0x00, 0x00, 0xe2, 0x01, 0x80, 0x00, 44 | 0x01, 0xc0, 0x02, 0x00, 0x00, 0x23, 0x80, 0x00, 0x00, 0x01, 45 | 0xc4, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x07, 46 | 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 48 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 49 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 50 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 51 | 0x00 52 | } 53 | }; 54 | 55 | const tft_image_t infeed_st = { 56 | .width = 40, 57 | .height = 40, 58 | .data = (const uint8_t[]){ 59 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 60 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 61 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 62 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 63 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 64 | 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 65 | 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 66 | 0x00, 0x01, 0xff, 0x80, 0x00, 0x00, 0x07, 0xff, 0xe0, 0x00, 67 | 0x00, 0x0f, 0xff, 0xf0, 0x00, 0x00, 0x1f, 0xff, 0xf8, 0x00, 68 | 0x00, 0x3f, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 69 | 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 70 | 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 71 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 72 | 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 73 | 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 74 | 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 75 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 76 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 77 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 78 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 79 | } 80 | }; 81 | -------------------------------------------------------------------------------- /src/bore_dimension.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | void els_bore_dimension_setup(void); 8 | void els_bore_dimension_start(void); 9 | void els_bore_dimension_update(void); 10 | void els_bore_dimension_stop(void); 11 | bool els_bore_dimension_busy(void); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /src/bore_hole.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | void els_bore_hole_setup(void); 8 | void els_bore_hole_start(void); 9 | void els_bore_hole_update(void); 10 | void els_bore_hole_stop(void); 11 | bool els_bore_hole_busy(void); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /src/clock.c: -------------------------------------------------------------------------------- 1 | #include "clock.h" 2 | 3 | //============================================================================== 4 | // Clock and peripherals setup 5 | //============================================================================== 6 | 7 | // ----------------------------------------------------------------------------- 8 | // Change to 0 to use internal oscillator 9 | // ----------------------------------------------------------------------------- 10 | #define ELS_USE_HSE 1 11 | 12 | // ----------------------------------------------------------------------------- 13 | // 8MHz external crystal 14 | // ----------------------------------------------------------------------------- 15 | // See UM1724 Rev 14 Page 24 16 | // 17 | // The following configuration is needed: 18 | // – SB54 and SB55 OFF 19 | // – R35 and R37 soldered 20 | // – C33 and C34 soldered with 20 pF capacitors 21 | // – SB16 and SB50 OFF 22 | // ----------------------------------------------------------------------------- 23 | #if ELS_USE_HSE 24 | const struct rcc_clock_scale rcc_clock_config = { 25 | .pllm = 8, 26 | .plln = 360, 27 | .pllp = 2, 28 | .pllq = 4, 29 | .pllr = 0, 30 | .pll_source = RCC_CFGR_PLLSRC_HSE_CLK, 31 | .hpre = RCC_CFGR_HPRE_NODIV, 32 | .ppre1 = RCC_CFGR_PPRE_DIV4, 33 | .ppre2 = RCC_CFGR_PPRE_DIV2, 34 | .voltage_scale = PWR_SCALE1, 35 | .flash_config = FLASH_ACR_DCEN | FLASH_ACR_ICEN | FLASH_ACR_LATENCY_5WS, 36 | .ahb_frequency = 180000000, 37 | .apb1_frequency = 45000000, 38 | .apb2_frequency = 90000000, 39 | }; 40 | #else 41 | // 16MHz internal osc 42 | const struct rcc_clock_scale rcc_clock_config = { 43 | .pllm = 16, 44 | .plln = 360, 45 | .pllp = 2, 46 | .pllq = 4, 47 | .pllr = 0, 48 | .pll_source = RCC_CFGR_PLLSRC_HSI_CLK, 49 | .hpre = RCC_CFGR_HPRE_NODIV, 50 | .ppre1 = RCC_CFGR_PPRE_DIV4, 51 | .ppre2 = RCC_CFGR_PPRE_DIV2, 52 | .voltage_scale = PWR_SCALE1, 53 | .flash_config = FLASH_ACR_DCEN | FLASH_ACR_ICEN | FLASH_ACR_LATENCY_5WS, 54 | .ahb_frequency = 180000000, 55 | .apb1_frequency = 45000000, 56 | .apb2_frequency = 90000000, 57 | }; 58 | #endif 59 | 60 | void els_clock_setup(void) { 61 | rcc_clock_setup_pll(&rcc_clock_config); 62 | 63 | // Enable clocks for GPIOA, GPIOB, GPIOC, USART1, SYSCFG (required for port mapping). 64 | rcc_periph_clock_enable(RCC_GPIOA); 65 | rcc_periph_clock_enable(RCC_GPIOB); 66 | rcc_periph_clock_enable(RCC_GPIOC); 67 | rcc_periph_clock_enable(RCC_USART1); 68 | rcc_periph_clock_enable(RCC_SYSCFG); 69 | } 70 | -------------------------------------------------------------------------------- /src/clock.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | void els_clock_setup(void); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /src/concave_ext_r.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | void els_concave_ext_r_setup(void); 8 | void els_concave_ext_r_start(void); 9 | void els_concave_ext_r_update(void); 10 | void els_concave_ext_r_stop(void); 11 | bool els_concave_ext_r_busy(void); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /src/config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | typedef struct { 15 | uint32_t x_pulses_per_mm; 16 | uint32_t z_pulses_per_mm; 17 | 18 | uint32_t x_backlash_um; 19 | uint32_t z_backlash_um; 20 | 21 | uint32_t spindle_encoder_ppr; 22 | 23 | uint32_t x_jog_mm_s; 24 | uint32_t z_jog_mm_s; 25 | uint32_t x_retract_jog_mm_s; 26 | uint32_t z_retract_jog_mm_s; 27 | 28 | // boolean 29 | bool x_closed_loop; 30 | bool z_closed_loop; 31 | bool x_dro_invert; 32 | bool z_dro_invert; 33 | bool x_dir_invert; 34 | bool z_dir_invert; 35 | 36 | // computed 37 | uint32_t x_backlash_pulses; 38 | uint32_t z_backlash_pulses; 39 | } els_config_t; 40 | 41 | extern const els_config_t *els_config; 42 | 43 | void els_config_setup(void); 44 | void els_config_start(void); 45 | void els_config_update(void); 46 | void els_config_stop(void); 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /src/convex_ext_l.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | void els_convex_ext_l_setup(void); 8 | void els_convex_ext_l_start(void); 9 | void els_convex_ext_l_update(void); 10 | void els_convex_ext_l_stop(void); 11 | bool els_convex_ext_l_busy(void); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /src/convex_ext_r.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | void els_convex_ext_r_setup(void); 8 | void els_convex_ext_r_start(void); 9 | void els_convex_ext_r_update(void); 10 | void els_convex_ext_r_stop(void); 11 | bool els_convex_ext_r_busy(void); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /src/delay.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "delay.h" 5 | #include "rcc_config.h" 6 | 7 | void els_delay_setup(void) { 8 | SCS_DEMCR |= SCS_DEMCR_TRCENA; 9 | // unlock cm7 10 | DWT_LAR = 0xC5ACCE55; 11 | DWT_CYCCNT = 0; 12 | DWT_CTRL |= DWT_CTRL_CYCCNTENA; 13 | } 14 | 15 | void els_delay_microseconds(uint32_t microseconds) { 16 | DWT_CYCCNT = 0; 17 | uint32_t end_ticks = microseconds * RCC_CLOCK_BASE; 18 | while (DWT_CYCCNT < end_ticks); 19 | } 20 | 21 | void els_delay_milliseconds(uint32_t milliseconds) { 22 | DWT_CYCCNT = 0; 23 | uint32_t end_ticks = (milliseconds * 1000 * RCC_CLOCK_BASE); 24 | while (DWT_CYCCNT < end_ticks); 25 | } 26 | 27 | void els_delay_ticks(uint32_t ticks) { 28 | DWT_CYCCNT = 0; 29 | while (DWT_CYCCNT < ticks); 30 | } 31 | 32 | void els_delay_reset(void) { 33 | DWT_CYCCNT = 0; 34 | } 35 | 36 | uint32_t els_delay_elapsed_microseconds(void) { 37 | return (DWT_CYCCNT / RCC_CLOCK_BASE); 38 | } 39 | -------------------------------------------------------------------------------- /src/delay.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | 9 | void els_delay_setup(void); 10 | void els_delay_microseconds(uint32_t microseconds); 11 | void els_delay_milliseconds(uint32_t milliseconds); 12 | void els_delay_ticks(uint32_t ticks); 13 | void els_delay_reset(void); 14 | uint32_t els_delay_elapsed_microseconds(void); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | -------------------------------------------------------------------------------- /src/dro.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | typedef struct { 15 | volatile int32_t xpos_um; 16 | volatile int32_t zpos_um; 17 | } els_dro_t; 18 | 19 | extern volatile els_dro_t els_dro; 20 | 21 | void els_dro_setup(void); 22 | void els_dro_zero_x(void); 23 | void els_dro_zero_z(void); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /src/eeprom.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | void els_eeprom_setup(void); 15 | bool els_eeprom_erase(void); 16 | bool els_eeprom_read(size_t offset, void *dst, size_t size); 17 | bool els_eeprom_write(size_t offset, const void *src, size_t size); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /src/encoder.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "encoder.h" 15 | #include "timer.h" 16 | #include "gpio.h" 17 | 18 | #include "constants.h" 19 | 20 | //============================================================================== 21 | // Internal State 22 | //============================================================================== 23 | static volatile int32_t encoder_ticks, encoder_dir; 24 | static volatile uint64_t t1 = 0, t2 = 0; 25 | 26 | static uint32_t direction_debounce_us, rotation_debounce_us; 27 | static int16_t encoder_multiplier = 1; 28 | //============================================================================== 29 | // ISR 30 | //============================================================================== 31 | void ELS_I_ENCODER_ISR(void) { 32 | 33 | // ------------------------------------------------------ 34 | // Begin: check EXTI flag, required for shared EXTI ISRs. 35 | // ------------------------------------------------------ 36 | #if ELS_I_ENCODER_PINA > GPIO4 37 | if (exti_get_flag_status(ELS_I_ENCODER_EXTI)) { 38 | #endif 39 | exti_reset_request(ELS_I_ENCODER_EXTI); 40 | // rotation debounce 41 | t2 = els_timer_elapsed_microseconds(); 42 | if (t2 - t1 > rotation_debounce_us) { 43 | // direction debounce 44 | if (els_gpio_get(ELS_I_ENCODER_PORTB, ELS_I_ENCODER_PINB)) { 45 | if (encoder_dir == -1 || (t2 - t1) > direction_debounce_us) { 46 | encoder_dir = -1; 47 | encoder_ticks--; 48 | } 49 | } 50 | else { 51 | // direction debounce 52 | if (encoder_dir == 1 || (t2 - t1) > direction_debounce_us) { 53 | encoder_dir = 1; 54 | encoder_ticks++; 55 | } 56 | } 57 | t1 = t2; 58 | } 59 | // ------------------------------------------------------ 60 | // End: check EXTI flag, required for shared EXTI ISRs. 61 | // ------------------------------------------------------ 62 | #if ELS_I_ENCODER_PINA > GPIO4 63 | } 64 | #endif 65 | } 66 | 67 | //============================================================================== 68 | // API 69 | //============================================================================== 70 | void els_encoder_setup(void) { 71 | gpio_mode_setup(ELS_I_ENCODER_PORTA, GPIO_MODE_INPUT, GPIO_PUPD_PULLUP, ELS_I_ENCODER_PINA); 72 | gpio_mode_setup(ELS_I_ENCODER_PORTB, GPIO_MODE_INPUT, GPIO_PUPD_PULLUP, ELS_I_ENCODER_PINB); 73 | 74 | exti_select_source(ELS_I_ENCODER_EXTI, ELS_I_ENCODER_PORTA); 75 | exti_set_trigger(ELS_I_ENCODER_EXTI, EXTI_TRIGGER_RISING); 76 | exti_enable_request(ELS_I_ENCODER_EXTI); 77 | } 78 | 79 | void els_encoder_start(void) { 80 | encoder_ticks = 0; 81 | direction_debounce_us = 100e3; 82 | rotation_debounce_us = 25e3 / 10; 83 | 84 | nvic_set_priority(ELS_I_ENCODER_IRQ, 4); 85 | nvic_enable_irq(ELS_I_ENCODER_IRQ); 86 | } 87 | 88 | void els_encoder_set_direction_debounce(uint32_t delay_us) { 89 | direction_debounce_us = delay_us; 90 | } 91 | 92 | void els_encoder_set_rotation_debounce(uint32_t delay_us) { 93 | rotation_debounce_us = delay_us; 94 | } 95 | 96 | void els_encoder_stop(void) { 97 | encoder_ticks = 0; 98 | nvic_disable_irq(ELS_I_ENCODER_IRQ); 99 | } 100 | 101 | void els_encoder_reset(void) { 102 | encoder_ticks = 0; 103 | } 104 | 105 | int32_t els_encoder_read(void) { 106 | return encoder_ticks; 107 | } 108 | 109 | void els_encoder_write(int32_t ticks) { 110 | encoder_ticks = ticks; 111 | } 112 | 113 | void els_encoder_incr(uint16_t delta) { 114 | encoder_ticks += delta; 115 | } 116 | 117 | void els_encoder_decr(uint16_t delta) { 118 | encoder_ticks -= delta; 119 | } 120 | 121 | int16_t els_encoder_get_multiplier(void) { 122 | return encoder_multiplier; 123 | } 124 | 125 | void els_encoder_inc_multiplier(void) { 126 | encoder_multiplier = encoder_multiplier > 10 ? 1 : encoder_multiplier * 10; 127 | } 128 | -------------------------------------------------------------------------------- /src/encoder.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | void els_encoder_setup(void); 15 | void els_encoder_start(void); 16 | void els_encoder_set_direction_debounce(uint32_t usec); 17 | void els_encoder_set_rotation_debounce(uint32_t usec); 18 | void els_encoder_stop(void); 19 | void els_encoder_reset(void); 20 | void els_encoder_incr(uint16_t); 21 | void els_encoder_decr(uint16_t); 22 | int32_t els_encoder_read(void); 23 | void els_encoder_write(int32_t); 24 | int16_t els_encoder_get_multiplier(void); 25 | void els_encoder_inc_multiplier(void); 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /src/facing.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | void els_facing_setup(void); 8 | void els_facing_start(void); 9 | void els_facing_update(void); 10 | void els_facing_stop(void); 11 | bool els_facing_busy(void); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /src/function.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | void els_function_init(void); 8 | void els_function_update(void); 9 | void els_function_restore(void); 10 | 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /src/gpio.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "gpio.h" 15 | #include "constants.h" 16 | 17 | //============================================================================== 18 | // API 19 | //============================================================================== 20 | void els_gpio_setup(void) { 21 | 22 | //------------------------------------------------------------------------------ 23 | // Indicator LED 24 | //------------------------------------------------------------------------------ 25 | els_gpio_mode_output(LED_PORT, LED_PIN); 26 | gpio_clear(LED_PORT, LED_PIN); 27 | 28 | //------------------------------------------------------------------------------ 29 | // Z-Axis Stepper 30 | //------------------------------------------------------------------------------ 31 | els_gpio_mode_output(ELS_Z_ENA_PORT, ELS_Z_ENA_PIN); 32 | els_gpio_mode_output(ELS_Z_DIR_PORT, ELS_Z_DIR_PIN); 33 | els_gpio_mode_output(ELS_Z_PUL_PORT, ELS_Z_PUL_PIN); 34 | 35 | els_gpio_clear(ELS_Z_ENA_PORT, ELS_Z_ENA_PIN); 36 | els_gpio_clear(ELS_Z_DIR_PORT, ELS_Z_DIR_PIN); 37 | els_gpio_clear(ELS_Z_PUL_PORT, ELS_Z_PUL_PIN); 38 | 39 | //------------------------------------------------------------------------------ 40 | // X-Axis Stepper 41 | //------------------------------------------------------------------------------ 42 | els_gpio_mode_output(ELS_X_ENA_PORT, ELS_X_ENA_PIN); 43 | els_gpio_mode_output(ELS_X_DIR_PORT, ELS_X_DIR_PIN); 44 | els_gpio_mode_output(ELS_X_PUL_PORT, ELS_X_PUL_PIN); 45 | 46 | els_gpio_clear(ELS_X_ENA_PORT, ELS_X_ENA_PIN); 47 | els_gpio_clear(ELS_X_DIR_PORT, ELS_X_DIR_PIN); 48 | els_gpio_clear(ELS_X_PUL_PORT, ELS_X_PUL_PIN); 49 | } 50 | 51 | void els_gpio_mode_input(uint32_t port, uint32_t pins) { 52 | gpio_mode_setup(port, GPIO_MODE_INPUT, GPIO_PUPD_NONE, pins); 53 | } 54 | 55 | void els_gpio_mode_output(uint32_t port, uint32_t pins) { 56 | gpio_mode_setup(port, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, pins); 57 | gpio_set_output_options(port, GPIO_OTYPE_PP, GPIO_OSPEED_100MHZ, pins); 58 | } 59 | -------------------------------------------------------------------------------- /src/gpio.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | typedef struct { 21 | uint32_t port; 22 | uint32_t pin; 23 | } els_gpio_t; 24 | 25 | //============================================================================== 26 | // GPIO Mapping Summary. 27 | //============================================================================== 28 | 29 | // PA0 - TFT Data 30 | // PA1 - TFT Data 31 | // PA2 - TFT Data 32 | // PA3 - TFT Data 33 | // PA4 - TFT Data 34 | // PA5 - TFT Data 35 | // PA6 - TFT Data 36 | // PA7 - TFT Data 37 | // PA8 - RESERVED 38 | // PA9 - USART TX 39 | // PA10 - USART RX 40 | // PA11 - DRO X-A (Int) 41 | // PA12 - DRO X-B (Int) 42 | // PA13 - RESERVED 43 | // PA14 - RESERVED 44 | // PA15 - RESERVED 45 | // 46 | // PB0 - TFT RD 47 | // PB1 - DRO Z-A (Int) 48 | // PB2 - RESERVED 49 | // PB3 - Spindle Enc A (Int) 50 | // PB4 - Spindle Enc B 51 | // PB5 - DRO Z-B (Int) 52 | // PB6 - TFT WR 53 | // PB7 - TFT RS 54 | // PB8 - TFT CS 55 | // PB9 - TFT RST 56 | // PB10 - EEPROM SCL 57 | // PB11 - N/A 58 | // PB12 - RESERVED 59 | // PB13 - Z ENA 60 | // PB14 - Z DIR 61 | // PB15 - Z PUL 62 | // 63 | // PC0 - 64 | // PC1 - 65 | // PC2 - Input Enc A (Int) 66 | // PC3 - Input Enc B 67 | // PC4 - PS/2 Keypad CLK (Int) 68 | // PC5 - PS/2 Keypad DAT 69 | // PC6 - Spindle Enc A (Timer) 70 | // PC7 - Spindle Enc B (Timer) 71 | // PC8 - RESERVED 72 | // PC9 - RESERVED 73 | // PC10 - 74 | // PC11 - 75 | // PC12 - EEPROM SDA 76 | // PC13 - X ENA 77 | // PC14 - X DIR 78 | // PC15 - X PUL 79 | // 80 | // PH0 - 81 | // PH1 - 82 | //============================================================================== 83 | 84 | void els_gpio_setup(void); 85 | void els_gpio_mode_input(uint32_t port, uint32_t pins); 86 | void els_gpio_mode_output(uint32_t port, uint32_t pins); 87 | 88 | //============================================================================== 89 | // Helpers 90 | //============================================================================== 91 | 92 | #define els_gpio_get(port, pins) (GPIO_IDR(port) & pins) 93 | #define els_gpio_set(port, pins) GPIO_BSRR(port) = pins 94 | #define els_gpio_clear(port, pins) GPIO_BSRR(port) = (pins << 16) 95 | #define els_gpio_toggle(port, pins) do { \ 96 | uint32_t data = GPIO_ODR(port); \ 97 | GPIO_BSRR(port) = ((data & pins) << 16) | (~data & pins); \ 98 | } while(0) 99 | 100 | #ifdef __cplusplus 101 | } 102 | #endif 103 | -------------------------------------------------------------------------------- /src/keypad.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "keypad.h" 15 | 16 | #include "constants.h" 17 | #include "delay.h" 18 | #include "gpio.h" 19 | #include "ringbuffer.h" 20 | 21 | //============================================================================== 22 | // Internal State 23 | //============================================================================== 24 | uint8_t buffer[64]; 25 | bool locked; 26 | ringbuffer_t ringbuffer; 27 | 28 | volatile uint8_t byte = 0; 29 | volatile uint8_t bits = 0; 30 | volatile uint8_t bytes = 0; 31 | 32 | //------------------------------------------------------------------------------ 33 | // PS/2 34 | // 35 | // http://www.lucadavidian.com/2017/11/15/interfacing-ps2-keyboard-to-a-microcontroller/ 36 | // 37 | // A frame consists of: 38 | // 39 | // 1. start bit (always low) 40 | // 2. 8 data bits, LSB first 41 | // 3. a odd parity bit 42 | // 4. a stop bit (always high) 43 | // 44 | //------------------------------------------------------------------------------ 45 | void ELS_KEYPAD_ISR(void) { 46 | #if ELS_KEYPAD_CLK_PIN > GPIO4 47 | if (exti_get_flag_status(ELS_KEYPAD_EXTI)) { 48 | #endif 49 | 50 | exti_reset_request(ELS_KEYPAD_EXTI); 51 | if (bits > 0 && bits < 9) { 52 | byte >>= 1; 53 | els_delay_microseconds(10); 54 | if (gpio_get(ELS_KEYPAD_DAT_PORT, ELS_KEYPAD_DAT_PIN)) 55 | byte |= 0x80; 56 | } 57 | 58 | // D-8203 PS/2 keypad 59 | // 60 | // https://www.aliexpress.com/item/1005002340320709.html 61 | // 62 | // make & break codes come in a triplet, which is non-compliant for the keypad. 63 | // 64 | // 1. press => scan code, 0xf0 65 | // 2. release => scan code 66 | if (bits++ == 10) { 67 | bytes++; 68 | if (bytes > 2) { 69 | bytes = 0; 70 | ringbuffer_putc(&ringbuffer, byte); 71 | } 72 | 73 | // ignore reset & power-on ack. 74 | if (byte == 0xaa) { 75 | printf("kp ok\n"); 76 | bytes = 0; 77 | } 78 | 79 | // process next byte. 80 | byte = bits = 0; 81 | } 82 | 83 | #if ELS_KEYPAD_CLK_PIN > GPIO4 84 | } 85 | #endif 86 | } 87 | 88 | //============================================================================== 89 | // API 90 | //============================================================================== 91 | void els_keypad_setup(void) { 92 | ringbuffer_init(&ringbuffer, sizeof(buffer), buffer); 93 | 94 | // PS/2 keypad. 95 | gpio_mode_setup(ELS_KEYPAD_CLK_PORT, GPIO_MODE_INPUT, GPIO_PUPD_NONE, ELS_KEYPAD_CLK_PIN); 96 | gpio_mode_setup(ELS_KEYPAD_DAT_PORT, GPIO_MODE_INPUT, GPIO_PUPD_NONE, ELS_KEYPAD_DAT_PIN); 97 | 98 | exti_select_source(ELS_KEYPAD_EXTI, ELS_KEYPAD_CLK_PORT); 99 | exti_set_trigger(ELS_KEYPAD_EXTI, EXTI_TRIGGER_FALLING); 100 | exti_enable_request(ELS_KEYPAD_EXTI); 101 | 102 | nvic_set_priority(ELS_KEYPAD_IRQ, 4); 103 | nvic_enable_irq(ELS_KEYPAD_IRQ); 104 | } 105 | 106 | void els_keypad_lock(void) { 107 | locked = true; 108 | } 109 | 110 | void els_keypad_unlock(void) { 111 | locked = false; 112 | } 113 | 114 | bool els_keypad_locked(void) { 115 | return locked; 116 | } 117 | 118 | int els_keypad_read(void) { 119 | uint8_t data; 120 | if (locked) 121 | return ELS_KEY_EOF; 122 | 123 | if (ringbuffer_getc(&ringbuffer, &data)) { 124 | switch (data) { 125 | // top level function keys. 126 | case ELS_KEY_LOCK: 127 | case ELS_KEY_ENC_MULT: 128 | case ELS_KEY_FUN_TURN: 129 | case ELS_KEY_FUN_THREAD: 130 | case ELS_KEY_FUN_SELECT: 131 | els_keypad_write(data); 132 | return ELS_KEY_EOF; 133 | default: 134 | return data; 135 | } 136 | } 137 | else 138 | return ELS_KEY_EOF; 139 | } 140 | 141 | int els_keypad_peek(void) { 142 | uint8_t data; 143 | if (ringbuffer_peek(&ringbuffer, &data)) 144 | return data; 145 | else 146 | return ELS_KEY_EOF; 147 | } 148 | 149 | void els_keypad_flush(void) { 150 | ringbuffer.read_ptr = ringbuffer.write_ptr; 151 | } 152 | 153 | void els_keypad_write(uint8_t c) { 154 | ringbuffer_putc(&ringbuffer, c); 155 | } 156 | -------------------------------------------------------------------------------- /src/keypad.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | void els_keypad_setup(void); 15 | int els_keypad_read(void); 16 | void els_keypad_flush(void); 17 | int els_keypad_peek(void); 18 | void els_keypad_write(uint8_t c); 19 | void els_keypad_lock(void); 20 | void els_keypad_unlock(void); 21 | bool els_keypad_locked(void); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | 27 | -------------------------------------------------------------------------------- /src/knurling.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | void els_knurling_setup(void); 8 | void els_knurling_start(void); 9 | void els_knurling_update(void); 10 | void els_knurling_stop(void); 11 | bool els_knurling_busy(void); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /src/kv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "kv.h" 9 | 10 | #include "eeprom.h" 11 | #include "utils.h" 12 | 13 | void els_kv_setup(void) { 14 | uint8_t sig[8]; 15 | memset(sig, 0, sizeof(sig)); 16 | els_eeprom_read(0, sig, 8); 17 | if (memcmp(sig, ELS_KV_VERSION, strlen(ELS_KV_VERSION)) != 0) { 18 | printf("init eeprom: erase\n"); 19 | els_eeprom_erase(); 20 | printf("init eeprom: set version\n"); 21 | els_eeprom_write(0, ELS_KV_VERSION, strlen(ELS_KV_VERSION)); 22 | printf("init eeprom: done\n"); 23 | } 24 | } 25 | 26 | void els_kv_read(els_kv_t key, void *dst, size_t size) { 27 | els_eeprom_read(key * ELS_KV_BLOCK_SIZE, dst, size); 28 | } 29 | 30 | void els_kv_write(els_kv_t key, const void *src, size_t size) { 31 | els_eeprom_write(key * ELS_KV_BLOCK_SIZE, src, size); 32 | } 33 | -------------------------------------------------------------------------------- /src/kv.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | // version 15 | #define ELS_KV_VERSION "ELSKV1" 16 | 17 | // data block max size 18 | #define ELS_KV_BLOCK_SIZE (8) 19 | 20 | typedef enum { 21 | ELS_KV_X_PULSES_PER_MM = 1, 22 | ELS_KV_Z_PULSES_PER_MM = 2, 23 | ELS_KV_X_BACKLASH_UM = 3, 24 | ELS_KV_Z_BACKLASH_UM = 4, 25 | ELS_KV_X_BACKLASH_MM_S = 5, 26 | ELS_KV_Z_BACKLASH_MM_S = 6, 27 | ELS_KV_SPINDLE_ENCODER_PPR = 7, 28 | ELS_KV_X_RETRACT_JOG_MM_S = 8, 29 | ELS_KV_Z_RETRACT_JOG_MM_S = 9, 30 | ELS_KV_X_CLOSED_LOOP = 10, 31 | ELS_KV_Z_CLOSED_LOOP = 11, 32 | ELS_KV_X_DRO_INVERT = 12, 33 | ELS_KV_Z_DRO_INVERT = 13, 34 | ELS_KV_X_JOG_MM_S = 14, 35 | ELS_KV_Z_JOG_MM_S = 15, 36 | ELS_KV_X_DIR_INVERT = 16, 37 | ELS_KV_Z_DIR_INVERT = 17, 38 | } els_kv_t; 39 | 40 | void els_kv_setup(void); 41 | void els_kv_read(els_kv_t, void *dst, size_t size); 42 | void els_kv_write(els_kv_t, const void *src, size_t size); 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | -------------------------------------------------------------------------------- /src/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | //============================================================================== 16 | // Platform 17 | //============================================================================== 18 | #include "clock.h" 19 | #include "delay.h" 20 | #include "gpio.h" 21 | #include "nvic.h" 22 | #include "usart.h" 23 | #include "timer.h" 24 | 25 | //============================================================================== 26 | // TFT 27 | //============================================================================== 28 | #include "tft/tft.h" 29 | 30 | tft_device_t tft = { 31 | .ili948x.rd = {.port = GPIOB, .pin = GPIO0}, 32 | .ili948x.wr = {.port = GPIOB, .pin = GPIO6}, 33 | .ili948x.rs = {.port = GPIOB, .pin = GPIO7}, 34 | .ili948x.cs = {.port = GPIOB, .pin = GPIO8}, 35 | .ili948x.rst = {.port = GPIOB, .pin = GPIO9}, 36 | .ili948x.data = {.port = GPIOA, .pin = GPIO0 | GPIO1 | GPIO2 | GPIO3 | GPIO4 | GPIO5 | GPIO6 | GPIO7 } 37 | }; 38 | 39 | //============================================================================== 40 | // ELS Core 41 | //============================================================================== 42 | #include "constants.h" 43 | 44 | // peripherals 45 | #include "dro.h" 46 | #include "eeprom.h" 47 | #include "encoder.h" 48 | #include "keypad.h" 49 | #include "spindle.h" 50 | #include "stepper.h" 51 | 52 | // config & db 53 | #include "config.h" 54 | #include "kv.h" 55 | 56 | // operations 57 | #include "turning.h" 58 | #include "threading.h" 59 | 60 | // els functions 61 | #include "function.h" 62 | 63 | //============================================================================== 64 | // Helpers 65 | //============================================================================== 66 | static void els_screenshot(void) { 67 | for (size_t row = 0; row < 320; row++) { 68 | for (size_t col = 0; col < 480; col++) { 69 | tft_rgb_t color; 70 | tft_pixel_get(&tft, col, row, &color); 71 | printf("%02x%02x%02x", color.r, color.g, color.b); 72 | if ((col + 1) % 20 == 0) 73 | printf("\n"); 74 | } 75 | } 76 | } 77 | 78 | //============================================================================== 79 | // Main loop 80 | //============================================================================== 81 | int main(void) { 82 | els_nvic_setup(); 83 | els_clock_setup(); 84 | els_gpio_setup(); 85 | els_usart_setup(); 86 | 87 | printf("\nels v0.1.0 - build %s\n", GIT_SHA); 88 | 89 | // core 90 | els_timer_setup(); 91 | 92 | // peripherals 93 | els_encoder_setup(); 94 | els_encoder_start(); 95 | els_keypad_setup(); 96 | 97 | // IMPORTANT: needs to happen as late as possible. 98 | els_delay_setup(); 99 | 100 | // init kv db & load config 101 | els_eeprom_setup(); 102 | els_kv_setup(); 103 | els_config_setup(); 104 | 105 | els_dro_setup(); 106 | els_stepper_setup(); 107 | els_spindle_setup(); 108 | 109 | // setup display 110 | tft_init(&tft); 111 | tft_invert(&tft, true); 112 | //tft_rotate(&tft, ROTATE_90); 113 | tft_rotate(&tft, ROTATE_270); 114 | 115 | // functions manager, needs to be called after config read. 116 | els_function_init(); 117 | 118 | while (1) { 119 | switch (els_keypad_peek()) { 120 | case 0x00: 121 | els_screenshot(); 122 | els_keypad_flush(); 123 | break; 124 | case ELS_KEY_LOCK: 125 | if (els_keypad_locked()) { 126 | printf("keypad: unlock\n"); 127 | els_keypad_unlock(); 128 | } 129 | else { 130 | printf("keypad: lock\n"); 131 | els_keypad_lock(); 132 | } 133 | els_keypad_flush(); 134 | break; 135 | case ELS_KEY_ENC_MULT: 136 | els_encoder_inc_multiplier(); 137 | els_keypad_flush(); 138 | break; 139 | default: 140 | if (els_keypad_locked()) 141 | els_keypad_flush(); 142 | break; 143 | } 144 | 145 | els_function_update(); 146 | els_spindle_update(); 147 | } 148 | 149 | return 0; 150 | } 151 | -------------------------------------------------------------------------------- /src/nvic.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "libopencm3/cm3/scb.h" 12 | 13 | #include "nvic.h" 14 | 15 | static vector_table_t els_vector_table __attribute__((aligned(512))); 16 | 17 | void els_nvic_setup(void) { 18 | // copy vector table to RAM 19 | memcpy(&els_vector_table, &vector_table, sizeof(vector_table)); 20 | 21 | // relocate 22 | SCB_VTOR = (uint32_t)&els_vector_table; 23 | } 24 | 25 | void els_nvic_irq_set_handler(uint8_t irq_number, vector_table_entry_t isr) { 26 | if (irq_number < NVIC_IRQ_COUNT) 27 | els_vector_table.irq[irq_number] = isr; 28 | } 29 | -------------------------------------------------------------------------------- /src/nvic.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "libopencm3/cm3/vector.h" 15 | 16 | void els_nvic_setup(void); 17 | void els_nvic_irq_set_handler(uint8_t irq, vector_table_entry_t isr); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /src/parting.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | void els_parting_setup(void); 8 | void els_parting_start(void); 9 | void els_parting_update(void); 10 | void els_parting_stop(void); 11 | bool els_parting_busy(void); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /src/rcc_config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #define RCC_CLOCK_BASE (180) 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /src/ringbuffer.c: -------------------------------------------------------------------------------- 1 | #include "ringbuffer.h" 2 | 3 | bool ringbuffer_init(ringbuffer_t *buffer, size_t size, void *data) { 4 | // not a power of 2. 5 | if ((size & (size -1)) != 0) 6 | return false; 7 | 8 | memset(buffer, 0, sizeof(ringbuffer_t)); 9 | buffer->data = data; 10 | buffer->size = size; 11 | buffer->mask = size - 1; 12 | return true; 13 | } 14 | 15 | bool ringbuffer_putc(ringbuffer_t *buffer, uint8_t byte) { 16 | if (((buffer->write_ptr - buffer->read_ptr) & buffer->mask) == buffer->mask) 17 | return false; 18 | 19 | buffer->data[buffer->write_ptr] = byte; 20 | buffer->write_ptr = (buffer->write_ptr + 1) & buffer->mask; 21 | return true; 22 | } 23 | 24 | bool ringbuffer_getc(ringbuffer_t *buffer, uint8_t *byte) { 25 | if (((buffer->write_ptr - buffer->read_ptr) & buffer->mask) <= 0) 26 | return false; 27 | 28 | *byte = buffer->data[buffer->read_ptr]; 29 | buffer->read_ptr = (buffer->read_ptr + 1) & buffer->mask; 30 | return true; 31 | } 32 | 33 | bool ringbuffer_peek(ringbuffer_t *buffer, uint8_t *byte) { 34 | if (((buffer->write_ptr - buffer->read_ptr) & buffer->mask) <= 0) 35 | return false; 36 | *byte = buffer->data[buffer->read_ptr]; 37 | return true; 38 | } 39 | 40 | size_t ringbuffer_used(ringbuffer_t *buffer) { 41 | return (buffer->write_ptr - buffer->read_ptr) & buffer->mask; 42 | } 43 | 44 | size_t ringbuffer_free(ringbuffer_t *buffer) { 45 | return buffer->size - ((buffer->write_ptr - buffer->read_ptr) & buffer->mask); 46 | } 47 | -------------------------------------------------------------------------------- /src/ringbuffer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef struct { 15 | uint8_t *data; 16 | size_t size, mask, write_ptr, read_ptr; 17 | } ringbuffer_t; 18 | 19 | bool ringbuffer_init(ringbuffer_t *buffer, size_t size, void *data); 20 | 21 | bool ringbuffer_putc(ringbuffer_t *buffer, uint8_t byte); 22 | bool ringbuffer_getc(ringbuffer_t *buffer, uint8_t *byte); 23 | bool ringbuffer_peek(ringbuffer_t *buffer, uint8_t *byte); 24 | 25 | size_t ringbuffer_used(ringbuffer_t *buffer); 26 | size_t ringbuffer_free(ringbuffer_t *buffer); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | -------------------------------------------------------------------------------- /src/ringbuffer_token.c: -------------------------------------------------------------------------------- 1 | #include "ringbuffer_token.h" 2 | 3 | bool ringbuffer_token_init(ringbuffer_token_t *buffer, size_t size) { 4 | // not a power of 2. 5 | if ((size & (size -1)) != 0) 6 | return false; 7 | 8 | memset(buffer, 0, sizeof(ringbuffer_token_t)); 9 | buffer->size = size; 10 | buffer->mask = size - 1; 11 | return true; 12 | } 13 | 14 | bool ringbuffer_token_put(ringbuffer_token_t *buffer, size_t *pos) { 15 | if (((buffer->write_ptr - buffer->read_ptr) & buffer->mask) == buffer->mask) 16 | return false; 17 | 18 | *pos = buffer->write_ptr; 19 | buffer->write_ptr = (buffer->write_ptr + 1) & buffer->mask; 20 | return true; 21 | } 22 | 23 | bool ringbuffer_token_get(ringbuffer_token_t *buffer, size_t *pos) { 24 | if (((buffer->write_ptr - buffer->read_ptr) & buffer->mask) <= 0) 25 | return false; 26 | 27 | *pos = buffer->read_ptr; 28 | buffer->read_ptr = (buffer->read_ptr + 1) & buffer->mask; 29 | return true; 30 | } 31 | 32 | size_t ringbuffer_token_used(ringbuffer_token_t *buffer) { 33 | return (buffer->write_ptr - buffer->read_ptr) & buffer->mask; 34 | } 35 | 36 | size_t ringbuffer_token_free(ringbuffer_token_t *buffer) { 37 | return buffer->size - ((buffer->write_ptr - buffer->read_ptr) & buffer->mask); 38 | } 39 | -------------------------------------------------------------------------------- /src/ringbuffer_token.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef struct { 15 | size_t size, mask, write_ptr, read_ptr; 16 | } ringbuffer_token_t; 17 | 18 | bool ringbuffer_token_init(ringbuffer_token_t *buffer, size_t size); 19 | bool ringbuffer_token_put(ringbuffer_token_t *buffer, size_t *pos); 20 | bool ringbuffer_token_get(ringbuffer_token_t *buffer, size_t *pos); 21 | size_t ringbuffer_token_used(ringbuffer_token_t *buffer); 22 | size_t ringbuffer_token_free(ringbuffer_token_t *buffer); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /src/spindle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include "gpio.h" 8 | 9 | typedef enum { 10 | ELS_S_DIRECTION_IDLE = 1, 11 | ELS_S_DIRECTION_CW = 2, 12 | ELS_S_DIRECTION_CCW = 3 13 | } els_spindle_direction_t; 14 | 15 | void els_spindle_setup(void); 16 | void els_spindle_update(void); 17 | float els_spindle_get_angle(void); 18 | uint16_t els_spindle_get_counter(void); 19 | uint16_t els_spindle_get_rpm(void); 20 | els_spindle_direction_t els_spindle_get_direction(void); 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /src/stepper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | void els_stepper_setup(void); 15 | void els_stepper_start(void); 16 | void els_stepper_stop(void); 17 | void els_stepper_sync(void); 18 | 19 | void els_stepper_move_x(double mm, double speed_mm_s); 20 | void els_stepper_move_z(double mm, double speed_mm_s); 21 | 22 | void els_stepper_move_x_no_accel(double mm, double speed_mm_s); 23 | void els_stepper_move_z_no_accel(double mm, double speed_mm_s); 24 | 25 | void els_stepper_move_xz(double x_mm, double z_mm, double speed_mm_s); 26 | 27 | void els_stepper_x_backlash_fix(void); 28 | void els_stepper_z_backlash_fix(void); 29 | 30 | // clockwise arc quadrants. 31 | void els_stepper_move_arc_q2_cw(double arc_center_z, double arc_center_x, double radius, double xd, double speed_mm_s); 32 | 33 | // counter clockwise arc quadrants. 34 | void els_stepper_move_arc_q3_ccw(double arc_center_z, double arc_center_x, double radius, double xd, double speed_mm_s); 35 | void els_stepper_move_arc_q4_ccw(double arc_center_z, double arc_center_x, double radius, double xd, double speed_mm_s); 36 | 37 | void els_stepper_zero_x(void); 38 | void els_stepper_zero_z(void); 39 | 40 | void els_stepper_enable(void); 41 | void els_stepper_disable(void); 42 | 43 | void els_stepper_enable_x(void); 44 | void els_stepper_enable_z(void); 45 | void els_stepper_disable_x(void); 46 | void els_stepper_disable_z(void); 47 | 48 | void els_stepper_set_xdir_incr(void); 49 | void els_stepper_set_xdir_decr(void); 50 | 51 | void els_stepper_set_zdir_incr(void); 52 | void els_stepper_set_zdir_decr(void); 53 | 54 | typedef struct { 55 | double xpos; 56 | double zpos; 57 | int8_t xdir; 58 | int8_t zdir; 59 | bool xbusy; 60 | bool zbusy; 61 | } els_stepper_t; 62 | 63 | extern els_stepper_t *els_stepper; 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | -------------------------------------------------------------------------------- /src/taper_ext_l.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | void els_taper_ext_l_setup(void); 8 | void els_taper_ext_l_start(void); 9 | void els_taper_ext_l_update(void); 10 | void els_taper_ext_l_stop(void); 11 | bool els_taper_ext_l_busy(void); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /src/taper_ext_r.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | void els_taper_ext_r_setup(void); 8 | void els_taper_ext_r_start(void); 9 | void els_taper_ext_r_update(void); 10 | void els_taper_ext_r_stop(void); 11 | bool els_taper_ext_r_busy(void); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /src/taper_int.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | void els_taper_int_setup(void); 8 | void els_taper_int_start(void); 9 | void els_taper_int_update(void); 10 | void els_taper_int_stop(void); 11 | bool els_taper_int_busy(void); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /src/tft/fonts/fonts.c: -------------------------------------------------------------------------------- 1 | #include "fonts.h" 2 | 3 | static const tft_font_glyph_t * find_glyph(const tft_font_t *font, char c) { 4 | for (size_t i = 0; i < font->glyph_count; i++) { 5 | if (font->glyphs[i].character == c) 6 | return &font->glyphs[i]; 7 | } 8 | 9 | return NULL; 10 | } 11 | 12 | void tft_font_write_bg(const tft_device_t * tft, uint16_t x, uint16_t y, 13 | const char *text, 14 | const tft_font_t *font, tft_rgb_t color, tft_rgb_t bgcolor) { 15 | 16 | tft_font_write_bg_xadv(tft, x, y, text, font, color, bgcolor, font->glyphs[0].xadvance); 17 | } 18 | 19 | 20 | void tft_font_write_bg_xadv(const tft_device_t * tft, uint16_t x, uint16_t y, 21 | const char *text, 22 | const tft_font_t *font, tft_rgb_t color, tft_rgb_t bgcolor, 23 | uint16_t xadvance) { 24 | 25 | uint16_t xcurr = x, xpos, ypos, rgb16 = tft_rgb_to_rgb16(color), bgrgb16 = tft_rgb_to_rgb16(bgcolor); 26 | 27 | tft_flood_start(tft); 28 | while(*text) { 29 | const tft_font_glyph_t *g = find_glyph(font, *text); 30 | if (g) { 31 | xpos = xcurr + g->xoffset; 32 | ypos = y + g->yoffset; 33 | xcurr += g->xadvance; 34 | 35 | size_t pixels = g->width * g->height; 36 | size_t bytes = pixels / 8, trailing_bits = pixels - (bytes * 8); 37 | 38 | tft_set_window(tft, xpos, ypos, g->width, g->height); 39 | 40 | uint8_t data, mask; 41 | for (size_t i = 0; i < bytes; i++) { 42 | data = g->data[i]; 43 | tft_flood_write_rgb16(tft, data & 0x80 ? rgb16 : bgrgb16); 44 | data <<= 1; 45 | tft_flood_write_rgb16(tft, data & 0x80 ? rgb16 : bgrgb16); 46 | data <<= 1; 47 | tft_flood_write_rgb16(tft, data & 0x80 ? rgb16 : bgrgb16); 48 | data <<= 1; 49 | tft_flood_write_rgb16(tft, data & 0x80 ? rgb16 : bgrgb16); 50 | data <<= 1; 51 | tft_flood_write_rgb16(tft, data & 0x80 ? rgb16 : bgrgb16); 52 | data <<= 1; 53 | tft_flood_write_rgb16(tft, data & 0x80 ? rgb16 : bgrgb16); 54 | data <<= 1; 55 | tft_flood_write_rgb16(tft, data & 0x80 ? rgb16 : bgrgb16); 56 | data <<= 1; 57 | tft_flood_write_rgb16(tft, data & 0x80 ? rgb16 : bgrgb16); 58 | } 59 | 60 | if (trailing_bits > 0) { 61 | data = g->data[bytes]; 62 | mask = 1 << (trailing_bits - 1); 63 | for (size_t i = 0; i < trailing_bits; i++) { 64 | tft_flood_write_rgb16(tft, data & mask ? rgb16 : bgrgb16); 65 | data <<= 1; 66 | } 67 | } 68 | } 69 | else if (*text == ' ') { 70 | tft_set_window(tft, xcurr, y + font->yoffset, xadvance, font->size); 71 | for (size_t n = 0; n < xadvance * font->size; n++) 72 | tft_flood_write_rgb16(tft, bgrgb16); 73 | xcurr += xadvance; 74 | } 75 | text++; 76 | }; 77 | tft_flood_finish(tft); 78 | } 79 | 80 | void tft_font_write(const tft_device_t * tft, uint16_t x, uint16_t y, 81 | const char *text, 82 | const tft_font_t *font, tft_rgb_t color) { 83 | 84 | uint16_t xcurr = x, xpos, ypos, rgb16 = tft_rgb_to_rgb16(color); 85 | 86 | while(*text) { 87 | const tft_font_glyph_t *g = find_glyph(font, *text); 88 | if (g) { 89 | xpos = xcurr + g->xoffset; 90 | ypos = y + g->yoffset; 91 | xcurr += g->xadvance; 92 | 93 | size_t pixels = g->width * g->height; 94 | size_t bytes = pixels / 8, trailing_bits = pixels - (bytes * 8); 95 | uint8_t data = 0, mask = 0x80; 96 | 97 | size_t bitpos = 0, bytepos = 0; 98 | 99 | for (uint16_t yp = ypos; yp < ypos + g->height; yp++) { 100 | for (uint16_t xp = xpos; xp < xpos + g->width; xp++) { 101 | if (bitpos % 8 == 0) { 102 | mask = bytepos > bytes ? (1 << trailing_bits) : 0x80; 103 | data = g->data[bytepos++]; 104 | } 105 | 106 | if (data & mask) 107 | tft_pixel_set(tft, xp, yp, color); 108 | 109 | data <<= 1; 110 | bitpos++; 111 | } 112 | } 113 | } 114 | else if (*text == ' ') { 115 | xcurr += font->glyphs[0].xadvance; 116 | } 117 | text++; 118 | }; 119 | } 120 | 121 | -------------------------------------------------------------------------------- /src/tft/fonts/fonts.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include "../tft.h" 8 | 9 | typedef struct { 10 | const char character; 11 | const uint8_t width; 12 | const uint8_t height; 13 | const int8_t xoffset; 14 | const int8_t yoffset; 15 | const uint8_t xadvance; 16 | const uint8_t * const data; 17 | } tft_font_glyph_t; 18 | 19 | typedef struct { 20 | const uint16_t glyph_count; 21 | const uint8_t size; 22 | const uint8_t yoffset; // default for space 23 | const tft_font_glyph_t *glyphs; 24 | } tft_font_t; 25 | 26 | void tft_font_write(const tft_device_t *, uint16_t x, uint16_t y, const char *text, 27 | const tft_font_t *, tft_rgb_t color); 28 | 29 | void tft_font_write_bg(const tft_device_t *, uint16_t x, uint16_t y, const char *text, 30 | const tft_font_t *, tft_rgb_t color, tft_rgb_t bgcolor); 31 | 32 | void tft_font_write_bg_xadv(const tft_device_t * tft, uint16_t x, uint16_t y, 33 | const char *text, 34 | const tft_font_t *font, tft_rgb_t color, tft_rgb_t bgcolor, uint16_t xadvance); 35 | 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | -------------------------------------------------------------------------------- /src/tft/fonts/gears_regular_50.c: -------------------------------------------------------------------------------- 1 | #include "fonts.h" 2 | 3 | const tft_font_t gears_regular_50 = { 4 | .size = 50, 5 | .glyph_count = 1, 6 | .glyphs = (const tft_font_glyph_t[]){ 7 | { 8 | .character = 0x4e, 9 | .width = 49, 10 | .height = 35, 11 | .xoffset = 3, 12 | .yoffset = 7, 13 | .xadvance = 67, 14 | .data = (const uint8_t[]){ 15 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 16 | 0xfc, 0x00, 0x00, 0x07, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x03, 17 | 0xff, 0xff, 0xff, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xb0, 18 | 0x00, 0x00, 0xff, 0xff, 0xff, 0xd8, 0x00, 0x01, 0x7f, 0xff, 19 | 0xff, 0xec, 0x00, 0x00, 0xbf, 0xff, 0xff, 0xf7, 0xc0, 0x00, 20 | 0x5f, 0xff, 0xff, 0xfb, 0xe0, 0x00, 0x2f, 0xff, 0xff, 0xfd, 21 | 0xf0, 0x1f, 0xd7, 0xff, 0xff, 0xfe, 0xfb, 0xcf, 0xeb, 0xff, 22 | 0xff, 0xff, 0x7d, 0xe7, 0xf5, 0xff, 0xe0, 0x7f, 0xbe, 0xf3, 23 | 0xfa, 0xff, 0xe7, 0x9f, 0xdf, 0x79, 0xfd, 0x7f, 0xe4, 0x27, 24 | 0xef, 0xbc, 0xfe, 0xbf, 0xf4, 0x0b, 0xf0, 0x00, 0x7f, 0x5f, 25 | 0xf2, 0x64, 0xf8, 0x00, 0x3f, 0xaf, 0xf9, 0x7a, 0x7c, 0x00, 26 | 0x1f, 0xd7, 0xfc, 0x99, 0x3e, 0x00, 0x0f, 0xeb, 0xff, 0x40, 27 | 0xbf, 0x00, 0x07, 0xf5, 0xff, 0x90, 0x9f, 0xbe, 0xf3, 0xfa, 28 | 0xff, 0xe7, 0x9f, 0xdf, 0x79, 0xfd, 0x7f, 0xfc, 0x3f, 0xef, 29 | 0xbc, 0xfe, 0xbf, 0xff, 0xff, 0xf7, 0xde, 0x7f, 0x5f, 0xff, 30 | 0xff, 0xfb, 0xef, 0x3f, 0xaf, 0xff, 0xff, 0xfd, 0xf0, 0x00, 31 | 0x17, 0xff, 0xff, 0xfe, 0xf8, 0x00, 0x0b, 0xff, 0xff, 0xff, 32 | 0x7c, 0x00, 0x05, 0xff, 0xff, 0xff, 0xb0, 0x00, 0x02, 0xff, 33 | 0xff, 0xff, 0xd8, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xec, 0x00, 34 | 0x00, 0x3f, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x1f, 0xff, 0xff, 35 | 0xf8, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 36 | 0x00, 0x00, 0x00, 0x00, 0x00 37 | } 38 | } 39 | } 40 | }; 41 | -------------------------------------------------------------------------------- /src/tft/fonts/noto_sans_mono_bold_arrows_24.c: -------------------------------------------------------------------------------- 1 | #include "fonts.h" 2 | 3 | const tft_font_t noto_sans_mono_bold_arrows_24 = { 4 | .size = 24, 5 | .yoffset = 18, 6 | .glyph_count = 4, 7 | .glyphs = (const tft_font_glyph_t[]){ 8 | { 9 | .character = 0x41, 10 | .width = 15, 11 | .height = 7, 12 | .xoffset = 2, 13 | .yoffset = 26, 14 | .xadvance = 19, 15 | .data = (const uint8_t[]){ 16 | 0x10, 0x00, 0x60, 0x01, 0xc0, 0x07, 0xff, 0xf7, 0x00, 0x06, 17 | 0x00, 0x04, 0x00, 0x00 18 | } 19 | }, 20 | { 21 | .character = 0x42, 22 | .width = 7, 23 | .height = 19, 24 | .xoffset = 6, 25 | .yoffset = 17, 26 | .xadvance = 19, 27 | .data = (const uint8_t[]){ 28 | 0x10, 0x71, 0xf7, 0xf1, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 29 | 0x81, 0x02, 0x04, 0x08, 0x10, 0x20, 0x08 30 | } 31 | }, 32 | { 33 | .character = 0x43, 34 | .width = 15, 35 | .height = 7, 36 | .xoffset = 2, 37 | .yoffset = 26, 38 | .xadvance = 19, 39 | .data = (const uint8_t[]){ 40 | 0x00, 0x10, 0x00, 0x30, 0x00, 0x77, 0xff, 0xf0, 0x01, 0xc0, 41 | 0x03, 0x00, 0x04, 0x00 42 | } 43 | }, 44 | { 45 | .character = 0x44, 46 | .width = 7, 47 | .height = 19, 48 | .xoffset = 6, 49 | .yoffset = 17, 50 | .xadvance = 19, 51 | .data = (const uint8_t[]){ 52 | 0x10, 0x20, 0x40, 0x81, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 53 | 0x81, 0x02, 0x04, 0x7f, 0x7c, 0x70, 0x08 54 | } 55 | } 56 | } 57 | }; 58 | -------------------------------------------------------------------------------- /src/tft/image.c: -------------------------------------------------------------------------------- 1 | #include "tft/image.h" 2 | 3 | void tft_image_draw(const tft_device_t *tft, uint16_t x, uint16_t y, const tft_image_t *img, tft_rgb_t color) { 4 | size_t offset = 0; 5 | uint16_t bits = 0, data = 0; 6 | uint16_t xpos = x, ypos = y; 7 | for (size_t h = 0; h < img->height; h++, ypos++) { 8 | xpos = x; 9 | for (size_t w = 0; w < img->width; w++, xpos++) { 10 | if (bits == 0) { 11 | bits = 8; 12 | data = img->data[offset++]; 13 | } 14 | if (data & 0x80) 15 | tft_pixel_set(tft, xpos, ypos, color); 16 | 17 | data <<= 1; 18 | bits--; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/tft/image.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "tft/tft.h" 15 | 16 | typedef struct { 17 | uint16_t width; 18 | uint16_t height; 19 | const uint8_t *data; 20 | } tft_image_t; 21 | 22 | void tft_image_draw(const tft_device_t *, uint16_t x, uint16_t y, const tft_image_t *, tft_rgb_t); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /src/tft/tft.c: -------------------------------------------------------------------------------- 1 | #include "tft.h" 2 | #include 3 | 4 | void tft_gpio_set(uint32_t port, uint32_t pins) { 5 | GPIO_BSRR(port) = pins; 6 | } 7 | 8 | void tft_gpio_clear(uint32_t port, uint32_t pins) { 9 | GPIO_BSRR(port) = (pins << 16); 10 | } 11 | 12 | uint32_t tft_gpio_get(uint32_t port, uint32_t pins) { 13 | return (GPIO_IDR(port) & pins); 14 | } 15 | 16 | void tft_gpio_mode_input(uint32_t port, uint32_t pins) { 17 | gpio_mode_setup(port, GPIO_MODE_INPUT, GPIO_PUPD_NONE, pins); 18 | } 19 | 20 | void tft_gpio_mode_output(uint32_t port, uint32_t pins) { 21 | gpio_mode_setup(port, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, pins); 22 | gpio_set_output_options(port, GPIO_OTYPE_PP, GPIO_OSPEED_2MHZ, pins); 23 | } 24 | -------------------------------------------------------------------------------- /src/tft/tft_platform.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | // speeds up render by avoiding function calls. 8 | 9 | #include 10 | 11 | #define tft_gpio_set(port, pins) GPIO_BSRR(port) = pins 12 | #define tft_gpio_clear(port, pins) GPIO_BSRR(port) = (pins << 16) 13 | 14 | #include "delay.h" 15 | 16 | #define tft_delay_microseconds(us) els_delay_microseconds(us) 17 | #define tft_delay_milliseconds(ms) els_delay_milliseconds(ms) 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /src/threading.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | void els_threading_setup(void); 8 | void els_threading_start(void); 9 | void els_threading_update(void); 10 | void els_threading_stop(void); 11 | bool els_threading_busy(void); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /src/threading_ext.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | void els_threading_ext_setup(void); 8 | void els_threading_ext_start(void); 9 | void els_threading_ext_update(void); 10 | void els_threading_ext_stop(void); 11 | bool els_threading_ext_busy(void); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /src/threading_int.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | void els_threading_int_setup(void); 8 | void els_threading_int_start(void); 9 | void els_threading_int_update(void); 10 | void els_threading_int_stop(void); 11 | bool els_threading_int_busy(void); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /src/timer.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include "gpio.h" 16 | #include "timer.h" 17 | #include "rcc_config.h" 18 | 19 | #define ELS_TIMER TIM2 20 | #define ELS_TIMER_IRQ NVIC_TIM2_IRQ 21 | #define ELS_TIMER_MAX UINT16_MAX 22 | #define ELS_TIMER_RCC RCC_TIM2 23 | #define ELS_TIMER_RST RST_TIM2 24 | #define ELS_TIMER_ISR tim2_isr 25 | 26 | //============================================================================== 27 | // Internal state 28 | //============================================================================== 29 | static uint64_t overflow_microseconds; 30 | 31 | //============================================================================== 32 | // ISR 33 | //============================================================================== 34 | void ELS_TIMER_ISR(void) { 35 | TIM_SR(ELS_TIMER) &= ~TIM_SR_UIF; 36 | overflow_microseconds += ELS_TIMER_MAX; 37 | } 38 | 39 | //============================================================================== 40 | // API 41 | //============================================================================== 42 | void els_timer_setup(void) { 43 | rcc_periph_clock_enable(ELS_TIMER_RCC); 44 | rcc_periph_reset_pulse(ELS_TIMER_RST); 45 | 46 | // clock division 0, alignment edge, count up. 47 | timer_set_mode(ELS_TIMER, TIM_CR1_CKD_CK_INT, TIM_CR1_CMS_EDGE, TIM_CR1_DIR_UP); 48 | 49 | // 100us counter, ~10KHz 50 | timer_set_prescaler(ELS_TIMER, ((rcc_apb1_frequency * 2) / 1e4) - 1); 51 | 52 | // keep running 53 | timer_disable_preload(ELS_TIMER); 54 | timer_continuous_mode(ELS_TIMER); 55 | 56 | // set to timer max 57 | timer_set_period(ELS_TIMER, ELS_TIMER_MAX); 58 | 59 | nvic_set_priority(ELS_TIMER_IRQ, 4); 60 | nvic_enable_irq(ELS_TIMER_IRQ); 61 | timer_enable_update_event(ELS_TIMER); 62 | 63 | overflow_microseconds = 0; 64 | timer_set_counter(ELS_TIMER, 0); 65 | timer_enable_counter(ELS_TIMER); 66 | timer_enable_irq(ELS_TIMER, TIM_DIER_UIE); 67 | } 68 | 69 | uint64_t els_timer_elapsed_microseconds(void) { 70 | return (timer_get_counter(ELS_TIMER) + overflow_microseconds) * 100; 71 | } 72 | 73 | uint32_t els_timer_elapsed_milliseconds(void) { 74 | return (timer_get_counter(ELS_TIMER) + overflow_microseconds) / 10; 75 | } 76 | -------------------------------------------------------------------------------- /src/timer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | void els_timer_setup(void); 15 | uint64_t els_timer_elapsed_microseconds(void); 16 | uint32_t els_timer_elapsed_milliseconds(void); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | -------------------------------------------------------------------------------- /src/turn_dimension.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | void els_turn_dimension_setup(void); 8 | void els_turn_dimension_start(void); 9 | void els_turn_dimension_update(void); 10 | void els_turn_dimension_stop(void); 11 | bool els_turn_dimension_busy(void); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /src/turning.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | void els_turning_setup(void); 8 | void els_turning_start(void); 9 | void els_turning_update(void); 10 | void els_turning_stop(void); 11 | bool els_turning_busy(void); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /src/usart.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "usart.h" 15 | 16 | #include "constants.h" 17 | #include "encoder.h" 18 | #include "keypad.h" 19 | #include "nvic.h" 20 | 21 | //------------------------------------------------------------------------------ 22 | // Set to 1 if you would like to use UART input to inject keypad scancodes. 23 | // 24 | // See the scan code table below for mapping 25 | //------------------------------------------------------------------------------ 26 | #ifndef ELS_USART_ENABLE_KEYPAD_INPUT 27 | #define ELS_USART_ENABLE_KEYPAD_INPUT 0 28 | #endif 29 | 30 | static uint8_t usart_scancode_table[] = { 31 | 0x1c, // A = Settings 32 | 0x32, // B = Functions 33 | 0x21, // C = F1 34 | 0x23, // D = F2 35 | 0x24, // E = F/P 36 | 0x2b, // F = 37 | 0x34, // G = Turn 38 | 0x33, // H = Thread 39 | 0x43, // I = Z/X 40 | 0x3b, // J = 0 41 | 0x42, // K = JOG 0 42 | 0x4b, // L = UNUSED 43 | 0x16, // M = Lock / Unlock 44 | 0x1e, // N = Encoder Multiplier 45 | 0x26, // O = STOP / EXIT 46 | 0x25, // P = READY / OK 47 | 0x2e, // Q = UNUSED 48 | 0x36 // R = UNUSED 49 | }; 50 | 51 | //------------------------------------------------------------------------------ 52 | // ISR 53 | //------------------------------------------------------------------------------ 54 | static void els_usart_isr(void) __attribute__ ((interrupt ("IRQ"))); 55 | 56 | //------------------------------------------------------------------------------ 57 | // UART & printf plumbing 58 | //------------------------------------------------------------------------------ 59 | void els_usart_setup(void) { 60 | // UART1 TX, RX 61 | gpio_mode_setup(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO9 | GPIO10); 62 | gpio_set_af(GPIOA, GPIO_AF7, GPIO9 | GPIO10); 63 | 64 | usart_set_baudrate(USART1, 921600); 65 | usart_set_databits(USART1, 8); 66 | usart_set_stopbits(USART1, USART_STOPBITS_1); 67 | usart_set_mode(USART1, USART_MODE_TX_RX); 68 | usart_set_parity(USART1, USART_PARITY_NONE); 69 | usart_set_flow_control(USART1, USART_FLOWCONTROL_NONE); 70 | 71 | // enable the USART. 72 | usart_enable(USART1); 73 | 74 | // NOTE: key input via UART disabled by default. 75 | #if ELS_USART_ENABLE_KEYPAD_INPUT 76 | els_nvic_irq_set_handler(NVIC_USART1_IRQ, els_usart_isr); 77 | nvic_enable_irq(NVIC_USART1_IRQ); 78 | usart_enable_rx_interrupt(USART1); 79 | #endif 80 | } 81 | 82 | int _write(int file, char *ptr, int len); 83 | int _write(int file, char *ptr, int len) { 84 | int i; 85 | 86 | if (file == 1) { 87 | for (i = 0; i < len; i++) 88 | usart_send_blocking(USART1, ptr[i]); 89 | return i; 90 | } 91 | 92 | errno = EIO; 93 | return -1; 94 | } 95 | 96 | //============================================================================== 97 | // ISR 98 | //============================================================================== 99 | static void els_usart_isr(void) { 100 | volatile uint8_t byte; 101 | volatile uint32_t reg; 102 | volatile bool kp_process; 103 | static uint8_t kp_state = 0; 104 | do { 105 | reg = USART_SR(USART1); 106 | if (reg & USART_SR_RXNE) { 107 | byte = USART_DR(USART1); 108 | kp_process = false; 109 | switch (kp_state) { 110 | case 0: 111 | if (byte == 0x1B) 112 | kp_state = 1; 113 | else 114 | kp_process = true; 115 | break; 116 | case 1: 117 | if (byte == 0x5B) 118 | kp_state = 2; 119 | else if (byte != 0x1B) { 120 | kp_state = 0; 121 | kp_process = true; 122 | } 123 | break; 124 | case 2: 125 | // up 126 | if (byte == 0x41 || byte == 0x44) 127 | els_encoder_decr(1); 128 | else if (byte == 0x42 || byte == 0x43) 129 | els_encoder_incr(1); 130 | else 131 | kp_process = true; 132 | kp_state = 0; 133 | break; 134 | } 135 | 136 | if (kp_process) { 137 | if (byte == '0') { 138 | els_keypad_write(0x00); 139 | } 140 | else if (byte >= 'a' && byte <= 'r') { 141 | els_keypad_write(usart_scancode_table[byte - 'a']); 142 | } 143 | else if (byte >= 'A' && byte <= 'R') { 144 | els_keypad_write(usart_scancode_table[byte - 'A']); 145 | } 146 | else if (byte == '\n' || byte == '\r') { 147 | els_keypad_write(ELS_KEY_OK); 148 | } 149 | else if (byte == 0x7E) { // shift esc 150 | els_keypad_write(ELS_KEY_EXIT); 151 | } 152 | } 153 | } 154 | } while ((reg & USART_SR_RXNE) != 0); 155 | } 156 | -------------------------------------------------------------------------------- /src/usart.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | void els_usart_setup(void); 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /src/utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | //============================================================================== 15 | // Utils 16 | //============================================================================== 17 | #define MAX(a, b) ((a) >= (b) ? (a) : (b)) 18 | #define MIN(a, b) ((a) <= (b) ? (a) : (b)) 19 | #define CEIL(a) ((int)((a) + 0.5)) 20 | #define SQR(a) ((a)*(a)) 21 | 22 | size_t els_sprint_double1(char *text, size_t size, float value, const char *prefix); 23 | size_t els_sprint_double2(char *text, size_t size, float value, const char *prefix); 24 | size_t els_sprint_double3(char *text, size_t size, float value, const char *prefix); 25 | size_t els_sprint_double33(char *text, size_t size, float value, const char *prefix); 26 | size_t els_sprint_double13(char *text, size_t size, float value, const char *prefix); 27 | size_t els_sprint_double23(char *text, size_t size, float value, const char *prefix); 28 | size_t els_sprint_double24(char *text, size_t size, float value, const char *prefix); 29 | uint32_t els_gcd(uint32_t u, uint32_t v); 30 | 31 | #ifdef ELS_DEBUG 32 | #define els_printf(...) printf(__VA_ARGS__) 33 | #else 34 | #define els_printf(...) 35 | #endif 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | -------------------------------------------------------------------------------- /tools/Morse.Taper.Dimensions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/tools/Morse.Taper.Dimensions.png -------------------------------------------------------------------------------- /tools/color-map-556: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | dir = File.dirname(__FILE__) 4 | file = File.join(dir, "colors.txt") 5 | data = File.read(file). 6 | split($/). 7 | map {|s| 8 | c = s.split(/\t+/) 9 | [c.shift, c.map(&:to_i)] 10 | }. 11 | map {|s, c| 12 | [ 13 | s, 14 | [ 15 | (c[0] * 31.0 / 255.0).round.to_i, 16 | (c[1] * 31.0 / 255.0).round.to_i, 17 | (c[2] * 63.0 / 255).round.to_i 18 | ] 19 | ] 20 | } 21 | 22 | data.each {|s, (r, g, b)| 23 | puts "#define %-25s (tft_rgb_t){.r = %3s, .g = %3s, .b = %3s}" % [s, r, g, b] 24 | } 25 | -------------------------------------------------------------------------------- /tools/color-map-565: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | dir = File.dirname(__FILE__) 4 | file = File.join(dir, "colors.txt") 5 | data = File.read(file). 6 | split($/). 7 | map {|s| 8 | c = s.split(/\t+/) 9 | [c.shift, c.map(&:to_i)] 10 | }. 11 | map {|s, c| 12 | [ 13 | s, 14 | [ 15 | (c[0] * 31.0 / 255.0).round.to_i, 16 | (c[1] * 63.0 / 255.0).round.to_i, 17 | (c[2] * 31.0 / 255).round.to_i 18 | ] 19 | ] 20 | } 21 | 22 | data.each {|s, (r, g, b)| 23 | puts "#define %-25s (tft_rgb_t){.r = %3s, .g = %3s, .b = %3s}" % [s, r, g, b] 24 | } 25 | 26 | -------------------------------------------------------------------------------- /tools/colors.txt: -------------------------------------------------------------------------------- 1 | TFT_COLOR_RED 255 0 0 2 | TFT_COLOR_GREEN 0 255 0 3 | TFT_COLOR_BLUE 0 0 255 4 | TFT_COLOR_YELLOW 255 255 0 5 | TFT_COLOR_CYAN 0 255 255 6 | TFT_COLOR_MAGENTA 255 0 255 7 | TFT_COLOR_WHITE 255 255 255 8 | TFT_COLOR_ORANGE 255 81 0 9 | TFT_COLOR_BLACK 0 0 0 10 | TFT_COLOR_CERULEAN 29 172 214 11 | TFT_COLOR_DIANNE 16 73 99 12 | TFT_COLOR_FROG 16 101 16 13 | TFT_COLOR_GRAY 58 57 58 14 | TFT_COLOR_LITEGRAY 115 113 115 15 | TFT_COLOR_FOREST 8 101 33 16 | TFT_COLOR_TURF 41 53 25 17 | TFT_COLOR_BLUE1 0 16 41 18 | TFT_COLOR_BLUE2 0 65 66 19 | TFT_COLOR_BGCOLOR1 16 154 181 20 | TFT_COLOR_BGCOLOR2 33 121 66 21 | TFT_COLOR_BGCOLOR3 222 40 0 22 | -------------------------------------------------------------------------------- /tools/concave-r.plot: -------------------------------------------------------------------------------- 1 | # radius of arc circle 2 | r = 12.5 3 | 4 | # depth of arc intersecting stock 5 | d = 5.0 6 | # length of arc intersecting stock 7 | l = 5.0 8 | 9 | # stock 10 | D = 25.0 11 | L = 50.0 12 | 13 | # circle origin calculation. 14 | # 15 | # see https://math.stackexchange.com/questions/1781438/finding-the-center-of-a-circle-given-two-points-and-a-radius-algebraically 16 | # 17 | # equation 18 | # (x - a)^2 + (y - b)^2 = r^2 19 | # 20 | # intersects at 2 points. 21 | # 22 | # (0, -d) and (-l, 0) 23 | # 24 | # midpoint of rhombus 25 | # 26 | dx = l / 2.0 27 | dy = d / 2.0 28 | mx = -dx 29 | my = -dy 30 | 31 | # diagonal 1 32 | d1 = sqrt(dx**2 + dy**2) 33 | # diagonal 2 34 | d2 = sqrt(r**2 - d1**2) 35 | 36 | # circle origin 37 | a = mx + (d2 * dy) / d1 38 | b = my + (d2 * dx) / d1 39 | 40 | print "l = ",l 41 | print "d = ",d 42 | print "radius = ",r 43 | 44 | print "mx = ", mx 45 | print "my = ", my 46 | 47 | print "d1 = ", d1 48 | print "d2 = ", d2 49 | 50 | print "origin = (", a, ", ", b, ")" 51 | 52 | set size ratio -1 53 | set xrange [-L:L] 54 | set yrange [D:-D] reverse 55 | 56 | set label "L" at -l/2, -d-3 57 | set arrow from -l, -d-1 to 0, -d-1 heads noborder lw 1 lc rgb "black" 58 | 59 | set label "D" at -l-3.5, -d/2 60 | set arrow from -l-1, -d to -l-1, 0 heads noborder lw 1 lc rgb "black" 61 | 62 | set label "R" at a-2, b/2 63 | set arrow from a, b to a, b - r heads noborder lw 1 lc rgb "black" 64 | 65 | set arrow from -l,-d to 0,-d nohead lw 2 lc rgb "red" 66 | set arrow from -l,-d to -l,0 nohead lw 2 lc rgb "red" 67 | 68 | set arrow from 0,0 to 0,-D nohead lw 2 lc rgb "blue" 69 | set arrow from -L,0 to 0,0 nohead lw 2 lc rgb "blue" 70 | set arrow from -L,-D to 0,-D nohead lw 2 lc rgb "blue" 71 | 72 | set object 1 circle front at a,b size r fillcolor rgb "gray" lw 2 73 | plot 0 notitle lw 1 74 | -------------------------------------------------------------------------------- /tools/convex-l.plot: -------------------------------------------------------------------------------- 1 | # radius of arc circle 2 | r = 12.5 3 | 4 | # depth of arc intersecting stock 5 | d = 5.0 6 | # length of arc intersecting stock 7 | l = 5.0 8 | 9 | # stock 10 | D = 25.0 11 | L = 50.0 12 | 13 | # circle origin calculation. 14 | # 15 | # see https://math.stackexchange.com/questions/1781438/finding-the-center-of-a-circle-given-two-points-and-a-radius-algebraically 16 | # 17 | # equation 18 | # (x - a)^2 + (y - b)^2 = r^2 19 | # 20 | # intersects at 2 points. 21 | # 22 | # (0, -d) and (l, 0) 23 | # 24 | # midpoint of rhombus 25 | # 26 | dx = l / 2.0 27 | dy = d / 2.0 28 | mx = +dx 29 | my = -dy 30 | 31 | # diagonal 1 32 | d1 = sqrt(dx**2 + dy**2) 33 | # diagonal 2 34 | d2 = sqrt(r**2 - d1**2) 35 | 36 | # circle origin 37 | a = mx + (d2 * dy) / d1 38 | b = my - (d2 * dx) / d1 39 | 40 | print "l = ",l 41 | print "d = ",d 42 | print "radius = ",r 43 | 44 | print "mx = ", mx 45 | print "my = ", my 46 | 47 | print "d1 = ", d1 48 | print "d2 = ", d2 49 | 50 | print "origin = (", a, ", ", b, ")" 51 | 52 | set size ratio -1 53 | set xrange [-L:L] 54 | set yrange [D:-D] reverse 55 | 56 | set label "L" at l/2-1, -d-3 57 | set arrow from l, -d-1 to 0, -d-1 heads noborder lw 1 lc rgb "black" 58 | 59 | set label "D" at l+1.5, -d/2 60 | set arrow from l+1, -d to l+1, 0 heads noborder lw 1 lc rgb "black" 61 | 62 | set label "R" at a-2, b/2 63 | set arrow from a, b to a, b + r heads noborder lw 1 lc rgb "black" 64 | 65 | set arrow from l,-d to 0,-d nohead lw 2 lc rgb "red" 66 | set arrow from l,-d to l,0 nohead lw 2 lc rgb "red" 67 | 68 | set arrow from 0,0 to 0,-D nohead lw 2 lc rgb "blue" 69 | set arrow from L,0 to 0,0 nohead lw 2 lc rgb "blue" 70 | set arrow from L,-D to 0,-D nohead lw 2 lc rgb "blue" 71 | 72 | set object 1 circle front at a,b size r fillcolor rgb "gray" lw 2 73 | plot 0 notitle lw 1 74 | -------------------------------------------------------------------------------- /tools/convex-r.plot: -------------------------------------------------------------------------------- 1 | # radius of arc circle 2 | r = 12.5 3 | 4 | # depth of arc intersecting stock 5 | d = 5.0 6 | # length of arc intersecting stock 7 | l = 5.0 8 | 9 | # stock 10 | D = 25.0 11 | L = 50.0 12 | 13 | # circle origin calculation. 14 | # 15 | # see https://math.stackexchange.com/questions/1781438/finding-the-center-of-a-circle-given-two-points-and-a-radius-algebraically 16 | # 17 | # equation 18 | # (x - a)^2 + (y - b)^2 = r^2 19 | # 20 | # intersects at 2 points. 21 | # 22 | # (0, -d) and (-l, 0) 23 | # 24 | # midpoint of rhombus 25 | # 26 | dx = l / 2.0 27 | dy = d / 2.0 28 | mx = -dx 29 | my = -dy 30 | 31 | # diagonal 1 32 | d1 = sqrt(dx**2 + dy**2) 33 | # diagonal 2 34 | d2 = sqrt(r**2 - d1**2) 35 | 36 | # circle origin 37 | a = mx - (d2 * dy) / d1 38 | b = my - (d2 * dx) / d1 39 | 40 | print "l = ",l 41 | print "d = ",d 42 | print "radius = ",r 43 | 44 | print "mx = ", mx 45 | print "my = ", my 46 | 47 | print "d1 = ", d1 48 | print "d2 = ", d2 49 | 50 | print "origin = (", a, ", ", b, ")" 51 | 52 | set size ratio -1 53 | set xrange [-L:L] 54 | set yrange [D:-D] reverse 55 | 56 | set label "L" at -l/2, -d-3 57 | set arrow from -l, -d-1 to 0, -d-1 heads noborder lw 1 lc rgb "black" 58 | 59 | set label "D" at -l-3.5, -d/2 60 | set arrow from -l-1, -d to -l-1, 0 heads noborder lw 1 lc rgb "black" 61 | 62 | set label "R" at a-2, b/2 63 | set arrow from a, b to a, b + r heads noborder lw 1 lc rgb "black" 64 | 65 | set arrow from -l,-d to 0,-d nohead lw 2 lc rgb "red" 66 | set arrow from -l,-d to -l,0 nohead lw 2 lc rgb "red" 67 | 68 | set arrow from 0,0 to 0,-D nohead lw 2 lc rgb "blue" 69 | set arrow from -L,0 to 0,0 nohead lw 2 lc rgb "blue" 70 | set arrow from -L,-D to 0,-D nohead lw 2 lc rgb "blue" 71 | 72 | set object 1 circle front at a,b size r fillcolor rgb "gray" lw 2 73 | plot 0 notitle lw 1 74 | -------------------------------------------------------------------------------- /tools/embed-font: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'io/console' 4 | require 'chunky_png' 5 | require 'json' 6 | 7 | class Glyph 8 | attr_reader :width, :height, :data, :char, :xoffset, :xadvance, :yoffset 9 | 10 | def initialize(char, width, height, xoffset, yoffset, xadvance, data) 11 | @char = char 12 | @width = width 13 | @height = height 14 | @data = data 15 | @xoffset = xoffset 16 | @yoffset = yoffset 17 | @xadvance = xadvance 18 | end 19 | 20 | def c_definition 21 | cdata = data. 22 | each_slice(8). 23 | map {|slice| slice.reduce(0) {|mask, s| s > 0 ? (mask << 1) | 1 : (mask << 1) }}. 24 | each_slice(10). 25 | map {|slice| slice.map {|n| '0x%02x' % n}.join(', ') }. 26 | join(",\n ") 27 | 28 | c = <<~C 29 | { 30 | .character = 0x#{'%02x' % char.ord}, 31 | .width = #{width}, 32 | .height = #{height}, 33 | .xoffset = #{xoffset}, 34 | .yoffset = #{yoffset}, 35 | .xadvance = #{xadvance}, 36 | .data = (const uint8_t[]){ 37 | #{cdata} 38 | } 39 | } 40 | C 41 | end 42 | end 43 | 44 | json, image = *ARGV 45 | 46 | config = JSON.parse(File.read(json)) 47 | png = ChunkyPNG::Image.from_file(image) 48 | 49 | fheight = config["config"]["size"] 50 | 51 | glyphs = [] 52 | 53 | config["symbols"].each do |glyph| 54 | char = glyph["id"].chr 55 | width = glyph["width"] 56 | height = glyph["height"] 57 | xstart = glyph["x"] 58 | ystart = glyph["y"] 59 | xoffset = glyph["xoffset"] 60 | yoffset = glyph["yoffset"] 61 | xadvance = glyph["xadvance"] 62 | 63 | data = [] 64 | for y in ystart..((ystart + height) - 1) 65 | for x in xstart..((xstart + width) - 1) 66 | if ChunkyPNG::Color.a(png[x, y]) > 0 67 | #print '1' if char == '0' 68 | data << 1 69 | else 70 | data << 0 71 | #print '0' if char == '0' 72 | end 73 | end 74 | #puts if char == '0' 75 | end 76 | 77 | glyphs << Glyph.new(char, width, height, xoffset, yoffset, xadvance, data) 78 | end 79 | 80 | c_glyphs = glyphs. 81 | map {|glyph| glyph.c_definition.strip.split($/).map {|l| ' ' + l }.join($/) }. 82 | join(",\n") 83 | 84 | yoffset_min = glyphs.map {|g| g.yoffset}.min + 1 85 | 86 | name = File.basename(image, File.extname(image)) 87 | 88 | #=begin 89 | puts <<~C 90 | #include "fonts.h" 91 | 92 | const tft_font_t #{name} = { 93 | .size = #{fheight}, 94 | .yoffset = #{yoffset_min}, 95 | .glyph_count = #{glyphs.size}, 96 | .glyphs = (const tft_font_glyph_t[]){ 97 | #{c_glyphs} 98 | } 99 | }; 100 | C 101 | #=end 102 | -------------------------------------------------------------------------------- /tools/embed-image: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'io/console' 4 | require 'chunky_png' 5 | 6 | file = ARGV.shift 7 | png = ChunkyPNG::Image.from_file(file) 8 | data = [] 9 | mask = 0 10 | bits = 0 11 | for y in 0..(png.height - 1) 12 | for x in 0..(png.width - 1) 13 | if ChunkyPNG::Color.a(png[x, y]) > 32 && ChunkyPNG::Color.b(png[x, y]) > 32 14 | mask = (mask << 1) | 1 15 | else 16 | mask = mask << 1 17 | end 18 | bits = bits + 1 19 | 20 | if bits == 8 21 | data << mask 22 | mask = 0 23 | bits = 0 24 | end 25 | end 26 | end 27 | 28 | if bits > 0 29 | data << mask 30 | end 31 | 32 | name = File.basename(file, File.extname(file)) 33 | name = name.gsub(/[^a-z0-9_]/, '_').gsub(/_+/, '_') 34 | puts(<<~C) 35 | #include "tft/image.h" 36 | 37 | const tft_image_t #{name} = { 38 | .width = #{png.width}, 39 | .height = #{png.height}, 40 | .data = (const uint8_t[]){ 41 | #{data.each_slice(10).map {|slice| slice.map {|b| '0x%02x' % b }.join(', ') }.join(",\n ")} 42 | } 43 | }; 44 | C 45 | -------------------------------------------------------------------------------- /tools/fonts/gear_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/tools/fonts/gear_icon.png -------------------------------------------------------------------------------- /tools/fonts/gear_icon.svg: -------------------------------------------------------------------------------- 1 | 2 | image/svg+xml 47 | 50 | 51 | -------------------------------------------------------------------------------- /tools/fonts/gears_regular_32.json: -------------------------------------------------------------------------------- 1 | { 2 | "config": { 3 | "base": 35, 4 | "bold": 0, 5 | "charHeight": 47, 6 | "charSpacing": 0, 7 | "face": "gears", 8 | "italic": 0, 9 | "lineSpacing": 0, 10 | "size": 32, 11 | "smooth": 1, 12 | "textureFile": "gears_regular_32.PNG", 13 | "textureHeight": 128, 14 | "textureWidth": 128 15 | }, 16 | "kerning": [ 17 | ], 18 | "symbols": [ 19 | { 20 | "height": 27, 21 | "id": 65, 22 | "width": 36, 23 | "x": 1, 24 | "xadvance": 35, 25 | "xoffset": 0, 26 | "y": 1, 27 | "yoffset": 4 28 | }, 29 | { 30 | "height": 27, 31 | "id": 66, 32 | "width": 36, 33 | "x": 38, 34 | "xadvance": 35, 35 | "xoffset": 0, 36 | "y": 1, 37 | "yoffset": 4 38 | }, 39 | { 40 | "height": 31, 41 | "id": 67, 42 | "width": 27, 43 | "x": 75, 44 | "xadvance": 26, 45 | "xoffset": 0, 46 | "y": 1, 47 | "yoffset": 4 48 | }, 49 | { 50 | "height": 36, 51 | "id": 68, 52 | "width": 27, 53 | "x": 1, 54 | "xadvance": 26, 55 | "xoffset": 0, 56 | "y": 33, 57 | "yoffset": -1 58 | }, 59 | { 60 | "height": 36, 61 | "id": 70, 62 | "width": 36, 63 | "x": 29, 64 | "xadvance": 35, 65 | "xoffset": 0, 66 | "y": 33, 67 | "yoffset": -1 68 | }, 69 | { 70 | "height": 31, 71 | "id": 72, 72 | "width": 35, 73 | "x": 66, 74 | "xadvance": 34, 75 | "xoffset": 0, 76 | "y": 38, 77 | "yoffset": 4 78 | }, 79 | { 80 | "height": 35, 81 | "id": 74, 82 | "width": 35, 83 | "x": 1, 84 | "xadvance": 34, 85 | "xoffset": 0, 86 | "y": 70, 87 | "yoffset": 0 88 | }, 89 | { 90 | "height": 33, 91 | "id": 75, 92 | "width": 35, 93 | "x": 37, 94 | "xadvance": 34, 95 | "xoffset": 0, 96 | "y": 74, 97 | "yoffset": 4 98 | } 99 | ] 100 | } 101 | -------------------------------------------------------------------------------- /tools/fonts/gears_regular_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/tools/fonts/gears_regular_32.png -------------------------------------------------------------------------------- /tools/fonts/gears_regular_50.json: -------------------------------------------------------------------------------- 1 | { 2 | "config": { 3 | "base": 54, 4 | "bold": 0, 5 | "charHeight": 73, 6 | "charSpacing": 0, 7 | "face": "gears", 8 | "italic": 0, 9 | "lineSpacing": 0, 10 | "size": 50, 11 | "smooth": 1, 12 | "textureFile": "gears_regular_50.PNG", 13 | "textureHeight": 64, 14 | "textureWidth": 64 15 | }, 16 | "kerning": [ 17 | ], 18 | "symbols": [ 19 | { 20 | "height": 35, 21 | "id": 78, 22 | "width": 49, 23 | "x": 1, 24 | "xadvance": 67, 25 | "xoffset": 3, 26 | "y": 1, 27 | "yoffset": 7 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /tools/fonts/gears_regular_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/tools/fonts/gears_regular_50.png -------------------------------------------------------------------------------- /tools/fonts/inconsolata_lgc_bold_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/tools/fonts/inconsolata_lgc_bold_14.png -------------------------------------------------------------------------------- /tools/fonts/noto_sans_mono_bold_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/tools/fonts/noto_sans_mono_bold_10.png -------------------------------------------------------------------------------- /tools/fonts/noto_sans_mono_bold_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/tools/fonts/noto_sans_mono_bold_14.png -------------------------------------------------------------------------------- /tools/fonts/noto_sans_mono_bold_20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/tools/fonts/noto_sans_mono_bold_20.png -------------------------------------------------------------------------------- /tools/fonts/noto_sans_mono_bold_26.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/tools/fonts/noto_sans_mono_bold_26.png -------------------------------------------------------------------------------- /tools/fonts/noto_sans_mono_bold_arrows_24.json: -------------------------------------------------------------------------------- 1 | { 2 | "config": { 3 | "base": 35, 4 | "bold": 0, 5 | "charHeight": 44, 6 | "charSpacing": 0, 7 | "face": "Noto Sans Mono", 8 | "italic": 0, 9 | "lineSpacing": 0, 10 | "size": 24, 11 | "smooth": 0, 12 | "textureFile": "noto_sans_mono_bold_arrows_24.PNG", 13 | "textureHeight": 32, 14 | "textureWidth": 64 15 | }, 16 | "kerning": [ 17 | ], 18 | "symbols": [ 19 | { 20 | "height": 7, 21 | "id": 65, 22 | "width": 15, 23 | "x": 1, 24 | "xadvance": 19, 25 | "xoffset": 2, 26 | "y": 10, 27 | "yoffset": 26 28 | }, 29 | { 30 | "height": 19, 31 | "id": 66, 32 | "width": 7, 33 | "x": 17, 34 | "xadvance": 19, 35 | "xoffset": 6, 36 | "y": 1, 37 | "yoffset": 17 38 | }, 39 | { 40 | "height": 7, 41 | "id": 67, 42 | "width": 15, 43 | "x": 25, 44 | "xadvance": 19, 45 | "xoffset": 2, 46 | "y": 10, 47 | "yoffset": 26 48 | }, 49 | { 50 | "height": 19, 51 | "id": 68, 52 | "width": 7, 53 | "x": 41, 54 | "xadvance": 19, 55 | "xoffset": 6, 56 | "y": 1, 57 | "yoffset": 17 58 | } 59 | ] 60 | } 61 | -------------------------------------------------------------------------------- /tools/fonts/noto_sans_mono_bold_arrows_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/tools/fonts/noto_sans_mono_bold_arrows_24.png -------------------------------------------------------------------------------- /tools/fonts/spindle_chuck_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hobbymachinist/els/03cfc7efa513142ef48f77a85858262047a75a55/tools/fonts/spindle_chuck_50.png -------------------------------------------------------------------------------- /tools/jacobs-taper-calculator: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # https://en.wikipedia.org/wiki/Machine_taper#Dimensions 4 | # 5 | PRESETS = { 6 | "0" => {small_end: 5.8024, large_end: 6.3500, length: 11.1130}, 7 | "1" => {small_end: 8.4686, large_end: 9.7536, length: 16.6690}, 8 | "2" => {small_end: 12.3860, large_end: 14.1990, length: 22.2250}, 9 | "2S" => {small_end: 12.3860, large_end: 13.9400, length: 19.0500}, 10 | "2.5" => {small_end: 15.8750, large_end: 17.1960, length: 26.7970}, 11 | "3" => {small_end: 18.9510, large_end: 20.5990, length: 30.9560}, 12 | "4" => {small_end: 26.3450, large_end: 28.5500, length: 42.0700}, 13 | "5" => {small_end: 33.4290, large_end: 35.8900, length: 47.6250}, 14 | "6" => {small_end: 15.8520, large_end: 17.1700, length: 25.4000}, 15 | "33" => {small_end: 14.2370, large_end: 15.8500, length: 25.4000}, 16 | }.freeze 17 | 18 | class JacobsTaper 19 | attr_reader :length, :angle, :tan_angle, :small_end, :large_end, :depth 20 | def initialize(length, small_end, large_end) 21 | @length = length 22 | @small_end = small_end 23 | @large_end = large_end 24 | @depth = (large_end - small_end) / 2 25 | 26 | @tan_angle = (depth / length) 27 | @angle = Math.atan(tan_angle) * 180 / Math::PI 28 | end 29 | 30 | def candidates 31 | puts "Nominal values:" 32 | puts "--------------------------------------------------" 33 | puts "Length = %.2f, Angle = %.8f°" % [length, angle] 34 | puts "Major Φ = %.2f, Minor Φ = %.2f, Depth = %.2f" % [large_end, small_end, (large_end - small_end) / 2] 35 | puts 36 | puts "Best length and taper depth combinations:" 37 | puts "--------------------------------------------------" 38 | data = 39 | ((length - 5)..(length + 5)). 40 | step(0.01). 41 | map {|l| 42 | depth = (l * tan_angle).round(5); 43 | ['%.2f' % l, '%.4f' % depth, '%.8f' % (tan_angle - (depth / l)).abs] 44 | }. 45 | select {|(l, d, delta)| d =~ /\...00/ }. 46 | sort_by {|(l, d, delta)| delta}. 47 | each {|(l, d, delta)| 48 | c_angle = (Math.atan(delta.to_f) * 180) / Math::PI 49 | print "length = %s depth = %.2f error = %.8f°\n" % [l, d.to_f, c_angle] 50 | } 51 | end 52 | end 53 | 54 | calc = ->(taper) do 55 | puts "==================================================" 56 | puts "Options for Jacobs Taper #{taper}" 57 | puts "==================================================" 58 | puts 59 | JacobsTaper. 60 | new( 61 | PRESETS[taper][:length], 62 | PRESETS[taper][:small_end], 63 | PRESETS[taper][:large_end], 64 | ). 65 | candidates 66 | end 67 | 68 | if ARGV.length > 0 && PRESETS.key?(ARGV[0]) 69 | calc.call(ARGV.shift) 70 | else 71 | PRESETS.keys.each {|taper| calc.call(taper) } 72 | end 73 | -------------------------------------------------------------------------------- /tools/knurling.plot: -------------------------------------------------------------------------------- 1 | # config 2 | set angles degrees 3 | 4 | # diameter 5 | D = 13 6 | 7 | # length 8 | L = 30 9 | 10 | # arc len 11 | X = (D / 2.0) * pi 12 | 13 | # helix angle 14 | A = 25 15 | 16 | # pitch 17 | P = X / tan((90 - A)) 18 | 19 | print "D = ", D 20 | print "A = ", A 21 | print "P = ", P 22 | 23 | set object 1 rect from 0,0 to L,D fc rgb "grey" 24 | 25 | do for [t=0:L] { 26 | set arrow from t*2,0 to P+t*2,D nohead lw 1 lc rgb "black" 27 | set arrow from t*2,D to P+t*2,0 nohead lw 1 lc rgb "black" 28 | } 29 | 30 | do for [t=-L:0] { 31 | set arrow from t*2,0 to P+t*2,D nohead lw 1 lc rgb "black" 32 | set arrow from t*2,D to P+t*2,0 nohead lw 1 lc rgb "black" 33 | } 34 | 35 | plot [0:L][-5:D+5] 0 notitle lw 1 36 | -------------------------------------------------------------------------------- /tools/morse-taper-calculator: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | 4 | # https://en.wikipedia.org/wiki/Machine_taper#Dimensions 5 | # 6 | # https://www.cgtk.co.uk/metalwork/data/morse 7 | # 8 | # Taper D1 D2 L2 Half Angle 9 | # 10 | PRESETS = { 11 | 0 => {major_dia: 9.045, minor_dia: 6.40, length: 50.80, angle: [1, 29, 27]}, 12 | 1 => {major_dia: 12.065, minor_dia: 9.37, length: 53.98, angle: [1, 25, 43]}, 13 | 2 => {major_dia: 17.780, minor_dia: 14.52, length: 65.09, angle: [1, 25, 50]}, 14 | 3 => {major_dia: 23.825, minor_dia: 19.76, length: 80.96, angle: [1, 26, 16]}, 15 | 4 => {major_dia: 31.267, minor_dia: 25.91, length: 103.19, angle: [1, 29, 15]}, 16 | 5 => {major_dia: 44.399, minor_dia: 37.47, length: 131.76, angle: [1, 30, 26]}, 17 | 6 => {major_dia: 63.348, minor_dia: 53.75, length: 184.15, angle: [1, 29, 36]}, 18 | 7 => {major_dia: 83.058, minor_dia: 69.85, length: 254.00, angle: [1, 29, 22]} 19 | } 20 | 21 | class MorseTaper 22 | attr_reader :length, :angle, :tan_angle, :major_dia, :minor_dia 23 | def initialize(length, (deg, min, sec), major_dia, minor_dia) 24 | @length = length 25 | @angle = deg + min / 60.0 + sec / 3600.0 26 | @tan_angle = Math.tan(angle * Math::PI / 180) 27 | @major_dia = major_dia 28 | @minor_dia = minor_dia 29 | end 30 | 31 | def candidates 32 | puts "Nominal values:" 33 | puts "--------------------------------------------------" 34 | puts "Length = %.2f, Angle = %.8f°" % [length, angle] 35 | puts "Major Φ = %.2f, Minor Φ = %.2f" % [major_dia, minor_dia] 36 | puts 37 | puts "Best length and taper depth combinations:" 38 | puts "--------------------------------------------------" 39 | data = 40 | ((length - 10)..(length + 5)). 41 | step(0.01). 42 | map {|l| 43 | depth = (l * tan_angle).round(5); 44 | ['%.2f' % l, '%.4f' % depth, '%.8f' % (tan_angle - (depth / l)).abs] 45 | }. 46 | select {|(l, d, delta)| d =~ /\...00/ }. 47 | sort_by {|(l, d, delta)| delta}. 48 | each {|(l, d, delta)| 49 | c_angle = (Math.atan(delta.to_f) * 180) / Math::PI 50 | print "length = %s depth = %.2f error = %.8f°\n" % [l, d.to_f, c_angle] 51 | } 52 | end 53 | end 54 | 55 | calc = ->(taper) do 56 | puts "==================================================" 57 | puts "Options for Morse Taper #{taper}" 58 | puts "==================================================" 59 | puts 60 | MorseTaper. 61 | new( 62 | PRESETS[taper][:length], 63 | PRESETS[taper][:angle], 64 | PRESETS[taper][:major_dia], 65 | PRESETS[taper][:minor_dia], 66 | ). 67 | candidates 68 | end 69 | 70 | if ARGV.length > 0 && (0..7).include?(taper = ARGV.shift.to_i) 71 | calc.call(taper) 72 | else 73 | (0..7).each {|taper| calc.call(taper) } 74 | end 75 | -------------------------------------------------------------------------------- /tools/screenshot: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'chunky_png' 4 | require 'fileutils' 5 | 6 | file = ARGV.shift 7 | hex = File.read(file).split(/[\r\n]+/).join 8 | png = ChunkyPNG::Image.new(480, 320, ChunkyPNG::Color::BLACK) 9 | pixels = hex.bytes.each_slice(6).entries 10 | 11 | # build rgba from 5:6:5, 16 bit colorspace 12 | rgba = pixels.map do |rgb| 13 | rgb.each_slice(2).map.with_index do |c, n| 14 | (([c.map(&:chr).join].pack("H*").ord * 255.0) / (n == 1 ? 63 : 31)).round(0).to_i 15 | end 16 | end 17 | 18 | for row in 1..320 19 | for col in 1..480 20 | idx = (row - 1) * 480 + (col - 1) 21 | png[col - 1, row - 1] = ChunkyPNG::Color.rgba(rgba[idx][0], rgba[idx][1], rgba[idx][2], 255) 22 | end 23 | end 24 | 25 | png.save(file.sub(/.hex$/, '.png'), interlace: true) 26 | #FileUtils.rm_f(file) 27 | --------------------------------------------------------------------------------