From 31995f676acba8796a3184a048c7642b7b08196d Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Sat, 3 Aug 2024 19:14:18 +0200 Subject: [PATCH] Ergogen: Finalize PCB --- ergogen/config.yaml | 74 ++++++++++++++++++++++----- ergogen/footprints/mountinghole_m2.js | 24 +++++++++ ergogen/footprints/text.js | 38 ++++++++++++++ 3 files changed, 124 insertions(+), 12 deletions(-) create mode 100644 ergogen/footprints/mountinghole_m2.js create mode 100644 ergogen/footprints/text.js diff --git a/ergogen/config.yaml b/ergogen/config.yaml index cd0626d..7ad972b 100644 --- a/ergogen/config.yaml +++ b/ergogen/config.yaml @@ -49,13 +49,13 @@ points: rows: # Modifier row (Ctrl, ..., but excluding the thumb keys) mods: - row_net: GP13 + row_net: GP17 led_previous_key: "{{zone.name}}_{{neighbor_col_left}}_{{row}}" tags: [ is_key, flip_led ] # Bottom letter row (Shift, ZXCV...) bottom: - row_net: GP14 + row_net: GP16 led_previous_key: "{{zone.name}}_{{neighbor_col_right}}_{{row}}" # Middle/home letter row (Caps Lock, ASDFG...) @@ -66,12 +66,12 @@ points: # Top letter row (Tab, QWERT...) top: - row_net: GP16 + row_net: GP14 led_previous_key: "{{zone.name}}_{{neighbor_col_right}}_{{row}}" # Number row (`, 12345...) numbers: - row_net: GP17 + row_net: GP13 led_previous_key: "{{zone.name}}_{{neighbor_col_left}}_{{row}}" tags: [ is_key, flip_led ] @@ -165,7 +165,7 @@ points: # Rotate the thumb keys around the bottom-left corner of the key key: - row_net: GP13 + row_net: GP17 tags: [ is_key, flip_led ] origin: [ -0.5cx, -0.5cy ] splay: -4 @@ -306,18 +306,18 @@ outlines: - what: polygon points: - ref: primary_zero_numbers - shift: [ -0.5cx, 1.5cy + function_zone_offset ] + shift: [ -0.5cx + 1, 1.5cy + function_zone_offset + 2 ] - ref: primary_twelve_numbers - shift: [ 0.5cx, 1.5cy + function_zone_offset ] + shift: [ 0.5cx - 1, 1.5cy + function_zone_offset + 2] - ref: primary_twelve_mods - shift: [ 0.5cx, -0.5cy ] + shift: [ 0.5cx - 1, -0.5cy + 2 ] - ref: mirror_thumb_four - shift: [ 0.5cx, -0.5cy ] + shift: [ 0.5cx, -0.5cy + 2 ] - ref: thumb_four - shift: [ 0.5cx, -0.5cy ] + shift: [ 0.5cx, -0.5cy + 2 ] - ref: primary_zero_mods - shift: [ -0.5cx, -0.5cy ] - expand: 6 + shift: [ -0.5cx + 1, -0.5cy + 2 ] + expand: 4 # Preview version of board with key caps and components for visualization board_preview: @@ -359,10 +359,12 @@ outlines: # Generate the PCB pcbs: eepyboard: + # Define outline (edges) of the board based on the outlines defined above outlines: main: outline: board + # Define PCB components footprints: controller: what: rp2040_purple @@ -495,3 +497,51 @@ pcbs: params: from: GND to: RUN + + # Mounting holes + mounting_hole_top_left: + what: mountinghole_m2 + where: + ref: function_esc + shift: [ -9, 11.5 ] + + mounting_hole_top_center: + what: mountinghole_m2 + where: + ref: function_f4 + shift: [ 12.5, 0 ] + + mounting_hole_top_right: + what: mountinghole_m2 + where: + ref: primary_twelve_numbers + shift: [ 9, cy + function_zone_offset + 11.5 ] + + mounting_hole_bottom_left: + what: mountinghole_m2 + where: + ref: primary_one_mods + shift: [ 10.5, -12 ] + + mounting_hole_bottom_center: + what: mountinghole_m2 + where: + ref: primary_six_bottom + shift: [ 0, -23 ] + + mounting_hole_bottom_right: + what: mountinghole_m2 + where: + ref: primary_eleven_mods + shift: [ -10.5, -12 ] + + # Render text with project name and copyright onto the PCB + copyright_text: + what: text + where: + ref: primary_six_bottom + shift: [ 0, -15 ] + params: + text: |- + eepyBoard v1.0 by binaryDiv + (c) 2024 (MIT License) diff --git a/ergogen/footprints/mountinghole_m2.js b/ergogen/footprints/mountinghole_m2.js new file mode 100644 index 0000000..b11ed32 --- /dev/null +++ b/ergogen/footprints/mountinghole_m2.js @@ -0,0 +1,24 @@ +// MountingHole_2.2mm_M2 +// Source: https://kicad.github.io/footprints/MountingHole +module.exports = { + nets: { + net: undefined + }, + params: { + class: 'HOLE', + }, + body: p => ` + (module MountingHole_2.2mm_M2 (layer F.Cu) (tedit 56D1B4CB) + ${p.at /* parametric position */} + + (fp_text reference "${p.ref}" (at 0 -3.2) (layer F.SilkS) ${p.ref_hide} + (effects (font (size 1 1) (thickness 0.15))) + ) + + (fp_circle (center 0 0) (end 2.2 0) (layer Cmts.User) (width 0.15)) + + (fp_circle (center 0 0) (end 2.45 0) (layer F.CrtYd) (width 0.05)) + (pad 1 np_thru_hole circle (at 0 0) (size 2.2 2.2) (drill 2.2) (layers *.Cu *.Mask)) + ) + ` +} diff --git a/ergogen/footprints/text.js b/ergogen/footprints/text.js new file mode 100644 index 0000000..1ab9c29 --- /dev/null +++ b/ergogen/footprints/text.js @@ -0,0 +1,38 @@ +// Graphical text box to render text (e.g. project name, copyright) onto the board +// +// The text can be multi-line. Linebreaks and quotes are automatically escaped. +// Backslashes are *not* escaped to allow for other escape sequences. +// +// Params +// side: Side of the PCB ("F" or "B") +// text: Text to be rendered + +module.exports = { + params: { + layer: 'F.SilkS', + text: 'Example text!', + }, + body: p => { + function escape_str(text) { + return text + .replace('"', '\\"') + .replace('\n', '\\n') + .replace('\r', '') + } + + return ` + (gr_text "${escape_str(p.text)}" + ${p.at /* parametric position */} + + (layer ${p.layer}) + (effects + (font + (size 1.5 1.5) + (thickness 0.3) + (bold yes) + ) + ) + ) + `; + } +}