initial commit

This commit is contained in:
demik 2020-09-14 22:32:07 +02:00
parent 97c7fc54e8
commit 242aeea308
44 changed files with 26639 additions and 0 deletions

53
.gitignore vendored Normal file
View File

@ -0,0 +1,53 @@
# Object files
*.o
# Libraries
*.lib
*.a
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
# http://www.gnu.org/software/automake
Makefile.in
# http://www.gnu.org/software/autoconf
/autom4te.cache
/aclocal.m4
/compile
/configure
/depcomp
/install-sh
/missing
# OS X
.DS_Store
.AppleDouble
.LSOverride
Icon
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Subversion
.svn/
# Linux
.*
!.gitignore
*~
# Project specific
/build

6
CMakeLists.txt Normal file
View File

@ -0,0 +1,6 @@
# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(quack)

14
EDA/.gitignore vendored Normal file
View File

@ -0,0 +1,14 @@
# tmp zip files
*.zip
# KiCad backup files
*bak
# KiCad cache files
*-cache
# Gerber files
*.drl
*.gbr
*.ps

9
EDA/2301843-1.dcm Executable file
View File

@ -0,0 +1,9 @@
EESchema-DOCLIB Version 2.0
#
$CMP 2301843-1
D TE CONNECTIVITY - 2301843-1 - D-SUB CONN, PLUG, 9POS, THROUGH HOLE
K
F https://componentsearchengine.com/Datasheets/2/2301843-1.pdf
$ENDCMP
#
#End Doc Library

32
EDA/2301843-1.lib Executable file
View File

@ -0,0 +1,32 @@
EESchema-LIBRARY Version 2.3
#encoding utf-8
#SamacSys ECAD Model 2301843-1
#/1754128/231798/2.47/11/4/Connector
DEF 2301843-1 J 0 30 Y Y 1 F N
F0 "J" 850 500 50 H V L CNN
F1 "2301843-1" 850 400 50 H V L CNN
F2 "23018431" 850 300 50 H I L CNN
F3 "https://componentsearchengine.com/Datasheets/2/2301843-1.pdf" 850 200 50 H I L CNN
F4 "TE CONNECTIVITY - 2301843-1 - D-SUB CONN, PLUG, 9POS, THROUGH HOLE" 850 100 50 H I L CNN "Description"
F5 "13.955" 850 0 50 H I L CNN "Height"
F6 "571-2301843-1" 850 -100 50 H I L CNN "Mouser Part Number"
F7 "https://www.mouser.co.uk/ProductDetail/TE-Connectivity-AMP/2301843-1?qs=rrS6PyfT74crws9wAQVNoA%3D%3D" 850 -200 50 H I L CNN "Mouser Price/Stock"
F8 "TE Connectivity" 850 -300 50 H I L CNN "Manufacturer_Name"
F9 "2301843-1" 850 -400 50 H I L CNN "Manufacturer_Part_Number"
DRAW
X 1 1 300 500 200 D 50 50 0 0 P
X 2 2 400 500 200 D 50 50 0 0 P
X 3 3 500 500 200 D 50 50 0 0 P
X 4 4 600 500 200 D 50 50 0 0 P
X 5 5 700 500 200 D 50 50 0 0 P
X 6 6 300 -500 200 U 50 50 0 0 P
X 7 7 400 -500 200 U 50 50 0 0 P
X 8 8 500 -500 200 U 50 50 0 0 P
X 9 9 600 -500 200 U 50 50 0 0 P
X MH1 MH1 0 0 200 R 50 50 0 0 P
X MH2 MH2 1000 0 200 L 50 50 0 0 P
P 5 0 1 6 200 300 800 300 800 -300 200 -300 200 300 N
ENDDRAW
ENDDEF
#
#End Library

File diff suppressed because it is too large Load Diff

13071
EDA/2301843-1.pretty/2301843-1.wrl Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,46 @@
(module 23018431 (layer F.Cu) (tedit 5F5F1DF5)
(descr 2301843-1-3)
(tags Connector)
(fp_text reference J** (at 5.56 8.645) (layer F.SilkS)
(effects (font (size 1.27 1.27) (thickness 0.254)))
)
(fp_text value 23018431 (at 5.56 8.645) (layer F.SilkS) hide
(effects (font (size 1.27 1.27) (thickness 0.254)))
)
(fp_line (start 14.01 18.97) (end 14.01 12.97) (layer Dwgs.User) (width 0.2))
(fp_line (start -2.89 18.97) (end 14.01 18.97) (layer Dwgs.User) (width 0.2))
(fp_line (start -2.89 12.97) (end -2.89 18.97) (layer Dwgs.User) (width 0.2))
(fp_line (start -10.845 19.97) (end -10.845 -2.68) (layer Dwgs.User) (width 0.1))
(fp_line (start 21.965 19.97) (end -10.845 19.97) (layer Dwgs.User) (width 0.1))
(fp_line (start 21.965 -2.68) (end 21.965 19.97) (layer Dwgs.User) (width 0.1))
(fp_line (start -10.845 -2.68) (end 21.965 -2.68) (layer Dwgs.User) (width 0.1))
(fp_line (start -9.845 12.97) (end -9.845 -1.68) (layer F.SilkS) (width 0.1))
(fp_line (start 20.965 12.97) (end -9.845 12.97) (layer F.SilkS) (width 0.1))
(fp_line (start 20.965 -1.68) (end 20.965 12.97) (layer F.SilkS) (width 0.1))
(fp_line (start -9.845 -1.68) (end 20.965 -1.68) (layer F.SilkS) (width 0.1))
(fp_line (start -9.845 12.97) (end -9.845 -1.68) (layer Dwgs.User) (width 0.2))
(fp_line (start 20.965 12.97) (end -9.845 12.97) (layer Dwgs.User) (width 0.2))
(fp_line (start 20.965 -1.68) (end 20.965 12.97) (layer Dwgs.User) (width 0.2))
(fp_line (start -9.845 -1.68) (end 20.965 -1.68) (layer Dwgs.User) (width 0.2))
(pad MH2 thru_hole circle (at 18.055 1.27 90) (size 4.95 4.95) (drill 3.3) (layers *.Cu *.Mask F.SilkS))
(pad MH1 thru_hole circle (at -6.935 1.27 90) (size 4.95 4.95) (drill 3.3) (layers *.Cu *.Mask F.SilkS))
(pad 9 thru_hole circle (at 9.73 2.54 90) (size 1.5 1.5) (drill 1) (layers *.Cu *.Mask F.SilkS))
(pad 8 thru_hole circle (at 6.95 2.54 90) (size 1.5 1.5) (drill 1) (layers *.Cu *.Mask F.SilkS))
(pad 7 thru_hole circle (at 4.17 2.54 90) (size 1.5 1.5) (drill 1) (layers *.Cu *.Mask F.SilkS))
(pad 6 thru_hole circle (at 1.39 2.54 90) (size 1.5 1.5) (drill 1) (layers *.Cu *.Mask F.SilkS))
(pad 5 thru_hole circle (at 11.12 0 90) (size 1.5 1.5) (drill 1) (layers *.Cu *.Mask F.SilkS))
(pad 4 thru_hole circle (at 8.34 0 90) (size 1.5 1.5) (drill 1) (layers *.Cu *.Mask F.SilkS))
(pad 3 thru_hole circle (at 5.56 0 90) (size 1.5 1.5) (drill 1) (layers *.Cu *.Mask F.SilkS))
(pad 2 thru_hole circle (at 2.78 0 90) (size 1.5 1.5) (drill 1) (layers *.Cu *.Mask F.SilkS))
(pad 1 thru_hole circle (at 0 0 90) (size 1.5 1.5) (drill 1) (layers *.Cu *.Mask F.SilkS))
(model ${KIPRJMOD}/2301843-1.pretty/2301843-1.wrl
(at (xyz 0 0 0))
(scale (xyz 1 1 1))
(rotate (xyz 0 0 0))
)
(model ${KIPRJMOD}/2301843-1.pretty/2301843-1.step
(offset (xyz 5.5 -19 7))
(scale (xyz 1 1 1))
(rotate (xyz 90 180 180))
)
)

9
EDA/5749181-1.dcm Executable file
View File

@ -0,0 +1,9 @@
EESchema-DOCLIB Version 2.0
#
$CMP 5749181-1
D TE CONNECTIVITY / AMP - 5749181-1 - CONNECTOR, DIN, JACK, 4 POSITION
K
F http://www.te.com/commerce/DocumentDelivery/DDEController?Action=showdoc&DocId=Customer+Drawing%7F5749181%7FP%7Fpdf%7FEnglish%7FENG_CD_5749181_P.pdf%7F5749181-1
$ENDCMP
#
#End Doc Library

28
EDA/5749181-1.lib Executable file
View File

@ -0,0 +1,28 @@
EESchema-LIBRARY Version 2.3
#encoding utf-8
#SamacSys ECAD Model 5749181-1
#/305393/231798/2.47/7/4/Connector
DEF 5749181-1 J 0 30 Y Y 1 F N
F0 "J" 750 300 50 H V L CNN
F1 "5749181-1" 750 200 50 H V L CNN
F2 "57491811" 750 100 50 H I L CNN
F3 "http://www.te.com/commerce/DocumentDelivery/DDEController?Action=showdoc&DocId=Customer+Drawing%7F5749181%7FP%7Fpdf%7FEnglish%7FENG_CD_5749181_P.pdf%7F5749181-1" 750 0 50 H I L CNN
F4 "TE CONNECTIVITY / AMP - 5749181-1 - CONNECTOR, DIN, JACK, 4 POSITION" 750 -100 50 H I L CNN "Description"
F5 "13" 750 -200 50 H I L CNN "Height"
F6 "571-5749181-1" 750 -300 50 H I L CNN "Mouser Part Number"
F7 "https://www.mouser.co.uk/ProductDetail/TE-Connectivity/5749181-1?qs=XlZqES4cpWbRcAMR%2FcJqkQ%3D%3D" 750 -400 50 H I L CNN "Mouser Price/Stock"
F8 "TE Connectivity" 750 -500 50 H I L CNN "Manufacturer_Name"
F9 "5749181-1" 750 -600 50 H I L CNN "Manufacturer_Part_Number"
DRAW
X 1 1 0 0 200 R 50 50 0 0 P
X 2 2 0 -100 200 R 50 50 0 0 P
X 3 3 0 -200 200 R 50 50 0 0 P
X 4 4 0 -300 200 R 50 50 0 0 P
X MH1 MH1 900 0 200 L 50 50 0 0 P
X MH2 MH2 900 -100 200 L 50 50 0 0 P
X MH3 MH3 900 -200 200 L 50 50 0 0 P
P 5 0 1 6 200 100 700 100 700 -400 200 -400 200 100 N
ENDDRAW
ENDDEF
#
#End Library

86
EDA/5749181-1.mod Executable file
View File

@ -0,0 +1,86 @@
PCBNEW-LibModule-V1 2020-09-13 19:21:50
# encoding utf-8
Units mm
$INDEX
57491811
$EndINDEX
$MODULE 57491811
Po 0 0 0 15 5f5e633e 00000000 ~~
Li 57491811
Cd 5749181-1-2
Kw Connector
Sc 0
At STD
AR
Op 0 0 0
T0 -3.350 2.895 1.27 1.27 0 0.254 N V 21 N "J**"
T1 -3.350 2.895 1.27 1.27 0 0.254 N I 21 N "57491811"
DS -10.35 9.31 3.65 9.31 0.2 24
DS 3.65 9.31 3.65 -3.52 0.2 24
DS 3.65 -3.52 -10.35 -3.52 0.2 24
DS -10.35 -3.52 -10.35 9.31 0.2 24
DS -12.788 10.31 6.088 10.31 0.1 24
DS 6.088 10.31 6.088 -4.52 0.1 24
DS 6.088 -4.52 -12.788 -4.52 0.1 24
DS -12.788 -4.52 -12.788 10.31 0.1 24
DS -10.35 5.3 -10.35 9.31 0.1 21
DS -10.35 9.31 3.65 9.31 0.1 21
DS 3.65 9.31 3.65 5.3 0.1 21
DS -10.35 0.8 -10.35 -3.52 0.1 21
DS -10.35 -3.52 3.65 -3.52 0.1 21
DS 3.65 -3.52 3.65 0.3 0.1 21
DS 4.5 -0 4.5 -0 0.1 21
DS 4.6 -0 4.6 -0 0.1 21
DA 4.45 -0 4.500 -0 -1800 0.1 21
DA 4.45 -0 4.600 -0 -1800 0.1 21
$PAD
Po 0.000 -0
Sh "1" C 1.509 1.509 0 0 900
Dr 0.97 0 0
At STD N 00E0FFFF
Ne 0 ""
$EndPAD
$PAD
Po -6.700 -0
Sh "2" C 1.509 1.509 0 0 900
Dr 0.97 0 0
At STD N 00E0FFFF
Ne 0 ""
$EndPAD
$PAD
Po 0.000 -2.5
Sh "3" C 1.509 1.509 0 0 900
Dr 0.97 0 0
At STD N 00E0FFFF
Ne 0 ""
$EndPAD
$PAD
Po -6.700 -2.5
Sh "4" C 1.509 1.509 0 0 900
Dr 0.97 0 0
At STD N 00E0FFFF
Ne 0 ""
$EndPAD
$PAD
Po -3.350 3.8
Sh "MH1" C 3.356 3.356 0 0 900
Dr 2.237 0 0
At STD N 00E0FFFF
Ne 0 ""
$EndPAD
$PAD
Po -10.110 2.99
Sh "MH2" C 3.356 3.356 0 0 900
Dr 2.237 0 0
At STD N 00E0FFFF
Ne 0 ""
$EndPAD
$PAD
Po 3.410 2.99
Sh "MH3" C 3.356 3.356 0 0 900
Dr 2.237 0 0
At STD N 00E0FFFF
Ne 0 ""
$EndPAD
$EndMODULE 57491811
$EndLIBRARY

43
EDA/57491811.kicad_mod Executable file
View File

@ -0,0 +1,43 @@
(module "57491811" (layer F.Cu)
(descr "5749181-1-2")
(tags "Connector")
(fp_text reference J** (at -3.350 2.895) (layer F.SilkS)
(effects (font (size 1.27 1.27) (thickness 0.254)))
)
(fp_text user %R (at -3.350 2.895) (layer F.Fab)
(effects (font (size 1.27 1.27) (thickness 0.254)))
)
(fp_text value "57491811" (at -3.350 2.895) (layer F.SilkS) hide
(effects (font (size 1.27 1.27) (thickness 0.254)))
)
(fp_line (start -10.35 9.31) (end 3.65 9.31) (layer F.Fab) (width 0.2))
(fp_line (start 3.65 9.31) (end 3.65 -3.52) (layer F.Fab) (width 0.2))
(fp_line (start 3.65 -3.52) (end -10.35 -3.52) (layer F.Fab) (width 0.2))
(fp_line (start -10.35 -3.52) (end -10.35 9.31) (layer F.Fab) (width 0.2))
(fp_line (start -12.788 10.31) (end 6.088 10.31) (layer F.CrtYd) (width 0.1))
(fp_line (start 6.088 10.31) (end 6.088 -4.52) (layer F.CrtYd) (width 0.1))
(fp_line (start 6.088 -4.52) (end -12.788 -4.52) (layer F.CrtYd) (width 0.1))
(fp_line (start -12.788 -4.52) (end -12.788 10.31) (layer F.CrtYd) (width 0.1))
(fp_line (start -10.35 5.3) (end -10.35 9.31) (layer F.SilkS) (width 0.1))
(fp_line (start -10.35 9.31) (end 3.65 9.31) (layer F.SilkS) (width 0.1))
(fp_line (start 3.65 9.31) (end 3.65 5.3) (layer F.SilkS) (width 0.1))
(fp_line (start -10.35 0.8) (end -10.35 -3.52) (layer F.SilkS) (width 0.1))
(fp_line (start -10.35 -3.52) (end 3.65 -3.52) (layer F.SilkS) (width 0.1))
(fp_line (start 3.65 -3.52) (end 3.65 0.3) (layer F.SilkS) (width 0.1))
(fp_line (start 4.5 -0) (end 4.5 -0) (layer F.SilkS) (width 0.1))
(fp_line (start 4.6 -0) (end 4.6 -0) (layer F.SilkS) (width 0.1))
(fp_arc (start 4.55 -0) (end 4.500 -0) (angle -180) (layer F.SilkS) (width 0.1))
(fp_arc (start 4.55 -0) (end 4.600 -0) (angle -180) (layer F.SilkS) (width 0.1))
(pad 1 thru_hole circle (at 0.000 -0) (size 1.509 1.509) (drill 0.97) (layers *.Cu *.Mask))
(pad 2 thru_hole circle (at -6.700 -0) (size 1.509 1.509) (drill 0.97) (layers *.Cu *.Mask))
(pad 3 thru_hole circle (at 0.000 -2.5) (size 1.509 1.509) (drill 0.97) (layers *.Cu *.Mask))
(pad 4 thru_hole circle (at -6.700 -2.5) (size 1.509 1.509) (drill 0.97) (layers *.Cu *.Mask))
(pad MH1 thru_hole circle (at -3.350 3.8) (size 3.356 3.356) (drill 2.237) (layers *.Cu *.Mask))
(pad MH2 thru_hole circle (at -10.110 2.99) (size 3.356 3.356) (drill 2.237) (layers *.Cu *.Mask))
(pad MH3 thru_hole circle (at 3.410 2.99) (size 3.356 3.356) (drill 2.237) (layers *.Cu *.Mask))
(model 5749181-1.stp
(at (xyz 0 0 0))
(scale (xyz 1 1 1))
(rotate (xyz 0 0 0))
)
)

BIN
EDA/Datasheet/1593KTBU.pdf Normal file

Binary file not shown.

Binary file not shown.

BIN
EDA/Datasheet/txb0108.pdf Normal file

Binary file not shown.

9
EDA/ESP32-PICO-D4.dcm Executable file
View File

@ -0,0 +1,9 @@
EESchema-DOCLIB Version 2.0
#
$CMP ESP32-PICO-D4
D ESP32-PICO-D4 module
K
F https://hr.mouser.com/datasheet/2/891/esp32-pico-d4_datasheet_en-1365829.pdf
$ENDCMP
#
#End Doc Library

70
EDA/ESP32-PICO-D4.lib Executable file
View File

@ -0,0 +1,70 @@
EESchema-LIBRARY Version 2.3
#encoding utf-8
#SamacSys ECAD Model ESP32-PICO-D4
#/992851/231798/2.47/49/4/Integrated Circuit
DEF ESP32-PICO-D4 IC 0 30 Y Y 1 F N
F0 "IC" 1650 900 50 H V L CNN
F1 "ESP32-PICO-D4" 1650 800 50 H V L CNN
F2 "ESP32-PICO-D4_1" 1650 700 50 H I L CNN
F3 "https://hr.mouser.com/datasheet/2/891/esp32-pico-d4_datasheet_en-1365829.pdf" 1650 600 50 H I L CNN
F4 "ESP32-PICO-D4 module" 1650 500 50 H I L CNN "Description"
F5 "" 1650 400 50 H I L CNN "Height"
F6 "356-ESP32-PICO-D4" 1650 300 50 H I L CNN "Mouser Part Number"
F7 "" 1650 200 50 H I L CNN "Mouser Price/Stock"
F8 "Espressif" 1650 100 50 H I L CNN "Manufacturer_Name"
F9 "ESP32-PICO-D4" 1650 0 50 H I L CNN "Manufacturer_Part_Number"
DRAW
X VDDA_1 1 600 900 200 D 50 50 0 0 P
X LNA_IN 2 0 0 200 R 50 50 0 0 P
X VDDA3P3_1 3 700 900 200 D 50 50 0 0 P
X VDDA3P3_2 4 800 900 200 D 50 50 0 0 P
X SENSOR_VP 5 0 -1900 200 R 50 50 0 0 P
X SENSOR_CAPP 6 0 -2000 200 R 50 50 0 0 P
X SENSOR_CAPN 7 1800 -1200 200 L 50 50 0 0 P
X SENSOR_VN 8 0 -2100 200 R 50 50 0 0 P
X EN 9 0 -2200 200 R 50 50 0 0 P
X IO34 10 0 -2300 200 R 50 50 0 0 P
X IO35 11 0 -2400 200 R 50 50 0 0 P
X IO32 12 0 -100 200 R 50 50 0 0 P
X IO33 13 0 -200 200 R 50 50 0 0 P
X IO25 14 0 -300 200 R 50 50 0 0 P
X IO26 15 0 -400 200 R 50 50 0 0 P
X IO27 16 0 -500 200 R 50 50 0 0 P
X IO14 17 0 -600 200 R 50 50 0 0 P
X IO12 18 0 -700 200 R 50 50 0 0 P
X VDD3P3_RTC 19 900 900 200 D 50 50 0 0 P
X IO13 20 0 -800 200 R 50 50 0 0 P
X IO15 21 0 -900 200 R 50 50 0 0 P
X IO2 22 0 -1000 200 R 50 50 0 0 P
X IO0 23 0 -1100 200 R 50 50 0 0 P
X IO4 24 0 -1200 200 R 50 50 0 0 P
X IO16 25 0 -1300 200 R 50 50 0 0 P
X VDD_SDIO_NC 26 0 -1400 200 R 50 50 0 0 P
X IO17 27 0 -1500 200 R 50 50 0 0 P
X SD2 28 0 -1600 200 R 50 50 0 0 P
X SD3 29 0 -1700 200 R 50 50 0 0 P
X CMD 30 0 -1800 200 R 50 50 0 0 P
X CLK 31 1800 0 200 L 50 50 0 0 P
X SD0 32 1800 -100 200 L 50 50 0 0 P
X SD1 33 1800 -200 200 L 50 50 0 0 P
X IO5 34 1800 -300 200 L 50 50 0 0 P
X IO18 35 1800 -400 200 L 50 50 0 0 P
X IO23 36 1800 -500 200 L 50 50 0 0 P
X VDD3P3_CPU 37 1800 -600 200 L 50 50 0 0 P
X IO19 38 1800 -700 200 L 50 50 0 0 P
X IO22 39 1800 -800 200 L 50 50 0 0 P
X U0RXD 40 1800 -900 200 L 50 50 0 0 P
X U0TXD 41 1800 -1000 200 L 50 50 0 0 P
X IO21 42 1800 -1100 200 L 50 50 0 0 P
X VDDA_2 43 1000 900 200 D 50 50 0 0 P
X XTAL_N_NC 44 1800 -1300 200 L 50 50 0 0 P
X XTAL_P_NC 45 1800 -1400 200 L 50 50 0 0 P
X VDDA_3 46 1100 900 200 D 50 50 0 0 P
X CAP2_NC 47 1800 -1500 200 L 50 50 0 0 P
X CAP1_NC 48 1800 -1600 200 L 50 50 0 0 P
X GND 49 1800 -1700 200 L 50 50 0 0 P
P 5 0 1 6 200 700 1600 700 1600 -2500 200 -2500 200 700 N
ENDDRAW
ENDDEF
#
#End Library

318
EDA/ESP32-PICO-D4.mod Executable file
View File

@ -0,0 +1,318 @@
PCBNEW-LibModule-V1 2020-09-13 18:10:54
# encoding utf-8
Units mm
$INDEX
ESP32-PICO-D4_1
$EndINDEX
$MODULE ESP32-PICO-D4_1
Po 0 0 0 15 5f5e529e 00000000 ~~
Li ESP32-PICO-D4_1
Cd ESP32-PICO-D4_1
Kw Integrated Circuit
Sc 0
At SMD
AR
Op 0 0 0
T0 -0.341 -0.132 1.27 1.27 0 0.254 N V 21 N "IC**"
T1 -0.341 -0.132 1.27 1.27 0 0.254 N I 21 N "ESP32-PICO-D4_1"
DS -3.5 -3.5 3.5 -3.5 0.2 24
DS 3.5 -3.5 3.5 3.5 0.2 24
DS 3.5 3.5 -3.5 3.5 0.2 24
DS -3.5 3.5 -3.5 -3.5 0.2 24
DC -3.991 -2.825 -4.02812 -2.825 0.254 21
$PAD
Po -3.3 -2.75
Sh "1" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -3.3 -2.25
Sh "2" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -3.3 -1.75
Sh "3" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -3.3 -1.25
Sh "4" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -3.3 -0.75
Sh "5" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -3.3 -0.25
Sh "6" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -3.3 0.25
Sh "7" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -3.3 0.75
Sh "8" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -3.3 1.25
Sh "9" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -3.3 1.75
Sh "10" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -3.3 2.25
Sh "11" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -3.3 2.75
Sh "12" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -2.75 3.3
Sh "13" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -2.25 3.3
Sh "14" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -1.75 3.3
Sh "15" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -1.25 3.3
Sh "16" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -0.75 3.3
Sh "17" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -0.25 3.3
Sh "18" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 0.25 3.3
Sh "19" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 0.75 3.3
Sh "20" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 1.25 3.3
Sh "21" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 1.75 3.3
Sh "22" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 2.25 3.3
Sh "23" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 2.75 3.3
Sh "24" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 3.3 2.75
Sh "25" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 3.3 2.25
Sh "26" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 3.3 1.75
Sh "27" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 3.3 1.25
Sh "28" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 3.3 0.75
Sh "29" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 3.3 0.25
Sh "30" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 3.3 -0.25
Sh "31" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 3.3 -0.75
Sh "32" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 3.3 -1.25
Sh "33" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 3.3 -1.75
Sh "34" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 3.3 -2.25
Sh "35" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 3.3 -2.75
Sh "36" R 0.35 0.55 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 2.75 -3.3
Sh "37" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 2.25 -3.3
Sh "38" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 1.75 -3.3
Sh "39" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 1.25 -3.3
Sh "40" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 0.75 -3.3
Sh "41" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 0.25 -3.3
Sh "42" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -0.25 -3.3
Sh "43" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -0.75 -3.3
Sh "44" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -1.25 -3.3
Sh "45" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -1.75 -3.3
Sh "46" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -2.25 -3.3
Sh "47" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -2.75 -3.3
Sh "48" R 0.35 0.55 0 0 0
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -0.006 -0.013
Sh "49" R 5.5 5.5 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$EndMODULE ESP32-PICO-D4_1
$EndLIBRARY

68
EDA/ESP32-PICO-D4_1.kicad_mod Executable file
View File

@ -0,0 +1,68 @@
(module "ESP32-PICO-D4_1" (layer F.Cu)
(descr "ESP32-PICO-D4_1")
(tags "Integrated Circuit")
(attr smd)
(fp_text reference IC** (at -0.341 -0.132) (layer F.SilkS)
(effects (font (size 1.27 1.27) (thickness 0.254)))
)
(fp_text user %R (at -0.341 -0.132) (layer F.Fab)
(effects (font (size 1.27 1.27) (thickness 0.254)))
)
(fp_text value "ESP32-PICO-D4_1" (at -0.341 -0.132) (layer F.SilkS) hide
(effects (font (size 1.27 1.27) (thickness 0.254)))
)
(fp_line (start -3.5 -3.5) (end 3.5 -3.5) (layer F.Fab) (width 0.2))
(fp_line (start 3.5 -3.5) (end 3.5 3.5) (layer F.Fab) (width 0.2))
(fp_line (start 3.5 3.5) (end -3.5 3.5) (layer F.Fab) (width 0.2))
(fp_line (start -3.5 3.5) (end -3.5 -3.5) (layer F.Fab) (width 0.2))
(fp_circle (center -3.991 -2.825) (end -3.991 -2.78788) (layer F.SilkS) (width 0.2))
(pad 1 smd rect (at -3.3 -2.75 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 2 smd rect (at -3.3 -2.25 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 3 smd rect (at -3.3 -1.75 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 4 smd rect (at -3.3 -1.25 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 5 smd rect (at -3.3 -0.75 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 6 smd rect (at -3.3 -0.25 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 7 smd rect (at -3.3 0.25 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 8 smd rect (at -3.3 0.75 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 9 smd rect (at -3.3 1.25 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 10 smd rect (at -3.3 1.75 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 11 smd rect (at -3.3 2.25 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 12 smd rect (at -3.3 2.75 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 13 smd rect (at -2.75 3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 14 smd rect (at -2.25 3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 15 smd rect (at -1.75 3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 16 smd rect (at -1.25 3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 17 smd rect (at -0.75 3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 18 smd rect (at -0.25 3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 19 smd rect (at 0.25 3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 20 smd rect (at 0.75 3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 21 smd rect (at 1.25 3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 22 smd rect (at 1.75 3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 23 smd rect (at 2.25 3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 24 smd rect (at 2.75 3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 25 smd rect (at 3.3 2.75 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 26 smd rect (at 3.3 2.25 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 27 smd rect (at 3.3 1.75 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 28 smd rect (at 3.3 1.25 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 29 smd rect (at 3.3 0.75 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 30 smd rect (at 3.3 0.25 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 31 smd rect (at 3.3 -0.25 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 32 smd rect (at 3.3 -0.75 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 33 smd rect (at 3.3 -1.25 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 34 smd rect (at 3.3 -1.75 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 35 smd rect (at 3.3 -2.25 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 36 smd rect (at 3.3 -2.75 90) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 37 smd rect (at 2.75 -3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 38 smd rect (at 2.25 -3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 39 smd rect (at 1.75 -3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 40 smd rect (at 1.25 -3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 41 smd rect (at 0.75 -3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 42 smd rect (at 0.25 -3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 43 smd rect (at -0.25 -3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 44 smd rect (at -0.75 -3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 45 smd rect (at -1.25 -3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 46 smd rect (at -1.75 -3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 47 smd rect (at -2.25 -3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 48 smd rect (at -2.75 -3.3 0) (size 0.35 0.55) (layers F.Cu F.Paste F.Mask))
(pad 49 smd rect (at -0.006 -0.013 90) (size 5.5 5.5) (layers F.Cu F.Paste F.Mask))
)

BIN
EDA/SMT/quack-all-pos.numbers Executable file

Binary file not shown.

BIN
EDA/SMT/quack-all-pos.xlsx Normal file

Binary file not shown.

BIN
EDA/SMT/quack-bom.numbers Executable file

Binary file not shown.

BIN
EDA/SMT/quack-bom.xlsx Normal file

Binary file not shown.

53
EDA/SOP65P640X120-20N.kicad_mod Executable file
View File

@ -0,0 +1,53 @@
(module "SOP65P640X120-20N" (layer F.Cu)
(descr "PW (R-PDSO-G20)")
(tags "Integrated Circuit")
(attr smd)
(fp_text reference IC** (at 0 0) (layer F.SilkS)
(effects (font (size 1.27 1.27) (thickness 0.254)))
)
(fp_text user %R (at 0 0) (layer F.Fab)
(effects (font (size 1.27 1.27) (thickness 0.254)))
)
(fp_text value "SOP65P640X120-20N" (at 0 0) (layer F.SilkS) hide
(effects (font (size 1.27 1.27) (thickness 0.254)))
)
(fp_line (start -3.925 -3.55) (end 3.925 -3.55) (layer F.CrtYd) (width 0.05))
(fp_line (start 3.925 -3.55) (end 3.925 3.55) (layer F.CrtYd) (width 0.05))
(fp_line (start 3.925 3.55) (end -3.925 3.55) (layer F.CrtYd) (width 0.05))
(fp_line (start -3.925 3.55) (end -3.925 -3.55) (layer F.CrtYd) (width 0.05))
(fp_line (start -2.2 -3.25) (end 2.2 -3.25) (layer F.Fab) (width 0.1))
(fp_line (start 2.2 -3.25) (end 2.2 3.25) (layer F.Fab) (width 0.1))
(fp_line (start 2.2 3.25) (end -2.2 3.25) (layer F.Fab) (width 0.1))
(fp_line (start -2.2 3.25) (end -2.2 -3.25) (layer F.Fab) (width 0.1))
(fp_line (start -2.2 -2.6) (end -1.55 -3.25) (layer F.Fab) (width 0.1))
(fp_line (start -1.85 -3.25) (end 1.85 -3.25) (layer F.SilkS) (width 0.2))
(fp_line (start 1.85 -3.25) (end 1.85 3.25) (layer F.SilkS) (width 0.2))
(fp_line (start 1.85 3.25) (end -1.85 3.25) (layer F.SilkS) (width 0.2))
(fp_line (start -1.85 3.25) (end -1.85 -3.25) (layer F.SilkS) (width 0.2))
(fp_line (start -3.675 -3.5) (end -2.2 -3.5) (layer F.SilkS) (width 0.2))
(pad 1 smd rect (at -2.938 -2.925 90) (size 0.45 1.475) (layers F.Cu F.Paste F.Mask))
(pad 2 smd rect (at -2.938 -2.275 90) (size 0.45 1.475) (layers F.Cu F.Paste F.Mask))
(pad 3 smd rect (at -2.938 -1.625 90) (size 0.45 1.475) (layers F.Cu F.Paste F.Mask))
(pad 4 smd rect (at -2.938 -0.975 90) (size 0.45 1.475) (layers F.Cu F.Paste F.Mask))
(pad 5 smd rect (at -2.938 -0.325 90) (size 0.45 1.475) (layers F.Cu F.Paste F.Mask))
(pad 6 smd rect (at -2.938 0.325 90) (size 0.45 1.475) (layers F.Cu F.Paste F.Mask))
(pad 7 smd rect (at -2.938 0.975 90) (size 0.45 1.475) (layers F.Cu F.Paste F.Mask))
(pad 8 smd rect (at -2.938 1.625 90) (size 0.45 1.475) (layers F.Cu F.Paste F.Mask))
(pad 9 smd rect (at -2.938 2.275 90) (size 0.45 1.475) (layers F.Cu F.Paste F.Mask))
(pad 10 smd rect (at -2.938 2.925 90) (size 0.45 1.475) (layers F.Cu F.Paste F.Mask))
(pad 11 smd rect (at 2.938 2.925 90) (size 0.45 1.475) (layers F.Cu F.Paste F.Mask))
(pad 12 smd rect (at 2.938 2.275 90) (size 0.45 1.475) (layers F.Cu F.Paste F.Mask))
(pad 13 smd rect (at 2.938 1.625 90) (size 0.45 1.475) (layers F.Cu F.Paste F.Mask))
(pad 14 smd rect (at 2.938 0.975 90) (size 0.45 1.475) (layers F.Cu F.Paste F.Mask))
(pad 15 smd rect (at 2.938 0.325 90) (size 0.45 1.475) (layers F.Cu F.Paste F.Mask))
(pad 16 smd rect (at 2.938 -0.325 90) (size 0.45 1.475) (layers F.Cu F.Paste F.Mask))
(pad 17 smd rect (at 2.938 -0.975 90) (size 0.45 1.475) (layers F.Cu F.Paste F.Mask))
(pad 18 smd rect (at 2.938 -1.625 90) (size 0.45 1.475) (layers F.Cu F.Paste F.Mask))
(pad 19 smd rect (at 2.938 -2.275 90) (size 0.45 1.475) (layers F.Cu F.Paste F.Mask))
(pad 20 smd rect (at 2.938 -2.925 90) (size 0.45 1.475) (layers F.Cu F.Paste F.Mask))
(model TXB0108PWR.stp
(at (xyz 0 0 0))
(scale (xyz 1 1 1))
(rotate (xyz 0 0 0))
)
)

9
EDA/TXB0108PWR.dcm Executable file
View File

@ -0,0 +1,9 @@
EESchema-DOCLIB Version 2.0
#
$CMP TXB0108PWR
D 8-Bit Bidirectional Voltage-Level Shifter with Auto Direction Sensing and +/-15-kV ESD Protect
K
F http://www.ti.com/lit/ds/symlink/txb0108.pdf
$ENDCMP
#
#End Doc Library

41
EDA/TXB0108PWR.lib Executable file
View File

@ -0,0 +1,41 @@
EESchema-LIBRARY Version 2.3
#encoding utf-8
#SamacSys ECAD Model TXB0108PWR
#/5667/231798/2.47/20/3/Integrated Circuit
DEF TXB0108PWR IC 0 30 Y Y 1 F N
F0 "IC" 950 300 50 H V L CNN
F1 "TXB0108PWR" 950 200 50 H V L CNN
F2 "SOP65P640X120-20N" 950 100 50 H I L CNN
F3 "http://www.ti.com/lit/ds/symlink/txb0108.pdf" 950 0 50 H I L CNN
F4 "8-Bit Bidirectional Voltage-Level Shifter with Auto Direction Sensing and +/-15-kV ESD Protect" 950 -100 50 H I L CNN "Description"
F5 "1.2" 950 -200 50 H I L CNN "Height"
F6 "595-TXB0108PWR" 950 -300 50 H I L CNN "Mouser Part Number"
F7 "https://www.mouser.co.uk/ProductDetail/Texas-Instruments/TXB0108PWR?qs=oFXvjAmG9EgEUWGWzOVFCA%3D%3D" 950 -400 50 H I L CNN "Mouser Price/Stock"
F8 "Texas Instruments" 950 -500 50 H I L CNN "Manufacturer_Name"
F9 "TXB0108PWR" 950 -600 50 H I L CNN "Manufacturer_Part_Number"
DRAW
X A1 1 0 0 200 R 50 50 0 0 P
X VCCA 2 0 -100 200 R 50 50 0 0 P
X A2 3 0 -200 200 R 50 50 0 0 P
X A3 4 0 -300 200 R 50 50 0 0 P
X A4 5 0 -400 200 R 50 50 0 0 P
X A5 6 0 -500 200 R 50 50 0 0 P
X A6 7 0 -600 200 R 50 50 0 0 P
X A7 8 0 -700 200 R 50 50 0 0 P
X A8 9 0 -800 200 R 50 50 0 0 P
X OE 10 0 -900 200 R 50 50 0 0 P
X B1 20 1100 0 200 L 50 50 0 0 P
X VCCB 19 1100 -100 200 L 50 50 0 0 P
X B2 18 1100 -200 200 L 50 50 0 0 P
X B3 17 1100 -300 200 L 50 50 0 0 P
X B4 16 1100 -400 200 L 50 50 0 0 P
X B5 15 1100 -500 200 L 50 50 0 0 P
X B6 14 1100 -600 200 L 50 50 0 0 P
X B7 13 1100 -700 200 L 50 50 0 0 P
X B8 12 1100 -800 200 L 50 50 0 0 P
X GND 11 1100 -900 200 L 50 50 0 0 P
P 5 0 1 6 200 100 900 100 900 -1000 200 -1000 200 100 N
ENDDRAW
ENDDEF
#
#End Library

153
EDA/TXB0108PWR.mod Executable file
View File

@ -0,0 +1,153 @@
PCBNEW-LibModule-V1 2020-09-13 18:33:11
# encoding utf-8
Units mm
$INDEX
SOP65P640X120-20N
$EndINDEX
$MODULE SOP65P640X120-20N
Po 0 0 0 15 5f5e57d7 00000000 ~~
Li SOP65P640X120-20N
Cd PW (R-PDSO-G20)
Kw Integrated Circuit
Sc 0
At SMD
AR
Op 0 0 0
T0 0 0 1.27 1.27 0 0.254 N V 21 N "IC**"
T1 0 0 1.27 1.27 0 0.254 N I 21 N "SOP65P640X120-20N"
DS -3.925 -3.55 3.925 -3.55 0.05 24
DS 3.925 -3.55 3.925 3.55 0.05 24
DS 3.925 3.55 -3.925 3.55 0.05 24
DS -3.925 3.55 -3.925 -3.55 0.05 24
DS -2.2 -3.25 2.2 -3.25 0.1 24
DS 2.2 -3.25 2.2 3.25 0.1 24
DS 2.2 3.25 -2.2 3.25 0.1 24
DS -2.2 3.25 -2.2 -3.25 0.1 24
DS -2.2 -2.6 -1.55 -3.25 0.1 24
DS -1.85 -3.25 1.85 -3.25 0.2 21
DS 1.85 -3.25 1.85 3.25 0.2 21
DS 1.85 3.25 -1.85 3.25 0.2 21
DS -1.85 3.25 -1.85 -3.25 0.2 21
DS -3.675 -3.5 -2.2 -3.5 0.2 21
$PAD
Po -2.938 -2.925
Sh "1" R 0.45 1.475 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -2.938 -2.275
Sh "2" R 0.45 1.475 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -2.938 -1.625
Sh "3" R 0.45 1.475 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -2.938 -0.975
Sh "4" R 0.45 1.475 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -2.938 -0.325
Sh "5" R 0.45 1.475 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -2.938 0.325
Sh "6" R 0.45 1.475 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -2.938 0.975
Sh "7" R 0.45 1.475 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -2.938 1.625
Sh "8" R 0.45 1.475 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -2.938 2.275
Sh "9" R 0.45 1.475 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po -2.938 2.925
Sh "10" R 0.45 1.475 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 2.938 2.925
Sh "11" R 0.45 1.475 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 2.938 2.275
Sh "12" R 0.45 1.475 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 2.938 1.625
Sh "13" R 0.45 1.475 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 2.938 0.975
Sh "14" R 0.45 1.475 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 2.938 0.325
Sh "15" R 0.45 1.475 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 2.938 -0.325
Sh "16" R 0.45 1.475 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 2.938 -0.975
Sh "17" R 0.45 1.475 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 2.938 -1.625
Sh "18" R 0.45 1.475 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 2.938 -2.275
Sh "19" R 0.45 1.475 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$PAD
Po 2.938 -2.925
Sh "20" R 0.45 1.475 0 0 900
At SMD N 00888000
Ne 0 ""
$EndPAD
$EndMODULE SOP65P640X120-20N
$EndLIBRARY

1637
EDA/quack.kicad_pcb Normal file

File diff suppressed because it is too large Load Diff

624
EDA/quack.net Normal file
View File

@ -0,0 +1,624 @@
(export (version D)
(design
(source /Users/demik/github/quack/EDA/quack.sch)
(date "2020 September 14, Monday 09:39:46")
(tool "Eeschema (5.1.5-0-10_14)")
(sheet (number 1) (name /) (tstamps /)
(title_block
(title)
(company)
(rev)
(date)
(source quack.sch)
(comment (number 1) (value ""))
(comment (number 2) (value ""))
(comment (number 3) (value ""))
(comment (number 4) (value ""))))
(sheet (number 2) (name /quack_connectors/) (tstamps /5F5EA845/)
(title_block
(title)
(company)
(rev)
(date)
(source quack_connectors.sch)
(comment (number 1) (value ""))
(comment (number 2) (value ""))
(comment (number 3) (value ""))
(comment (number 4) (value "")))))
(components
(comp (ref U1)
(value AMS1117-3.3)
(footprint Package_TO_SOT_SMD:SOT-223-3_TabPin2)
(datasheet http://www.advanced-monolithic.com/pdf/ds1117.pdf)
(libsource (lib Regulator_Linear) (part AMS1117-3.3) (description "1A Low Dropout regulator, positive, 3.3V fixed output, SOT-223"))
(sheetpath (names /) (tstamps /))
(tstamp 5F607118))
(comp (ref C1)
(value 10uF)
(footprint Capacitor_SMD:C_0805_2012Metric)
(datasheet ~)
(libsource (lib Device) (part C) (description "Unpolarized capacitor"))
(sheetpath (names /) (tstamps /))
(tstamp 5F60FDC9))
(comp (ref C2)
(value 100uF)
(footprint Capacitor_Tantalum_SMD:CP_EIA-3528-12_Kemet-T)
(datasheet ~)
(libsource (lib Device) (part CP) (description "Polarized capacitor"))
(sheetpath (names /) (tstamps /))
(tstamp 5F6139D7))
(comp (ref D4)
(value "GREEN LED")
(footprint LED_SMD:LED_0805_2012Metric_Castellated)
(datasheet ~)
(libsource (lib Device) (part LED) (description "Light emitting diode"))
(sheetpath (names /) (tstamps /))
(tstamp 5F621DE4))
(comp (ref D1)
(value "BLUE LED")
(footprint LED_SMD:LED_0805_2012Metric_Castellated)
(datasheet ~)
(libsource (lib Device) (part LED) (description "Light emitting diode"))
(sheetpath (names /) (tstamps /))
(tstamp 5F6256F8))
(comp (ref D2)
(value "YELLOW LED")
(footprint LED_SMD:LED_0805_2012Metric_Castellated)
(datasheet ~)
(libsource (lib Device) (part LED) (description "Light emitting diode"))
(sheetpath (names /) (tstamps /))
(tstamp 5F626D09))
(comp (ref D3)
(value "RED LED")
(footprint LED_SMD:LED_0805_2012Metric_Castellated)
(datasheet ~)
(libsource (lib Device) (part LED) (description "Light emitting diode"))
(sheetpath (names /) (tstamps /))
(tstamp 5F62988B))
(comp (ref R1)
(value 33)
(footprint Resistor_SMD:R_0805_2012Metric)
(datasheet ~)
(libsource (lib Device) (part R) (description Resistor))
(sheetpath (names /) (tstamps /))
(tstamp 5F62B2A2))
(comp (ref R2)
(value 120)
(footprint Resistor_SMD:R_0805_2012Metric)
(datasheet ~)
(libsource (lib Device) (part R) (description Resistor))
(sheetpath (names /) (tstamps /))
(tstamp 5F62BD09))
(comp (ref R3)
(value 120)
(footprint Resistor_SMD:R_0805_2012Metric)
(datasheet ~)
(libsource (lib Device) (part R) (description Resistor))
(sheetpath (names /) (tstamps /))
(tstamp 5F62CA4D))
(comp (ref R4)
(value 120)
(footprint Resistor_SMD:R_0805_2012Metric)
(datasheet ~)
(libsource (lib Device) (part R) (description Resistor))
(sheetpath (names /) (tstamps /))
(tstamp 5F63A510))
(comp (ref C4)
(value 0.1)
(footprint Capacitor_SMD:C_0805_2012Metric)
(datasheet ~)
(libsource (lib Device) (part C) (description "Unpolarized capacitor"))
(sheetpath (names /) (tstamps /))
(tstamp 5F66EA30))
(comp (ref C3)
(value 10)
(footprint Capacitor_SMD:C_0805_2012Metric)
(datasheet ~)
(libsource (lib Device) (part C) (description "Unpolarized capacitor"))
(sheetpath (names /) (tstamps /))
(tstamp 5F66FB55))
(comp (ref IC1)
(value ESP32-PICO-D4)
(footprint ESP32-PICO-D4:ESP32-PICO-D4_1)
(datasheet https://hr.mouser.com/datasheet/2/891/esp32-pico-d4_datasheet_en-1365829.pdf)
(fields
(field (name Description) "ESP32-PICO-D4 module")
(field (name Manufacturer_Name) Espressif)
(field (name Manufacturer_Part_Number) ESP32-PICO-D4)
(field (name "Mouser Part Number") 356-ESP32-PICO-D4))
(libsource (lib ESP32-PICO-D4) (part ESP32-PICO-D4) (description "ESP32-PICO-D4 module"))
(sheetpath (names /) (tstamps /))
(tstamp 5F5E5479))
(comp (ref R5)
(value 10k)
(footprint Resistor_SMD:R_0805_2012Metric)
(datasheet ~)
(libsource (lib Device) (part R) (description Resistor))
(sheetpath (names /) (tstamps /))
(tstamp 5F628CC1))
(comp (ref C5)
(value 0.1uF)
(footprint Capacitor_SMD:C_0805_2012Metric)
(datasheet ~)
(libsource (lib Device) (part C) (description "Unpolarized capacitor"))
(sheetpath (names /) (tstamps /))
(tstamp 5F6294FB))
(comp (ref J1)
(value DIN-4)
(footprint Quack_MDIN4:57491811)
(datasheet http://www.mouser.com/ds/2/18/40_c091_abd_e-75918.pdf)
(libsource (lib Connector) (part DIN-4) (description "4-pin DIN connector"))
(sheetpath (names /quack_connectors/) (tstamps /5F5EA845/))
(tstamp 5F5EB6CA))
(comp (ref J2)
(value DB9_Male)
(footprint Quack_DB9:23018431)
(datasheet " ~")
(libsource (lib Connector) (part DB9_Male) (description "9-pin male D-SUB connector"))
(sheetpath (names /quack_connectors/) (tstamps /5F5EA845/))
(tstamp 5F5EB6D0))
(comp (ref IC2)
(value TXB0108PWR)
(footprint Package_SO:TSSOP-20_4.4x6.5mm_P0.65mm)
(datasheet http://www.ti.com/lit/ds/symlink/txb0108.pdf)
(fields
(field (name Description) "8-Bit Bidirectional Voltage-Level Shifter with Auto Direction Sensing and +/-15-kV ESD Protect")
(field (name Height) 1.2)
(field (name Manufacturer_Name) "Texas Instruments")
(field (name Manufacturer_Part_Number) TXB0108PWR)
(field (name "Mouser Part Number") 595-TXB0108PWR)
(field (name "Mouser Price/Stock") https://www.mouser.co.uk/ProductDetail/Texas-Instruments/TXB0108PWR?qs=oFXvjAmG9EgEUWGWzOVFCA%3D%3D))
(libsource (lib TXB0108PWR) (part TXB0108PWR) (description "8-Bit Bidirectional Voltage-Level Shifter with Auto Direction Sensing and +/-15-kV ESD Protect"))
(sheetpath (names /quack_connectors/) (tstamps /5F5EA845/))
(tstamp 5F5EC2ED))
(comp (ref J3)
(value FTDI)
(footprint Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical)
(datasheet ~)
(libsource (lib Connector_Generic) (part Conn_01x04) (description "Generic connector, single row, 01x04, script generated (kicad-library-utils/schlib/autogen/connector/)"))
(sheetpath (names /quack_connectors/) (tstamps /5F5EA845/))
(tstamp 5F65399F))
(comp (ref J4)
(value MODE)
(footprint Connector_PinHeader_2.54mm:PinHeader_2x03_P2.54mm_Vertical)
(datasheet ~)
(libsource (lib Connector_Generic) (part Conn_02x03_Odd_Even) (description "Generic connector, double row, 02x03, odd/even pin numbering scheme (row 1 odd numbers, row 2 even numbers), script generated (kicad-library-utils/schlib/autogen/connector/)"))
(sheetpath (names /quack_connectors/) (tstamps /5F5EA845/))
(tstamp 5F665D50)))
(libparts
(libpart (lib Connector) (part DB9_Male)
(description "9-pin male D-SUB connector")
(docs " ~")
(footprints
(fp DSUB*Male*))
(fields
(field (name Reference) J)
(field (name Value) DB9_Male))
(pins
(pin (num 1) (name 1) (type passive))
(pin (num 2) (name 2) (type passive))
(pin (num 3) (name 3) (type passive))
(pin (num 4) (name 4) (type passive))
(pin (num 5) (name 5) (type passive))
(pin (num 6) (name 6) (type passive))
(pin (num 7) (name 7) (type passive))
(pin (num 8) (name 8) (type passive))
(pin (num 9) (name 9) (type passive))))
(libpart (lib Connector) (part DIN-4)
(description "4-pin DIN connector")
(docs http://www.mouser.com/ds/2/18/40_c091_abd_e-75918.pdf)
(footprints
(fp DIN*))
(fields
(field (name Reference) J)
(field (name Value) DIN-4))
(pins
(pin (num 1) (name ~) (type passive))
(pin (num 2) (name ~) (type passive))
(pin (num 3) (name ~) (type passive))
(pin (num 4) (name ~) (type passive))))
(libpart (lib Connector_Generic) (part Conn_01x04)
(description "Generic connector, single row, 01x04, script generated (kicad-library-utils/schlib/autogen/connector/)")
(docs ~)
(footprints
(fp Connector*:*_1x??_*))
(fields
(field (name Reference) J)
(field (name Value) Conn_01x04))
(pins
(pin (num 1) (name Pin_1) (type passive))
(pin (num 2) (name Pin_2) (type passive))
(pin (num 3) (name Pin_3) (type passive))
(pin (num 4) (name Pin_4) (type passive))))
(libpart (lib Connector_Generic) (part Conn_02x03_Odd_Even)
(description "Generic connector, double row, 02x03, odd/even pin numbering scheme (row 1 odd numbers, row 2 even numbers), script generated (kicad-library-utils/schlib/autogen/connector/)")
(docs ~)
(footprints
(fp Connector*:*_2x??_*))
(fields
(field (name Reference) J)
(field (name Value) Conn_02x03_Odd_Even))
(pins
(pin (num 1) (name Pin_1) (type passive))
(pin (num 2) (name Pin_2) (type passive))
(pin (num 3) (name Pin_3) (type passive))
(pin (num 4) (name Pin_4) (type passive))
(pin (num 5) (name Pin_5) (type passive))
(pin (num 6) (name Pin_6) (type passive))))
(libpart (lib Device) (part C)
(description "Unpolarized capacitor")
(docs ~)
(footprints
(fp C_*))
(fields
(field (name Reference) C)
(field (name Value) C))
(pins
(pin (num 1) (name ~) (type passive))
(pin (num 2) (name ~) (type passive))))
(libpart (lib Device) (part CP)
(description "Polarized capacitor")
(docs ~)
(footprints
(fp CP_*))
(fields
(field (name Reference) C)
(field (name Value) CP))
(pins
(pin (num 1) (name ~) (type passive))
(pin (num 2) (name ~) (type passive))))
(libpart (lib Device) (part LED)
(description "Light emitting diode")
(docs ~)
(footprints
(fp LED*)
(fp LED_SMD:*)
(fp LED_THT:*))
(fields
(field (name Reference) D)
(field (name Value) LED))
(pins
(pin (num 1) (name K) (type passive))
(pin (num 2) (name A) (type passive))))
(libpart (lib Device) (part R)
(description Resistor)
(docs ~)
(footprints
(fp R_*))
(fields
(field (name Reference) R)
(field (name Value) R))
(pins
(pin (num 1) (name ~) (type passive))
(pin (num 2) (name ~) (type passive))))
(libpart (lib ESP32-PICO-D4) (part ESP32-PICO-D4)
(description "ESP32-PICO-D4 module")
(docs https://hr.mouser.com/datasheet/2/891/esp32-pico-d4_datasheet_en-1365829.pdf)
(fields
(field (name Reference) IC)
(field (name Value) ESP32-PICO-D4)
(field (name Footprint) ESP32-PICO-D4_1)
(field (name Datasheet) https://hr.mouser.com/datasheet/2/891/esp32-pico-d4_datasheet_en-1365829.pdf)
(field (name Description) "ESP32-PICO-D4 module")
(field (name "Mouser Part Number") 356-ESP32-PICO-D4)
(field (name Manufacturer_Name) Espressif)
(field (name Manufacturer_Part_Number) ESP32-PICO-D4))
(pins
(pin (num 1) (name VDDA_1) (type passive))
(pin (num 2) (name LNA_IN) (type passive))
(pin (num 3) (name VDDA3P3_1) (type passive))
(pin (num 4) (name VDDA3P3_2) (type passive))
(pin (num 5) (name SENSOR_VP) (type passive))
(pin (num 6) (name SENSOR_CAPP) (type passive))
(pin (num 7) (name SENSOR_CAPN) (type passive))
(pin (num 8) (name SENSOR_VN) (type passive))
(pin (num 9) (name EN) (type passive))
(pin (num 10) (name IO34) (type passive))
(pin (num 11) (name IO35) (type passive))
(pin (num 12) (name IO32) (type passive))
(pin (num 13) (name IO33) (type passive))
(pin (num 14) (name IO25) (type passive))
(pin (num 15) (name IO26) (type passive))
(pin (num 16) (name IO27) (type passive))
(pin (num 17) (name IO14) (type passive))
(pin (num 18) (name IO12) (type passive))
(pin (num 19) (name VDD3P3_RTC) (type passive))
(pin (num 20) (name IO13) (type passive))
(pin (num 21) (name IO15) (type passive))
(pin (num 22) (name IO2) (type passive))
(pin (num 23) (name IO0) (type passive))
(pin (num 24) (name IO4) (type passive))
(pin (num 25) (name IO16) (type passive))
(pin (num 26) (name VDD_SDIO_NC) (type passive))
(pin (num 27) (name IO17) (type passive))
(pin (num 28) (name SD2) (type passive))
(pin (num 29) (name SD3) (type passive))
(pin (num 30) (name CMD) (type passive))
(pin (num 31) (name CLK) (type passive))
(pin (num 32) (name SD0) (type passive))
(pin (num 33) (name SD1) (type passive))
(pin (num 34) (name IO5) (type passive))
(pin (num 35) (name IO18) (type passive))
(pin (num 36) (name IO23) (type passive))
(pin (num 37) (name VDD3P3_CPU) (type passive))
(pin (num 38) (name IO19) (type passive))
(pin (num 39) (name IO22) (type passive))
(pin (num 40) (name U0RXD) (type passive))
(pin (num 41) (name U0TXD) (type passive))
(pin (num 42) (name IO21) (type passive))
(pin (num 43) (name VDDA_2) (type passive))
(pin (num 44) (name XTAL_N_NC) (type passive))
(pin (num 45) (name XTAL_P_NC) (type passive))
(pin (num 46) (name VDDA_3) (type passive))
(pin (num 47) (name CAP2_NC) (type passive))
(pin (num 48) (name CAP1_NC) (type passive))
(pin (num 49) (name GND) (type passive))))
(libpart (lib Regulator_Linear) (part AP1117-15)
(aliases
(alias AP1117-18)
(alias AP1117-25)
(alias AP1117-33)
(alias AP1117-50)
(alias LD1117S33TR_SOT223)
(alias LD1117S12TR_SOT223)
(alias LD1117S18TR_SOT223)
(alias LD1117S25TR_SOT223)
(alias LD1117S50TR_SOT223)
(alias NCP1117-12_SOT223)
(alias NCP1117-1.5_SOT223)
(alias NCP1117-1.8_SOT223)
(alias NCP1117-2.0_SOT223)
(alias NCP1117-2.5_SOT223)
(alias NCP1117-2.85_SOT223)
(alias NCP1117-3.3_SOT223)
(alias NCP1117-5.0_SOT223)
(alias AMS1117-1.5)
(alias AMS1117-1.8)
(alias AMS1117-2.5)
(alias AMS1117-2.85)
(alias AMS1117-3.3)
(alias AMS1117-5.0))
(description "1A Low Dropout regulator, positive, 1.5V fixed output, SOT-223")
(docs http://www.diodes.com/datasheets/AP1117.pdf)
(footprints
(fp SOT?223*TabPin2*))
(fields
(field (name Reference) U)
(field (name Value) AP1117-15)
(field (name Footprint) Package_TO_SOT_SMD:SOT-223-3_TabPin2))
(pins
(pin (num 1) (name GND) (type power_in))
(pin (num 2) (name VO) (type power_out))
(pin (num 3) (name VI) (type power_in))))
(libpart (lib TXB0108PWR) (part TXB0108PWR)
(description "8-Bit Bidirectional Voltage-Level Shifter with Auto Direction Sensing and +/-15-kV ESD Protect")
(docs http://www.ti.com/lit/ds/symlink/txb0108.pdf)
(fields
(field (name Reference) IC)
(field (name Value) TXB0108PWR)
(field (name Footprint) SOP65P640X120-20N)
(field (name Datasheet) http://www.ti.com/lit/ds/symlink/txb0108.pdf)
(field (name Description) "8-Bit Bidirectional Voltage-Level Shifter with Auto Direction Sensing and +/-15-kV ESD Protect")
(field (name Height) 1.2)
(field (name "Mouser Part Number") 595-TXB0108PWR)
(field (name "Mouser Price/Stock") https://www.mouser.co.uk/ProductDetail/Texas-Instruments/TXB0108PWR?qs=oFXvjAmG9EgEUWGWzOVFCA%3D%3D)
(field (name Manufacturer_Name) "Texas Instruments")
(field (name Manufacturer_Part_Number) TXB0108PWR))
(pins
(pin (num 1) (name A1) (type passive))
(pin (num 2) (name VCCA) (type passive))
(pin (num 3) (name A2) (type passive))
(pin (num 4) (name A3) (type passive))
(pin (num 5) (name A4) (type passive))
(pin (num 6) (name A5) (type passive))
(pin (num 7) (name A6) (type passive))
(pin (num 8) (name A7) (type passive))
(pin (num 9) (name A8) (type passive))
(pin (num 10) (name OE) (type passive))
(pin (num 11) (name GND) (type passive))
(pin (num 12) (name B8) (type passive))
(pin (num 13) (name B7) (type passive))
(pin (num 14) (name B6) (type passive))
(pin (num 15) (name B5) (type passive))
(pin (num 16) (name B4) (type passive))
(pin (num 17) (name B3) (type passive))
(pin (num 18) (name B2) (type passive))
(pin (num 19) (name VCCB) (type passive))
(pin (num 20) (name B1) (type passive)))))
(libraries
(library (logical Connector)
(uri "/Library/Application Support/kicad/library/Connector.lib"))
(library (logical Connector_Generic)
(uri "/Library/Application Support/kicad/library/Connector_Generic.lib"))
(library (logical Device)
(uri "/Library/Application Support/kicad/library/Device.lib"))
(library (logical ESP32-PICO-D4)
(uri /Users/demik/github/quack/EDA/ESP32-PICO-D4.lib))
(library (logical Regulator_Linear)
(uri "/Library/Application Support/kicad/library/Regulator_Linear.lib"))
(library (logical TXB0108PWR)
(uri /Users/demik/github/quack/EDA/TXB0108PWR.lib)))
(nets
(net (code 1) (name +3V3)
(node (ref R5) (pin 1))
(node (ref U1) (pin 2))
(node (ref C3) (pin 1))
(node (ref IC2) (pin 2))
(node (ref IC1) (pin 46))
(node (ref IC1) (pin 1))
(node (ref IC1) (pin 3))
(node (ref IC1) (pin 4))
(node (ref C2) (pin 1))
(node (ref IC1) (pin 43))
(node (ref IC1) (pin 37))
(node (ref C4) (pin 1))
(node (ref IC1) (pin 19)))
(net (code 2) (name +5V)
(node (ref J3) (pin 1))
(node (ref IC2) (pin 19))
(node (ref J2) (pin 2))
(node (ref J1) (pin 3))
(node (ref C1) (pin 1))
(node (ref U1) (pin 3)))
(net (code 3) (name GND)
(node (ref D3) (pin 1))
(node (ref U1) (pin 1))
(node (ref C1) (pin 2))
(node (ref C4) (pin 2))
(node (ref C3) (pin 2))
(node (ref J1) (pin 4))
(node (ref J2) (pin 1))
(node (ref J2) (pin 3))
(node (ref IC2) (pin 10))
(node (ref J4) (pin 6))
(node (ref J4) (pin 4))
(node (ref J4) (pin 2))
(node (ref IC2) (pin 11))
(node (ref J3) (pin 4))
(node (ref IC1) (pin 49))
(node (ref C5) (pin 2))
(node (ref D2) (pin 1))
(node (ref C2) (pin 2))
(node (ref D1) (pin 1))
(node (ref D4) (pin 1)))
(net (code 4) (name "Net-(IC1-Pad31)")
(node (ref IC1) (pin 31)))
(net (code 5) (name "Net-(IC1-Pad32)")
(node (ref IC1) (pin 32)))
(net (code 6) (name "Net-(IC1-Pad33)")
(node (ref IC1) (pin 33)))
(net (code 7) (name "Net-(IC1-Pad30)")
(node (ref IC1) (pin 30)))
(net (code 8) (name "Net-(IC1-Pad25)")
(node (ref IC1) (pin 25)))
(net (code 9) (name "Net-(IC1-Pad27)")
(node (ref IC1) (pin 27)))
(net (code 10) (name "Net-(IC1-Pad42)")
(node (ref R4) (pin 2))
(node (ref IC1) (pin 42)))
(net (code 11) (name "Net-(D1-Pad2)")
(node (ref D1) (pin 2))
(node (ref R1) (pin 2)))
(net (code 12) (name "Net-(D2-Pad2)")
(node (ref D2) (pin 2))
(node (ref R2) (pin 2)))
(net (code 13) (name "Net-(D3-Pad2)")
(node (ref D3) (pin 2))
(node (ref R3) (pin 2)))
(net (code 14) (name "Net-(IC1-Pad14)")
(node (ref R1) (pin 1))
(node (ref IC1) (pin 14)))
(net (code 15) (name "Net-(IC1-Pad15)")
(node (ref R2) (pin 1))
(node (ref IC1) (pin 15)))
(net (code 16) (name "Net-(IC1-Pad16)")
(node (ref R3) (pin 1))
(node (ref IC1) (pin 16)))
(net (code 17) (name "Net-(D4-Pad2)")
(node (ref D4) (pin 2))
(node (ref R4) (pin 1)))
(net (code 18) (name U0RXD)
(node (ref IC1) (pin 40))
(node (ref J3) (pin 2)))
(net (code 19) (name U0TXD)
(node (ref J3) (pin 3))
(node (ref IC1) (pin 41)))
(net (code 20) (name FLASH)
(node (ref J4) (pin 1))
(node (ref IC1) (pin 23)))
(net (code 21) (name QX1_3V)
(node (ref IC1) (pin 18))
(node (ref IC2) (pin 6)))
(net (code 22) (name QX2_3V)
(node (ref IC1) (pin 20))
(node (ref IC2) (pin 5)))
(net (code 23) (name QY1_3V)
(node (ref IC2) (pin 7))
(node (ref IC1) (pin 17)))
(net (code 24) (name QY2_3V)
(node (ref IC2) (pin 9))
(node (ref IC1) (pin 21)))
(net (code 25) (name CLICK_3V)
(node (ref IC1) (pin 22))
(node (ref IC2) (pin 8)))
(net (code 26) (name ADB)
(node (ref IC2) (pin 1))
(node (ref IC1) (pin 24)))
(net (code 27) (name "Net-(IC1-Pad7)")
(node (ref IC1) (pin 7)))
(net (code 28) (name "Net-(IC1-Pad8)")
(node (ref IC1) (pin 8)))
(net (code 29) (name "Net-(IC1-Pad6)")
(node (ref IC1) (pin 6)))
(net (code 30) (name "Net-(IC1-Pad5)")
(node (ref IC1) (pin 5)))
(net (code 31) (name "Net-(IC1-Pad45)")
(node (ref IC1) (pin 45)))
(net (code 32) (name "Net-(IC1-Pad44)")
(node (ref IC1) (pin 44)))
(net (code 33) (name "Net-(IC1-Pad47)")
(node (ref IC1) (pin 47)))
(net (code 34) (name "Net-(IC1-Pad48)")
(node (ref IC1) (pin 48)))
(net (code 35) (name "Net-(IC1-Pad2)")
(node (ref IC1) (pin 2)))
(net (code 36) (name "Net-(IC1-Pad10)")
(node (ref IC1) (pin 10)))
(net (code 37) (name "Net-(IC1-Pad11)")
(node (ref IC1) (pin 11)))
(net (code 38) (name "Net-(IC1-Pad26)")
(node (ref IC1) (pin 26)))
(net (code 39) (name "Net-(IC1-Pad28)")
(node (ref IC1) (pin 28)))
(net (code 40) (name "Net-(IC1-Pad29)")
(node (ref IC1) (pin 29)))
(net (code 41) (name "Net-(IC1-Pad34)")
(node (ref IC1) (pin 34)))
(net (code 42) (name "Net-(IC1-Pad35)")
(node (ref IC1) (pin 35)))
(net (code 43) (name "Net-(IC1-Pad36)")
(node (ref IC1) (pin 36)))
(net (code 44) (name "Net-(IC1-Pad38)")
(node (ref IC1) (pin 38)))
(net (code 45) (name "Net-(IC1-Pad39)")
(node (ref IC1) (pin 39)))
(net (code 46) (name BTOFF)
(node (ref J4) (pin 3))
(node (ref IC1) (pin 13)))
(net (code 47) (name ADBSRC)
(node (ref J4) (pin 5))
(node (ref IC1) (pin 12)))
(net (code 49) (name "Net-(C5-Pad1)")
(node (ref IC1) (pin 9))
(node (ref R5) (pin 2))
(node (ref C5) (pin 1)))
(net (code 50) (name "Net-(IC2-Pad20)")
(node (ref J1) (pin 1))
(node (ref IC2) (pin 20)))
(net (code 51) (name "Net-(J1-Pad2)")
(node (ref J1) (pin 2)))
(net (code 52) (name "Net-(J2-Pad6)")
(node (ref J2) (pin 6)))
(net (code 53) (name "Net-(IC2-Pad3)")
(node (ref IC2) (pin 3)))
(net (code 54) (name "Net-(IC2-Pad4)")
(node (ref IC2) (pin 4)))
(net (code 55) (name "Net-(IC2-Pad18)")
(node (ref IC2) (pin 18)))
(net (code 56) (name "Net-(IC2-Pad17)")
(node (ref IC2) (pin 17)))
(net (code 57) (name /quack_connectors/CLICK_5V)
(node (ref J2) (pin 7))
(node (ref IC2) (pin 13)))
(net (code 58) (name /quack_connectors/QX2_5V)
(node (ref J2) (pin 4))
(node (ref IC2) (pin 16)))
(net (code 59) (name /quack_connectors/QX1_5V)
(node (ref IC2) (pin 15))
(node (ref J2) (pin 5)))
(net (code 60) (name /quack_connectors/QY1_5V)
(node (ref IC2) (pin 14))
(node (ref J2) (pin 9)))
(net (code 61) (name /quack_connectors/QY2_5V)
(node (ref J2) (pin 8))
(node (ref IC2) (pin 12)))))

270
EDA/quack.pro Normal file
View File

@ -0,0 +1,270 @@
update=2020 September 13, Sunday 23:45:45
version=1
last_client=kicad
[general]
version=1
RootSch=
BoardNm=
[cvpcb]
version=1
NetIExt=net
[eeschema]
version=1
LibDir=
[eeschema/libraries]
[schematic_editor]
version=1
PageLayoutDescrFile=
PlotDirectoryName=
SubpartIdSeparator=0
SubpartFirstId=65
NetFmtName=Pcbnew
SpiceAjustPassiveValues=0
LabSize=50
ERC_TestSimilarLabels=1
[pcbnew]
version=1
PageLayoutDescrFile=
LastNetListRead=quack.net
CopperLayerCount=2
BoardThickness=1.6
AllowMicroVias=0
AllowBlindVias=0
RequireCourtyardDefinitions=0
ProhibitOverlappingCourtyards=1
MinTrackWidth=0.2
MinViaDiameter=0.4
MinViaDrill=0.3
MinMicroViaDiameter=0.2
MinMicroViaDrill=0.09999999999999999
MinHoleToHole=0.25
TrackWidth1=0.25
ViaDiameter1=0.8
ViaDrill1=0.4
dPairWidth1=0.2
dPairGap1=0.25
dPairViaGap1=0.25
SilkLineWidth=0.12
SilkTextSizeV=1
SilkTextSizeH=1
SilkTextSizeThickness=0.15
SilkTextItalic=0
SilkTextUpright=1
CopperLineWidth=0.2
CopperTextSizeV=1.5
CopperTextSizeH=1.5
CopperTextThickness=0.3
CopperTextItalic=0
CopperTextUpright=1
EdgeCutLineWidth=0.05
CourtyardLineWidth=0.05
OthersLineWidth=0.15
OthersTextSizeV=1
OthersTextSizeH=1
OthersTextSizeThickness=0.15
OthersTextItalic=0
OthersTextUpright=1
SolderMaskClearance=0.051
SolderMaskMinWidth=0.25
SolderPasteClearance=0
SolderPasteRatio=-0
[pcbnew/Layer.F.Cu]
Name=F.Cu
Type=0
Enabled=1
[pcbnew/Layer.In1.Cu]
Name=In1.Cu
Type=0
Enabled=0
[pcbnew/Layer.In2.Cu]
Name=In2.Cu
Type=0
Enabled=0
[pcbnew/Layer.In3.Cu]
Name=In3.Cu
Type=0
Enabled=0
[pcbnew/Layer.In4.Cu]
Name=In4.Cu
Type=0
Enabled=0
[pcbnew/Layer.In5.Cu]
Name=In5.Cu
Type=0
Enabled=0
[pcbnew/Layer.In6.Cu]
Name=In6.Cu
Type=0
Enabled=0
[pcbnew/Layer.In7.Cu]
Name=In7.Cu
Type=0
Enabled=0
[pcbnew/Layer.In8.Cu]
Name=In8.Cu
Type=0
Enabled=0
[pcbnew/Layer.In9.Cu]
Name=In9.Cu
Type=0
Enabled=0
[pcbnew/Layer.In10.Cu]
Name=In10.Cu
Type=0
Enabled=0
[pcbnew/Layer.In11.Cu]
Name=In11.Cu
Type=0
Enabled=0
[pcbnew/Layer.In12.Cu]
Name=In12.Cu
Type=0
Enabled=0
[pcbnew/Layer.In13.Cu]
Name=In13.Cu
Type=0
Enabled=0
[pcbnew/Layer.In14.Cu]
Name=In14.Cu
Type=0
Enabled=0
[pcbnew/Layer.In15.Cu]
Name=In15.Cu
Type=0
Enabled=0
[pcbnew/Layer.In16.Cu]
Name=In16.Cu
Type=0
Enabled=0
[pcbnew/Layer.In17.Cu]
Name=In17.Cu
Type=0
Enabled=0
[pcbnew/Layer.In18.Cu]
Name=In18.Cu
Type=0
Enabled=0
[pcbnew/Layer.In19.Cu]
Name=In19.Cu
Type=0
Enabled=0
[pcbnew/Layer.In20.Cu]
Name=In20.Cu
Type=0
Enabled=0
[pcbnew/Layer.In21.Cu]
Name=In21.Cu
Type=0
Enabled=0
[pcbnew/Layer.In22.Cu]
Name=In22.Cu
Type=0
Enabled=0
[pcbnew/Layer.In23.Cu]
Name=In23.Cu
Type=0
Enabled=0
[pcbnew/Layer.In24.Cu]
Name=In24.Cu
Type=0
Enabled=0
[pcbnew/Layer.In25.Cu]
Name=In25.Cu
Type=0
Enabled=0
[pcbnew/Layer.In26.Cu]
Name=In26.Cu
Type=0
Enabled=0
[pcbnew/Layer.In27.Cu]
Name=In27.Cu
Type=0
Enabled=0
[pcbnew/Layer.In28.Cu]
Name=In28.Cu
Type=0
Enabled=0
[pcbnew/Layer.In29.Cu]
Name=In29.Cu
Type=0
Enabled=0
[pcbnew/Layer.In30.Cu]
Name=In30.Cu
Type=0
Enabled=0
[pcbnew/Layer.B.Cu]
Name=B.Cu
Type=0
Enabled=1
[pcbnew/Layer.B.Adhes]
Enabled=0
[pcbnew/Layer.F.Adhes]
Enabled=1
[pcbnew/Layer.B.Paste]
Enabled=0
[pcbnew/Layer.F.Paste]
Enabled=1
[pcbnew/Layer.B.SilkS]
Enabled=0
[pcbnew/Layer.F.SilkS]
Enabled=1
[pcbnew/Layer.B.Mask]
Enabled=1
[pcbnew/Layer.F.Mask]
Enabled=1
[pcbnew/Layer.Dwgs.User]
Enabled=1
[pcbnew/Layer.Cmts.User]
Enabled=1
[pcbnew/Layer.Eco1.User]
Enabled=1
[pcbnew/Layer.Eco2.User]
Enabled=1
[pcbnew/Layer.Edge.Cuts]
Enabled=1
[pcbnew/Layer.Margin]
Enabled=1
[pcbnew/Layer.B.CrtYd]
Enabled=1
[pcbnew/Layer.F.CrtYd]
Enabled=1
[pcbnew/Layer.B.Fab]
Enabled=0
[pcbnew/Layer.F.Fab]
Enabled=1
[pcbnew/Layer.Rescue]
Enabled=0
[pcbnew/Netclasses]
[pcbnew/Netclasses/Default]
Name=Default
Clearance=0.2
TrackWidth=0.25
ViaDiameter=0.8
ViaDrill=0.4
uViaDiameter=0.3
uViaDrill=0.1
dPairWidth=0.2
dPairGap=0.25
dPairViaGap=0.25
[pcbnew/Netclasses/1]
Name=+V
Clearance=0.2
TrackWidth=0.4
ViaDiameter=1
ViaDrill=0.4
uViaDiameter=0.3
uViaDrill=0.1
dPairWidth=0.2
dPairGap=0.25
dPairViaGap=0.25
[pcbnew/Netclasses/2]
Name=GND
Clearance=0.2
TrackWidth=1
ViaDiameter=1.6
ViaDrill=0.8
uViaDiameter=0.3
uViaDrill=0.1
dPairWidth=0.2
dPairGap=0.25
dPairViaGap=0.25

531
EDA/quack.sch Normal file
View File

@ -0,0 +1,531 @@
EESchema Schematic File Version 4
EELAYER 30 0
EELAYER END
$Descr A4 11693 8268
encoding utf-8
Sheet 1 2
Title "Quack Mouse Adapter"
Date "2020-09-14"
Rev "1.0"
Comp "Lostwave"
Comment1 "https://68kmla.org"
Comment2 "https://github.com/demik/quack/tree/master/EDA"
Comment3 ""
Comment4 ""
$EndDescr
$Sheet
S 9500 5000 1000 1000
U 5F5EA845
F0 "quack_connectors" 50
F1 "quack_connectors.sch" 50
$EndSheet
$Comp
L Regulator_Linear:AMS1117-3.3 U1
U 1 1 5F607118
P 9000 2000
F 0 "U1" H 9000 2242 50 0000 C CNN
F 1 "AMS1117-3.3" H 9000 2151 50 0000 C CNN
F 2 "Package_TO_SOT_SMD:SOT-223-3_TabPin2" H 9000 2200 50 0001 C CNN
F 3 "http://www.advanced-monolithic.com/pdf/ds1117.pdf" H 9100 1750 50 0001 C CNN
1 9000 2000
1 0 0 -1
$EndComp
$Comp
L power:GND #PWR0108
U 1 1 5F60BEC0
P 9000 2600
F 0 "#PWR0108" H 9000 2350 50 0001 C CNN
F 1 "GND" H 9005 2427 50 0000 C CNN
F 2 "" H 9000 2600 50 0001 C CNN
F 3 "" H 9000 2600 50 0001 C CNN
1 9000 2600
1 0 0 -1
$EndComp
$Comp
L power:+5V #PWR0109
U 1 1 5F60C48E
P 8500 1750
F 0 "#PWR0109" H 8500 1600 50 0001 C CNN
F 1 "+5V" V 8515 1878 50 0000 L CNN
F 2 "" H 8500 1750 50 0001 C CNN
F 3 "" H 8500 1750 50 0001 C CNN
1 8500 1750
1 0 0 -1
$EndComp
$Comp
L power:+3.3V #PWR0110
U 1 1 5F60D325
P 9500 1750
F 0 "#PWR0110" H 9500 1600 50 0001 C CNN
F 1 "+3.3V" V 9515 1878 50 0000 L CNN
F 2 "" H 9500 1750 50 0001 C CNN
F 3 "" H 9500 1750 50 0001 C CNN
1 9500 1750
1 0 0 -1
$EndComp
$Comp
L Device:C C1
U 1 1 5F60FDC9
P 8500 2250
F 0 "C1" H 8615 2296 50 0000 L CNN
F 1 "10uF" H 8615 2205 50 0000 L CNN
F 2 "Capacitor_SMD:C_0805_2012Metric" H 8538 2100 50 0001 C CNN
F 3 "~" H 8500 2250 50 0001 C CNN
1 8500 2250
1 0 0 -1
$EndComp
Wire Wire Line
9000 2300 9000 2500
Wire Wire Line
9000 2500 8500 2500
Wire Wire Line
8500 2500 8500 2400
Connection ~ 9000 2500
Wire Wire Line
9000 2500 9000 2600
Wire Wire Line
8500 2100 8500 2000
Wire Wire Line
8500 2000 8700 2000
Wire Wire Line
8500 2000 8500 1750
Connection ~ 8500 2000
$Comp
L Device:CP C2
U 1 1 5F6139D7
P 9500 2250
F 0 "C2" H 9618 2296 50 0000 L CNN
F 1 "100uF" H 9618 2205 50 0000 L CNN
F 2 "Capacitor_Tantalum_SMD:CP_EIA-3528-12_Kemet-T" H 9538 2100 50 0001 C CNN
F 3 "~" H 9500 2250 50 0001 C CNN
1 9500 2250
1 0 0 -1
$EndComp
Wire Wire Line
9300 2000 9500 2000
Wire Wire Line
9500 2000 9500 2100
Wire Wire Line
9500 2400 9500 2500
Wire Wire Line
9500 2500 9000 2500
Wire Wire Line
9500 1750 9500 2000
Connection ~ 9500 2000
$Comp
L power:+3.3V #PWR0111
U 1 1 5F6191ED
P 4850 1400
F 0 "#PWR0111" H 4850 1250 50 0001 C CNN
F 1 "+3.3V" H 4865 1573 50 0000 C CNN
F 2 "" H 4850 1400 50 0001 C CNN
F 3 "" H 4850 1400 50 0001 C CNN
1 4850 1400
1 0 0 -1
$EndComp
Wire Wire Line
4850 1500 4850 2000
Wire Wire Line
4950 2000 4950 1500
Wire Wire Line
4950 1500 4850 1500
Connection ~ 4850 1500
Wire Wire Line
4850 1500 4850 1400
Wire Wire Line
4750 2000 4750 1500
Wire Wire Line
4750 1500 4850 1500
Wire Wire Line
5050 2000 5050 1500
Connection ~ 4950 1500
$Comp
L power:GND #PWR0112
U 1 1 5F61B257
P 6050 4700
F 0 "#PWR0112" H 6050 4450 50 0001 C CNN
F 1 "GND" H 6055 4527 50 0000 C CNN
F 2 "" H 6050 4700 50 0001 C CNN
F 3 "" H 6050 4700 50 0001 C CNN
1 6050 4700
1 0 0 -1
$EndComp
Wire Wire Line
5950 4600 6050 4600
Wire Wire Line
6050 4600 6050 4700
Wire Wire Line
5150 2000 5150 1500
Wire Wire Line
4950 1500 5050 1500
Connection ~ 5050 1500
Wire Wire Line
5050 1500 5150 1500
Wire Wire Line
5250 2000 5250 1500
Wire Wire Line
5250 1500 5150 1500
Connection ~ 5150 1500
$Comp
L power:+3.3V #PWR0113
U 1 1 5F61CCB7
P 6500 3500
F 0 "#PWR0113" H 6500 3350 50 0001 C CNN
F 1 "+3.3V" V 6515 3628 50 0000 L CNN
F 2 "" H 6500 3500 50 0001 C CNN
F 3 "" H 6500 3500 50 0001 C CNN
1 6500 3500
0 1 1 0
$EndComp
Wire Wire Line
5950 3500 6500 3500
NoConn ~ 5950 2900
NoConn ~ 5950 3000
NoConn ~ 5950 3100
NoConn ~ 4150 4700
NoConn ~ 4150 4200
NoConn ~ 4150 4400
$Comp
L Device:LED D4
U 1 1 5F621DE4
P 7250 4000
F 0 "D4" H 7243 4216 50 0000 C CNN
F 1 "GREEN LED" H 7243 4125 50 0000 C CNN
F 2 "LED_SMD:LED_0805_2012Metric_Castellated" H 7250 4000 50 0001 C CNN
F 3 "~" H 7250 4000 50 0001 C CNN
1 7250 4000
-1 0 0 1
$EndComp
Wire Wire Line
5950 4000 6600 4000
$Comp
L Device:LED D1
U 1 1 5F6256F8
P 2750 3000
F 0 "D1" H 2743 3216 50 0000 C CNN
F 1 "BLUE LED" H 2743 3125 50 0000 C CNN
F 2 "LED_SMD:LED_0805_2012Metric_Castellated" H 2750 3000 50 0001 C CNN
F 3 "~" H 2750 3000 50 0001 C CNN
1 2750 3000
1 0 0 -1
$EndComp
$Comp
L Device:LED D2
U 1 1 5F626D09
P 2750 3500
F 0 "D2" H 2743 3716 50 0000 C CNN
F 1 "YELLOW LED" H 2743 3625 50 0000 C CNN
F 2 "LED_SMD:LED_0805_2012Metric_Castellated" H 2750 3500 50 0001 C CNN
F 3 "~" H 2750 3500 50 0001 C CNN
1 2750 3500
1 0 0 -1
$EndComp
$Comp
L Device:LED D3
U 1 1 5F62988B
P 2750 4000
F 0 "D3" H 2743 4216 50 0000 C CNN
F 1 "RED LED" H 2743 4125 50 0000 C CNN
F 2 "LED_SMD:LED_0805_2012Metric_Castellated" H 2750 4000 50 0001 C CNN
F 3 "~" H 2750 4000 50 0001 C CNN
1 2750 4000
1 0 0 -1
$EndComp
$Comp
L Device:R R1
U 1 1 5F62B2A2
P 3250 3000
F 0 "R1" V 3043 3000 50 0000 C CNN
F 1 "33" V 3134 3000 50 0000 C CNN
F 2 "Resistor_SMD:R_0805_2012Metric" V 3180 3000 50 0001 C CNN
F 3 "~" H 3250 3000 50 0001 C CNN
1 3250 3000
0 1 1 0
$EndComp
$Comp
L Device:R R2
U 1 1 5F62BD09
P 3250 3500
F 0 "R2" V 3043 3500 50 0000 C CNN
F 1 "120" V 3134 3500 50 0000 C CNN
F 2 "Resistor_SMD:R_0805_2012Metric" V 3180 3500 50 0001 C CNN
F 3 "~" H 3250 3500 50 0001 C CNN
1 3250 3500
0 1 1 0
$EndComp
$Comp
L Device:R R3
U 1 1 5F62CA4D
P 3250 4000
F 0 "R3" V 3043 4000 50 0000 C CNN
F 1 "120" V 3134 4000 50 0000 C CNN
F 2 "Resistor_SMD:R_0805_2012Metric" V 3180 4000 50 0001 C CNN
F 3 "~" H 3250 4000 50 0001 C CNN
1 3250 4000
0 1 1 0
$EndComp
Wire Wire Line
3100 3000 2900 3000
Wire Wire Line
3100 3500 2900 3500
Wire Wire Line
3100 4000 2900 4000
Wire Wire Line
4150 3200 3600 3200
Wire Wire Line
4150 3300 3500 3300
Wire Wire Line
3500 3300 3500 3500
Wire Wire Line
3500 3500 3400 3500
Wire Wire Line
4150 3400 3600 3400
Wire Wire Line
3600 3400 3600 4000
Wire Wire Line
3600 4000 3400 4000
Wire Wire Line
3600 3200 3600 3000
Wire Wire Line
3400 3000 3600 3000
$Comp
L power:GND #PWR0114
U 1 1 5F631BD7
P 2250 4100
F 0 "#PWR0114" H 2250 3850 50 0001 C CNN
F 1 "GND" H 2255 3927 50 0000 C CNN
F 2 "" H 2250 4100 50 0001 C CNN
F 3 "" H 2250 4100 50 0001 C CNN
1 2250 4100
1 0 0 -1
$EndComp
Wire Wire Line
2250 3000 2250 3500
Connection ~ 2250 4000
Wire Wire Line
2250 4000 2250 4100
Connection ~ 2250 3500
Wire Wire Line
2250 3500 2250 4000
Wire Wire Line
2250 3000 2600 3000
Wire Wire Line
2250 3500 2600 3500
Wire Wire Line
2250 4000 2600 4000
$Comp
L Device:R R4
U 1 1 5F63A510
P 6750 4000
F 0 "R4" V 6543 4000 50 0000 C CNN
F 1 "120" V 6634 4000 50 0000 C CNN
F 2 "Resistor_SMD:R_0805_2012Metric" V 6680 4000 50 0001 C CNN
F 3 "~" H 6750 4000 50 0001 C CNN
1 6750 4000
0 1 1 0
$EndComp
Wire Wire Line
6900 4000 7100 4000
$Comp
L power:GND #PWR0115
U 1 1 5F64B0BE
P 7750 4100
F 0 "#PWR0115" H 7750 3850 50 0001 C CNN
F 1 "GND" H 7755 3927 50 0000 C CNN
F 2 "" H 7750 4100 50 0001 C CNN
F 3 "" H 7750 4100 50 0001 C CNN
1 7750 4100
1 0 0 -1
$EndComp
Wire Wire Line
7750 4100 7750 4000
Wire Wire Line
7750 4000 7400 4000
Text GLabel 6050 3800 2 50 Input ~ 0
U0RXD
Text GLabel 6050 3900 2 50 Output ~ 0
U0TXD
Wire Wire Line
6050 3800 5950 3800
Wire Wire Line
6050 3900 5950 3900
Text GLabel 4050 4000 0 50 UnSpc ~ 0
FLASH
Wire Wire Line
4150 4000 4050 4000
$Comp
L Device:C C4
U 1 1 5F66EA30
P 4500 1750
F 0 "C4" H 4615 1796 50 0000 L CNN
F 1 "0.1" H 4615 1705 50 0000 L CNN
F 2 "Capacitor_SMD:C_0805_2012Metric" H 4538 1600 50 0001 C CNN
F 3 "~" H 4500 1750 50 0001 C CNN
1 4500 1750
1 0 0 -1
$EndComp
$Comp
L Device:C C3
U 1 1 5F66FB55
P 4000 1750
F 0 "C3" H 4115 1796 50 0000 L CNN
F 1 "10" H 4115 1705 50 0000 L CNN
F 2 "Capacitor_SMD:C_0805_2012Metric" H 4038 1600 50 0001 C CNN
F 3 "~" H 4000 1750 50 0001 C CNN
1 4000 1750
1 0 0 -1
$EndComp
Wire Wire Line
4750 1500 4500 1500
Wire Wire Line
4000 1500 4000 1600
Connection ~ 4750 1500
$Comp
L power:GND #PWR0118
U 1 1 5F671A03
P 4000 2100
F 0 "#PWR0118" H 4000 1850 50 0001 C CNN
F 1 "GND" H 4005 1927 50 0000 C CNN
F 2 "" H 4000 2100 50 0001 C CNN
F 3 "" H 4000 2100 50 0001 C CNN
1 4000 2100
1 0 0 -1
$EndComp
Wire Wire Line
4000 2100 4000 2000
Wire Wire Line
4500 1900 4500 2000
Wire Wire Line
4500 2000 4000 2000
Connection ~ 4000 2000
Wire Wire Line
4000 2000 4000 1900
Wire Wire Line
4500 1600 4500 1500
Connection ~ 4500 1500
Wire Wire Line
4500 1500 4000 1500
Text GLabel 4050 3600 0 50 Output ~ 0
QX1_3V
Text GLabel 4050 3700 0 50 Output ~ 0
QX2_3V
Text GLabel 4050 3500 0 50 Output ~ 0
QY1_3V
Text GLabel 4050 3800 0 50 Output ~ 0
QY2_3V
Text GLabel 4050 3900 0 50 Output ~ 0
CLICK_3V
Wire Wire Line
4050 3500 4150 3500
Wire Wire Line
4050 3600 4150 3600
Wire Wire Line
4050 3700 4150 3700
Wire Wire Line
4050 3800 4150 3800
Wire Wire Line
4050 3900 4150 3900
Text GLabel 4050 4100 0 50 BiDi ~ 0
ADB
Wire Wire Line
4150 4100 4050 4100
NoConn ~ 5950 4100
NoConn ~ 4150 5000
NoConn ~ 4150 4900
NoConn ~ 4150 4800
NoConn ~ 5950 4300
NoConn ~ 5950 4200
NoConn ~ 5950 4400
NoConn ~ 5950 4500
$Comp
L ESP32-PICO-D4:ESP32-PICO-D4 IC1
U 1 1 5F5E5479
P 4150 2900
F 0 "IC1" H 5050 327 50 0000 C CNN
F 1 "ESP32-PICO-D4" H 5050 236 50 0000 C CNN
F 2 "ESP32-PICO-D4:ESP32-PICO-D4_1" H 5800 3600 50 0001 L CNN
F 3 "https://hr.mouser.com/datasheet/2/891/esp32-pico-d4_datasheet_en-1365829.pdf" H 5800 3500 50 0001 L CNN
F 4 "ESP32-PICO-D4 module" H 5800 3400 50 0001 L CNN "Description"
F 5 "" H 5800 3300 50 0001 L CNN "Height"
F 6 "356-ESP32-PICO-D4" H 5800 3200 50 0001 L CNN "Mouser Part Number"
F 7 "" H 5800 3100 50 0001 L CNN "Mouser Price/Stock"
F 8 "Espressif" H 5800 3000 50 0001 L CNN "Manufacturer_Name"
F 9 "ESP32-PICO-D4" H 5800 2900 50 0001 L CNN "Manufacturer_Part_Number"
1 4150 2900
1 0 0 -1
$EndComp
Text GLabel 4050 3100 0 50 Output ~ 0
BTOFF
Text GLabel 4050 3000 0 50 Output ~ 0
ADBSRC
Wire Wire Line
4150 3100 4050 3100
Wire Wire Line
4150 3000 4050 3000
NoConn ~ 4150 4600
NoConn ~ 4150 4500
NoConn ~ 4150 4300
NoConn ~ 5950 3700
NoConn ~ 5950 3600
NoConn ~ 5950 3400
NoConn ~ 5950 3300
NoConn ~ 5950 3200
NoConn ~ 4150 5200
NoConn ~ 4150 5300
NoConn ~ 9400 4250
$Comp
L Device:R R5
U 1 1 5F628CC1
P 3500 4850
F 0 "R5" H 3570 4896 50 0000 L CNN
F 1 "10k" H 3570 4805 50 0000 L CNN
F 2 "Resistor_SMD:R_0805_2012Metric" V 3430 4850 50 0001 C CNN
F 3 "~" H 3500 4850 50 0001 C CNN
1 3500 4850
1 0 0 -1
$EndComp
$Comp
L Device:C C5
U 1 1 5F6294FB
P 3500 5350
F 0 "C5" H 3615 5396 50 0000 L CNN
F 1 "0.1uF" H 3615 5305 50 0000 L CNN
F 2 "Capacitor_SMD:C_0805_2012Metric" H 3538 5200 50 0001 C CNN
F 3 "~" H 3500 5350 50 0001 C CNN
1 3500 5350
1 0 0 -1
$EndComp
Wire Wire Line
3500 5200 3500 5100
Wire Wire Line
3500 5100 4150 5100
Connection ~ 3500 5100
Wire Wire Line
3500 5100 3500 5000
$Comp
L power:GND #PWR0121
U 1 1 5F62D413
P 3500 5600
F 0 "#PWR0121" H 3500 5350 50 0001 C CNN
F 1 "GND" H 3505 5427 50 0000 C CNN
F 2 "" H 3500 5600 50 0001 C CNN
F 3 "" H 3500 5600 50 0001 C CNN
1 3500 5600
1 0 0 -1
$EndComp
$Comp
L power:+3.3V #PWR0122
U 1 1 5F62DCC0
P 3500 4600
F 0 "#PWR0122" H 3500 4450 50 0001 C CNN
F 1 "+3.3V" H 3515 4773 50 0000 C CNN
F 2 "" H 3500 4600 50 0001 C CNN
F 3 "" H 3500 4600 50 0001 C CNN
1 3500 4600
1 0 0 -1
$EndComp
Wire Wire Line
3500 4600 3500 4700
Wire Wire Line
3500 5500 3500 5600
$EndSCHEMATC

387
EDA/quack_connectors.sch Normal file
View File

@ -0,0 +1,387 @@
EESchema Schematic File Version 4
EELAYER 30 0
EELAYER END
$Descr A4 11693 8268
encoding utf-8
Sheet 2 2
Title "Quack Mouse Adapter"
Date "2020-09-14"
Rev "1.0"
Comp "Lostwave"
Comment1 "https://68kmla.org"
Comment2 "https://github.com/demik/quack/tree/master/EDA"
Comment3 ""
Comment4 ""
$EndDescr
$Comp
L Connector:DIN-4 J?
U 1 1 5F5EB6CA
P 9750 1750
AR Path="/5F5EB6CA" Ref="J?" Part="1"
AR Path="/5F5EA845/5F5EB6CA" Ref="J1" Part="1"
F 0 "J1" H 9750 1475 50 0000 C CNN
F 1 "DIN-4" H 9750 1384 50 0000 C CNN
F 2 "Quack_MDIN4:57491811" H 9750 1750 50 0001 C CNN
F 3 "http://www.mouser.com/ds/2/18/40_c091_abd_e-75918.pdf" H 9750 1750 50 0001 C CNN
1 9750 1750
1 0 0 -1
$EndComp
$Comp
L Connector:DB9_Male J?
U 1 1 5F5EB6D0
P 9800 3700
AR Path="/5F5EB6D0" Ref="J?" Part="1"
AR Path="/5F5EA845/5F5EB6D0" Ref="J2" Part="1"
F 0 "J2" H 9980 3746 50 0000 L CNN
F 1 "DB9_Male" H 9980 3655 50 0000 L CNN
F 2 "Quack_DB9:23018431" H 9800 3700 50 0001 C CNN
F 3 " ~" H 9800 3700 50 0001 C CNN
1 9800 3700
1 0 0 -1
$EndComp
$Comp
L TXB0108PWR:TXB0108PWR IC2
U 1 1 5F5EC2ED
P 5300 2500
F 0 "IC2" H 5850 2765 50 0000 C CNN
F 1 "TXB0108PWR" H 5850 2674 50 0000 C CNN
F 2 "Package_SO:TSSOP-20_4.4x6.5mm_P0.65mm" H 6250 2600 50 0001 L CNN
F 3 "http://www.ti.com/lit/ds/symlink/txb0108.pdf" H 6250 2500 50 0001 L CNN
F 4 "8-Bit Bidirectional Voltage-Level Shifter with Auto Direction Sensing and +/-15-kV ESD Protect" H 6250 2400 50 0001 L CNN "Description"
F 5 "1.2" H 6250 2300 50 0001 L CNN "Height"
F 6 "595-TXB0108PWR" H 6250 2200 50 0001 L CNN "Mouser Part Number"
F 7 "https://www.mouser.co.uk/ProductDetail/Texas-Instruments/TXB0108PWR?qs=oFXvjAmG9EgEUWGWzOVFCA%3D%3D" H 6250 2100 50 0001 L CNN "Mouser Price/Stock"
F 8 "Texas Instruments" H 6250 2000 50 0001 L CNN "Manufacturer_Name"
F 9 "TXB0108PWR" H 6250 1900 50 0001 L CNN "Manufacturer_Part_Number"
1 5300 2500
1 0 0 -1
$EndComp
$Comp
L power:GND #PWR0101
U 1 1 5F5F910C
P 10200 1850
F 0 "#PWR0101" H 10200 1600 50 0001 C CNN
F 1 "GND" H 10205 1677 50 0000 C CNN
F 2 "" H 10200 1850 50 0001 C CNN
F 3 "" H 10200 1850 50 0001 C CNN
1 10200 1850
1 0 0 -1
$EndComp
Wire Wire Line
10200 1850 10200 1750
Wire Wire Line
10200 1750 10050 1750
NoConn ~ 9650 1450
$Comp
L power:+5V #PWR0102
U 1 1 5F5F9B56
P 9850 1250
F 0 "#PWR0102" H 9850 1100 50 0001 C CNN
F 1 "+5V" H 9865 1423 50 0000 C CNN
F 2 "" H 9850 1250 50 0001 C CNN
F 3 "" H 9850 1250 50 0001 C CNN
1 9850 1250
1 0 0 -1
$EndComp
Wire Wire Line
9850 1350 9850 1450
NoConn ~ 9500 4000
$Comp
L power:GND #PWR0103
U 1 1 5F5FA5F3
P 9000 4200
F 0 "#PWR0103" H 9000 3950 50 0001 C CNN
F 1 "GND" H 9005 4027 50 0000 C CNN
F 2 "" H 9000 4200 50 0001 C CNN
F 3 "" H 9000 4200 50 0001 C CNN
1 9000 4200
1 0 0 -1
$EndComp
Wire Wire Line
9500 4100 9000 4100
Wire Wire Line
9000 4100 9000 4200
Wire Wire Line
9450 1750 7000 1750
Wire Wire Line
7000 1750 7000 2500
Wire Wire Line
7000 2500 6400 2500
$Comp
L power:+5V #PWR0104
U 1 1 5F5FB441
P 9400 3900
F 0 "#PWR0104" H 9400 3750 50 0001 C CNN
F 1 "+5V" V 9415 4028 50 0000 L CNN
F 2 "" H 9400 3900 50 0001 C CNN
F 3 "" H 9400 3900 50 0001 C CNN
1 9400 3900
0 -1 -1 0
$EndComp
Wire Wire Line
9500 3900 9400 3900
Text Label 9400 3800 2 50 ~ 0
CLICK_5V
$Comp
L power:GND #PWR0105
U 1 1 5F5FC5FB
P 6500 3500
F 0 "#PWR0105" H 6500 3250 50 0001 C CNN
F 1 "GND" H 6505 3327 50 0000 C CNN
F 2 "" H 6500 3500 50 0001 C CNN
F 3 "" H 6500 3500 50 0001 C CNN
1 6500 3500
1 0 0 -1
$EndComp
Wire Wire Line
6500 3500 6500 3400
Wire Wire Line
6500 3400 6400 3400
Wire Wire Line
9400 3800 9500 3800
Wire Wire Line
9500 3700 9000 3700
Wire Wire Line
9000 3700 9000 4100
Connection ~ 9000 4100
Text GLabel 5200 2500 0 50 BiDi ~ 0
ADB
Wire Wire Line
5300 2500 5200 2500
$Comp
L power:+3.3V #PWR0106
U 1 1 5F5FE1F1
P 4750 2000
F 0 "#PWR0106" H 4750 1850 50 0001 C CNN
F 1 "+3.3V" H 4765 2173 50 0000 C CNN
F 2 "" H 4750 2000 50 0001 C CNN
F 3 "" H 4750 2000 50 0001 C CNN
1 4750 2000
1 0 0 -1
$EndComp
Wire Wire Line
4750 2000 4750 2600
Wire Wire Line
4750 2600 5300 2600
$Comp
L power:+5V #PWR0107
U 1 1 5F5FF2AB
P 6500 2600
F 0 "#PWR0107" H 6500 2450 50 0001 C CNN
F 1 "+5V" V 6515 2728 50 0000 L CNN
F 2 "" H 6500 2600 50 0001 C CNN
F 3 "" H 6500 2600 50 0001 C CNN
1 6500 2600
0 1 1 0
$EndComp
Wire Wire Line
6400 2600 6500 2600
NoConn ~ 6400 2700
NoConn ~ 6400 2800
Text Label 6500 3200 0 50 ~ 0
CLICK_5V
Wire Wire Line
6500 3200 6400 3200
NoConn ~ 5300 2800
NoConn ~ 5300 2700
$Comp
L power:PWR_FLAG #FLG0101
U 1 1 5F6091B0
P 10300 1250
F 0 "#FLG0101" H 10300 1325 50 0001 C CNN
F 1 "PWR_FLAG" H 10300 1423 50 0000 C CNN
F 2 "" H 10300 1250 50 0001 C CNN
F 3 "~" H 10300 1250 50 0001 C CNN
1 10300 1250
1 0 0 -1
$EndComp
Wire Wire Line
10300 1250 10300 1350
Wire Wire Line
10300 1350 9850 1350
Wire Wire Line
9850 1250 9850 1350
Connection ~ 9850 1350
$Comp
L Connector_Generic:Conn_01x04 J3
U 1 1 5F65399F
P 1450 1600
F 0 "J3" H 1368 1175 50 0000 C CNN
F 1 "FTDI" H 1368 1266 50 0000 C CNN
F 2 "Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical" H 1450 1600 50 0001 C CNN
F 3 "~" H 1450 1600 50 0001 C CNN
1 1450 1600
-1 0 0 1
$EndComp
$Comp
L power:GND #PWR0116
U 1 1 5F65581C
P 1900 1400
F 0 "#PWR0116" H 1900 1150 50 0001 C CNN
F 1 "GND" V 1905 1272 50 0000 R CNN
F 2 "" H 1900 1400 50 0001 C CNN
F 3 "" H 1900 1400 50 0001 C CNN
1 1900 1400
0 -1 -1 0
$EndComp
$Comp
L power:+5V #PWR0117
U 1 1 5F656219
P 1900 1700
F 0 "#PWR0117" H 1900 1550 50 0001 C CNN
F 1 "+5V" V 1915 1828 50 0000 L CNN
F 2 "" H 1900 1700 50 0001 C CNN
F 3 "" H 1900 1700 50 0001 C CNN
1 1900 1700
0 1 1 0
$EndComp
Wire Wire Line
1900 1700 1650 1700
Wire Wire Line
1900 1400 1650 1400
Text GLabel 1950 1600 2 50 Output ~ 0
U0RXD
Text GLabel 1950 1500 2 50 Input ~ 0
U0TXD
Wire Wire Line
1950 1600 1650 1600
Wire Wire Line
1950 1500 1650 1500
Text Label 6500 2900 0 50 ~ 0
QX2_5V
Text Label 6500 3000 0 50 ~ 0
QX1_5V
Text Label 6500 3100 0 50 ~ 0
QY1_5V
Text Label 6500 3300 0 50 ~ 0
QY2_5V
Wire Wire Line
6400 3300 6500 3300
Wire Wire Line
6400 3100 6500 3100
Wire Wire Line
6400 3000 6500 3000
Wire Wire Line
6400 2900 6500 2900
Text Label 9400 3600 2 50 ~ 0
QY2_5V
Text Label 9400 3500 2 50 ~ 0
QX2_5V
Text Label 9400 3400 2 50 ~ 0
QY1_5V
Text Label 9400 3300 2 50 ~ 0
QX1_5V
Wire Wire Line
9400 3600 9500 3600
Wire Wire Line
9400 3500 9500 3500
Wire Wire Line
9400 3400 9500 3400
Wire Wire Line
9400 3300 9500 3300
$Comp
L Connector_Generic:Conn_02x03_Odd_Even J4
U 1 1 5F665D50
P 1850 3100
F 0 "J4" H 1900 3417 50 0000 C CNN
F 1 "MODE" H 1900 3326 50 0000 C CNN
F 2 "Connector_PinHeader_2.54mm:PinHeader_2x03_P2.54mm_Vertical" H 1850 3100 50 0001 C CNN
F 3 "~" H 1850 3100 50 0001 C CNN
1 1850 3100
1 0 0 -1
$EndComp
Text Notes 1650 3850 0 50 ~ 0
1-2 : FLASH\n3-4 : BTOFF\n7-8 : ADBSRC
$Comp
L power:GND #PWR0119
U 1 1 5F668D4A
P 2250 3300
F 0 "#PWR0119" H 2250 3050 50 0001 C CNN
F 1 "GND" H 2255 3127 50 0000 C CNN
F 2 "" H 2250 3300 50 0001 C CNN
F 3 "" H 2250 3300 50 0001 C CNN
1 2250 3300
1 0 0 -1
$EndComp
Wire Wire Line
2150 3000 2250 3000
Wire Wire Line
2250 3000 2250 3100
Wire Wire Line
2150 3100 2250 3100
Connection ~ 2250 3100
Wire Wire Line
2250 3100 2250 3200
Wire Wire Line
2150 3200 2250 3200
Connection ~ 2250 3200
Wire Wire Line
2250 3200 2250 3300
Text GLabel 1550 3000 0 50 UnSpc ~ 0
FLASH
Wire Wire Line
1550 3000 1650 3000
Text GLabel 5200 2900 0 50 Input ~ 0
QX2_3V
Text GLabel 5200 3000 0 50 Input ~ 0
QX1_3V
Text GLabel 5200 3100 0 50 Input ~ 0
QY1_3V
Text GLabel 5200 3200 0 50 Input ~ 0
CLICK_3V
Text GLabel 5200 3300 0 50 Input ~ 0
QY2_3V
$Comp
L power:GND #PWR0120
U 1 1 5F68010C
P 5200 3500
F 0 "#PWR0120" H 5200 3250 50 0001 C CNN
F 1 "GND" H 5205 3327 50 0000 C CNN
F 2 "" H 5200 3500 50 0001 C CNN
F 3 "" H 5200 3500 50 0001 C CNN
1 5200 3500
1 0 0 -1
$EndComp
Wire Wire Line
5200 3500 5200 3400
Wire Wire Line
5200 3400 5300 3400
Wire Wire Line
5200 3300 5300 3300
Wire Wire Line
5200 3200 5300 3200
Wire Wire Line
5200 3100 5300 3100
Wire Wire Line
5300 3000 5200 3000
Wire Wire Line
5300 2900 5200 2900
Text GLabel 1550 3100 0 50 Input ~ 0
BTOFF
Text GLabel 1550 3200 0 50 Input ~ 0
ADBSRC
Wire Wire Line
1550 3100 1650 3100
Wire Wire Line
1550 3200 1650 3200
Wire Notes Line
1000 1000 1000 2000
Wire Notes Line
1000 2000 2500 2000
Wire Notes Line
2500 2000 2500 1000
Wire Notes Line
2500 1000 1000 1000
Wire Notes Line
1000 2500 2500 2500
Wire Notes Line
2500 2500 2500 4000
Wire Notes Line
2500 4000 1000 4000
Wire Notes Line
1000 4000 1000 2500
Text Notes 1500 950 0 50 ~ 0
FTDI / UART0
Text Notes 1450 2450 0 50 ~ 0
MODE JUMPERS
$EndSCHEMATC

9
Makefile Normal file
View File

@ -0,0 +1,9 @@
#
# This is a project Makefile. It is assumed the directory this Makefile resides in is a
# project subdirectory.
#
PROJECT_NAME := quack
include $(IDF_PATH)/make/project.mk

5
README.md Normal file
View File

@ -0,0 +1,5 @@
# Hello World Example
Starts a FreeRTOS task to print "Hello World"
See the README.md file in the upper level 'examples' directory for more information about examples.

10
main/CMakeLists.txt Normal file
View File

@ -0,0 +1,10 @@
set(srcs "blue.c"
"esp_hid_gap.c"
"gpio.c"
"main.c")
set(include_dirs ".")
idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS "${include_dirs}"
REQUIRES esp_hid)

166
main/blue.c Normal file
View File

@ -0,0 +1,166 @@
/* This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this software is
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "esp_system.h"
#include "esp_wifi.h"
#include "esp_event.h"
#include "esp_log.h"
#include "nvs_flash.h"
#include "esp_bt.h"
#include "esp_bt_defs.h"
#include "esp_gap_ble_api.h"
#include "esp_gatts_api.h"
#include "esp_gatt_defs.h"
#include "esp_bt_main.h"
#include "esp_bt_device.h"
#include "esp_hidh.h"
#include "esp_hid_gap.h"
#include "blue.h"
static const char *TAG = "blue";
#define BTMOUSE_BUTTON1 (1 << 0)
#define BTMOUSE_BUTTON2 (1 << 1)
#define BTMOUSE_BUTTON3 (1 << 2)
void hidh_callback(void *handler_args, esp_event_base_t base, int32_t id, void *event_data)
{
esp_hidh_event_t event = (esp_hidh_event_t)id;
esp_hidh_event_data_t *param = (esp_hidh_event_data_t *)event_data;
/*
* esp_hidh_event_data_t:
* struct {
* esp_hidh_dev_t *dev; HID Remote bluetooth device
* esp_hid_usage_t usage; HID report usage
* uint16_t report_id; HID report index
* uint16_t length; HID data length
* uint8_t *data; The pointer to the HID data
* uint8_t map_index; HID report map index
* } input;
*/
char click;
short x, y;
switch (event) {
case ESP_HIDH_OPEN_EVENT: {
const uint8_t *bda = esp_hidh_dev_bda_get(param->open.dev);
if (strlen((char *)param->open.dev) > 0)
ESP_LOGI(TAG, "opened connection with device: " ESP_BD_ADDR_STR " named %s", ESP_BD_ADDR_HEX(bda), esp_hidh_dev_name_get(param->open.dev));
else
ESP_LOGI(TAG, "opened connection with device: " ESP_BD_ADDR_STR, ESP_BD_ADDR_HEX(bda));
//esp_hidh_dev_dump(param->open.dev, stdout);
break;
}
case ESP_HIDH_BATTERY_EVENT: {
const uint8_t *bda = esp_hidh_dev_bda_get(param->battery.dev);
ESP_LOGI(TAG, ESP_BD_ADDR_STR " BATTERY: %d%%", ESP_BD_ADDR_HEX(bda), param->battery.level);
break;
}
case ESP_HIDH_INPUT_EVENT: {
const uint8_t *bda = esp_hidh_dev_bda_get(param->input.dev);
ESP_LOGD(TAG, ESP_BD_ADDR_STR " INPUT: %8s, MAP: %2u, ID: %3u, Len: %d, Data:", ESP_BD_ADDR_HEX(bda), esp_hid_usage_str(param->input.usage), param->input.map_index, param->input.report_id, param->input.length);
ESP_LOG_BUFFER_HEX(TAG, param->input.data, param->input.length);
memcpy (&click, param->input.data, sizeof(uint8_t));
click = click & (BTMOUSE_BUTTON1 | BTMOUSE_BUTTON2 | BTMOUSE_BUTTON3);
if (click)
ESP_LOGI(TAG, "CLICK: %d", click);
break;
}
case ESP_HIDH_FEATURE_EVENT: {
const uint8_t *bda = esp_hidh_dev_bda_get(param->feature.dev);
ESP_LOGI(TAG, ESP_BD_ADDR_STR " FEATURE: %8s, MAP: %2u, ID: %3u, Len: %d", ESP_BD_ADDR_HEX(bda), esp_hid_usage_str(param->feature.usage), param->feature.map_index, param->feature.report_id, param->feature.length);
ESP_LOG_BUFFER_HEX(TAG, param->feature.data, param->feature.length);
break;
}
case ESP_HIDH_CLOSE_EVENT: {
const uint8_t *bda = esp_hidh_dev_bda_get(param->close.dev);
ESP_LOGI(TAG, ESP_BD_ADDR_STR " CLOSE: '%s' %s", ESP_BD_ADDR_HEX(bda), esp_hidh_dev_name_get(param->close.dev), esp_hid_disconnect_reason_str(esp_hidh_dev_transport_get(param->close.dev), param->close.reason));
esp_hidh_dev_free(param->close.dev);
break;
}
default:
ESP_LOGI(TAG, "EVENT: %d", event);
}
}
#define SCAN_DURATION_SECONDS 6
void hid_demo_task(void *pvParameters)
{
size_t len = 0;
esp_hid_scan_result_t *mouse = NULL;
esp_hid_scan_result_t *results = NULL;
ESP_LOGI(TAG, "starting scan on core %d…", xPortGetCoreID());
esp_hid_scan(SCAN_DURATION_SECONDS, &len, &results);
ESP_LOGI(TAG, "scan returned %u result(s)", len);
if (len) {
esp_hid_scan_result_t *r = results;
while (r) {
ESP_LOGI(TAG, "found %s device: " ESP_BD_ADDR_STR ", RSSI: %d, NAME: %s",
(r->transport == ESP_HID_TRANSPORT_BLE) ? "BLE" : "BT",
ESP_BD_ADDR_HEX(r->bda), r->rssi, r->name ? r->name : "");
if (r->transport == ESP_HID_TRANSPORT_BLE) {
printf("APPEARANCE: 0x%04x, ", r->ble.appearance);
printf("ADDR_TYPE: '%s', ", ble_addr_type_str(r->ble.addr_type));
} else {
if (strcmp("PERIPHERAL", esp_hid_cod_major_str(r->bt.cod.major)) == 0
&& (r->bt.cod.minor & ESP_HID_COD_MIN_MOUSE)) {
ESP_LOGI(TAG, "found generic mouse");
mouse = r;
}
}
r = r->next;
}
if (mouse) {
// try to connect to the last mouse found
esp_hidh_dev_open(mouse->bda, mouse->transport, mouse->ble.addr_type);
}
else {
ESP_LOGI(TAG, "devices found but no mouse detected");
}
esp_hid_scan_results_free(results);
}
vTaskDelete(NULL);
}
void blue_init(void)
{
esp_err_t ret;
ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
ESP_ERROR_CHECK(nvs_flash_erase());
ret = nvs_flash_init();
}
ESP_ERROR_CHECK(ret);
ESP_ERROR_CHECK(esp_hid_gap_init(ESP_BT_MODE_BTDM));
ESP_ERROR_CHECK(esp_ble_gattc_register_callback(esp_hidh_gattc_event_handler));
esp_hidh_config_t config = {
.callback = hidh_callback,
};
ESP_ERROR_CHECK( esp_hidh_init(&config) );
/* keep scanning until a device is found */
xTaskCreatePinnedToCore(&hid_demo_task, "hid_task", 6 * 1024, NULL, 2, NULL, 0);
}

33
main/blue.h Normal file
View File

@ -0,0 +1,33 @@
/*
* blue.h
* quack
*
* Created by Michel DEPEIGE on 13/09/2020.
* Copyright (c) 2020 Michel DEPEIGE.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
* Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
*/
#ifndef BLUE_H
#define BLUE_H
/* prototypes */
void blue_init(void);
#endif

5
main/component.mk Normal file
View File

@ -0,0 +1,5 @@
#
# "main" pseudo-component makefile.
#
# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.)

799
main/esp_hid_gap.c Normal file
View File

@ -0,0 +1,799 @@
// Copyright 2017-2019 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <string.h>
#include <stdbool.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "esp_hid_gap.h"
static const char *TAG = "ESP_HID_GAP";
// uncomment to print all devices that were seen during a scan
#define GAP_DBG_PRINTF(...) //printf(__VA_ARGS__)
//static const char * gap_bt_prop_type_names[5] = {"","BDNAME","COD","RSSI","EIR"};
static esp_hid_scan_result_t *bt_scan_results = NULL;
static size_t num_bt_scan_results = 0;
static esp_hid_scan_result_t *ble_scan_results = NULL;
static size_t num_ble_scan_results = 0;
static xSemaphoreHandle bt_hidh_cb_semaphore = NULL;
#define WAIT_BT_CB() xSemaphoreTake(bt_hidh_cb_semaphore, portMAX_DELAY)
#define SEND_BT_CB() xSemaphoreGive(bt_hidh_cb_semaphore)
static xSemaphoreHandle ble_hidh_cb_semaphore = NULL;
#define WAIT_BLE_CB() xSemaphoreTake(ble_hidh_cb_semaphore, portMAX_DELAY)
#define SEND_BLE_CB() xSemaphoreGive(ble_hidh_cb_semaphore)
#define SIZEOF_ARRAY(a) (sizeof(a)/sizeof(*a))
static const char *ble_gap_evt_names[] = { "ADV_DATA_SET_COMPLETE", "SCAN_RSP_DATA_SET_COMPLETE", "SCAN_PARAM_SET_COMPLETE", "SCAN_RESULT", "ADV_DATA_RAW_SET_COMPLETE", "SCAN_RSP_DATA_RAW_SET_COMPLETE", "ADV_START_COMPLETE", "SCAN_START_COMPLETE", "AUTH_CMPL", "KEY", "SEC_REQ", "PASSKEY_NOTIF", "PASSKEY_REQ", "OOB_REQ", "LOCAL_IR", "LOCAL_ER", "NC_REQ", "ADV_STOP_COMPLETE", "SCAN_STOP_COMPLETE", "SET_STATIC_RAND_ADDR", "UPDATE_CONN_PARAMS", "SET_PKT_LENGTH_COMPLETE", "SET_LOCAL_PRIVACY_COMPLETE", "REMOVE_BOND_DEV_COMPLETE", "CLEAR_BOND_DEV_COMPLETE", "GET_BOND_DEV_COMPLETE", "READ_RSSI_COMPLETE", "UPDATE_WHITELIST_COMPLETE"};
static const char *bt_gap_evt_names[] = { "DISC_RES", "DISC_STATE_CHANGED", "RMT_SRVCS", "RMT_SRVC_REC", "AUTH_CMPL", "PIN_REQ", "CFM_REQ", "KEY_NOTIF", "KEY_REQ", "READ_RSSI_DELTA"};
static const char *ble_addr_type_names[] = {"PUBLIC", "RANDOM", "RPA_PUBLIC", "RPA_RANDOM"};
const char *ble_addr_type_str(esp_ble_addr_type_t ble_addr_type)
{
if (ble_addr_type > BLE_ADDR_TYPE_RPA_RANDOM) {
return "UNKNOWN";
}
return ble_addr_type_names[ble_addr_type];
}
const char *ble_gap_evt_str(uint8_t event)
{
if (event >= SIZEOF_ARRAY(ble_gap_evt_names)) {
return "UNKNOWN";
}
return ble_gap_evt_names[event];
}
const char *bt_gap_evt_str(uint8_t event)
{
if (event >= SIZEOF_ARRAY(bt_gap_evt_names)) {
return "UNKNOWN";
}
return bt_gap_evt_names[event];
}
const char *esp_ble_key_type_str(esp_ble_key_type_t key_type)
{
const char *key_str = NULL;
switch (key_type) {
case ESP_LE_KEY_NONE:
key_str = "ESP_LE_KEY_NONE";
break;
case ESP_LE_KEY_PENC:
key_str = "ESP_LE_KEY_PENC";
break;
case ESP_LE_KEY_PID:
key_str = "ESP_LE_KEY_PID";
break;
case ESP_LE_KEY_PCSRK:
key_str = "ESP_LE_KEY_PCSRK";
break;
case ESP_LE_KEY_PLK:
key_str = "ESP_LE_KEY_PLK";
break;
case ESP_LE_KEY_LLK:
key_str = "ESP_LE_KEY_LLK";
break;
case ESP_LE_KEY_LENC:
key_str = "ESP_LE_KEY_LENC";
break;
case ESP_LE_KEY_LID:
key_str = "ESP_LE_KEY_LID";
break;
case ESP_LE_KEY_LCSRK:
key_str = "ESP_LE_KEY_LCSRK";
break;
default:
key_str = "INVALID BLE KEY TYPE";
break;
}
return key_str;
}
void esp_hid_scan_results_free(esp_hid_scan_result_t *results)
{
esp_hid_scan_result_t *r = NULL;
while (results) {
r = results;
results = results->next;
if (r->name != NULL) {
free((char *)r->name);
}
free(r);
}
}
static esp_hid_scan_result_t *find_scan_result(esp_bd_addr_t bda, esp_hid_scan_result_t *results)
{
esp_hid_scan_result_t *r = results;
while (r) {
if (memcmp(bda, r->bda, sizeof(esp_bd_addr_t)) == 0) {
return r;
}
r = r->next;
}
return NULL;
}
static void add_bt_scan_result(esp_bd_addr_t bda, esp_bt_cod_t *cod, esp_bt_uuid_t *uuid, uint8_t *name, uint8_t name_len, int rssi)
{
esp_hid_scan_result_t *r = find_scan_result(bda, bt_scan_results);
if (r) {
//Some info may come later
if (r->name == NULL && name && name_len) {
char *name_s = (char *)malloc(name_len + 1);
if (name_s == NULL) {
ESP_LOGE(TAG, "Malloc result name failed!");
return;
}
memcpy(name_s, name, name_len);
name_s[name_len] = 0;
r->name = (const char *)name_s;
}
if (r->bt.uuid.len == 0 && uuid->len) {
memcpy(&r->bt.uuid, uuid, sizeof(esp_bt_uuid_t));
}
if (rssi != 0) {
r->rssi = rssi;
}
return;
}
r = (esp_hid_scan_result_t *)malloc(sizeof(esp_hid_scan_result_t));
if (r == NULL) {
ESP_LOGE(TAG, "Malloc bt_hidh_scan_result_t failed!");
return;
}
r->transport = ESP_HID_TRANSPORT_BT;
memcpy(r->bda, bda, sizeof(esp_bd_addr_t));
memcpy(&r->bt.cod, cod, sizeof(esp_bt_cod_t));
memcpy(&r->bt.uuid, uuid, sizeof(esp_bt_uuid_t));
r->usage = esp_hid_usage_from_cod((uint32_t)cod);
r->rssi = rssi;
r->name = NULL;
if (name_len && name) {
char *name_s = (char *)malloc(name_len + 1);
if (name_s == NULL) {
free(r);
ESP_LOGE(TAG, "Malloc result name failed!");
return;
}
memcpy(name_s, name, name_len);
name_s[name_len] = 0;
r->name = (const char *)name_s;
}
r->next = bt_scan_results;
bt_scan_results = r;
num_bt_scan_results++;
}
static void add_ble_scan_result(esp_bd_addr_t bda, esp_ble_addr_type_t addr_type, uint16_t appearance, uint8_t *name, uint8_t name_len, int rssi)
{
if (find_scan_result(bda, ble_scan_results)) {
ESP_LOGW(TAG, "Result already exists!");
return;
}
esp_hid_scan_result_t *r = (esp_hid_scan_result_t *)malloc(sizeof(esp_hid_scan_result_t));
if (r == NULL) {
ESP_LOGE(TAG, "Malloc ble_hidh_scan_result_t failed!");
return;
}
r->transport = ESP_HID_TRANSPORT_BLE;
memcpy(r->bda, bda, sizeof(esp_bd_addr_t));
r->ble.appearance = appearance;
r->ble.addr_type = addr_type;
r->usage = esp_hid_usage_from_appearance(appearance);
r->rssi = rssi;
r->name = NULL;
if (name_len && name) {
char *name_s = (char *)malloc(name_len + 1);
if (name_s == NULL) {
free(r);
ESP_LOGE(TAG, "Malloc result name failed!");
return;
}
memcpy(name_s, name, name_len);
name_s[name_len] = 0;
r->name = (const char *)name_s;
}
r->next = ble_scan_results;
ble_scan_results = r;
num_ble_scan_results++;
}
void print_uuid(esp_bt_uuid_t *uuid)
{
if (uuid->len == ESP_UUID_LEN_16) {
GAP_DBG_PRINTF("UUID16: 0x%04x", uuid->uuid.uuid16);
} else if (uuid->len == ESP_UUID_LEN_32) {
GAP_DBG_PRINTF("UUID32: 0x%08x", uuid->uuid.uuid32);
} else if (uuid->len == ESP_UUID_LEN_128) {
GAP_DBG_PRINTF("UUID128: %02x,%02x,%02x,%02x,%02x,%02x,%02x,%02x,%02x,%02x,%02x,%02x,%02x,%02x,%02x,%02x", uuid->uuid.uuid128[0],
uuid->uuid.uuid128[1], uuid->uuid.uuid128[2], uuid->uuid.uuid128[3],
uuid->uuid.uuid128[4], uuid->uuid.uuid128[5], uuid->uuid.uuid128[6],
uuid->uuid.uuid128[7], uuid->uuid.uuid128[8], uuid->uuid.uuid128[9],
uuid->uuid.uuid128[10], uuid->uuid.uuid128[11], uuid->uuid.uuid128[12],
uuid->uuid.uuid128[13], uuid->uuid.uuid128[14], uuid->uuid.uuid128[15]);
}
}
static void handle_bt_device_result(struct disc_res_param *disc_res)
{
GAP_DBG_PRINTF("BT : " ESP_BD_ADDR_STR, ESP_BD_ADDR_HEX(disc_res->bda));
uint32_t codv = 0;
esp_bt_cod_t *cod = (esp_bt_cod_t *)&codv;
int8_t rssi = 0;
uint8_t *name = NULL;
uint8_t name_len = 0;
esp_bt_uuid_t uuid;
uuid.len = ESP_UUID_LEN_16;
uuid.uuid.uuid16 = 0;
for (int i = 0; i < disc_res->num_prop; i++) {
esp_bt_gap_dev_prop_t *prop = &disc_res->prop[i];
if (prop->type != ESP_BT_GAP_DEV_PROP_EIR) {
GAP_DBG_PRINTF(", %s: ", gap_bt_prop_type_names[prop->type]);
}
if (prop->type == ESP_BT_GAP_DEV_PROP_BDNAME) {
name = (uint8_t *)prop->val;
name_len = strlen((const char *)name);
GAP_DBG_PRINTF("%s", (const char *)name);
} else if (prop->type == ESP_BT_GAP_DEV_PROP_RSSI) {
rssi = *((int8_t *)prop->val);
GAP_DBG_PRINTF("%d", rssi);
} else if (prop->type == ESP_BT_GAP_DEV_PROP_COD) {
memcpy(&codv, prop->val, sizeof(uint32_t));
GAP_DBG_PRINTF("major: %s, minor: %d, service: 0x%03x", esp_hid_cod_major_str(cod->major), cod->minor, cod->service);
} else if (prop->type == ESP_BT_GAP_DEV_PROP_EIR) {
uint8_t len = 0;
uint8_t *data = 0;
data = esp_bt_gap_resolve_eir_data((uint8_t *)prop->val, ESP_BT_EIR_TYPE_CMPL_16BITS_UUID, &len);
if (data == NULL) {
data = esp_bt_gap_resolve_eir_data((uint8_t *)prop->val, ESP_BT_EIR_TYPE_INCMPL_16BITS_UUID, &len);
}
if (data && len == ESP_UUID_LEN_16) {
uuid.len = ESP_UUID_LEN_16;
uuid.uuid.uuid16 = data[0] + (data[1] << 8);
GAP_DBG_PRINTF(", "); print_uuid(&uuid);
continue;
}
data = esp_bt_gap_resolve_eir_data((uint8_t *)prop->val, ESP_BT_EIR_TYPE_CMPL_32BITS_UUID, &len);
if (data == NULL) {
data = esp_bt_gap_resolve_eir_data((uint8_t *)prop->val, ESP_BT_EIR_TYPE_INCMPL_32BITS_UUID, &len);
}
if (data && len == ESP_UUID_LEN_32) {
uuid.len = len;
memcpy(&uuid.uuid.uuid32, data, sizeof(uint32_t));
GAP_DBG_PRINTF(", "); print_uuid(&uuid);
continue;
}
data = esp_bt_gap_resolve_eir_data((uint8_t *)prop->val, ESP_BT_EIR_TYPE_CMPL_128BITS_UUID, &len);
if (data == NULL) {
data = esp_bt_gap_resolve_eir_data((uint8_t *)prop->val, ESP_BT_EIR_TYPE_INCMPL_128BITS_UUID, &len);
}
if (data && len == ESP_UUID_LEN_128) {
uuid.len = len;
memcpy(uuid.uuid.uuid128, (uint8_t *)data, len);
GAP_DBG_PRINTF(", "); print_uuid(&uuid);
continue;
}
//try to find a name
if (name == NULL) {
data = esp_bt_gap_resolve_eir_data((uint8_t *)prop->val, ESP_BT_EIR_TYPE_CMPL_LOCAL_NAME, &len);
if (data == NULL) {
data = esp_bt_gap_resolve_eir_data((uint8_t *)prop->val, ESP_BT_EIR_TYPE_SHORT_LOCAL_NAME, &len);
}
if (data && len) {
name = data;
name_len = len;
GAP_DBG_PRINTF(", NAME: ");
for (int x = 0; x < len; x++) {
GAP_DBG_PRINTF("%c", (char)data[x]);
}
}
}
}
}
GAP_DBG_PRINTF("\n");
if (cod->major == ESP_BT_COD_MAJOR_DEV_PERIPHERAL || (find_scan_result(disc_res->bda, bt_scan_results) != NULL)) {
add_bt_scan_result(disc_res->bda, cod, &uuid, name, name_len, rssi);
}
}
static void handle_ble_device_result(struct ble_scan_result_evt_param *scan_rst)
{
uint16_t uuid = 0;
uint16_t appearance = 0;
char name[64] = {0};
uint8_t uuid_len = 0;
uint8_t *uuid_d = esp_ble_resolve_adv_data(scan_rst->ble_adv, ESP_BLE_AD_TYPE_16SRV_CMPL, &uuid_len);
if (uuid_d != NULL && uuid_len) {
uuid = uuid_d[0] + (uuid_d[1] << 8);
}
uint8_t appearance_len = 0;
uint8_t *appearance_d = esp_ble_resolve_adv_data(scan_rst->ble_adv, ESP_BLE_AD_TYPE_APPEARANCE, &appearance_len);
if (appearance_d != NULL && appearance_len) {
appearance = appearance_d[0] + (appearance_d[1] << 8);
}
uint8_t adv_name_len = 0;
uint8_t *adv_name = esp_ble_resolve_adv_data(scan_rst->ble_adv, ESP_BLE_AD_TYPE_NAME_CMPL, &adv_name_len);
if (adv_name == NULL) {
adv_name = esp_ble_resolve_adv_data(scan_rst->ble_adv, ESP_BLE_AD_TYPE_NAME_SHORT, &adv_name_len);
}
if (adv_name != NULL && adv_name_len) {
memcpy(name, adv_name, adv_name_len);
name[adv_name_len] = 0;
}
GAP_DBG_PRINTF("BLE: " ESP_BD_ADDR_STR ", ", ESP_BD_ADDR_HEX(scan_rst->bda));
GAP_DBG_PRINTF("RSSI: %d, ", scan_rst->rssi);
GAP_DBG_PRINTF("UUID: 0x%04x, ", uuid);
GAP_DBG_PRINTF("APPEARANCE: 0x%04x, ", appearance);
GAP_DBG_PRINTF("ADDR_TYPE: '%s'", ble_addr_type_str(scan_rst->ble_addr_type));
if (adv_name_len) {
GAP_DBG_PRINTF(", NAME: '%s'", name);
}
GAP_DBG_PRINTF("\n");
if (uuid == ESP_GATT_UUID_HID_SVC) {
add_ble_scan_result(scan_rst->bda, scan_rst->ble_addr_type, appearance, adv_name, adv_name_len, scan_rst->rssi);
}
}
/*
* BT GAP
* */
static void bt_gap_event_handler(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *param)
{
switch (event) {
case ESP_BT_GAP_DISC_STATE_CHANGED_EVT: {
ESP_LOGV(TAG, "BT GAP DISC_STATE %s", (param->disc_st_chg.state == ESP_BT_GAP_DISCOVERY_STARTED) ? "START" : "STOP");
if (param->disc_st_chg.state == ESP_BT_GAP_DISCOVERY_STOPPED) {
SEND_BT_CB();
}
break;
}
case ESP_BT_GAP_DISC_RES_EVT: {
handle_bt_device_result(&param->disc_res);
break;
}
case ESP_BT_GAP_KEY_NOTIF_EVT:
ESP_LOGI(TAG, "BT GAP KEY_NOTIF passkey:%d", param->key_notif.passkey);
break;
default:
ESP_LOGV(TAG, "BT GAP EVENT %s", bt_gap_evt_str(event));
break;
}
}
static esp_err_t init_bt_gap(void)
{
esp_err_t ret;
esp_bt_sp_param_t param_type = ESP_BT_SP_IOCAP_MODE;
esp_bt_io_cap_t iocap = ESP_BT_IO_CAP_IO;
esp_bt_gap_set_security_param(param_type, &iocap, sizeof(uint8_t));
/*
* Set default parameters for Legacy Pairing
* Use fixed pin code
*/
esp_bt_pin_type_t pin_type = ESP_BT_PIN_TYPE_FIXED;
esp_bt_pin_code_t pin_code;
pin_code[0] = '1';
pin_code[1] = '2';
pin_code[2] = '3';
pin_code[3] = '4';
esp_bt_gap_set_pin(pin_type, 4, pin_code);
if ((ret = esp_bt_gap_register_callback(bt_gap_event_handler)) != ESP_OK) {
ESP_LOGE(TAG, "esp_bt_gap_register_callback failed: %d", ret);
return ret;
}
// Allow BT devices to connect back to us
if ((ret = esp_bt_gap_set_scan_mode(ESP_BT_CONNECTABLE, ESP_BT_NON_DISCOVERABLE)) != ESP_OK) {
ESP_LOGE(TAG, "esp_bt_gap_set_scan_mode failed: %d", ret);
return ret;
}
return ret;
}
static esp_err_t start_bt_scan(uint32_t seconds)
{
esp_err_t ret = ESP_OK;
if ((ret = esp_bt_gap_start_discovery(ESP_BT_INQ_MODE_GENERAL_INQUIRY, (int)(seconds / 1.28), 0)) != ESP_OK) {
ESP_LOGE(TAG, "esp_bt_gap_start_discovery failed: %d", ret);
return ret;
}
return ret;
}
/*
* BLE GAP
* */
static void ble_gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param)
{
switch (event) {
/*
* SCAN
* */
case ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT: {
ESP_LOGV(TAG, "BLE GAP EVENT SCAN_PARAM_SET_COMPLETE");
SEND_BLE_CB();
break;
}
case ESP_GAP_BLE_SCAN_RESULT_EVT: {
esp_ble_gap_cb_param_t *scan_result = (esp_ble_gap_cb_param_t *)param;
switch (scan_result->scan_rst.search_evt) {
case ESP_GAP_SEARCH_INQ_RES_EVT: {
handle_ble_device_result(&scan_result->scan_rst);
break;
}
case ESP_GAP_SEARCH_INQ_CMPL_EVT:
ESP_LOGV(TAG, "BLE GAP EVENT SCAN DONE: %d", scan_result->scan_rst.num_resps);
SEND_BLE_CB();
break;
default:
break;
}
break;
}
case ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT: {
ESP_LOGV(TAG, "BLE GAP EVENT SCAN CANCELED");
break;
}
/*
* ADVERTISEMENT
* */
case ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT:
ESP_LOGV(TAG, "BLE GAP ADV_DATA_SET_COMPLETE");
break;
case ESP_GAP_BLE_ADV_START_COMPLETE_EVT:
ESP_LOGV(TAG, "BLE GAP ADV_START_COMPLETE");
break;
/*
* AUTHENTICATION
* */
case ESP_GAP_BLE_AUTH_CMPL_EVT:
if (!param->ble_security.auth_cmpl.success) {
ESP_LOGE(TAG, "BLE GAP AUTH ERROR: 0x%x", param->ble_security.auth_cmpl.fail_reason);
} else {
ESP_LOGI(TAG, "BLE GAP AUTH SUCCESS");
}
break;
case ESP_GAP_BLE_KEY_EVT: //shows the ble key info share with peer device to the user.
ESP_LOGI(TAG, "BLE GAP KEY type = %s", esp_ble_key_type_str(param->ble_security.ble_key.key_type));
break;
case ESP_GAP_BLE_PASSKEY_NOTIF_EVT: // ESP_IO_CAP_OUT
// The app will receive this evt when the IO has Output capability and the peer device IO has Input capability.
// Show the passkey number to the user to input it in the peer device.
ESP_LOGI(TAG, "BLE GAP PASSKEY_NOTIF passkey:%d", param->ble_security.key_notif.passkey);
break;
case ESP_GAP_BLE_NC_REQ_EVT: // ESP_IO_CAP_IO
// The app will receive this event when the IO has DisplayYesNO capability and the peer device IO also has DisplayYesNo capability.
// show the passkey number to the user to confirm it with the number displayed by peer device.
ESP_LOGI(TAG, "BLE GAP NC_REQ passkey:%d", param->ble_security.key_notif.passkey);
esp_ble_confirm_reply(param->ble_security.key_notif.bd_addr, true);
break;
case ESP_GAP_BLE_PASSKEY_REQ_EVT: // ESP_IO_CAP_IN
// The app will receive this evt when the IO has Input capability and the peer device IO has Output capability.
// See the passkey number on the peer device and send it back.
ESP_LOGI(TAG, "BLE GAP PASSKEY_REQ");
//esp_ble_passkey_reply(param->ble_security.ble_req.bd_addr, true, 1234);
break;
case ESP_GAP_BLE_SEC_REQ_EVT:
ESP_LOGI(TAG, "BLE GAP SEC_REQ");
// Send the positive(true) security response to the peer device to accept the security request.
// If not accept the security request, should send the security response with negative(false) accept value.
esp_ble_gap_security_rsp(param->ble_security.ble_req.bd_addr, true);
break;
default:
ESP_LOGV(TAG, "BLE GAP EVENT %s", ble_gap_evt_str(event));
break;
}
}
static esp_err_t init_ble_gap(void)
{
esp_err_t ret;
if ((ret = esp_ble_gap_register_callback(ble_gap_event_handler)) != ESP_OK) {
ESP_LOGE(TAG, "esp_ble_gap_register_callback failed: %d", ret);
return ret;
}
return ret;
}
static esp_ble_scan_params_t hid_scan_params = {
.scan_type = BLE_SCAN_TYPE_ACTIVE,
.own_addr_type = BLE_ADDR_TYPE_PUBLIC,
.scan_filter_policy = BLE_SCAN_FILTER_ALLOW_ALL,
.scan_interval = 0x50,
.scan_window = 0x30,
.scan_duplicate = BLE_SCAN_DUPLICATE_ENABLE,
};
static esp_err_t start_ble_scan(uint32_t seconds)
{
esp_err_t ret = ESP_OK;
if ((ret = esp_ble_gap_set_scan_params(&hid_scan_params)) != ESP_OK) {
ESP_LOGE(TAG, "esp_ble_gap_set_scan_params failed: %d", ret);
return ret;
}
WAIT_BLE_CB();
if ((ret = esp_ble_gap_start_scanning(seconds)) != ESP_OK) {
ESP_LOGE(TAG, "esp_ble_gap_start_scanning failed: %d", ret);
return ret;
}
return ret;
}
esp_err_t esp_hid_ble_gap_adv_init(uint16_t appearance, const char *device_name)
{
esp_err_t ret;
const uint8_t hidd_service_uuid128[] = {
0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0x12, 0x18, 0x00, 0x00,
};
esp_ble_adv_data_t ble_adv_data = {
.set_scan_rsp = false,
.include_name = true,
.include_txpower = true,
.min_interval = 0x0006, //slave connection min interval, Time = min_interval * 1.25 msec
.max_interval = 0x0010, //slave connection max interval, Time = max_interval * 1.25 msec
.appearance = appearance,
.manufacturer_len = 0,
.p_manufacturer_data = NULL,
.service_data_len = 0,
.p_service_data = NULL,
.service_uuid_len = sizeof(hidd_service_uuid128),
.p_service_uuid = (uint8_t *)hidd_service_uuid128,
.flag = 0x6,
};
esp_ble_auth_req_t auth_req = ESP_LE_AUTH_REQ_SC_MITM_BOND;
//esp_ble_io_cap_t iocap = ESP_IO_CAP_OUT;//you have to enter the key on the host
//esp_ble_io_cap_t iocap = ESP_IO_CAP_IN;//you have to enter the key on the device
esp_ble_io_cap_t iocap = ESP_IO_CAP_IO;//you have to agree that key matches on both
//esp_ble_io_cap_t iocap = ESP_IO_CAP_NONE;//device is not capable of input or output, unsecure
uint8_t init_key = ESP_BLE_ENC_KEY_MASK | ESP_BLE_ID_KEY_MASK;
uint8_t rsp_key = ESP_BLE_ENC_KEY_MASK | ESP_BLE_ID_KEY_MASK;
uint8_t key_size = 16; //the key size should be 7~16 bytes
uint32_t passkey = 1234;//ESP_IO_CAP_OUT
if ((ret = esp_ble_gap_set_security_param(ESP_BLE_SM_AUTHEN_REQ_MODE, &auth_req, 1)) != ESP_OK) {
ESP_LOGE(TAG, "GAP set_security_param AUTHEN_REQ_MODE failed: %d", ret);
return ret;
}
if ((ret = esp_ble_gap_set_security_param(ESP_BLE_SM_IOCAP_MODE, &iocap, 1)) != ESP_OK) {
ESP_LOGE(TAG, "GAP set_security_param IOCAP_MODE failed: %d", ret);
return ret;
}
if ((ret = esp_ble_gap_set_security_param(ESP_BLE_SM_SET_INIT_KEY, &init_key, 1)) != ESP_OK) {
ESP_LOGE(TAG, "GAP set_security_param SET_INIT_KEY failed: %d", ret);
return ret;
}
if ((ret = esp_ble_gap_set_security_param(ESP_BLE_SM_SET_RSP_KEY, &rsp_key, 1)) != ESP_OK) {
ESP_LOGE(TAG, "GAP set_security_param SET_RSP_KEY failed: %d", ret);
return ret;
}
if ((ret = esp_ble_gap_set_security_param(ESP_BLE_SM_MAX_KEY_SIZE, &key_size, 1)) != ESP_OK) {
ESP_LOGE(TAG, "GAP set_security_param MAX_KEY_SIZE failed: %d", ret);
return ret;
}
if ((ret = esp_ble_gap_set_security_param(ESP_BLE_SM_SET_STATIC_PASSKEY, &passkey, sizeof(uint32_t))) != ESP_OK) {
ESP_LOGE(TAG, "GAP set_security_param SET_STATIC_PASSKEY failed: %d", ret);
return ret;
}
if ((ret = esp_ble_gap_set_device_name(device_name)) != ESP_OK) {
ESP_LOGE(TAG, "GAP set_device_name failed: %d", ret);
return ret;
}
if ((ret = esp_ble_gap_config_adv_data(&ble_adv_data)) != ESP_OK) {
ESP_LOGE(TAG, "GAP config_adv_data failed: %d", ret);
return ret;
}
return ret;
}
esp_err_t esp_hid_ble_gap_adv_start(void)
{
static esp_ble_adv_params_t hidd_adv_params = {
.adv_int_min = 0x20,
.adv_int_max = 0x30,
.adv_type = ADV_TYPE_IND,
.own_addr_type = BLE_ADDR_TYPE_PUBLIC,
.channel_map = ADV_CHNL_ALL,
.adv_filter_policy = ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY,
};
return esp_ble_gap_start_advertising(&hidd_adv_params);
}
/*
* CONTROLLER INIT
* */
static esp_err_t init_low_level(uint8_t mode)
{
esp_err_t ret;
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
if (mode & ESP_BT_MODE_CLASSIC_BT) {
bt_cfg.mode = mode;
bt_cfg.bt_max_acl_conn = 3;
bt_cfg.bt_max_sync_conn = 3;
} else {
ret = esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT);
if (ret) {
ESP_LOGE(TAG, "esp_bt_controller_mem_release failed: %d", ret);
return ret;
}
}
ret = esp_bt_controller_init(&bt_cfg);
if (ret) {
ESP_LOGE(TAG, "esp_bt_controller_init failed: %d", ret);
return ret;
}
ret = esp_bt_controller_enable(mode);
if (ret) {
ESP_LOGE(TAG, "esp_bt_controller_enable failed: %d", ret);
return ret;
}
ret = esp_bluedroid_init();
if (ret) {
ESP_LOGE(TAG, "esp_bluedroid_init failed: %d", ret);
return ret;
}
ret = esp_bluedroid_enable();
if (ret) {
ESP_LOGE(TAG, "esp_bluedroid_enable failed: %d", ret);
return ret;
}
if (mode & ESP_BT_MODE_CLASSIC_BT) {
ret = init_bt_gap();
if (ret) {
return ret;
}
}
if (mode & ESP_BT_MODE_BLE) {
ret = init_ble_gap();
if (ret) {
return ret;
}
}
return ret;
}
esp_err_t esp_hid_gap_init(uint8_t mode)
{
esp_err_t ret;
if (!mode || mode > ESP_BT_MODE_BTDM) {
ESP_LOGE(TAG, "Invalid mode given!");
return ESP_FAIL;
}
if (bt_hidh_cb_semaphore != NULL) {
ESP_LOGE(TAG, "Already initialised");
return ESP_FAIL;
}
bt_hidh_cb_semaphore = xSemaphoreCreateBinary();
if (bt_hidh_cb_semaphore == NULL) {
ESP_LOGE(TAG, "xSemaphoreCreateMutex failed!");
return ESP_FAIL;
}
ble_hidh_cb_semaphore = xSemaphoreCreateBinary();
if (ble_hidh_cb_semaphore == NULL) {
ESP_LOGE(TAG, "xSemaphoreCreateMutex failed!");
vSemaphoreDelete(bt_hidh_cb_semaphore);
bt_hidh_cb_semaphore = NULL;
return ESP_FAIL;
}
ret = init_low_level(mode);
if (ret != ESP_OK) {
vSemaphoreDelete(bt_hidh_cb_semaphore);
bt_hidh_cb_semaphore = NULL;
vSemaphoreDelete(ble_hidh_cb_semaphore);
ble_hidh_cb_semaphore = NULL;
return ret;
}
return ESP_OK;
}
esp_err_t esp_hid_scan(uint32_t seconds, size_t *num_results, esp_hid_scan_result_t **results)
{
if (num_bt_scan_results || bt_scan_results || num_ble_scan_results || ble_scan_results) {
ESP_LOGE(TAG, "There are old scan results. Free them first!");
return ESP_FAIL;
}
if (start_ble_scan(seconds) == ESP_OK) {
if (start_bt_scan(seconds) == ESP_OK) {
WAIT_BT_CB();
}
WAIT_BLE_CB();
} else {
return ESP_FAIL;
}
*num_results = num_bt_scan_results + num_ble_scan_results;
*results = bt_scan_results;
if (num_bt_scan_results) {
while (bt_scan_results->next != NULL) {
bt_scan_results = bt_scan_results->next;
}
bt_scan_results->next = ble_scan_results;
} else {
*results = ble_scan_results;
}
num_bt_scan_results = 0;
bt_scan_results = NULL;
num_ble_scan_results = 0;
ble_scan_results = NULL;
return ESP_OK;
}

68
main/esp_hid_gap.h Normal file
View File

@ -0,0 +1,68 @@
// Copyright 2017-2019 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef _ESP_HID_GAP_H_
#define _ESP_HID_GAP_H_
#include "esp_err.h"
#include "esp_log.h"
#include "esp_bt.h"
#include "esp_bt_defs.h"
#include "esp_bt_main.h"
#include "esp_gattc_api.h"
#include "esp_gatt_defs.h"
#include "esp_gap_ble_api.h"
#include "esp_gap_bt_api.h"
#include "esp_hid_common.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct esp_hidh_scan_result_s {
struct esp_hidh_scan_result_s *next;
esp_bd_addr_t bda;
const char *name;
int8_t rssi;
esp_hid_usage_t usage;
esp_hid_transport_t transport; //BT, BLE or USB
union {
struct {
esp_bt_cod_t cod;
esp_bt_uuid_t uuid;
} bt;
struct {
esp_ble_addr_type_t addr_type;
uint16_t appearance;
} ble;
};
} esp_hid_scan_result_t;
esp_err_t esp_hid_gap_init(uint8_t mode);
esp_err_t esp_hid_scan(uint32_t seconds, size_t *num_results, esp_hid_scan_result_t **results);
void esp_hid_scan_results_free(esp_hid_scan_result_t *results);
esp_err_t esp_hid_ble_gap_adv_init(uint16_t appearance, const char *device_name);
esp_err_t esp_hid_ble_gap_adv_start(void);
void print_uuid(esp_bt_uuid_t *uuid);
const char *ble_addr_type_str(esp_ble_addr_type_t ble_addr_type);
#ifdef __cplusplus
}
#endif
#endif /* _ESP_HIDH_GAP_H_ */

28
main/gpio.c Normal file
View File

@ -0,0 +1,28 @@
/* Hello World Example
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <stdio.h>
#include "driver/gpio.h"
#include "sdkconfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "esp_spi_flash.h"
#include "gpio.h"
void gpio_init(void) {
gpio_reset_pin(GREENLED_GPIO);
gpio_set_direction(GREENLED_GPIO, GPIO_MODE_OUTPUT);
/* do a half second blink for debug mode */
gpio_set_level(GREENLED_GPIO, 1);
vTaskDelay(500 / portTICK_PERIOD_MS);
gpio_set_level(GREENLED_GPIO, 0);
vTaskDelay(500 / portTICK_PERIOD_MS);
}

64
main/gpio.h Normal file
View File

@ -0,0 +1,64 @@
/*
* gpio.h
* quack
*
* Created by Michel DEPEIGE on 13/09/2020.
* Copyright (c) 2020 Michel DEPEIGE.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
* Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
*/
#ifndef GPIO_H
#define GPIO_H
/* prototypes */
void gpio_init(void);
/* GPIO pins definitions
*
* pin layout is compatible with ESP32-CAM module for prototyping
* LEDs aren't avaible on ESP32-CAM but DEBUG LED (Camera connector)
*
* on ESP32-CAM the following pins are already used:
* - CSI_MCLK (GPIO0)
* - U0TXD (GPIO1)
* - U0TXD (GPIO3)
* - FLASH (GPIO4)
*
* on ESP32-PICO-D4, the following pins are used for connecting the
* embedded flash:
* - CLK (GPIO6)
* - SD0 (GPIO7)
* - SD1 (GPIO8)
* - CMD (GPIO11)
* - GPIO16
* - GPIO17
*/
#define ADB_GPIO 4
#define CLICK_HPIO 2
#define QX1_GPIO 12
#define QX2_GPIO 13
#define QY1_GPIO 14
#define QY2_GPIO 15
#define GREENLED_GPIO 21
#define BLUELED_GPIO 25
#define YELLOWLED_GPIO 26
#define REDLED_GPIO 27
#endif

42
main/main.c Normal file
View File

@ -0,0 +1,42 @@
/* Hello World Example
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <stdio.h>
#include "driver/gpio.h"
#include "sdkconfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"
#include "esp_system.h"
#include "esp_spi_flash.h"
#include "blue.h"
#include "gpio.h"
static const char* TAG = "quack";
void app_main(void)
{
/* Print chip information */
esp_chip_info_t chip_info;
esp_chip_info(&chip_info);
ESP_LOGI(TAG, "This is %s chip with %d CPU cores, WiFi%s%s, "
"revision %d, %dMB %s flash",
CONFIG_IDF_TARGET,
chip_info.cores,
(chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "",
(chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : "",
chip_info.revision,
spi_flash_get_chip_size() / (1024 * 1024),
(chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external");
ESP_LOGI(TAG, "Minimum free heap size: %d bytes", esp_get_minimum_free_heap_size());
gpio_init();
blue_init();
}

1622
sdkconfig Normal file

File diff suppressed because it is too large Load Diff