Upgrade to Ergogen v4 (#25)
* Upgrade to Ergogen v4 and its new positioning / offset rules * Make Samoklava a "bundle" that includes all of its custom footprints
This commit is contained in:
parent
fc3018e56b
commit
571c693253
2
Makefile
2
Makefile
|
|
@ -10,7 +10,7 @@ setup:
|
|||
npm install
|
||||
|
||||
# outputs from
|
||||
output/pcbs/board.kicad_pcb output/pcbs/top_plate.kicad_pcb output/pcbs/bottom_plate.kicad_pcb &: samoklava.yaml
|
||||
output/pcbs/board.kicad_pcb output/pcbs/top_plate.kicad_pcb output/pcbs/bottom_plate.kicad_pcb &: config.yaml
|
||||
npm run gen
|
||||
|
||||
output/pcbs/%.dsn: output/pcbs/%.kicad_pcb
|
||||
|
|
|
|||
|
|
@ -0,0 +1,408 @@
|
|||
meta:
|
||||
engine: 4.0.4
|
||||
name: samoklava
|
||||
version: 0.3
|
||||
author: soundmonnster
|
||||
url: https://github.com/soundmonster/samoklava
|
||||
units:
|
||||
kx: cx
|
||||
ky: cy
|
||||
px: 2
|
||||
py: 2
|
||||
points:
|
||||
key:
|
||||
footprints:
|
||||
choc_hotswap:
|
||||
type: choc
|
||||
params:
|
||||
hotswap: true
|
||||
reverse: true
|
||||
keycaps: true
|
||||
nets:
|
||||
from: =colrow
|
||||
to: =column_net
|
||||
diode:
|
||||
type: diode
|
||||
nets:
|
||||
from: =colrow
|
||||
to: =row_net
|
||||
anchor:
|
||||
shift: [0, -5]
|
||||
zones:
|
||||
matrix:
|
||||
key.padding: ky
|
||||
columns:
|
||||
pinky:
|
||||
key:
|
||||
stagger: 0 ky
|
||||
spread: kx
|
||||
column_net: col_pinky
|
||||
ring:
|
||||
key:
|
||||
stagger: 0.7 ky
|
||||
spread: kx
|
||||
column_net: col_ring
|
||||
middle:
|
||||
key:
|
||||
stagger: 0.2 ky
|
||||
spread: kx
|
||||
column_net: col_middle
|
||||
index:
|
||||
key:
|
||||
stagger: -0.2 ky
|
||||
spread: kx
|
||||
column_net: col_index
|
||||
inner:
|
||||
key:
|
||||
stagger: -0.1 ky
|
||||
spread: kx
|
||||
column_net: col_inner
|
||||
rows:
|
||||
bottom:
|
||||
row_net: row_bottom
|
||||
home:
|
||||
row_net: row_home
|
||||
top:
|
||||
row_net: row_top
|
||||
thumbfan:
|
||||
anchor:
|
||||
ref: matrix_inner_bottom
|
||||
shift: [-0.5 kx, -1 ky]
|
||||
columns:
|
||||
near:
|
||||
key:
|
||||
spread: kx
|
||||
splay: -15
|
||||
origin: [-0.5 kx, -0.5 ky]
|
||||
column_net: col_middle
|
||||
home:
|
||||
key:
|
||||
spread: kx
|
||||
splay: -15
|
||||
origin: [-0.5 kx, -0.5 ky]
|
||||
column_net: col_index
|
||||
far:
|
||||
key:
|
||||
spread: kx
|
||||
splay: -15
|
||||
origin: [-0.5 kx, -0.5 ky]
|
||||
column_net: col_inner
|
||||
rows:
|
||||
thumb:
|
||||
row_net: row_thumb
|
||||
outlines:
|
||||
# board dimensions according to JLCPCB: 122.28 mm x 101.05 mm
|
||||
raw:
|
||||
- what: rectangle
|
||||
where: true
|
||||
asym: source
|
||||
size: [kx + px, ky + py]
|
||||
corner: px
|
||||
thumbfan_glue:
|
||||
- what: polygon
|
||||
points:
|
||||
- ref: matrix_inner_bottom
|
||||
shift: [0.5 kx + 0.5px, -0.5 ky + 0.5 py]
|
||||
- ref: thumbfan_far_thumb
|
||||
shift: [0.5 kx - 0.5px, 0.5 ky + 0.5 py]
|
||||
- ref: thumbfan_far_thumb
|
||||
shift: [0.5 kx - 0.5px, -0.5 ky - 0.5 py]
|
||||
- ref: thumbfan_near_thumb
|
||||
shift: [-0.5 kx + 0.5 px, -0.5 ky - 0.5 py]
|
||||
- ref: matrix_pinky_bottom
|
||||
shift: [0.5 kx - 0.5 py, -0.5 ky - 0.5 py]
|
||||
- ref: matrix_pinky_home
|
||||
- ref: matrix_inner_home
|
||||
patch_outer:
|
||||
- what: polygon
|
||||
points:
|
||||
- ref: matrix_ring_top
|
||||
- ref: matrix_ring_bottom
|
||||
- ref: matrix_pinky_bottom
|
||||
shift: [-0.5 (kx + px), 0]
|
||||
- ref: matrix_pinky_top
|
||||
shift: [-0.5 (kx + px), 0]
|
||||
patch_inner:
|
||||
- what: polygon
|
||||
points:
|
||||
- ref: matrix_inner_top
|
||||
shift: [0.5 (kx + px), 0]
|
||||
- ref: matrix_inner_bottom
|
||||
shift: [0.5 (kx + px), 0]
|
||||
- ref: matrix_index_bottom
|
||||
- ref: matrix_index_top
|
||||
controller_area:
|
||||
- what: rectangle
|
||||
where:
|
||||
- ref: matrix_inner_top
|
||||
# re-tranalte to new anchor position
|
||||
shift: [32/2 + 0 kx, 76.5/2 - 4.05 ky]
|
||||
size: [32, 76.5]
|
||||
corner: px
|
||||
switches:
|
||||
- what: rectangle
|
||||
where: true
|
||||
asym: source
|
||||
size: 14
|
||||
keycaps:
|
||||
- what: rectangle
|
||||
where: true
|
||||
asym: source
|
||||
size: [kx, ky]
|
||||
corner: 1
|
||||
keywell:
|
||||
- "raw"
|
||||
- "+patch_inner"
|
||||
- "+patch_outer"
|
||||
- "+thumbfan_glue"
|
||||
base_outline:
|
||||
- "keywell"
|
||||
- "+controller_area"
|
||||
screw_holes:
|
||||
top_left:
|
||||
what: circle
|
||||
where:
|
||||
- ref: matrix_ring_home
|
||||
shift: [-0.5 kx, 0 ky]
|
||||
radius: 1.05
|
||||
bottom_left:
|
||||
what: circle
|
||||
where:
|
||||
- ref: matrix_pinky_bottom
|
||||
shift: [0.5 kx, 0]
|
||||
radius: 1.05
|
||||
top_right:
|
||||
what: circle
|
||||
where:
|
||||
- ref: matrix_inner_top
|
||||
shift: [-0.5 kx, 0]
|
||||
radius: 1.05
|
||||
palm:
|
||||
what: circle
|
||||
where:
|
||||
- ref: matrix_index_bottom
|
||||
shift: [0, -1.06 ky]
|
||||
radius: 1.05
|
||||
thumb:
|
||||
what: circle
|
||||
where:
|
||||
- ref: thumbfan_far_thumb
|
||||
shift: [-0.55 kx, 0]
|
||||
radius: 1.05
|
||||
mounting_holes:
|
||||
$extends: outlines.screw_holes
|
||||
top_left:
|
||||
radius: 2.05
|
||||
bottom_left:
|
||||
radius: 2.05
|
||||
top_right:
|
||||
radius: 2.05
|
||||
palm:
|
||||
radius: 2.05
|
||||
thumb:
|
||||
radius: 2.05
|
||||
bottom_outline:
|
||||
- "base_outline"
|
||||
# TODO use footprints with pad + via reinforcement as mounting holes
|
||||
- "-screw_holes"
|
||||
plate:
|
||||
- "keywell"
|
||||
- "-switches"
|
||||
- "-screw_holes"
|
||||
pcb:
|
||||
- "base_outline"
|
||||
# TODO use footprints with pad + via reinforcement as mounting holes
|
||||
- "-mounting_holes"
|
||||
pcbs:
|
||||
top_plate:
|
||||
outlines:
|
||||
edge:
|
||||
outline: plate
|
||||
layer: Edge.Cuts
|
||||
footprints:
|
||||
jlc_order_number:
|
||||
what: text
|
||||
where:
|
||||
ref:
|
||||
- matrix_ring_home
|
||||
shift: [-0.25 kx, 0.5 ky]
|
||||
params:
|
||||
text: "JLCJLCJLCJLC"
|
||||
justify: left
|
||||
bottom_plate:
|
||||
outlines:
|
||||
edge:
|
||||
outline: bottom_outline
|
||||
layer: Edge.Cuts
|
||||
board:
|
||||
outlines:
|
||||
edge:
|
||||
outline: pcb
|
||||
layer: Edge.Cuts
|
||||
footprints:
|
||||
choc_hotswap:
|
||||
what: choc
|
||||
where:
|
||||
- /matrix_.*/
|
||||
- /thumbfan_.*/
|
||||
params:
|
||||
hotswap: true
|
||||
reverse: true
|
||||
keycaps: true
|
||||
from: "{{colrow}}"
|
||||
to: "{{column_net}}"
|
||||
diode:
|
||||
what: diode
|
||||
where:
|
||||
- /matrix_.*/
|
||||
- /thumbfan_.*/
|
||||
adjust.shift: [0, -5]
|
||||
params:
|
||||
from: "{{colrow}}"
|
||||
to: "{{row_net}}"
|
||||
mcu_l:
|
||||
what: promicro
|
||||
where:
|
||||
ref:
|
||||
- matrix_inner_top
|
||||
shift: [20, -11]
|
||||
rotate: 270
|
||||
params:
|
||||
orientation: up
|
||||
P4: row_top
|
||||
P5: row_home
|
||||
P6: row_bottom
|
||||
P7: row_thumb
|
||||
P14: col_inner
|
||||
P15: col_index
|
||||
P18: col_middle
|
||||
P19: col_ring
|
||||
P20: col_pinky
|
||||
mcu_r:
|
||||
what: promicro
|
||||
where:
|
||||
ref:
|
||||
- matrix_inner_top
|
||||
shift: [22.5, -12.25]
|
||||
rotate: 270
|
||||
params:
|
||||
orientation: down
|
||||
pad_plus:
|
||||
what: pad
|
||||
where:
|
||||
ref:
|
||||
- matrix_inner_top
|
||||
shift: [23, -6]
|
||||
rotate: 0
|
||||
params:
|
||||
front: true
|
||||
back: true
|
||||
width: 1.5
|
||||
height: 1.5
|
||||
text: "B+"
|
||||
net: Bplus
|
||||
pad_minus:
|
||||
what: pad
|
||||
where:
|
||||
ref:
|
||||
- matrix_inner_top
|
||||
shift: [23, -3]
|
||||
rotate: 0
|
||||
params:
|
||||
front: true
|
||||
back: true
|
||||
width: 1.5
|
||||
height: 1.5
|
||||
text: "B-"
|
||||
net: GND
|
||||
trrs:
|
||||
what: trrs_tight
|
||||
where:
|
||||
ref:
|
||||
- matrix_inner_bottom
|
||||
shift: [32, -15]
|
||||
rotate: 270
|
||||
params:
|
||||
reverse: true
|
||||
symmetric: false
|
||||
# The naming of the nets on this footprint is different from the Corne schematics.
|
||||
A: ""
|
||||
B: VCC
|
||||
C: GND
|
||||
D: P0
|
||||
jumper_l:
|
||||
what: jumper
|
||||
where:
|
||||
ref:
|
||||
- matrix_inner_bottom
|
||||
shift: [23.5, 0]
|
||||
rotate: 270
|
||||
params:
|
||||
side: B
|
||||
from: Bplus
|
||||
to: RAW
|
||||
jumper_r:
|
||||
what: jumper
|
||||
where:
|
||||
ref:
|
||||
- matrix_inner_bottom
|
||||
shift: [23.5, 0]
|
||||
rotate: 270
|
||||
params:
|
||||
side: F
|
||||
from: Bplus
|
||||
to: RAW
|
||||
slider_l:
|
||||
what: slider_threeway
|
||||
where:
|
||||
ref:
|
||||
- matrix_inner_bottom
|
||||
shift: [30, 0]
|
||||
rotate: 270
|
||||
params:
|
||||
side: F
|
||||
from: RAW
|
||||
left: Bplus
|
||||
right: ''
|
||||
slider_r:
|
||||
what: slider_threeway
|
||||
where:
|
||||
ref:
|
||||
- matrix_inner_bottom
|
||||
shift: [30, 0]
|
||||
rotate: 270
|
||||
params:
|
||||
side: B
|
||||
from: RAW
|
||||
left: ''
|
||||
right: Bplus
|
||||
reset:
|
||||
what: reset_button
|
||||
where:
|
||||
ref:
|
||||
- matrix_inner_bottom
|
||||
shift: [17, 0]
|
||||
rotate: 270
|
||||
params:
|
||||
from: GND
|
||||
to: RST
|
||||
info_l:
|
||||
what: text
|
||||
where:
|
||||
ref:
|
||||
- matrix_pinky_bottom
|
||||
shift: [0.75 kx, 0]
|
||||
params:
|
||||
text: "samoklava v0.3\\nby soundmonster"
|
||||
justify: left
|
||||
info_r:
|
||||
what: text
|
||||
where:
|
||||
ref:
|
||||
- matrix_pinky_bottom
|
||||
shift: [0.75 kx, 0]
|
||||
params:
|
||||
layer: B.SilkS
|
||||
text: "samoklava v0.3\\nby soundmonster"
|
||||
justify: right mirror
|
||||
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
module.exports = {
|
||||
params: {
|
||||
designator: 'B', // for Button
|
||||
from: undefined,
|
||||
to: undefined
|
||||
},
|
||||
body: p => {
|
||||
// this footprint goes to both sides by default so it ignores the layer setting
|
||||
return `
|
||||
(module kbd:ResetSW (layer F.Cu) (tedit 5B9559E6) (tstamp 61905781)
|
||||
|
||||
(descr "Two pin through hole Tactile Switch, the same as on the Corne")
|
||||
(tags "Tactile Switch")
|
||||
|
||||
${p.at /* parametric position */}
|
||||
${'' /* footprint reference */}
|
||||
(fp_text reference "${p.ref}" (at 0 2.55) (layer F.SilkS) ${p.ref_hide} (effects (font (size 1 1) (thickness 0.15))))
|
||||
(fp_text value "" (at 0 -2.55) (layer F.Fab) (effects (font (size 1 1) (thickness 0.15))))
|
||||
|
||||
${'' /* outline */}
|
||||
(fp_text user RESET (at 0 0 ${p.rot}) (layer F.SilkS) (effects (font (size 1 1) (thickness 0.15))))
|
||||
(fp_text user RESET (at 0.127 0 ${p.rot}) (layer B.SilkS) (effects (font (size 1 1) (thickness 0.15)) (justify mirror)))
|
||||
|
||||
(fp_line (start 3 1.5) (end 3 1.75) (layer B.SilkS) (width 0.15))
|
||||
(fp_line (start 3 1.75) (end -3 1.75) (layer B.SilkS) (width 0.15))
|
||||
(fp_line (start -3 1.75) (end -3 1.5) (layer B.SilkS) (width 0.15))
|
||||
(fp_line (start -3 -1.5) (end -3 -1.75) (layer B.SilkS) (width 0.15))
|
||||
(fp_line (start -3 -1.75) (end 3 -1.75) (layer B.SilkS) (width 0.15))
|
||||
(fp_line (start 3 -1.75) (end 3 -1.5) (layer B.SilkS) (width 0.15))
|
||||
(fp_line (start -3 1.75) (end 3 1.75) (layer F.SilkS) (width 0.15))
|
||||
(fp_line (start 3 1.75) (end 3 1.5) (layer F.SilkS) (width 0.15))
|
||||
(fp_line (start -3 1.75) (end -3 1.5) (layer F.SilkS) (width 0.15))
|
||||
(fp_line (start -3 -1.75) (end -3 -1.5) (layer F.SilkS) (width 0.15))
|
||||
(fp_line (start -3 -1.75) (end 3 -1.75) (layer F.SilkS) (width 0.15))
|
||||
(fp_line (start 3 -1.75) (end 3 -1.5) (layer F.SilkS) (width 0.15))
|
||||
|
||||
${'' /* pins */}
|
||||
(pad 2 thru_hole circle (at -3.25 0 ${p.rot}) (size 2 2) (drill 1.3) (layers *.Cu *.Mask F.SilkS) ${p.from.str})
|
||||
(pad 1 thru_hole circle (at 3.25 0 ${p.rot}) (size 2 2) (drill 1.3) (layers *.Cu *.Mask F.SilkS) ${p.to.str})
|
||||
)
|
||||
`
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
module.exports = {
|
||||
params: {
|
||||
designator: 'T', // for Toggle
|
||||
side: 'F',
|
||||
from: undefined,
|
||||
left: undefined,
|
||||
right: undefined
|
||||
},
|
||||
body: p => {
|
||||
|
||||
const left = p.side == 'F' ? '-' : ''
|
||||
const right = p.side == 'F' ? '' : '-'
|
||||
|
||||
return `
|
||||
|
||||
(module E73:SPDT_C128955 (layer F.Cu) (tstamp 5BF2CC3C)
|
||||
|
||||
${p.at /* parametric position */}
|
||||
|
||||
${'' /* footprint reference */}
|
||||
(fp_text reference "${p.ref}" (at 0 0) (layer F.SilkS) ${p.ref_hide} (effects (font (size 1.27 1.27) (thickness 0.15))))
|
||||
(fp_text value "" (at 0 0) (layer F.SilkS) hide (effects (font (size 1.27 1.27) (thickness 0.15))))
|
||||
|
||||
${'' /* outline */}
|
||||
(fp_line (start 1.95 -1.35) (end -1.95 -1.35) (layer ${p.side}.SilkS) (width 0.15))
|
||||
(fp_line (start 0 -1.35) (end -3.3 -1.35) (layer ${p.side}.SilkS) (width 0.15))
|
||||
(fp_line (start -3.3 -1.35) (end -3.3 1.5) (layer ${p.side}.SilkS) (width 0.15))
|
||||
(fp_line (start -3.3 1.5) (end 3.3 1.5) (layer ${p.side}.SilkS) (width 0.15))
|
||||
(fp_line (start 3.3 1.5) (end 3.3 -1.35) (layer ${p.side}.SilkS) (width 0.15))
|
||||
(fp_line (start 0 -1.35) (end 3.3 -1.35) (layer ${p.side}.SilkS) (width 0.15))
|
||||
|
||||
${'' /* extra indicator for the slider */}
|
||||
(fp_line (start -1.95 -3.85) (end 1.95 -3.85) (layer Dwgs.User) (width 0.15))
|
||||
(fp_line (start 1.95 -3.85) (end 1.95 -1.35) (layer Dwgs.User) (width 0.15))
|
||||
(fp_line (start -1.95 -1.35) (end -1.95 -3.85) (layer Dwgs.User) (width 0.15))
|
||||
|
||||
${'' /* bottom cutouts */}
|
||||
(pad "" np_thru_hole circle (at 1.5 0) (size 1 1) (drill 0.9) (layers *.Cu *.Mask))
|
||||
(pad "" np_thru_hole circle (at -1.5 0) (size 1 1) (drill 0.9) (layers *.Cu *.Mask))
|
||||
|
||||
${'' /* pins */}
|
||||
(pad 1 smd rect (at ${right}2.25 2.075 ${p.rot}) (size 0.9 1.25) (layers ${p.side}.Cu ${p.side}.Paste ${p.side}.Mask) ${p.right.str})
|
||||
(pad 2 smd rect (at ${left}0.75 2.075 ${p.rot}) (size 0.9 1.25) (layers ${p.side}.Cu ${p.side}.Paste ${p.side}.Mask) ${p.from.str})
|
||||
(pad 3 smd rect (at ${left}2.25 2.075 ${p.rot}) (size 0.9 1.25) (layers ${p.side}.Cu ${p.side}.Paste ${p.side}.Mask) ${p.left.str})
|
||||
|
||||
${'' /* side mounts */}
|
||||
(pad "" smd rect (at 3.7 -1.1 ${p.rot}) (size 0.9 0.9) (layers ${p.side}.Cu ${p.side}.Paste ${p.side}.Mask))
|
||||
(pad "" smd rect (at 3.7 1.1 ${p.rot}) (size 0.9 0.9) (layers ${p.side}.Cu ${p.side}.Paste ${p.side}.Mask))
|
||||
(pad "" smd rect (at -3.7 1.1 ${p.rot}) (size 0.9 0.9) (layers ${p.side}.Cu ${p.side}.Paste ${p.side}.Mask))
|
||||
(pad "" smd rect (at -3.7 -1.1 ${p.rot}) (size 0.9 0.9) (layers ${p.side}.Cu ${p.side}.Paste ${p.side}.Mask))
|
||||
)
|
||||
|
||||
`
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
module.exports = {
|
||||
params: {
|
||||
layer: "F.SilkS",
|
||||
text: "",
|
||||
h_size: 1,
|
||||
v_size: 1,
|
||||
thickness: 0.15,
|
||||
justify: "",
|
||||
},
|
||||
body: (p) => {
|
||||
let justify = "";
|
||||
if (p.justify != "") {
|
||||
justify = `(justify ${p.justify})`;
|
||||
}
|
||||
|
||||
return `
|
||||
(gr_text "${p.text}" ${p.at} (layer ${p.layer})
|
||||
(effects (font (size ${p.h_size} ${p.v_size}) (thickness ${p.thickness})) ${justify})
|
||||
)
|
||||
`;
|
||||
},
|
||||
};
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
// TRRS-PJ-320A-dual
|
||||
//
|
||||
// Normal footprint:
|
||||
// _________________
|
||||
// | (2) (3) (4)|
|
||||
// | |
|
||||
// | (1) |
|
||||
// |________________|
|
||||
//
|
||||
// Reverse footprint:
|
||||
// _________________
|
||||
// | (2) (3) (4)|
|
||||
// | (1) |
|
||||
// | (1) |
|
||||
// |___(2)___(3)_(4)|
|
||||
//
|
||||
// Reverse & symmetric footprint:
|
||||
// _________________
|
||||
// | (1|2) (3) (4)|
|
||||
// | |
|
||||
// |_(1|2)___(3)_(4)|
|
||||
//
|
||||
// Nets
|
||||
// A: corresponds to pin 1
|
||||
// B: corresponds to pin 2
|
||||
// C: corresponds to pin 3
|
||||
// D: corresponds to pin 4
|
||||
// Params
|
||||
// reverse: default is false
|
||||
// if true, will flip the footprint such that the pcb can be reversible
|
||||
// symmetric: default is false
|
||||
// if true, will only work if reverse is also true
|
||||
// this will cause the footprint to be symmetrical on each half
|
||||
// pins 1 and 2 must be identical if symmetric is true, as they will overlap
|
||||
|
||||
module.exports = {
|
||||
params: {
|
||||
designator: 'TRRS',
|
||||
reverse: false,
|
||||
symmetric: false,
|
||||
A: undefined,
|
||||
B: undefined,
|
||||
C: undefined,
|
||||
D: undefined
|
||||
},
|
||||
body: p => {
|
||||
const standard = `
|
||||
(module TRRS-PJ-320A-dual (layer F.Cu) (tedit 5970F8E5)
|
||||
|
||||
${p.at /* parametric position */}
|
||||
|
||||
${'' /* footprint reference */}
|
||||
(fp_text reference "${p.ref}" (at 0 14.2) (layer Dwgs.User) (effects (font (size 1 1) (thickness 0.15))))
|
||||
(fp_text value TRRS-PJ-320A-dual (at 0 -5.6) (layer F.Fab) (effects (font (size 1 1) (thickness 0.15))))
|
||||
|
||||
${''/* corner marks */}
|
||||
(fp_line (start 0.5 -2) (end -5.1 -2) (layer Dwgs.User) (width 0.15))
|
||||
(fp_line (start -5.1 0) (end -5.1 -2) (layer Dwgs.User) (width 0.15))
|
||||
(fp_line (start 0.5 0) (end 0.5 -2) (layer Dwgs.User) (width 0.15))
|
||||
(fp_line (start -5.35 0) (end -5.35 12.1) (layer Dwgs.User) (width 0.15))
|
||||
(fp_line (start 0.75 0) (end 0.75 12.1) (layer Dwgs.User) (width 0.15))
|
||||
(fp_line (start 0.75 12.1) (end -5.35 12.1) (layer Dwgs.User) (width 0.15))
|
||||
(fp_line (start 0.75 0) (end -5.35 0) (layer Dwgs.User) (width 0.15))
|
||||
|
||||
`
|
||||
function stabilizers(def_pos) {
|
||||
return `
|
||||
(pad "" np_thru_hole circle (at ${def_pos} 8.6) (size 1.2 1.2) (drill 1.2) (layers *.Cu *.Mask))
|
||||
(pad "" np_thru_hole circle (at ${def_pos} 1.6) (size 1.2 1.2) (drill 1.2) (layers *.Cu *.Mask))
|
||||
`
|
||||
}
|
||||
function pins(def_neg, def_pos) {
|
||||
return `
|
||||
(pad 1 thru_hole oval (at ${def_neg} 11.3 ${p.rot}) (size 1.6 2.2) (drill oval 0.9 1.5) (layers *.Cu *.Mask) ${p.A.str})
|
||||
(pad 2 thru_hole oval (at ${def_pos} 10.2 ${p.rot}) (size 1.6 2.2) (drill oval 0.9 1.5) (layers *.Cu *.Mask) ${p.B.str})
|
||||
(pad 3 thru_hole oval (at ${def_pos} 6.2 ${p.rot}) (size 1.6 2.2) (drill oval 0.9 1.5) (layers *.Cu *.Mask) ${p.C.str})
|
||||
(pad 4 thru_hole oval (at ${def_pos} 3.2 ${p.rot}) (size 1.6 2.2) (drill oval 0.9 1.5) (layers *.Cu *.Mask) ${p.D.str})
|
||||
`
|
||||
}
|
||||
if(p.reverse & p.symmetric) {
|
||||
return `
|
||||
${standard}
|
||||
${stabilizers('-2.3')}
|
||||
${pins('0', '-4.6')}
|
||||
${pins('-4.6', '0')})
|
||||
`
|
||||
} else if(p.reverse) {
|
||||
return `
|
||||
${standard}
|
||||
${stabilizers('-2.3')}
|
||||
${stabilizers('0')}
|
||||
${pins('-2.3', '2.3')}
|
||||
${pins('0', '-4.6')})
|
||||
`
|
||||
} else {
|
||||
return `
|
||||
${standard}
|
||||
${stabilizers('-2.3')}
|
||||
${pins('-4.6', '0')})
|
||||
`
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"scripts": {
|
||||
"gen": "ergogen samoklava.yaml"
|
||||
},
|
||||
"dependencies": {
|
||||
"ergogen": "github:soundmonster/ergogen#samoklava"
|
||||
}
|
||||
"scripts": {
|
||||
"gen": "ergogen -d ."
|
||||
},
|
||||
"dependencies": {
|
||||
"ergogen": "github:ergogen/ergogen#v4.0.4"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
444
samoklava.yaml
444
samoklava.yaml
|
|
@ -1,444 +0,0 @@
|
|||
units:
|
||||
kx: cx
|
||||
ky: cy
|
||||
px: 2
|
||||
py: 2
|
||||
points:
|
||||
key:
|
||||
footprints:
|
||||
choc_hotswap:
|
||||
type: choc
|
||||
params:
|
||||
hotswap: true
|
||||
reverse: true
|
||||
keycaps: true
|
||||
nets:
|
||||
# from: P1
|
||||
# to: P2
|
||||
from: =colrow
|
||||
to: =column_net
|
||||
diode:
|
||||
type: diode
|
||||
nets:
|
||||
# from: P3
|
||||
# to: P4
|
||||
from: =colrow
|
||||
to: =row_net
|
||||
anchor:
|
||||
shift: [0, -5]
|
||||
zones:
|
||||
matrix:
|
||||
# anchor:
|
||||
# rotate: 5
|
||||
key.padding: ky
|
||||
columns:
|
||||
pinky:
|
||||
stagger: 0 ky
|
||||
spread: kx
|
||||
key:
|
||||
column_net: P20
|
||||
ring:
|
||||
stagger: 0.7 ky
|
||||
spread: kx
|
||||
key:
|
||||
column_net: P19
|
||||
middle:
|
||||
stagger: 0.2 ky
|
||||
spread: kx
|
||||
key:
|
||||
column_net: P18
|
||||
index:
|
||||
stagger: -0.2 ky
|
||||
spread: kx
|
||||
key:
|
||||
column_net: P15
|
||||
inner:
|
||||
stagger: -0.1 ky
|
||||
spread: kx
|
||||
key:
|
||||
column_net: P14
|
||||
rows:
|
||||
bottom:
|
||||
row_net: P6
|
||||
home:
|
||||
row_net: P5
|
||||
top:
|
||||
row_net: P4
|
||||
thumbfan:
|
||||
anchor:
|
||||
ref: matrix_inner_bottom
|
||||
shift: [-1.5 kx, -1 ky]
|
||||
columns:
|
||||
near:
|
||||
spread: kx
|
||||
rotate: -15
|
||||
origin: [-0.5 kx, -0.5 ky]
|
||||
key:
|
||||
column_net: P18
|
||||
home:
|
||||
spread: kx
|
||||
rotate: -15
|
||||
origin: [-0.5 kx, -0.5 ky]
|
||||
key:
|
||||
column_net: P15
|
||||
far:
|
||||
spread: kx
|
||||
rotate: -15
|
||||
origin: [-0.5 kx, -0.5 ky]
|
||||
key:
|
||||
column_net: P14
|
||||
rows:
|
||||
thumb:
|
||||
row_net: P7
|
||||
outlines:
|
||||
# board dimensions according to JLCPCB: 122.28 mm x 101.05 mm
|
||||
exports:
|
||||
raw:
|
||||
- type: keys
|
||||
side: left
|
||||
size: [kx + px, ky + py]
|
||||
corner: px
|
||||
thumbfan_glue:
|
||||
- type: polygon
|
||||
points:
|
||||
- ref: matrix_inner_bottom
|
||||
shift: [0.5 kx + 0.5px, -0.5 ky + 0.5 py]
|
||||
- ref: thumbfan_far_thumb
|
||||
shift: [0.5 kx - 0.5px, 0.5 ky + 0.5 py]
|
||||
- ref: thumbfan_far_thumb
|
||||
shift: [0.5 kx - 0.5px, -0.5 ky - 0.5 py]
|
||||
- ref: thumbfan_near_thumb
|
||||
shift: [-0.5 kx + 0.5 px, -0.5 ky - 0.5 py]
|
||||
- ref: matrix_pinky_bottom
|
||||
shift: [0.5 kx - 0.5 py, -0.5 ky - 0.5 py]
|
||||
- ref: matrix_pinky_home
|
||||
- ref: matrix_inner_home
|
||||
patch_outer:
|
||||
- type: polygon
|
||||
points:
|
||||
- ref: matrix_ring_top
|
||||
- ref: matrix_ring_bottom
|
||||
- ref: matrix_pinky_bottom
|
||||
shift: [-0.5 (kx + px), 0]
|
||||
- ref: matrix_pinky_top
|
||||
shift: [-0.5 (kx + px), 0]
|
||||
patch_inner:
|
||||
- type: polygon
|
||||
points:
|
||||
- ref: matrix_inner_top
|
||||
shift: [0.5 (kx + px), 0]
|
||||
- ref: matrix_inner_bottom
|
||||
shift: [0.5 (kx + px), 0]
|
||||
- ref: matrix_index_bottom
|
||||
- ref: matrix_index_top
|
||||
controller_area:
|
||||
main:
|
||||
type: rectangle
|
||||
anchor:
|
||||
ref:
|
||||
- matrix_inner_top
|
||||
shift: [0 kx, -4.05 ky]
|
||||
size: [32, 76.5]
|
||||
corner: px
|
||||
switches:
|
||||
main:
|
||||
type: keys
|
||||
side: left
|
||||
size: 14
|
||||
bound: false
|
||||
keycaps:
|
||||
main:
|
||||
type: keys
|
||||
side: left
|
||||
size: [kx, ky]
|
||||
bound: false
|
||||
corner: 1
|
||||
keywell:
|
||||
main:
|
||||
type: outline
|
||||
name: raw
|
||||
patch_inner:
|
||||
type: outline
|
||||
name: patch_inner
|
||||
operation: add
|
||||
patch_outer:
|
||||
type: outline
|
||||
name: patch_outer
|
||||
operation: add
|
||||
thumbfan_glue:
|
||||
type: outline
|
||||
name: thumbfan_glue
|
||||
operation: add
|
||||
base_outline:
|
||||
main:
|
||||
type: outline
|
||||
name: keywell
|
||||
controller:
|
||||
type: outline
|
||||
name: controller_area
|
||||
operation: add
|
||||
screw_holes:
|
||||
top_left:
|
||||
type: circle
|
||||
anchor:
|
||||
- ref: matrix_ring_home
|
||||
shift: [-0.5 kx, 0 ky]
|
||||
radius: 1.05
|
||||
bottom_left:
|
||||
type: circle
|
||||
anchor:
|
||||
- ref: matrix_pinky_bottom
|
||||
shift: [0.5 kx, 0]
|
||||
radius: 1.05
|
||||
top_right:
|
||||
type: circle
|
||||
anchor:
|
||||
- ref: matrix_inner_top
|
||||
shift: [-0.5 kx, 0]
|
||||
radius: 1.05
|
||||
palm:
|
||||
type: circle
|
||||
anchor:
|
||||
- ref: matrix_index_bottom
|
||||
shift: [0, -1.06 ky]
|
||||
radius: 1.05
|
||||
thumb:
|
||||
type: circle
|
||||
anchor:
|
||||
- ref: thumbfan_far_thumb
|
||||
shift: [-0.55 kx, 0]
|
||||
radius: 1.05
|
||||
mounting_holes:
|
||||
$extends: outlines.exports.screw_holes
|
||||
top_left:
|
||||
radius: 2.05
|
||||
bottom_left:
|
||||
radius: 2.05
|
||||
top_right:
|
||||
radius: 2.05
|
||||
palm:
|
||||
radius: 2.05
|
||||
thumb:
|
||||
radius: 2.05
|
||||
bottom_outline:
|
||||
main:
|
||||
type: outline
|
||||
name: base_outline
|
||||
screw_holes:
|
||||
type: outline
|
||||
# TODO use footprints with pad + via reinforcement as mounting holes
|
||||
name: screw_holes
|
||||
operation: subtract
|
||||
plate:
|
||||
main:
|
||||
type: outline
|
||||
name: keywell
|
||||
switches:
|
||||
type: outline
|
||||
name: switches
|
||||
operation: subtract
|
||||
mounting_holes:
|
||||
type: outline
|
||||
# TODO use footprints with pad + via reinforcement as mounting holes
|
||||
name: screw_holes
|
||||
operation: subtract
|
||||
pcb:
|
||||
main:
|
||||
type: outline
|
||||
name: base_outline
|
||||
mounting_holes:
|
||||
type: outline
|
||||
# TODO use plated through hole footprints as mounting holes
|
||||
name: mounting_holes
|
||||
operation: subtract
|
||||
pcbs:
|
||||
top_plate:
|
||||
include_keys: false
|
||||
outlines:
|
||||
edge:
|
||||
outline: plate
|
||||
layer: Edge.Cuts
|
||||
footprints:
|
||||
jlc_order_number:
|
||||
type: text
|
||||
anchor:
|
||||
ref:
|
||||
- matrix_ring_home
|
||||
shift: [-0.25 kx, 0.5 ky]
|
||||
params:
|
||||
text: "JLCJLCJLCJLC"
|
||||
justify: left
|
||||
bottom_plate:
|
||||
include_keys: false
|
||||
outlines:
|
||||
edge:
|
||||
outline: bottom_outline
|
||||
layer: Edge.Cuts
|
||||
board:
|
||||
outlines:
|
||||
edge:
|
||||
outline: pcb
|
||||
layer: Edge.Cuts
|
||||
footprints:
|
||||
mcu_l:
|
||||
type: promicro
|
||||
params:
|
||||
orientation: up
|
||||
anchor:
|
||||
ref:
|
||||
- matrix_inner_top
|
||||
shift: [20, -11]
|
||||
rotate: 270
|
||||
mcu_r:
|
||||
type: promicro
|
||||
params:
|
||||
orientation: down
|
||||
anchor:
|
||||
ref:
|
||||
- matrix_inner_top
|
||||
shift: [22.5, -12.25]
|
||||
rotate: 270
|
||||
pad_plus:
|
||||
type: pad
|
||||
anchor:
|
||||
ref:
|
||||
- matrix_inner_top
|
||||
shift: [23, -6]
|
||||
rotate: 0
|
||||
params:
|
||||
front: true
|
||||
back: true
|
||||
width: 1.5
|
||||
height: 1.5
|
||||
text: "B+"
|
||||
nets:
|
||||
net: Bplus
|
||||
pad_minus:
|
||||
type: pad
|
||||
anchor:
|
||||
ref:
|
||||
- matrix_inner_top
|
||||
shift: [23, -3]
|
||||
rotate: 0
|
||||
params:
|
||||
front: true
|
||||
back: true
|
||||
width: 1.5
|
||||
height: 1.5
|
||||
text: "B-"
|
||||
nets:
|
||||
net: GND
|
||||
trrs_l:
|
||||
type: trrs
|
||||
anchor:
|
||||
ref:
|
||||
- matrix_inner_bottom
|
||||
shift: [32, -15]
|
||||
rotate: 270
|
||||
params:
|
||||
reverse: false
|
||||
symmetric: false
|
||||
# The naming of the nets on this footprint is different from the Corne schematics.
|
||||
nets:
|
||||
A: ""
|
||||
B: VCC
|
||||
C: GND
|
||||
D: P0
|
||||
trrs_r:
|
||||
type: trrs
|
||||
anchor:
|
||||
ref:
|
||||
- matrix_inner_bottom
|
||||
shift: [32, -13]
|
||||
rotate: 270
|
||||
params:
|
||||
reverse: true
|
||||
symmetric: false
|
||||
# The naming of the nets on this footprint is different from the Corne schematics.
|
||||
nets:
|
||||
A: ""
|
||||
B: VCC
|
||||
C: GND
|
||||
D: P0
|
||||
jumper_l:
|
||||
type: jumper
|
||||
anchor:
|
||||
ref:
|
||||
- matrix_inner_bottom
|
||||
shift: [23.5, 0]
|
||||
rotate: 270
|
||||
params:
|
||||
side: B
|
||||
nets:
|
||||
from: Bplus
|
||||
to: RAW
|
||||
jumper_r:
|
||||
type: jumper
|
||||
anchor:
|
||||
ref:
|
||||
- matrix_inner_bottom
|
||||
shift: [23.5, 0]
|
||||
rotate: 270
|
||||
params:
|
||||
side: F
|
||||
nets:
|
||||
from: Bplus
|
||||
to: RAW
|
||||
slider_l:
|
||||
type: slider
|
||||
anchor:
|
||||
ref:
|
||||
- matrix_inner_bottom
|
||||
shift: [30, 0]
|
||||
rotate: 270
|
||||
params:
|
||||
side: F
|
||||
nets:
|
||||
from: RAW
|
||||
left: Bplus
|
||||
right: ''
|
||||
slider_r:
|
||||
type: slider
|
||||
anchor:
|
||||
ref:
|
||||
- matrix_inner_bottom
|
||||
shift: [30, 0]
|
||||
rotate: 270
|
||||
params:
|
||||
side: B
|
||||
nets:
|
||||
from: RAW
|
||||
left: ''
|
||||
right: Bplus
|
||||
reset:
|
||||
type: button
|
||||
anchor:
|
||||
ref:
|
||||
- matrix_inner_bottom
|
||||
shift: [17, 0]
|
||||
rotate: 270
|
||||
params:
|
||||
variant: 2_pin_th
|
||||
nets:
|
||||
from: GND
|
||||
to: RST
|
||||
info_l:
|
||||
type: text
|
||||
anchor:
|
||||
ref:
|
||||
- matrix_pinky_bottom
|
||||
shift: [0.75 kx, 0]
|
||||
params:
|
||||
text: "samoklava v0.1\\nby soundmonster"
|
||||
justify: left
|
||||
info_r:
|
||||
type: text
|
||||
anchor:
|
||||
ref:
|
||||
- matrix_pinky_bottom
|
||||
shift: [0.75 kx, 0]
|
||||
params:
|
||||
layer: B.SilkS
|
||||
text: "samoklava v0.1\\nby soundmonster"
|
||||
justify: right mirror
|
||||
|
||||
Loading…
Reference in New Issue