// Tactile button 6x6mm
// Source: https://kicad.github.io/footprints/Button_Switch_SMD
module.exports = {
    params: {
        designator: 'B',
        side: 'F',
        from: undefined,
        to: undefined
    },
    body: p => `
    (module SW_Push_1P1T_NO_6x6mm_H9.5mm (layer F.Cu) (tedit 5CA1CA7F)
        (descr "tactile push button, 6x6mm e.g. PTS645xx series, height=9.5mm")
        (tags "tact sw push 6mm smd")
        (attr smd)

        ${p.at /* parametric position */}

        ${'' /* footprint reference */}
        (fp_text reference "${p.ref}" (at 0 -4.05) (layer F.SilkS) ${p.ref_hide} (effects (font (size 1 1) (thickness 0.15))))
        (fp_text value "" (at 0 4.15) (layer F.SilkS) hide (effects (font (size 1 1) (thickness 0.15))))

        ${'' /* outline */}
        (fp_line (start -3    -3   ) (end -3     3   ) (layer ${p.side}.Fab)   (width 0.1))
        (fp_line (start -3     3   ) (end  3     3   ) (layer ${p.side}.Fab)   (width 0.1))
        (fp_line (start  3     3   ) (end  3    -3   ) (layer ${p.side}.Fab)   (width 0.1))
        (fp_line (start  3    -3   ) (end -3    -3   ) (layer ${p.side}.Fab)   (width 0.1))
        (fp_line (start  5     3.25) (end  5    -3.25) (layer ${p.side}.CrtYd) (width 0.05))
        (fp_line (start -5    -3.25) (end -5     3.25) (layer ${p.side}.CrtYd) (width 0.05))
        (fp_line (start -5     3.25) (end  5     3.25) (layer ${p.side}.CrtYd) (width 0.05))
        (fp_line (start -5    -3.25) (end  5    -3.25) (layer ${p.side}.CrtYd) (width 0.05))
        (fp_line (start  3.23 -3.23) (end  3.23 -3.2 ) (layer ${p.side}.SilkS) (width 0.12))
        (fp_line (start  3.23  3.23) (end  3.23  3.2 ) (layer ${p.side}.SilkS) (width 0.12))
        (fp_line (start -3.23  3.23) (end -3.23  3.2 ) (layer ${p.side}.SilkS) (width 0.12))
        (fp_line (start -3.23 -3.2 ) (end -3.23 -3.23) (layer ${p.side}.SilkS) (width 0.12))
        (fp_line (start  3.23 -1.3 ) (end  3.23  1.3 ) (layer ${p.side}.SilkS) (width 0.12))
        (fp_line (start -3.23 -3.23) (end  3.23 -3.23) (layer ${p.side}.SilkS) (width 0.12))
        (fp_line (start -3.23 -1.3 ) (end -3.23  1.3 ) (layer ${p.side}.SilkS) (width 0.12))
        (fp_line (start -3.23  3.23) (end  3.23  3.23) (layer ${p.side}.SilkS) (width 0.12))
        (fp_circle (center 0 0)      (end 1.75 -0.05)  (layer ${p.side}.Fab)   (width 0.1))

        ${'' /* pins */}
        (pad 1 smd rect (at -3.975 -2.25 ${p.r}) (size 1.55 1.3) (layers ${p.side}.Cu ${p.side}.Paste ${p.side}.Mask) ${p.from})
        (pad 1 smd rect (at  3.975 -2.25 ${p.r}) (size 1.55 1.3) (layers ${p.side}.Cu ${p.side}.Paste ${p.side}.Mask) ${p.from})
        (pad 2 smd rect (at -3.975  2.25 ${p.r}) (size 1.55 1.3) (layers ${p.side}.Cu ${p.side}.Paste ${p.side}.Mask) ${p.to})
        (pad 2 smd rect (at  3.975  2.25 ${p.r}) (size 1.55 1.3) (layers ${p.side}.Cu ${p.side}.Paste ${p.side}.Mask) ${p.to})
    )
    `
}
