add network daemon
10
kicad/RJ45_plate/RJ45.pretty/FUSE.kicad_mod
Normal file
@ -0,0 +1,10 @@
|
||||
(module FUSE (layer F.Cu) (tedit 5B686345)
|
||||
(fp_text reference F1 (at 8.255 3.937) (layer F.SilkS)
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
(fp_text value Fuse (at 7.874 -4.064) (layer F.Fab)
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
(pad 2 smd rect (at 14.25 0) (size 6 5) (layers F.Cu F.Paste F.Mask))
|
||||
(pad 1 smd rect (at 0 0) (size 6 5) (layers F.Cu F.Paste F.Mask))
|
||||
)
|
||||
9
kicad/RJ45_plate/RJ45.pretty/Hole_3mm.kicad_mod
Normal file
@ -0,0 +1,9 @@
|
||||
(module Hole_3mm (layer F.Cu) (tedit 5B67E17F)
|
||||
(fp_text reference REF** (at 0 3.81) (layer F.SilkS) hide
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
(fp_text value Hole_3mm (at 0 -7.62) (layer F.Fab) hide
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
(pad 1 thru_hole circle (at 0 0) (size 5 5) (drill 1) (layers *.Cu *.Mask))
|
||||
)
|
||||
41
kicad/RJ45_plate/RJ45.pretty/RJ45.kicad_mod
Normal file
@ -0,0 +1,41 @@
|
||||
(module RJ45 (layer F.Cu) (tedit 5AD06174)
|
||||
(descr "RJ45 connector, 8-pin")
|
||||
(tags RJ45)
|
||||
(fp_text reference REF** (at 3.25 -4.25) (layer F.SilkS)
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
(fp_text value TJ8P8C (at 2.8 5) (layer F.Fab)
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
(fp_line (start -6.25 -3.25) (end 12.25 -3.25) (layer F.CrtYd) (width 0.15))
|
||||
(fp_line (start 12.25 -3.25) (end 12.25 7.25) (layer F.CrtYd) (width 0.15))
|
||||
(fp_line (start 12.25 7.25) (end -6.25 7.25) (layer F.CrtYd) (width 0.15))
|
||||
(fp_line (start -6.25 7.25) (end -6.25 -3.25) (layer F.CrtYd) (width 0.15))
|
||||
(fp_line (start -5.8 6.8) (end 11.8 6.8) (layer F.Fab) (width 0.15))
|
||||
(fp_line (start 11.8 6.8) (end 11.8 -2.8) (layer F.Fab) (width 0.15))
|
||||
(fp_line (start 11.8 -2.8) (end -4.8 -2.8) (layer F.Fab) (width 0.15))
|
||||
(fp_line (start -4.8 -2.8) (end -5.8 -1.8) (layer F.Fab) (width 0.15))
|
||||
(fp_line (start -5.8 -1.8) (end -5.8 6.8) (layer F.Fab) (width 0.15))
|
||||
(fp_line (start -6 7) (end 12 7) (layer F.SilkS) (width 0.15))
|
||||
(fp_line (start 12 7) (end 12 -3) (layer F.SilkS) (width 0.15))
|
||||
(fp_line (start 12 -3) (end -6 -3) (layer F.SilkS) (width 0.15))
|
||||
(fp_line (start -6 -3) (end -6 7) (layer F.SilkS) (width 0.15))
|
||||
(fp_text user %R (at 3.25 -4.25) (layer F.Fab)
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
(pad "" np_thru_hole circle (at 10.4 4.5) (size 2.2 2.2) (drill 2) (layers *.Cu *.Mask))
|
||||
(pad "" np_thru_hole circle (at -4.4 4.5) (size 2.2 2.2) (drill 2) (layers *.Cu *.Mask))
|
||||
(pad 1 thru_hole rect (at 0 0) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask))
|
||||
(pad 2 thru_hole circle (at 1 2.5) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask))
|
||||
(pad 3 thru_hole circle (at 2 0) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask))
|
||||
(pad 4 thru_hole circle (at 3 2.5) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask))
|
||||
(pad 5 thru_hole circle (at 4 0) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask))
|
||||
(pad 6 thru_hole circle (at 5 2.5) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask))
|
||||
(pad 7 thru_hole circle (at 6 0) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask))
|
||||
(pad 8 thru_hole circle (at 7 2.5) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask))
|
||||
(model ${KISYS3DMOD}/Connector_RJ.3dshapes/RJ45_8.wrl
|
||||
(at (xyz 116.128797 -161.289995 0))
|
||||
(scale (xyz 0.4 0.4 0.4))
|
||||
(rotate (xyz 0 0 0))
|
||||
)
|
||||
)
|
||||
1182
kicad/RJ45_plate/RJ45_plate-B.Cu.svg
Normal file
|
After Width: | Height: | Size: 41 KiB |
1086
kicad/RJ45_plate/RJ45_plate-F.Cu.svg
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
kicad/RJ45_plate/RJ45_plate-drl_map.pdf
Normal file
BIN
kicad/RJ45_plate/RJ45_plate.Cu.pdf
Normal file
3798
kicad/RJ45_plate/RJ45_plate.Cu.svg
Normal file
|
After Width: | Height: | Size: 121 KiB |
446
kicad/RJ45_plate/RJ45_plate.kicad_pcb
Normal file
@ -0,0 +1,446 @@
|
||||
(kicad_pcb (version 4) (host pcbnew 4.0.7)
|
||||
|
||||
(general
|
||||
(links 17)
|
||||
(no_connects 0)
|
||||
(area 111.899999 37.06238 175.157143 83.985)
|
||||
(thickness 1.6)
|
||||
(drawings 13)
|
||||
(tracks 88)
|
||||
(zones 0)
|
||||
(modules 7)
|
||||
(nets 6)
|
||||
)
|
||||
|
||||
(page A4)
|
||||
(layers
|
||||
(0 F.Cu signal)
|
||||
(31 B.Cu signal)
|
||||
(32 B.Adhes user)
|
||||
(33 F.Adhes user)
|
||||
(34 B.Paste user)
|
||||
(35 F.Paste user)
|
||||
(36 B.SilkS user)
|
||||
(37 F.SilkS user)
|
||||
(38 B.Mask user)
|
||||
(39 F.Mask user)
|
||||
(40 Dwgs.User user)
|
||||
(41 Cmts.User user)
|
||||
(42 Eco1.User user)
|
||||
(43 Eco2.User user)
|
||||
(44 Edge.Cuts user)
|
||||
(45 Margin user)
|
||||
(46 B.CrtYd user)
|
||||
(47 F.CrtYd user)
|
||||
(48 B.Fab user)
|
||||
(49 F.Fab user)
|
||||
)
|
||||
|
||||
(setup
|
||||
(last_trace_width 1)
|
||||
(user_trace_width 0.5)
|
||||
(user_trace_width 1)
|
||||
(user_trace_width 2)
|
||||
(trace_clearance 0.3)
|
||||
(zone_clearance 0.508)
|
||||
(zone_45_only no)
|
||||
(trace_min 0.2)
|
||||
(segment_width 0.2)
|
||||
(edge_width 0.15)
|
||||
(via_size 2)
|
||||
(via_drill 0.8)
|
||||
(via_min_size 0.4)
|
||||
(via_min_drill 0.3)
|
||||
(user_via 2 0.8)
|
||||
(uvia_size 0.3)
|
||||
(uvia_drill 0.1)
|
||||
(uvias_allowed no)
|
||||
(uvia_min_size 0.2)
|
||||
(uvia_min_drill 0.1)
|
||||
(pcb_text_width 0.3)
|
||||
(pcb_text_size 1.5 1.5)
|
||||
(mod_edge_width 0.15)
|
||||
(mod_text_size 1 1)
|
||||
(mod_text_width 0.15)
|
||||
(pad_size 1.524 1.524)
|
||||
(pad_drill 0.762)
|
||||
(pad_to_mask_clearance 0.2)
|
||||
(aux_axis_origin 0 0)
|
||||
(visible_elements FFFFFF7F)
|
||||
(pcbplotparams
|
||||
(layerselection 0x00000_00000001)
|
||||
(usegerberextensions false)
|
||||
(excludeedgelayer false)
|
||||
(linewidth 0.100000)
|
||||
(plotframeref false)
|
||||
(viasonmask false)
|
||||
(mode 1)
|
||||
(useauxorigin false)
|
||||
(hpglpennumber 1)
|
||||
(hpglpenspeed 20)
|
||||
(hpglpendiameter 15)
|
||||
(hpglpenoverlay 2)
|
||||
(psnegative true)
|
||||
(psa4output false)
|
||||
(plotreference false)
|
||||
(plotvalue false)
|
||||
(plotinvisibletext false)
|
||||
(padsonsilk false)
|
||||
(subtractmaskfromsilk false)
|
||||
(outputformat 5)
|
||||
(mirror true)
|
||||
(drillshape 2)
|
||||
(scaleselection 1)
|
||||
(outputdirectory ""))
|
||||
)
|
||||
|
||||
(net 0 "")
|
||||
(net 1 "Net-(J1-Pad1)")
|
||||
(net 2 "Net-(J1-Pad2)")
|
||||
(net 3 "Net-(J1-Pad3)")
|
||||
(net 4 "Net-(F1-Pad1)")
|
||||
(net 5 "Net-(F1-Pad2)")
|
||||
|
||||
(net_class Default "This is the default net class."
|
||||
(clearance 0.3)
|
||||
(trace_width 0.5)
|
||||
(via_dia 2)
|
||||
(via_drill 0.8)
|
||||
(uvia_dia 0.3)
|
||||
(uvia_drill 0.1)
|
||||
(add_net "Net-(F1-Pad1)")
|
||||
(add_net "Net-(F1-Pad2)")
|
||||
(add_net "Net-(J1-Pad1)")
|
||||
(add_net "Net-(J1-Pad2)")
|
||||
(add_net "Net-(J1-Pad3)")
|
||||
)
|
||||
|
||||
(module Connector_PinHeader_2.54mm.pretty:PinHeader_1x04_P2.54mm_Vertical (layer F.Cu) (tedit 59FED5CC) (tstamp 5B68A033)
|
||||
(at 129.286 41.91 90)
|
||||
(descr "Through hole straight pin header, 1x04, 2.54mm pitch, single row")
|
||||
(tags "Through hole pin header THT 1x04 2.54mm single row")
|
||||
(path /5B67E004)
|
||||
(fp_text reference J1 (at 0 -2.33 90) (layer F.SilkS)
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
(fp_text value Conn_01x04 (at 0 9.95 90) (layer F.Fab)
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
(fp_line (start -0.635 -1.27) (end 1.27 -1.27) (layer F.Fab) (width 0.1))
|
||||
(fp_line (start 1.27 -1.27) (end 1.27 8.89) (layer F.Fab) (width 0.1))
|
||||
(fp_line (start 1.27 8.89) (end -1.27 8.89) (layer F.Fab) (width 0.1))
|
||||
(fp_line (start -1.27 8.89) (end -1.27 -0.635) (layer F.Fab) (width 0.1))
|
||||
(fp_line (start -1.27 -0.635) (end -0.635 -1.27) (layer F.Fab) (width 0.1))
|
||||
(fp_line (start -1.33 8.95) (end 1.33 8.95) (layer F.SilkS) (width 0.12))
|
||||
(fp_line (start -1.33 1.27) (end -1.33 8.95) (layer F.SilkS) (width 0.12))
|
||||
(fp_line (start 1.33 1.27) (end 1.33 8.95) (layer F.SilkS) (width 0.12))
|
||||
(fp_line (start -1.33 1.27) (end 1.33 1.27) (layer F.SilkS) (width 0.12))
|
||||
(fp_line (start -1.33 0) (end -1.33 -1.33) (layer F.SilkS) (width 0.12))
|
||||
(fp_line (start -1.33 -1.33) (end 0 -1.33) (layer F.SilkS) (width 0.12))
|
||||
(fp_line (start -1.8 -1.8) (end -1.8 9.4) (layer F.CrtYd) (width 0.05))
|
||||
(fp_line (start -1.8 9.4) (end 1.8 9.4) (layer F.CrtYd) (width 0.05))
|
||||
(fp_line (start 1.8 9.4) (end 1.8 -1.8) (layer F.CrtYd) (width 0.05))
|
||||
(fp_line (start 1.8 -1.8) (end -1.8 -1.8) (layer F.CrtYd) (width 0.05))
|
||||
(fp_text user %R (at 0 3.81 180) (layer F.Fab)
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
(pad 1 thru_hole rect (at 0 0 90) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)
|
||||
(net 1 "Net-(J1-Pad1)"))
|
||||
(pad 2 thru_hole oval (at 0 2.54 90) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)
|
||||
(net 2 "Net-(J1-Pad2)"))
|
||||
(pad 3 thru_hole oval (at 0 5.08 90) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)
|
||||
(net 3 "Net-(J1-Pad3)"))
|
||||
(pad 4 thru_hole oval (at 0 7.62 90) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)
|
||||
(net 5 "Net-(F1-Pad2)"))
|
||||
(model ${KISYS3DMOD}/Connector_PinHeader_2.54mm.3dshapes/PinHeader_1x04_P2.54mm_Vertical.wrl
|
||||
(at (xyz 0 0 0))
|
||||
(scale (xyz 1 1 1))
|
||||
(rotate (xyz 0 0 0))
|
||||
)
|
||||
)
|
||||
|
||||
(module RJ45:RJ45 (layer F.Cu) (tedit 5AD06174) (tstamp 5B68A04F)
|
||||
(at 139.5 53.5)
|
||||
(descr "RJ45 connector, 8-pin")
|
||||
(tags RJ45)
|
||||
(path /5B67DE38)
|
||||
(fp_text reference J2 (at 3.25 -4.25) (layer F.SilkS)
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
(fp_text value RJ45 (at 2.8 5) (layer F.Fab)
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
(fp_line (start -6.25 -3.25) (end 12.25 -3.25) (layer F.CrtYd) (width 0.15))
|
||||
(fp_line (start 12.25 -3.25) (end 12.25 7.25) (layer F.CrtYd) (width 0.15))
|
||||
(fp_line (start 12.25 7.25) (end -6.25 7.25) (layer F.CrtYd) (width 0.15))
|
||||
(fp_line (start -6.25 7.25) (end -6.25 -3.25) (layer F.CrtYd) (width 0.15))
|
||||
(fp_line (start -5.8 6.8) (end 11.8 6.8) (layer F.Fab) (width 0.15))
|
||||
(fp_line (start 11.8 6.8) (end 11.8 -2.8) (layer F.Fab) (width 0.15))
|
||||
(fp_line (start 11.8 -2.8) (end -4.8 -2.8) (layer F.Fab) (width 0.15))
|
||||
(fp_line (start -4.8 -2.8) (end -5.8 -1.8) (layer F.Fab) (width 0.15))
|
||||
(fp_line (start -5.8 -1.8) (end -5.8 6.8) (layer F.Fab) (width 0.15))
|
||||
(fp_line (start -6 7) (end 12 7) (layer F.SilkS) (width 0.15))
|
||||
(fp_line (start 12 7) (end 12 -3) (layer F.SilkS) (width 0.15))
|
||||
(fp_line (start 12 -3) (end -6 -3) (layer F.SilkS) (width 0.15))
|
||||
(fp_line (start -6 -3) (end -6 7) (layer F.SilkS) (width 0.15))
|
||||
(fp_text user %R (at 3.25 -4.25) (layer F.Fab)
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
(pad "" np_thru_hole circle (at 10.4 4.5) (size 2.2 2.2) (drill 2) (layers *.Cu *.Mask))
|
||||
(pad "" np_thru_hole circle (at -4.4 4.5) (size 2.2 2.2) (drill 2) (layers *.Cu *.Mask))
|
||||
(pad 1 thru_hole rect (at 0 0) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask)
|
||||
(net 4 "Net-(F1-Pad1)"))
|
||||
(pad 2 thru_hole circle (at 1 2.5) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask)
|
||||
(net 4 "Net-(F1-Pad1)"))
|
||||
(pad 3 thru_hole circle (at 2 0) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask)
|
||||
(net 4 "Net-(F1-Pad1)"))
|
||||
(pad 4 thru_hole circle (at 3 2.5) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask)
|
||||
(net 3 "Net-(J1-Pad3)"))
|
||||
(pad 5 thru_hole circle (at 4 0) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask)
|
||||
(net 2 "Net-(J1-Pad2)"))
|
||||
(pad 6 thru_hole circle (at 5 2.5) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask)
|
||||
(net 1 "Net-(J1-Pad1)"))
|
||||
(pad 7 thru_hole circle (at 6 0) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask)
|
||||
(net 1 "Net-(J1-Pad1)"))
|
||||
(pad 8 thru_hole circle (at 7 2.5) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask)
|
||||
(net 1 "Net-(J1-Pad1)"))
|
||||
(model ${KISYS3DMOD}/Connector_RJ.3dshapes/RJ45_8.wrl
|
||||
(at (xyz 116.128797 -161.289995 0))
|
||||
(scale (xyz 0.4 0.4 0.4))
|
||||
(rotate (xyz 0 0 0))
|
||||
)
|
||||
)
|
||||
|
||||
(module RJ45:RJ45 (layer F.Cu) (tedit 5AD06174) (tstamp 5B68A06B)
|
||||
(at 120.5 53.5)
|
||||
(descr "RJ45 connector, 8-pin")
|
||||
(tags RJ45)
|
||||
(path /5B67DF3D)
|
||||
(fp_text reference J3 (at 3.25 -4.25) (layer F.SilkS)
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
(fp_text value RJ45 (at 2.8 5) (layer F.Fab)
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
(fp_line (start -6.25 -3.25) (end 12.25 -3.25) (layer F.CrtYd) (width 0.15))
|
||||
(fp_line (start 12.25 -3.25) (end 12.25 7.25) (layer F.CrtYd) (width 0.15))
|
||||
(fp_line (start 12.25 7.25) (end -6.25 7.25) (layer F.CrtYd) (width 0.15))
|
||||
(fp_line (start -6.25 7.25) (end -6.25 -3.25) (layer F.CrtYd) (width 0.15))
|
||||
(fp_line (start -5.8 6.8) (end 11.8 6.8) (layer F.Fab) (width 0.15))
|
||||
(fp_line (start 11.8 6.8) (end 11.8 -2.8) (layer F.Fab) (width 0.15))
|
||||
(fp_line (start 11.8 -2.8) (end -4.8 -2.8) (layer F.Fab) (width 0.15))
|
||||
(fp_line (start -4.8 -2.8) (end -5.8 -1.8) (layer F.Fab) (width 0.15))
|
||||
(fp_line (start -5.8 -1.8) (end -5.8 6.8) (layer F.Fab) (width 0.15))
|
||||
(fp_line (start -6 7) (end 12 7) (layer F.SilkS) (width 0.15))
|
||||
(fp_line (start 12 7) (end 12 -3) (layer F.SilkS) (width 0.15))
|
||||
(fp_line (start 12 -3) (end -6 -3) (layer F.SilkS) (width 0.15))
|
||||
(fp_line (start -6 -3) (end -6 7) (layer F.SilkS) (width 0.15))
|
||||
(fp_text user %R (at 3.25 -4.25) (layer F.Fab)
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
(pad "" np_thru_hole circle (at 10.4 4.5) (size 2.2 2.2) (drill 2) (layers *.Cu *.Mask))
|
||||
(pad "" np_thru_hole circle (at -4.4 4.5) (size 2.2 2.2) (drill 2) (layers *.Cu *.Mask))
|
||||
(pad 1 thru_hole rect (at 0 0) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask)
|
||||
(net 4 "Net-(F1-Pad1)"))
|
||||
(pad 2 thru_hole circle (at 1 2.5) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask)
|
||||
(net 4 "Net-(F1-Pad1)"))
|
||||
(pad 3 thru_hole circle (at 2 0) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask)
|
||||
(net 4 "Net-(F1-Pad1)"))
|
||||
(pad 4 thru_hole circle (at 3 2.5) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask)
|
||||
(net 3 "Net-(J1-Pad3)"))
|
||||
(pad 5 thru_hole circle (at 4 0) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask)
|
||||
(net 2 "Net-(J1-Pad2)"))
|
||||
(pad 6 thru_hole circle (at 5 2.5) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask)
|
||||
(net 1 "Net-(J1-Pad1)"))
|
||||
(pad 7 thru_hole circle (at 6 0) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask)
|
||||
(net 1 "Net-(J1-Pad1)"))
|
||||
(pad 8 thru_hole circle (at 7 2.5) (size 1.5 1.5) (drill 0.9) (layers *.Cu *.Mask)
|
||||
(net 1 "Net-(J1-Pad1)"))
|
||||
(model ${KISYS3DMOD}/Connector_RJ.3dshapes/RJ45_8.wrl
|
||||
(at (xyz 116.128797 -161.289995 0))
|
||||
(scale (xyz 0.4 0.4 0.4))
|
||||
(rotate (xyz 0 0 0))
|
||||
)
|
||||
)
|
||||
|
||||
(module RJ45:Hole_3mm (layer F.Cu) (tedit 5B67E153) (tstamp 5B67E16B)
|
||||
(at 171 79)
|
||||
(fp_text reference REF** (at 0 3.81) (layer F.SilkS) hide
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
(fp_text value Hole_3mm (at 0 -7.62) (layer F.Fab) hide
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
)
|
||||
|
||||
(module RJ45:Hole_3mm (layer F.Cu) (tedit 5B67E17F) (tstamp 5B67E190)
|
||||
(at 117.75 48)
|
||||
(fp_text reference REF** (at 0 3.81) (layer F.SilkS) hide
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
(fp_text value Hole_3mm (at 0 -7.62) (layer F.Fab) hide
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
(pad 1 thru_hole circle (at 0 0) (size 5 5) (drill 1) (layers *.Cu *.Mask))
|
||||
)
|
||||
|
||||
(module RJ45:Hole_3mm (layer F.Cu) (tedit 5B67E17F) (tstamp 5B67E19A)
|
||||
(at 148.25 48)
|
||||
(fp_text reference REF** (at 0 3.81) (layer F.SilkS) hide
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
(fp_text value Hole_3mm (at 0 -7.62) (layer F.Fab) hide
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
(pad 1 thru_hole circle (at 0 0) (size 5 5) (drill 1) (layers *.Cu *.Mask))
|
||||
)
|
||||
|
||||
(module RJ45:FUSE (layer F.Cu) (tedit 5B686345) (tstamp 5B6873A7)
|
||||
(at 126.238 47.371)
|
||||
(path /5B685A07)
|
||||
(fp_text reference F1 (at 8.255 3.937) (layer F.SilkS)
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
(fp_text value Fuse (at 7.874 -4.064) (layer F.Fab)
|
||||
(effects (font (size 1 1) (thickness 0.15)))
|
||||
)
|
||||
(pad 2 smd rect (at 14.25 0) (size 6 5) (layers F.Cu F.Paste F.Mask)
|
||||
(net 5 "Net-(F1-Pad2)"))
|
||||
(pad 1 smd rect (at 0 0) (size 6 5) (layers F.Cu F.Paste F.Mask)
|
||||
(net 4 "Net-(F1-Pad1)"))
|
||||
)
|
||||
|
||||
(dimension 22 (width 0.3) (layer Dwgs.User)
|
||||
(gr_text "22.000 mm" (at 156.85 51 90) (layer Dwgs.User)
|
||||
(effects (font (size 1.5 1.5) (thickness 0.3)))
|
||||
)
|
||||
(feature1 (pts (xy 152 40) (xy 158.2 40)))
|
||||
(feature2 (pts (xy 152 62) (xy 158.2 62)))
|
||||
(crossbar (pts (xy 155.5 62) (xy 155.5 40)))
|
||||
(arrow1a (pts (xy 155.5 40) (xy 156.086421 41.126504)))
|
||||
(arrow1b (pts (xy 155.5 40) (xy 154.913579 41.126504)))
|
||||
(arrow2a (pts (xy 155.5 62) (xy 156.086421 60.873496)))
|
||||
(arrow2b (pts (xy 155.5 62) (xy 154.913579 60.873496)))
|
||||
)
|
||||
(dimension 38 (width 0.3) (layer Dwgs.User)
|
||||
(gr_text "38.000 mm" (at 133 65.349999) (layer Dwgs.User)
|
||||
(effects (font (size 1.5 1.5) (thickness 0.3)))
|
||||
)
|
||||
(feature1 (pts (xy 152 62) (xy 152 66.699999)))
|
||||
(feature2 (pts (xy 114 62) (xy 114 66.699999)))
|
||||
(crossbar (pts (xy 114 63.999999) (xy 152 63.999999)))
|
||||
(arrow1a (pts (xy 152 63.999999) (xy 150.873496 64.58642)))
|
||||
(arrow1b (pts (xy 152 63.999999) (xy 150.873496 63.413578)))
|
||||
(arrow2a (pts (xy 114 63.999999) (xy 115.126504 64.58642)))
|
||||
(arrow2b (pts (xy 114 63.999999) (xy 115.126504 63.413578)))
|
||||
)
|
||||
(gr_text 3-CANL (at 146.431 41.529) (layer B.Cu)
|
||||
(effects (font (size 1.5 1.5) (thickness 0.3)) (justify mirror))
|
||||
)
|
||||
(gr_text 2CANH (at 117.856 41.529) (layer B.Cu)
|
||||
(effects (font (size 1.5 1.5) (thickness 0.3)) (justify mirror))
|
||||
)
|
||||
(gr_text "4 +12V" (at 145.923 41.783) (layer F.Cu)
|
||||
(effects (font (size 1.5 1.5) (thickness 0.3)))
|
||||
)
|
||||
(gr_text "1 Gnd" (at 117.856 41.783) (layer F.Cu)
|
||||
(effects (font (size 1.5 1.5) (thickness 0.3)))
|
||||
)
|
||||
(gr_line (start 152 62) (end 152 61) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
(gr_line (start 114 62) (end 152 62) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
(gr_line (start 114 61) (end 114 62) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
(gr_line (start 114 40) (end 152 40) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
(gr_line (start 114 40) (end 114 61) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
(gr_line (start 152 40) (end 152 61) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
(gr_line (start 112 48) (end 154 48) (angle 90) (layer Dwgs.User) (width 0.2))
|
||||
|
||||
(segment (start 122.682 42.545) (end 122.682 42.037) (width 1) (layer B.Cu) (net 1))
|
||||
(segment (start 122.682 42.037) (end 123.698 41.021) (width 1) (layer B.Cu) (net 1) (tstamp 5B6874D9))
|
||||
(segment (start 121.298822 50.718325) (end 121.298822 43.928178) (width 1) (layer F.Cu) (net 1))
|
||||
(segment (start 121.298822 43.928178) (end 122.682 42.545) (width 1) (layer F.Cu) (net 1) (tstamp 5B6874D6))
|
||||
(segment (start 128.27 51.435) (end 144.272 51.435) (width 1) (layer F.Cu) (net 1))
|
||||
(segment (start 145.5 50.885) (end 145.5 53.5) (width 1) (layer B.Cu) (net 1) (tstamp 5B687478))
|
||||
(segment (start 144.399 49.784) (end 145.5 50.885) (width 1) (layer B.Cu) (net 1) (tstamp 5B687477))
|
||||
(segment (start 144.399 46.101) (end 144.399 49.784) (width 1) (layer B.Cu) (net 1) (tstamp 5B687476))
|
||||
(segment (start 146.431 44.069) (end 144.399 46.101) (width 1) (layer B.Cu) (net 1) (tstamp 5B687475))
|
||||
(via (at 146.431 44.069) (size 2) (drill 0.8) (layers F.Cu B.Cu) (net 1))
|
||||
(segment (start 144.907 45.593) (end 146.431 44.069) (width 1) (layer F.Cu) (net 1) (tstamp 5B687473))
|
||||
(segment (start 144.907 50.8) (end 144.907 45.593) (width 1) (layer F.Cu) (net 1) (tstamp 5B687472))
|
||||
(segment (start 144.272 51.435) (end 144.907 50.8) (width 1) (layer F.Cu) (net 1) (tstamp 5B687471))
|
||||
(segment (start 126.5 53.5) (end 128.491 53.5) (width 1) (layer B.Cu) (net 1))
|
||||
(segment (start 128.397 41.021) (end 129.286 41.91) (width 1) (layer B.Cu) (net 1) (tstamp 5B68744D))
|
||||
(via (at 122.682 42.545) (size 2) (drill 0.8) (layers F.Cu B.Cu) (net 1))
|
||||
(segment (start 123.698 41.021) (end 128.397 41.021) (width 1) (layer B.Cu) (net 1) (tstamp 5B6874DC))
|
||||
(segment (start 121.285 50.8) (end 121.298822 50.718325) (width 1) (layer F.Cu) (net 1) (tstamp 5B687448))
|
||||
(segment (start 121.92 51.435) (end 121.285 50.8) (width 1) (layer F.Cu) (net 1) (tstamp 5B687447))
|
||||
(segment (start 129.794 51.435) (end 128.27 51.435) (width 1) (layer F.Cu) (net 1) (tstamp 5B687446))
|
||||
(segment (start 128.27 51.435) (end 121.92 51.435) (width 1) (layer F.Cu) (net 1) (tstamp 5B68746F))
|
||||
(segment (start 130.81 50.419) (end 129.794 51.435) (width 1) (layer F.Cu) (net 1) (tstamp 5B687445))
|
||||
(segment (start 130.81 49.657) (end 130.81 50.419) (width 1) (layer F.Cu) (net 1) (tstamp 5B687444))
|
||||
(segment (start 131.064 49.403) (end 130.81 49.657) (width 1) (layer F.Cu) (net 1) (tstamp 5B687443))
|
||||
(via (at 131.064 49.403) (size 2) (drill 0.8) (layers F.Cu B.Cu) (net 1))
|
||||
(segment (start 131.064 50.927) (end 131.064 49.403) (width 1) (layer B.Cu) (net 1) (tstamp 5B687441))
|
||||
(segment (start 128.491 53.5) (end 131.064 50.927) (width 1) (layer B.Cu) (net 1) (tstamp 5B687440))
|
||||
(segment (start 125.5 56) (end 127.5 56) (width 1) (layer B.Cu) (net 1))
|
||||
(segment (start 127.5 56) (end 126.5 55) (width 1) (layer B.Cu) (net 1) (tstamp 5B67E503))
|
||||
(segment (start 126.5 55) (end 126.5 53.5) (width 1) (layer B.Cu) (net 1) (tstamp 5B67E504))
|
||||
(segment (start 144.5 56) (end 146.5 56) (width 1) (layer B.Cu) (net 1))
|
||||
(segment (start 146.5 56) (end 145.5 55) (width 1) (layer B.Cu) (net 1) (tstamp 5B67E4FA))
|
||||
(segment (start 145.5 55) (end 145.5 53.5) (width 1) (layer B.Cu) (net 1) (tstamp 5B67E4FB))
|
||||
(segment (start 126.5 53.5) (end 126.5 53.078) (width 1) (layer B.Cu) (net 1))
|
||||
(segment (start 143.5 53.5) (end 143.5 52.06) (width 1) (layer B.Cu) (net 2))
|
||||
(segment (start 136.906 45.466) (end 135.636 45.466) (width 1) (layer B.Cu) (net 2) (tstamp 5B687451))
|
||||
(segment (start 143.5 52.06) (end 136.906 45.466) (width 1) (layer B.Cu) (net 2) (tstamp 5B687450))
|
||||
(segment (start 124.5 53.5) (end 124.5 47.585) (width 1) (layer B.Cu) (net 2))
|
||||
(segment (start 126.619 45.466) (end 131.064 45.466) (width 1) (layer B.Cu) (net 2) (tstamp 5B68741E))
|
||||
(segment (start 124.5 47.585) (end 126.619 45.466) (width 1) (layer B.Cu) (net 2) (tstamp 5B68741D))
|
||||
(segment (start 131.826 41.91) (end 131.826 44.704) (width 1) (layer B.Cu) (net 2))
|
||||
(segment (start 131.826 44.704) (end 131.064 45.466) (width 1) (layer B.Cu) (net 2) (tstamp 5B68741A))
|
||||
(via (at 131.064 45.466) (size 2) (drill 0.8) (layers F.Cu B.Cu) (net 2))
|
||||
(via (at 135.636 45.466) (size 2) (drill 0.8) (layers F.Cu B.Cu) (net 2))
|
||||
(segment (start 131.064 45.466) (end 135.636 45.466) (width 1) (layer F.Cu) (net 2) (tstamp 5B6873DF))
|
||||
(segment (start 133.731 45.212) (end 133.731 52.07) (width 1) (layer B.Cu) (net 3))
|
||||
(segment (start 133.731 52.07) (end 136.271 54.61) (width 1) (layer B.Cu) (net 3) (tstamp 5B687427))
|
||||
(segment (start 134.366 41.91) (end 134.366 43.561) (width 1) (layer B.Cu) (net 3))
|
||||
(segment (start 133.731 44.196) (end 133.731 45.212) (width 1) (layer B.Cu) (net 3) (tstamp 5B687404))
|
||||
(segment (start 134.366 43.561) (end 133.731 44.196) (width 1) (layer B.Cu) (net 3) (tstamp 5B687403))
|
||||
(segment (start 138.176 56.515) (end 138.176 60.452) (width 1) (layer B.Cu) (net 3) (tstamp 5B6873D7))
|
||||
(segment (start 136.271 54.61) (end 138.176 56.515) (width 1) (layer B.Cu) (net 3) (tstamp 5B68742A))
|
||||
(segment (start 123.5 56) (end 123.5 57.206) (width 1) (layer B.Cu) (net 3))
|
||||
(segment (start 139.827 60.452) (end 142.5 57.779) (width 1) (layer B.Cu) (net 3) (tstamp 5B67E537))
|
||||
(segment (start 126.746 60.452) (end 138.176 60.452) (width 1) (layer B.Cu) (net 3) (tstamp 5B67E536))
|
||||
(segment (start 138.176 60.452) (end 139.827 60.452) (width 1) (layer B.Cu) (net 3) (tstamp 5B6873DA))
|
||||
(segment (start 123.5 57.206) (end 126.746 60.452) (width 1) (layer B.Cu) (net 3) (tstamp 5B67E535))
|
||||
(segment (start 142.5 57.779) (end 142.5 56) (width 1) (layer B.Cu) (net 3) (tstamp 5B67E50D))
|
||||
(segment (start 126.238 47.371) (end 135.128 47.371) (width 1) (layer F.Cu) (net 4))
|
||||
(segment (start 135.128 47.371) (end 135.763 48.006) (width 1) (layer F.Cu) (net 4) (tstamp 5B6874B5))
|
||||
(segment (start 125.476 43.307) (end 125.476 46.609) (width 1) (layer F.Cu) (net 4))
|
||||
(segment (start 125.476 46.609) (end 126.238 47.371) (width 1) (layer F.Cu) (net 4) (tstamp 5B6874B1))
|
||||
(segment (start 139.5 53.5) (end 139.5 52.759) (width 1) (layer B.Cu) (net 4))
|
||||
(segment (start 139.5 52.759) (end 135.763 49.022) (width 1) (layer B.Cu) (net 4) (tstamp 5B687467))
|
||||
(segment (start 135.128 47.371) (end 125.73 47.371) (width 1) (layer F.Cu) (net 4) (tstamp 5B68746B))
|
||||
(segment (start 135.763 48.006) (end 135.128 47.371) (width 1) (layer F.Cu) (net 4) (tstamp 5B68746A))
|
||||
(via (at 135.763 48.006) (size 2) (drill 0.8) (layers F.Cu B.Cu) (net 4))
|
||||
(segment (start 135.763 49.022) (end 135.763 48.006) (width 1) (layer B.Cu) (net 4) (tstamp 5B687468))
|
||||
(segment (start 139.5 53.5) (end 141.5 53.5) (width 1) (layer B.Cu) (net 4))
|
||||
(segment (start 122.5 53.5) (end 122.5 46.283) (width 1) (layer B.Cu) (net 4))
|
||||
(segment (start 122.5 46.283) (end 125.476 43.307) (width 1) (layer B.Cu) (net 4) (tstamp 5B68743D))
|
||||
(segment (start 125.476 43.307) (end 125.476 47.117) (width 1) (layer F.Cu) (net 4))
|
||||
(via (at 125.476 43.307) (size 2) (drill 0.8) (layers F.Cu B.Cu) (net 4))
|
||||
(segment (start 125.476 47.117) (end 125.73 47.371) (width 1) (layer F.Cu) (net 4) (tstamp 5B687438))
|
||||
(segment (start 124.079 47.371) (end 125.73 47.371) (width 1) (layer F.Cu) (net 4) (tstamp 5B6873B5))
|
||||
(segment (start 120.5 53.5) (end 122.5 53.5) (width 1) (layer B.Cu) (net 4))
|
||||
(segment (start 122.5 53.5) (end 121.5 54.5) (width 1) (layer B.Cu) (net 4) (tstamp 5B67E4FF))
|
||||
(segment (start 121.5 54.5) (end 121.5 56) (width 1) (layer B.Cu) (net 4) (tstamp 5B67E500))
|
||||
(segment (start 141.5 53.5) (end 140.5 54.5) (width 1) (layer B.Cu) (net 4) (tstamp 5B67E4F5))
|
||||
(segment (start 140.5 54.5) (end 140.5 56) (width 1) (layer B.Cu) (net 4) (tstamp 5B67E4F6))
|
||||
(segment (start 121.5 56) (end 121.292 56) (width 1) (layer B.Cu) (net 4))
|
||||
(segment (start 140.716 43.18) (end 140.716 47.143) (width 1) (layer F.Cu) (net 5))
|
||||
(segment (start 140.716 47.143) (end 140.488 47.371) (width 1) (layer F.Cu) (net 5) (tstamp 5B6874AE))
|
||||
(segment (start 140.73 47.371) (end 140.73 43.194) (width 1) (layer F.Cu) (net 5))
|
||||
(segment (start 139.446 41.91) (end 136.906 41.91) (width 1) (layer B.Cu) (net 5) (tstamp 5B6873BB))
|
||||
(segment (start 140.716 43.18) (end 139.446 41.91) (width 1) (layer B.Cu) (net 5) (tstamp 5B6873BA))
|
||||
(via (at 140.716 43.18) (size 2) (drill 0.8) (layers F.Cu B.Cu) (net 5))
|
||||
(segment (start 140.73 43.194) (end 140.716 43.18) (width 1) (layer F.Cu) (net 5) (tstamp 5B6873B8))
|
||||
|
||||
)
|
||||
125
kicad/RJ45_plate/RJ45_plate.net
Normal file
@ -0,0 +1,125 @@
|
||||
(export (version D)
|
||||
(design
|
||||
(source /home/eddy/Docs/SAO/BTA/MIRROR_CONTROL_termo/Project/kicad/RJ45_plate/RJ45_plate.sch)
|
||||
(date "Пн 06 авг 2018 17:42:20")
|
||||
(tool "Eeschema 4.0.7")
|
||||
(sheet (number 1) (name /) (tstamps /)
|
||||
(title_block
|
||||
(title)
|
||||
(company)
|
||||
(rev)
|
||||
(date)
|
||||
(source RJ45_plate.sch)
|
||||
(comment (number 1) (value ""))
|
||||
(comment (number 2) (value ""))
|
||||
(comment (number 3) (value ""))
|
||||
(comment (number 4) (value "")))))
|
||||
(components
|
||||
(comp (ref J2)
|
||||
(value RJ45)
|
||||
(footprint RJ45:RJ45)
|
||||
(libsource (lib conn) (part Conn_01x08))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 5B67DE38))
|
||||
(comp (ref J3)
|
||||
(value RJ45)
|
||||
(footprint RJ45:RJ45)
|
||||
(libsource (lib conn) (part Conn_01x08))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 5B67DF3D))
|
||||
(comp (ref J1)
|
||||
(value Conn_01x04)
|
||||
(footprint Connector_PinHeader_2.54mm.pretty:PinHeader_1x04_P2.54mm_Vertical)
|
||||
(libsource (lib conn) (part Conn_01x04))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 5B67E004))
|
||||
(comp (ref F1)
|
||||
(value Fuse)
|
||||
(footprint RJ45:FUSE)
|
||||
(libsource (lib device) (part Fuse))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 5B685A07)))
|
||||
(libparts
|
||||
(libpart (lib conn) (part Conn_01x04)
|
||||
(description "Generic connector, single row, 01x04")
|
||||
(docs ~)
|
||||
(footprints
|
||||
(fp Connector*:*_??x*mm*)
|
||||
(fp Connector*:*1x??x*mm*)
|
||||
(fp Pin?Header?Straight?1X*)
|
||||
(fp Pin?Header?Angled?1X*)
|
||||
(fp Socket?Strip?Straight?1X*)
|
||||
(fp Socket?Strip?Angled?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 conn) (part Conn_01x08)
|
||||
(description "Generic connector, single row, 01x08")
|
||||
(docs ~)
|
||||
(footprints
|
||||
(fp Connector*:*_??x*mm*)
|
||||
(fp Connector*:*1x??x*mm*)
|
||||
(fp Pin?Header?Straight?1X*)
|
||||
(fp Pin?Header?Angled?1X*)
|
||||
(fp Socket?Strip?Straight?1X*)
|
||||
(fp Socket?Strip?Angled?1X*))
|
||||
(fields
|
||||
(field (name Reference) J)
|
||||
(field (name Value) Conn_01x08))
|
||||
(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))
|
||||
(pin (num 7) (name Pin_7) (type passive))
|
||||
(pin (num 8) (name Pin_8) (type passive))))
|
||||
(libpart (lib device) (part Fuse)
|
||||
(description "Fuse, generic")
|
||||
(footprints
|
||||
(fp *Fuse*))
|
||||
(fields
|
||||
(field (name Reference) F)
|
||||
(field (name Value) Fuse))
|
||||
(pins
|
||||
(pin (num 1) (name ~) (type passive))
|
||||
(pin (num 2) (name ~) (type passive)))))
|
||||
(libraries
|
||||
(library (logical conn)
|
||||
(uri /usr/share/kicad/library/conn.lib))
|
||||
(library (logical device)
|
||||
(uri /usr/share/kicad/library/device.lib)))
|
||||
(nets
|
||||
(net (code 1) (name "Net-(J1-Pad1)")
|
||||
(node (ref J2) (pin 8))
|
||||
(node (ref J3) (pin 7))
|
||||
(node (ref J3) (pin 8))
|
||||
(node (ref J2) (pin 7))
|
||||
(node (ref J2) (pin 6))
|
||||
(node (ref J1) (pin 1))
|
||||
(node (ref J3) (pin 6)))
|
||||
(net (code 2) (name "Net-(J1-Pad3)")
|
||||
(node (ref J1) (pin 3))
|
||||
(node (ref J2) (pin 4))
|
||||
(node (ref J3) (pin 4)))
|
||||
(net (code 3) (name "Net-(J1-Pad2)")
|
||||
(node (ref J3) (pin 5))
|
||||
(node (ref J1) (pin 2))
|
||||
(node (ref J2) (pin 5)))
|
||||
(net (code 4) (name "Net-(F1-Pad1)")
|
||||
(node (ref J2) (pin 3))
|
||||
(node (ref J2) (pin 1))
|
||||
(node (ref J3) (pin 3))
|
||||
(node (ref J3) (pin 2))
|
||||
(node (ref J3) (pin 1))
|
||||
(node (ref F1) (pin 1))
|
||||
(node (ref J2) (pin 2)))
|
||||
(net (code 5) (name "Net-(F1-Pad2)")
|
||||
(node (ref F1) (pin 2))
|
||||
(node (ref J1) (pin 4)))))
|
||||
63
kicad/RJ45_plate/RJ45_plate.pro
Normal file
@ -0,0 +1,63 @@
|
||||
update=Пн 06 авг 2018 08:33:28
|
||||
version=1
|
||||
last_client=kicad
|
||||
[pcbnew]
|
||||
version=1
|
||||
LastNetListRead=
|
||||
UseCmpFile=1
|
||||
PadDrill=0.600000000000
|
||||
PadDrillOvalY=0.600000000000
|
||||
PadSizeH=1.500000000000
|
||||
PadSizeV=1.500000000000
|
||||
PcbTextSizeV=1.500000000000
|
||||
PcbTextSizeH=1.500000000000
|
||||
PcbTextThickness=0.300000000000
|
||||
ModuleTextSizeV=1.000000000000
|
||||
ModuleTextSizeH=1.000000000000
|
||||
ModuleTextSizeThickness=0.150000000000
|
||||
SolderMaskClearance=0.000000000000
|
||||
SolderMaskMinWidth=0.000000000000
|
||||
DrawSegmentWidth=0.200000000000
|
||||
BoardOutlineThickness=0.100000000000
|
||||
ModuleOutlineThickness=0.150000000000
|
||||
[cvpcb]
|
||||
version=1
|
||||
NetIExt=net
|
||||
[eeschema]
|
||||
version=1
|
||||
LibDir=
|
||||
[eeschema/libraries]
|
||||
LibName1=power
|
||||
LibName2=device
|
||||
LibName3=switches
|
||||
LibName4=relays
|
||||
LibName5=motors
|
||||
LibName6=transistors
|
||||
LibName7=conn
|
||||
LibName8=linear
|
||||
LibName9=regul
|
||||
LibName10=74xx
|
||||
LibName11=cmos4000
|
||||
LibName12=adc-dac
|
||||
LibName13=memory
|
||||
LibName14=xilinx
|
||||
LibName15=microcontrollers
|
||||
LibName16=dsp
|
||||
LibName17=microchip
|
||||
LibName18=analog_switches
|
||||
LibName19=motorola
|
||||
LibName20=texas
|
||||
LibName21=intel
|
||||
LibName22=audio
|
||||
LibName23=interface
|
||||
LibName24=digital-audio
|
||||
LibName25=philips
|
||||
LibName26=display
|
||||
LibName27=cypress
|
||||
LibName28=siliconi
|
||||
LibName29=opto
|
||||
LibName30=atmel
|
||||
LibName31=contrib
|
||||
LibName32=valves
|
||||
[general]
|
||||
version=1
|
||||
145
kicad/RJ45_plate/RJ45_plate.sch
Normal file
@ -0,0 +1,145 @@
|
||||
EESchema Schematic File Version 2
|
||||
LIBS:power
|
||||
LIBS:device
|
||||
LIBS:switches
|
||||
LIBS:relays
|
||||
LIBS:motors
|
||||
LIBS:transistors
|
||||
LIBS:conn
|
||||
LIBS:linear
|
||||
LIBS:regul
|
||||
LIBS:74xx
|
||||
LIBS:cmos4000
|
||||
LIBS:adc-dac
|
||||
LIBS:memory
|
||||
LIBS:xilinx
|
||||
LIBS:microcontrollers
|
||||
LIBS:dsp
|
||||
LIBS:microchip
|
||||
LIBS:analog_switches
|
||||
LIBS:motorola
|
||||
LIBS:texas
|
||||
LIBS:intel
|
||||
LIBS:audio
|
||||
LIBS:interface
|
||||
LIBS:digital-audio
|
||||
LIBS:philips
|
||||
LIBS:display
|
||||
LIBS:cypress
|
||||
LIBS:siliconi
|
||||
LIBS:opto
|
||||
LIBS:atmel
|
||||
LIBS:contrib
|
||||
LIBS:valves
|
||||
LIBS:RJ45_plate-cache
|
||||
EELAYER 25 0
|
||||
EELAYER END
|
||||
$Descr A4 11693 8268
|
||||
encoding utf-8
|
||||
Sheet 1 1
|
||||
Title ""
|
||||
Date ""
|
||||
Rev ""
|
||||
Comp ""
|
||||
Comment1 ""
|
||||
Comment2 ""
|
||||
Comment3 ""
|
||||
Comment4 ""
|
||||
$EndDescr
|
||||
$Comp
|
||||
L Conn_01x08 J2
|
||||
U 1 1 5B67DE38
|
||||
P 5225 1525
|
||||
F 0 "J2" H 5225 1925 50 0000 C CNN
|
||||
F 1 "RJ45" H 5225 1025 50 0000 C CNN
|
||||
F 2 "RJ45:RJ45" H 5225 1525 50 0001 C CNN
|
||||
F 3 "" H 5225 1525 50 0001 C CNN
|
||||
1 5225 1525
|
||||
1 0 0 -1
|
||||
$EndComp
|
||||
$Comp
|
||||
L Conn_01x08 J3
|
||||
U 1 1 5B67DF3D
|
||||
P 5250 2575
|
||||
F 0 "J3" H 5250 2975 50 0000 C CNN
|
||||
F 1 "RJ45" H 5250 2075 50 0000 C CNN
|
||||
F 2 "RJ45:RJ45" H 5250 2575 50 0001 C CNN
|
||||
F 3 "" H 5250 2575 50 0001 C CNN
|
||||
1 5250 2575
|
||||
1 0 0 -1
|
||||
$EndComp
|
||||
Wire Wire Line
|
||||
5025 1225 5025 1425
|
||||
Wire Wire Line
|
||||
5025 1725 5025 1925
|
||||
Wire Wire Line
|
||||
5050 2275 5050 2475
|
||||
Wire Wire Line
|
||||
5050 2775 5050 2975
|
||||
Connection ~ 5050 2875
|
||||
Connection ~ 5050 2375
|
||||
Connection ~ 5025 1825
|
||||
Connection ~ 5025 1325
|
||||
$Comp
|
||||
L Conn_01x04 J1
|
||||
U 1 1 5B67E004
|
||||
P 4000 2000
|
||||
F 0 "J1" H 4000 2200 50 0000 C CNN
|
||||
F 1 "Conn_01x04" H 4000 1700 50 0000 C CNN
|
||||
F 2 "Connector_PinHeader_2.54mm.pretty:PinHeader_1x04_P2.54mm_Vertical" H 4000 2000 50 0001 C CNN
|
||||
F 3 "" H 4000 2000 50 0001 C CNN
|
||||
1 4000 2000
|
||||
-1 0 0 1
|
||||
$EndComp
|
||||
Wire Wire Line
|
||||
4200 2875 5050 2875
|
||||
Wire Wire Line
|
||||
4750 2875 4750 1825
|
||||
Wire Wire Line
|
||||
4750 1825 5025 1825
|
||||
Wire Wire Line
|
||||
5050 2375 4950 2375
|
||||
Wire Wire Line
|
||||
4950 2375 4950 1325
|
||||
Wire Wire Line
|
||||
4450 1325 5025 1325
|
||||
Wire Wire Line
|
||||
4200 1800 4450 1800
|
||||
Connection ~ 4950 1325
|
||||
Wire Wire Line
|
||||
4200 2875 4200 2100
|
||||
Connection ~ 4750 2875
|
||||
Wire Wire Line
|
||||
4200 1900 4575 1900
|
||||
Wire Wire Line
|
||||
4575 1525 4575 2575
|
||||
Wire Wire Line
|
||||
4575 1525 5025 1525
|
||||
Wire Wire Line
|
||||
4200 2000 4650 2000
|
||||
Wire Wire Line
|
||||
4650 1625 4650 2675
|
||||
Wire Wire Line
|
||||
4650 1625 5025 1625
|
||||
Wire Wire Line
|
||||
4650 2675 5050 2675
|
||||
Connection ~ 4650 2000
|
||||
Wire Wire Line
|
||||
4575 2575 5050 2575
|
||||
Connection ~ 4575 1900
|
||||
$Comp
|
||||
L Fuse F1
|
||||
U 1 1 5B685A07
|
||||
P 4450 1550
|
||||
F 0 "F1" V 4530 1550 50 0000 C CNN
|
||||
F 1 "Fuse" V 4375 1550 50 0000 C CNN
|
||||
F 2 "RJ45:FUSE" V 4380 1550 50 0001 C CNN
|
||||
F 3 "" H 4450 1550 50 0001 C CNN
|
||||
1 4450 1550
|
||||
1 0 0 -1
|
||||
$EndComp
|
||||
Wire Wire Line
|
||||
4450 1325 4450 1400
|
||||
Wire Wire Line
|
||||
4450 1800 4450 1700
|
||||
$EndSCHEMATC
|
||||
106
kicad/RJ45_plate/fp-lib-table
Normal file
@ -0,0 +1,106 @@
|
||||
(fp_lib_table
|
||||
(lib (name my_footprints)(type KiCad)(uri "$(KIPRJMOD)/my_footprints.pretty")(options "")(descr ""))
|
||||
(lib (name Battery)(type KiCad)(uri ${KISYSMOD}/Battery.pretty)(options "")(descr "battery and battery holder footprints"))
|
||||
(lib (name Button_Switch_Keyboard)(type KiCad)(uri ${KISYSMOD}/Button_Switch_Keyboard.pretty)(options "")(descr "Buttons and switches for keyboard applications"))
|
||||
(lib (name Button_Switch_SMD)(type KiCad)(uri ${KISYSMOD}/Button_Switch_SMD.pretty)(options "")(descr "Buttons and switches, surface mount"))
|
||||
(lib (name Button_Switch_THT)(type KiCad)(uri ${KISYSMOD}/Button_Switch_THT.pretty)(options "")(descr "Buttons and switches, through hole"))
|
||||
(lib (name Buzzer_Beeper)(type KiCad)(uri ${KISYSMOD}/Buzzer_Beeper.pretty)(options "")(descr "Audio signalling devices"))
|
||||
(lib (name Calibration_Scale)(type KiCad)(uri ${KISYSMOD}/Calibration_Scale.pretty)(options "")(descr "Scales and grids intended for calibration and measurement"))
|
||||
(lib (name Capacitor_SMD)(type KiCad)(uri ${KISYSMOD}/Capacitor_SMD.pretty)(options "")(descr "Capacitor, surface mount"))
|
||||
(lib (name Capacitor_THT)(type KiCad)(uri ${KISYSMOD}/Capacitor_THT.pretty)(options "")(descr "Capacitor, through hole"))
|
||||
(lib (name Capacitor_Tantalum_SMD)(type KiCad)(uri ${KISYSMOD}/Capacitor_Tantalum_SMD.pretty)(options "")(descr "Tantalum Capacitor, surface mount"))
|
||||
(lib (name Connector)(type KiCad)(uri ${KISYSMOD}/Connector.pretty)(options "")(descr "generic/unsorted connector footprints"))
|
||||
(lib (name Connector_Audio)(type KiCad)(uri ${KISYSMOD}/Connector_Audio.pretty)(options "")(descr "Audio connector footprints"))
|
||||
(lib (name Connector_BarrelJack)(type KiCad)(uri ${KISYSMOD}/Connector_BarrelJack.pretty)(options "")(descr "(DC) barrel jack connector footprints"))
|
||||
(lib (name Connector_Card)(type KiCad)(uri ${KISYSMOD}/Connector_Card.pretty)(options "")(descr "Card and card holder footprints"))
|
||||
(lib (name Connector_Coaxial)(type KiCad)(uri ${KISYSMOD}/Connector_Coaxial.pretty)(options "")(descr "Coaxial and RF connector footprints"))
|
||||
(lib (name Connector_Dsub)(type KiCad)(uri ${KISYSMOD}/Connector_Dsub.pretty)(options "")(descr "Footprints for DSub footprints"))
|
||||
(lib (name Connector_FFC-FPC)(type KiCad)(uri ${KISYSMOD}/Connector_FFC-FPC.pretty)(options "")(descr "FFC (Flexible Flat Cable) and FPC (Flexible Printed Circuit) connector footprints"))
|
||||
(lib (name Connector_HDMI)(type KiCad)(uri ${KISYSMOD}/Connector_HDMI.pretty)(options "")(descr "HDMI connector footprints"))
|
||||
(lib (name Connector_Harwin)(type KiCad)(uri ${KISYSMOD}/Connector_Harwin.pretty)(options "")(descr "Harwin connector footprints"))
|
||||
(lib (name Connector_Hirose)(type KiCad)(uri ${KISYSMOD}/Connector_Hirose.pretty)(options "")(descr "Hirose connector footprints"))
|
||||
(lib (name Connector_IDC)(type KiCad)(uri ${KISYSMOD}/Connector_IDC.pretty)(options "")(descr "IDC connector footprints"))
|
||||
(lib (name Connector_JAE)(type KiCad)(uri ${KISYSMOD}/Connector_JAE.pretty)(options "")(descr "JAE connector footprints"))
|
||||
(lib (name Connector_JST)(type KiCad)(uri ${KISYSMOD}/Connector_JST.pretty)(options "")(descr "JST connector footprints www.jst.com"))
|
||||
(lib (name Connector_Molex)(type KiCad)(uri ${KISYSMOD}/Connector_Molex.pretty)(options "")(descr "Molex connector foottprints www.molex.com"))
|
||||
(lib (name Connector_Multicomp)(type KiCad)(uri ${KISYSMOD}/Connector_Multicomp.pretty)(options "")(descr "Multicomp connector foottprints"))
|
||||
(lib (name Connector_PCBEdge)(type KiCad)(uri ${KISYSMOD}/Connector_PCBEdge.pretty)(options "")(descr "PCB edge connectors (e.g. PCI, ISA, PCIe, ...)"))
|
||||
(lib (name Connector_Pin)(type KiCad)(uri ${KISYSMOD}/Connector_Pin.pretty)(options "")(descr "Single (solder) pin conectors"))
|
||||
(lib (name Connector_PinHeader_1.00mm)(type KiCad)(uri ${KISYSMOD}/Connector_PinHeader_1.00mm.pretty)(options "")(descr "Pin headers, 1.0mm pitch"))
|
||||
(lib (name Connector_PinHeader_1.27mm)(type KiCad)(uri ${KISYSMOD}/Connector_PinHeader_1.27mm.pretty)(options "")(descr "Pin headers, 1.27mm pitch"))
|
||||
(lib (name Connector_PinHeader_2.00mm)(type KiCad)(uri ${KISYSMOD}/Connector_PinHeader_2.00mm.pretty)(options "")(descr "Pin headers, 2.0mm pitch"))
|
||||
(lib (name Connector_PinHeader_2.54mm)(type KiCad)(uri ${KISYSMOD}/Connector_PinHeader_2.54mm.pretty)(options "")(descr "Pin headers, 2.54mm pitch"))
|
||||
(lib (name Connector_PinSocket_1.00mm)(type KiCad)(uri ${KISYSMOD}/Connector_PinSocket_1.00mm.pretty)(options "")(descr "Pin sockets, 1.00mm pitch"))
|
||||
(lib (name Connector_PinSocket_1.27mm)(type KiCad)(uri ${KISYSMOD}/Connector_PinSocket_1.27mm.pretty)(options "")(descr "Pin sockets, 1.27mm pitch"))
|
||||
(lib (name Connector_PinSocket_2.00mm)(type KiCad)(uri ${KISYSMOD}/Connector_PinSocket_2.00mm.pretty)(options "")(descr "Pin sockets, 2.0mm pitch"))
|
||||
(lib (name Connector_PinSocket_2.54mm)(type KiCad)(uri ${KISYSMOD}/Connector_PinSocket_2.54mm.pretty)(options "")(descr "Pin sockets, 2.54mm pitch"))
|
||||
(lib (name Connector_Phoenix_MC)(type KiCad)(uri ${KISYSMOD}/Connector_Phoenix_MC.pretty)(options "")(descr "Phoenix MC connector footprints"))
|
||||
(lib (name Connector_Phoenix_MSTB)(type KiCad)(uri ${KISYSMOD}/Connector_Phoenix_MSTB.pretty)(options "")(descr "Phoenix MSTB connector footprints"))
|
||||
(lib (name Connector_RJ)(type KiCad)(uri ${KISYSMOD}/Connector_RJ.pretty)(options "")(descr "Registered Jack (RJ) connector footprints (e.g. RJ11, RJ45, ...)"))
|
||||
(lib (name Connector_SATA_SAS)(type KiCad)(uri ${KISYSMOD}/Connector_SATA_SAS.pretty)(options "")(descr "SATA/SAS connector footprints"))
|
||||
(lib (name Connector_TE-Connectivity)(type KiCad)(uri ${KISYSMOD}/Connector_TE-Connectivity.pretty)(options "")(descr "Footprints for connectors by TE Connectivity"))
|
||||
(lib (name Connector_USB)(type KiCad)(uri ${KISYSMOD}/Connector_USB.pretty)(options "")(descr "USB connector footprints"))
|
||||
(lib (name Connector_Wago)(type KiCad)(uri ${KISYSMOD}/Connector_Wago.pretty)(options "")(descr "Wago connector footprints"))
|
||||
(lib (name Connector_Wire)(type KiCad)(uri ${KISYSMOD}/Connector_Wire.pretty)(options "")(descr "Footprints for solder wire pads."))
|
||||
(lib (name Connector_Samtec)(type KiCad)(uri ${KISYSMOD}/Connector_Samtec.pretty)(options "")(descr "Samtec connector footprints"))
|
||||
(lib (name Converter_ACDC)(type KiCad)(uri ${KISYSMOD}/Converter_ACDC.pretty)(options "")(descr "AC/DC converter footprints"))
|
||||
(lib (name Converter_DCDC)(type KiCad)(uri ${KISYSMOD}/Converter_DCDC.pretty)(options "")(descr "DC/DC converter footprints"))
|
||||
(lib (name Crystal)(type KiCad)(uri ${KISYSMOD}/Crystal.pretty)(options "")(descr "Crystal footprints"))
|
||||
(lib (name Diode_SMD)(type KiCad)(uri ${KISYSMOD}/Diode_SMD.pretty)(options "")(descr "Diode footprints, surface mount"))
|
||||
(lib (name Diode_THT)(type KiCad)(uri ${KISYSMOD}/Diode_THT.pretty)(options "")(descr "Diode footprints, through hole"))
|
||||
(lib (name Display_7Segment)(type KiCad)(uri ${KISYSMOD}/Display_7Segment.pretty)(options "")(descr "Seven segment Display"))
|
||||
(lib (name Display)(type KiCad)(uri ${KISYSMOD}/Display.pretty)(options "")(descr "Display modules"))
|
||||
(lib (name Fiducial)(type KiCad)(uri ${KISYSMOD}/Fiducial.pretty)(options "")(descr "Fiducial markings"))
|
||||
(lib (name Fuse)(type KiCad)(uri ${KISYSMOD}/Fuse.pretty)(options "")(descr "Fuse and fuse holder footprints"))
|
||||
(lib (name Heatsink)(type KiCad)(uri ${KISYSMOD}/Heatsink.pretty)(options "")(descr "Heatsinks and thermal products"))
|
||||
(lib (name Inductor_SMD)(type KiCad)(uri ${KISYSMOD}/Inductor_SMD.pretty)(options "")(descr "Inductor footprints, surface mount"))
|
||||
(lib (name Inductor_THT)(type KiCad)(uri ${KISYSMOD}/Inductor_THT.pretty)(options "")(descr "Inductor footprints, through hole"))
|
||||
(lib (name Jumper)(type KiCad)(uri ${KISYSMOD}/Jumper.pretty)(options "")(descr "Jumpers, solder jumpers, ... footprints"))
|
||||
(lib (name LED_SMD)(type KiCad)(uri ${KISYSMOD}/LED_SMD.pretty)(options "")(descr "Light emitting diodes (LED), surface mount"))
|
||||
(lib (name LED_THT)(type KiCad)(uri ${KISYSMOD}/LED_THT.pretty)(options "")(descr "Light emitting diodes (LED), through hole"))
|
||||
(lib (name Module)(type KiCad)(uri ${KISYSMOD}/Module.pretty)(options "")(descr "Footprints for SoM (System on Module)"))
|
||||
(lib (name MountingHole)(type KiCad)(uri ${KISYSMOD}/MountingHole.pretty)(options "")(descr "Mechanical fasteners"))
|
||||
(lib (name NetTie)(type KiCad)(uri ${KISYSMOD}/NetTie.pretty)(options "")(descr "Net ties"))
|
||||
(lib (name OptoDevice)(type KiCad)(uri ${KISYSMOD}/OptoDevice.pretty)(options "")(descr "Optical devices (light sensors, opto isolators/interrupters, laser diodes, fiber optical components ...)"))
|
||||
(lib (name Oscillator)(type KiCad)(uri ${KISYSMOD}/Oscillator.pretty)(options "")(descr "Footprints for oscillator devices"))
|
||||
(lib (name Package_BGA)(type KiCad)(uri ${KISYSMOD}/Package_BGA.pretty)(options "")(descr "Ball Grid Array (BGA)"))
|
||||
(lib (name Package_CSP)(type KiCad)(uri ${KISYSMOD}/Package_CSP.pretty)(options "")(descr "Chip Scale Packages (CSP)"))
|
||||
(lib (name Package_DFN_QFN)(type KiCad)(uri ${KISYSMOD}/Package_DFN_QFN.pretty)(options "")(descr "Surface mount IC packages, DFN / LGA / QFN"))
|
||||
(lib (name Package_DIP)(type KiCad)(uri ${KISYSMOD}/Package_DIP.pretty)(options "")(descr "Through hole IC packages, DIP"))
|
||||
(lib (name Package_DirectFET)(type KiCad)(uri ${KISYSMOD}/Package_DirectFET.pretty)(options "")(descr "DirectFET packages from International Rectifier"))
|
||||
(lib (name Package_LCC)(type KiCad)(uri ${KISYSMOD}/Package_LCC.pretty)(options "")(descr "Leaded Chip Carriers (LCC)"))
|
||||
(lib (name Package_LGA)(type KiCad)(uri ${KISYSMOD}/Package_LGA.pretty)(options "")(descr "Land Grid Array (LGA)"))
|
||||
(lib (name Package_QFP)(type KiCad)(uri ${KISYSMOD}/Package_QFP.pretty)(options "")(descr "Quad Flat Package (QFP)"))
|
||||
(lib (name Package_SIP)(type KiCad)(uri ${KISYSMOD}/Package_SIP.pretty)(options "")(descr "Single Inline Package(SIP)"))
|
||||
(lib (name Package_SOIC)(type KiCad)(uri ${KISYSMOD}/Package_SOIC.pretty)(options "")(descr "Small Outline Integrated Circuits (SOIC)"))
|
||||
(lib (name Package_SON)(type KiCad)(uri ${KISYSMOD}/Package_SON.pretty)(options "")(descr "Small Outline No-Lead (SON)"))
|
||||
(lib (name Package_SSOP)(type KiCad)(uri ${KISYSMOD}/Package_SSOP.pretty)(options "")(descr "SSOP, TSSOP, MSOP, QSOP, VSO packages"))
|
||||
(lib (name Package_TO_SOT_SMD)(type KiCad)(uri ${KISYSMOD}/Package_TO_SOT_SMD.pretty)(options "")(descr "Surface mount transistor packages"))
|
||||
(lib (name Package_TO_SOT_THT)(type KiCad)(uri ${KISYSMOD}/Package_TO_SOT_THT.pretty)(options "")(descr "Through hole transistor packages"))
|
||||
(lib (name Potentiometer_SMD)(type KiCad)(uri ${KISYSMOD}/Potentiometer_SMD.pretty)(options "")(descr "Potentiometer footprints, surface mount (SMD)"))
|
||||
(lib (name Potentiometer_THT)(type KiCad)(uri ${KISYSMOD}/Potentiometer_THT.pretty)(options "")(descr "Potentiometer footprints, through hole (THT)"))
|
||||
(lib (name Relay_SMD)(type KiCad)(uri ${KISYSMOD}/Relay_SMD.pretty)(options "")(descr "Surface mount relay packages"))
|
||||
(lib (name Relay_THT)(type KiCad)(uri ${KISYSMOD}/Relay_THT.pretty)(options "")(descr "Through hole relay packages"))
|
||||
(lib (name Resistor_SMD)(type KiCad)(uri ${KISYSMOD}/Resistor_SMD.pretty)(options "")(descr "Resistor footprints, surface mount (SMD)"))
|
||||
(lib (name Resistor_THT)(type KiCad)(uri ${KISYSMOD}/Resistor_THT.pretty)(options "")(descr "Resistor footprints, through hole (THT)"))
|
||||
(lib (name RF_Antenna)(type KiCad)(uri ${KISYSMOD}/RF_Antenna.pretty)(options "")(descr "Radio-frequency / wireless antenna footprints"))
|
||||
(lib (name RF_Module)(type KiCad)(uri ${KISYSMOD}/RF_Module.pretty)(options "")(descr "Radio-frequency / wireless modules"))
|
||||
(lib (name RF_Shielding)(type KiCad)(uri ${KISYSMOD}/RF_Shielding.pretty)(options "")(descr "Specialied footprints for EMI shields and covers"))
|
||||
(lib (name Sensor_Current)(type KiCad)(uri ${KISYSMOD}/Sensor_Current.pretty)(options "")(descr "Specialied footprints for hall effect current sensors"))
|
||||
(lib (name Sensor_Pressure)(type KiCad)(uri ${KISYSMOD}/Sensor_Pressure.pretty)(options "")(descr "Specialied footprints for pressure sensors"))
|
||||
(lib (name Socket)(type KiCad)(uri ${KISYSMOD}/Socket.pretty)(options "")(descr Sockets))
|
||||
(lib (name Symbol)(type KiCad)(uri ${KISYSMOD}/Symbol.pretty)(options "")(descr "PCB symbols"))
|
||||
(lib (name TerminalBlock)(type KiCad)(uri ${KISYSMOD}/TerminalBlock.pretty)(options "")(descr "Footprints for terminal blocks that do not have their own manufacturer specific library."))
|
||||
(lib (name TerminalBlock_4Ucon)(type KiCad)(uri ${KISYSMOD}/TerminalBlock_4Ucon.pretty)(options "")(descr "4UCON terminal blocks"))
|
||||
(lib (name TerminalBlock_MetzConnect)(type KiCad)(uri ${KISYSMOD}/TerminalBlock_MetzConnect.pretty)(options "")(descr "Metz Connect terminal blocks"))
|
||||
(lib (name TerminalBlock_Philmore)(type KiCad)(uri ${KISYSMOD}/TerminalBlock_Philmore.pretty)(options "")(descr "Philmore terminal blocks"))
|
||||
(lib (name TerminalBlock_Phoenix)(type KiCad)(uri ${KISYSMOD}/TerminalBlock_Phoenix.pretty)(options "")(descr "RND terminal blocks"))
|
||||
(lib (name TerminalBlock_RND)(type KiCad)(uri ${KISYSMOD}/TerminalBlock_RND.pretty)(options "")(descr "Phoenix Contact terminal blocks"))
|
||||
(lib (name TerminalBlock_WAGO)(type KiCad)(uri ${KISYSMOD}/TerminalBlock_WAGO.pretty)(options "")(descr "WAGO terminal blocks"))
|
||||
(lib (name TestPoint)(type KiCad)(uri ${KISYSMOD}/TestPoint.pretty)(options "")(descr "Test points, measurement points, probe connection points"))
|
||||
(lib (name Transformer_SMD)(type KiCad)(uri ${KISYSMOD}/Transformer_SMD.pretty)(options "")(descr "Surface mount transformers"))
|
||||
(lib (name Transformer_THT)(type KiCad)(uri ${KISYSMOD}/Transformer_THT.pretty)(options "")(descr "Through hole transformers"))
|
||||
(lib (name Valve)(type KiCad)(uri ${KISYSMOD}/Valve.pretty)(options "")(descr Valve))
|
||||
(lib (name Varistor)(type KiCad)(uri ${KISYSMOD}/Varistor.pretty)(options "")(descr Varistor))
|
||||
(lib (name RJ45)(type KiCad)(uri "$(KIPRJMOD)/RJ45.pretty")(options "")(descr ""))
|
||||
)
|
||||
987
kicad/termorez_NX3L4051/my_elements.lib
Normal file
@ -0,0 +1,987 @@
|
||||
EESchema-LIBRARY Version 2.3 Date: Сб 27 дек 2014 18:50:19
|
||||
#encoding utf-8
|
||||
#
|
||||
# A1101
|
||||
#
|
||||
DEF A1101 IC 0 40 Y Y 1 F N
|
||||
F0 "IC" 0 250 60 H V C CNN
|
||||
F1 "A1101" 0 -250 60 H V C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
$FPLIST
|
||||
SOT23W
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -100 150 150 -150 0 1 0 N
|
||||
X VCC 1 -400 100 300 R 50 50 1 1 W
|
||||
X VOUT 2 -400 0 300 R 50 50 1 1 O
|
||||
X GND 3 -400 -100 300 R 50 50 1 1 W
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# AD7794/7795
|
||||
#
|
||||
DEF AD7794/7795 U 0 30 Y Y 1 F N
|
||||
F0 "U" 0 900 60 H V C CNN
|
||||
F1 "AD7794/7795" 0 -900 60 H V C CNN
|
||||
F2 "TSSOP24" 0 100 60 H I C CNN
|
||||
F3 "~" 0 100 60 H V C CNN
|
||||
$FPLIST
|
||||
TSSOP24
|
||||
SSOP24
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -400 800 400 -800 0 1 0 N
|
||||
X SCLK 1 700 -550 300 L 50 50 1 1 P
|
||||
X CLC 2 700 250 300 L 50 50 1 1 P
|
||||
X !CS 3 700 -450 300 L 50 50 1 1 P
|
||||
X AIN6(+)/P1 5 -700 -300 300 R 50 50 1 1 B
|
||||
X AIN6(-)/P2 6 -700 -400 300 R 50 50 1 1 B
|
||||
X AIN1(+) 7 -700 700 300 R 50 50 1 1 I
|
||||
X AIN1(-) 8 -700 600 300 R 50 50 1 1 I
|
||||
X AIN2(+) 9 -700 500 300 R 50 50 1 1 I
|
||||
X AIN2(-) 10 -700 400 300 R 50 50 1 1 I
|
||||
X GND 20 700 650 300 L 50 50 1 1 W
|
||||
X AIN3(+) 11 -700 300 300 R 50 50 1 1 I
|
||||
X AVDD 21 700 750 300 L 50 50 1 1 W
|
||||
X AIN3(-) 12 -700 200 300 R 50 50 1 1 I
|
||||
X DVDD 22 700 -300 300 L 50 50 1 1 W
|
||||
X REFIN1(+) 13 -700 -650 300 R 50 50 1 1 I
|
||||
X DOUT/!RDY 23 700 -750 300 L 50 50 1 1 P
|
||||
X REFIN1(-) 14 -700 -550 300 R 50 50 1 1 I
|
||||
X DIN 24 700 -650 300 L 50 50 1 1 P
|
||||
X AIN5(+)/IOUT2 15 -700 -100 300 R 50 50 1 1 I
|
||||
X AIN5(-)/IOUT1 16 -700 -200 300 R 50 50 1 1 I
|
||||
X AIN4(+)/REFIN2(+) 17 -700 100 300 R 50 50 1 1 I
|
||||
X AIN4(-)/REFIN2(-) 18 -700 0 300 R 50 50 1 1 I
|
||||
X PSW 19 -700 -750 300 R 50 50 1 1 I
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# ADG506A
|
||||
#
|
||||
DEF ADG506A U 0 30 Y Y 1 F N
|
||||
F0 "U" 0 900 60 H V C CNN
|
||||
F1 "ADG506A" 0 -900 60 H V C CNN
|
||||
F2 "DIP-28__600_ELL" 0 100 60 H I C CNN
|
||||
F3 "~" 0 100 60 H V C CNN
|
||||
$FPLIST
|
||||
DIP-28*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -250 800 250 -800 0 1 0 N
|
||||
X VDD 1 550 700 300 L 50 50 1 1 W
|
||||
X S16 4 -550 -750 300 R 50 50 1 1 I
|
||||
X S15 5 -550 -650 300 R 50 50 1 1 I
|
||||
X S14 6 -550 -550 300 R 50 50 1 1 I
|
||||
X S13 7 -550 -450 300 R 50 50 1 1 I
|
||||
X S12 8 -550 -350 300 R 50 50 1 1 I
|
||||
X S11 9 -550 -250 300 R 50 50 1 1 I
|
||||
X S10 10 -550 -150 300 R 50 50 1 1 I
|
||||
X S2 20 -550 650 300 R 50 50 1 1 I
|
||||
X S9 11 -550 -50 300 R 50 50 1 1 I
|
||||
X S3 21 -550 550 300 R 50 50 1 1 I
|
||||
X GND 12 550 500 300 L 50 50 1 1 W
|
||||
X S4 22 -550 450 300 R 50 50 1 1 I
|
||||
X S5 23 -550 350 300 R 50 50 1 1 I
|
||||
X A3 14 550 -700 300 L 50 50 1 1 P
|
||||
X S6 24 -550 250 300 R 50 50 1 1 I
|
||||
X A2 15 550 -600 300 L 50 50 1 1 P
|
||||
X S7 25 -550 150 300 R 50 50 1 1 I
|
||||
X A1 16 550 -500 300 L 50 50 1 1 P
|
||||
X S8 26 -550 50 300 R 50 50 1 1 I
|
||||
X A0 17 550 -400 300 L 50 50 1 1 P
|
||||
X VSS 27 550 600 300 L 50 50 1 1 W
|
||||
X EN 18 550 -200 300 L 50 50 1 1 P
|
||||
X D 28 550 0 300 L 50 50 1 1 O
|
||||
X S1 19 -550 750 300 R 50 50 1 1 I
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# ADM233L
|
||||
#
|
||||
DEF ADM233L IC 0 40 Y Y 1 F N
|
||||
F0 "IC" -200 450 60 H V C CNN
|
||||
F1 "ADM233L" 0 -900 60 H V C CNN
|
||||
F2 "DIP-20__300" 0 0 60 H I C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
$FPLIST
|
||||
DIP-20*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
T 900 0 -100 60 0 0 0 RS232 Normal 0 C C
|
||||
T 900 0 -550 60 0 0 0 TTL Normal 0 C C
|
||||
P 4 0 0 0 300 -350 50 -350 50 -750 300 -750 N
|
||||
P 4 0 0 0 300 100 50 100 50 -300 300 -300 N
|
||||
S -300 400 300 -800 0 1 0 f
|
||||
X T2_I 1 500 -400 200 L 50 50 1 1 I
|
||||
X T1_I 2 500 -500 200 L 50 50 1 1 I
|
||||
X R1_O 3 500 -700 200 L 50 50 1 1 O
|
||||
X R1_I 4 500 -250 200 L 50 50 1 1 I
|
||||
X T1_O 5 500 -50 200 L 50 50 1 1 O
|
||||
X GND 6 -500 150 200 R 50 50 1 1 W
|
||||
X VCC 7 -500 300 200 R 50 50 1 1 W
|
||||
X C1+ 8 -500 -100 200 R 50 50 1 1 P
|
||||
X GND 9 -500 50 200 R 50 50 1 1 W
|
||||
X C2- 10 -500 -600 200 R 50 50 1 1 P
|
||||
X R2_O 20 500 -600 200 L 50 50 1 1 O
|
||||
X C2+ 11 -500 -350 200 R 50 50 1 1 P
|
||||
X intV- 12 500 250 200 L 50 50 1 1 P
|
||||
X C1- 13 -500 -200 200 R 50 50 1 1 P
|
||||
X intV+ 14 500 350 200 L 50 50 1 1 P
|
||||
X C2- 15 -500 -450 200 R 50 50 1 1 P
|
||||
X C2- 16 -500 -700 200 R 50 50 1 1 P
|
||||
X intV- 17 500 150 200 L 50 50 1 1 P
|
||||
X T2_O 18 500 50 200 L 50 50 1 1 O
|
||||
X R2_I 19 500 -150 200 L 50 50 1 1 O
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# BMB2A0300AN1
|
||||
#
|
||||
DEF BMB2A0300AN1 L 0 0 N N 1 F N
|
||||
F0 "L" 0 100 50 H V C CNN
|
||||
F1 "BMB2A0300AN1" 0 -50 50 H V C CNN
|
||||
F2 "SM0805" 0 0 60 H I C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
$FPLIST
|
||||
SM0805
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
A -150 0 50 1 1799 0 1 0 N -100 0 -200 0
|
||||
A -50 0 50 1 1799 0 1 0 N 0 0 -100 0
|
||||
A 50 0 50 1 1799 0 1 0 N 100 0 0 0
|
||||
A 150 0 50 1 1799 0 1 0 N 200 0 100 0
|
||||
X 1 1 -250 0 50 R 30 30 1 1 I
|
||||
X 2 2 250 0 50 L 30 30 1 1 I
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# BTS6133
|
||||
#
|
||||
DEF BTS6133 U 0 40 Y Y 1 F N
|
||||
F0 "U" -300 250 60 H V C CNN
|
||||
F1 "BTS6133" 250 250 60 H V C CNN
|
||||
F2 "TO252" 0 0 60 H I C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
$FPLIST
|
||||
TO-252*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -300 200 300 -200 0 1 0 N
|
||||
X VOUT 1 550 -50 250 L 60 60 1 1 w
|
||||
X !EN 2 -550 100 250 R 60 60 1 1 I I
|
||||
X VSUP 3 550 100 250 L 60 60 1 1 W
|
||||
X IS 4 -550 -100 250 R 60 60 1 1 O
|
||||
X VOUT 5 550 -150 250 L 60 60 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# C
|
||||
#
|
||||
DEF C C 0 10 N Y 1 F N
|
||||
F0 "C" 0 100 40 H V L CNN
|
||||
F1 "C" 6 -85 40 H V L CNN
|
||||
F2 "SM0805" 38 -150 30 H I C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
$FPLIST
|
||||
SM0805
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
P 2 0 1 20 -80 -30 80 -30 N
|
||||
P 2 0 1 20 -80 30 80 30 N
|
||||
X ~ 1 0 200 170 D 40 40 1 1 P
|
||||
X ~ 2 0 -200 170 U 40 40 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# C0805
|
||||
#
|
||||
DEF C0805 C 0 10 N Y 1 F N
|
||||
F0 "C" 0 100 40 H V L CNN
|
||||
F1 "C0805" 6 -85 40 H V L CNN
|
||||
F2 "SM0805" 38 -150 30 H I C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
$FPLIST
|
||||
SM0805
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
P 2 0 1 20 -80 -30 80 -30 N
|
||||
P 2 0 1 20 -80 30 80 30 N
|
||||
X ~ 1 0 200 170 D 40 40 1 1 P
|
||||
X ~ 2 0 -200 170 U 40 40 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# CONN_16
|
||||
#
|
||||
DEF CONN_16 P 0 40 Y N 1 F N
|
||||
F0 "P" 0 0 60 V V C CNN
|
||||
F1 "CONN_16" 100 0 60 V V C CNN
|
||||
F2 "~" 0 100 60 H V C CNN
|
||||
F3 "~" 0 100 60 H V C CNN
|
||||
DRAW
|
||||
S -100 800 150 -800 0 1 0 N
|
||||
X P1 1 -350 750 250 R 50 50 1 1 P I
|
||||
X P2 2 -350 650 250 R 50 50 1 1 P I
|
||||
X P3 3 -350 550 250 R 50 50 1 1 P I
|
||||
X P4 4 -350 450 250 R 50 50 1 1 P I
|
||||
X P5 5 -350 350 250 R 50 50 1 1 P I
|
||||
X P6 6 -350 250 250 R 50 50 1 1 P I
|
||||
X P7 7 -350 150 250 R 50 50 1 1 P I
|
||||
X P8 8 -350 50 250 R 50 50 1 1 P I
|
||||
X P9 9 -350 -50 250 R 50 50 1 1 P I
|
||||
X P10 10 -350 -150 250 R 50 50 1 1 P I
|
||||
X P11 11 -350 -250 250 R 50 50 1 1 P I
|
||||
X P12 12 -350 -350 250 R 50 50 1 1 P I
|
||||
X P13 13 -350 -450 250 R 50 50 1 1 P I
|
||||
X P14 14 -350 -550 250 R 50 50 1 1 P I
|
||||
X P15 15 -350 -650 250 R 50 50 1 1 P I
|
||||
X P16 16 -350 -750 250 R 50 50 1 1 P I
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# Cs
|
||||
#
|
||||
DEF Cs C 0 10 N Y 1 F N
|
||||
F0 "C" 0 100 40 H V L CNN
|
||||
F1 "Cs" 6 -85 40 H V L CNN
|
||||
F2 "SM0805" 38 -150 30 H I C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
$FPLIST
|
||||
SM0805
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
P 2 0 1 20 -80 -30 80 -30 N
|
||||
P 2 0 1 20 -80 30 80 30 N
|
||||
X ~ 1 0 200 170 D 40 40 1 1 P
|
||||
X ~ 2 0 -200 170 U 40 40 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# GND_CONNECTOR
|
||||
#
|
||||
DEF GND_CONNECTOR X 0 40 N N 1 F N
|
||||
F0 "X" 0 100 60 H V C CNN
|
||||
F1 "GND_CONNECTOR" 0 -150 60 H V C CNN
|
||||
F2 "GND_connector" -100 0 60 H I C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
$FPLIST
|
||||
GND_connector
|
||||
GND*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
X GND1 1 -300 0 300 R 50 50 1 1 P
|
||||
X GND2 2 300 0 300 L 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# gprm1-45
|
||||
#
|
||||
DEF gprm1-45 P 0 40 Y N 1 F N
|
||||
F0 "P" 0 -1300 50 H V C CNN
|
||||
F1 "gprm1-45" 0 0 50 V V C CNN
|
||||
F2 "gprm1-45" 0 0 50 H I C CNN
|
||||
F3 "~" 0 0 50 H I C CNN
|
||||
DRAW
|
||||
S 150 1200 -150 -1200 1 0 0 N
|
||||
X 1-1 1-1 -450 1050 300 R 50 50 1 1 P
|
||||
X 2-1 2-1 450 1100 300 L 50 50 1 1 P
|
||||
X 1-2 1-2 -450 950 300 R 50 50 1 1 P
|
||||
X 2-2 2-2 450 1000 300 L 50 50 1 1 P
|
||||
X 1-3 1-3 -450 850 300 R 50 50 1 1 P
|
||||
X 2-3 2-3 450 900 300 L 50 50 1 1 P
|
||||
X 1-4 1-4 -450 750 300 R 50 50 1 1 P
|
||||
X 2-4 2-4 450 800 300 L 50 50 1 1 P
|
||||
X 1-5 1-5 -450 650 300 R 50 50 1 1 P
|
||||
X 2-5 2-5 450 700 300 L 50 50 1 1 P
|
||||
X 1-6 1-6 -450 550 300 R 50 50 1 1 P
|
||||
X 2-6 2-6 450 600 300 L 50 50 1 1 P
|
||||
X 1-7 1-7 -450 450 300 R 50 50 1 1 P
|
||||
X 2-7 2-7 450 500 300 L 50 50 1 1 P
|
||||
X 1-8 1-8 -450 350 300 R 50 50 1 1 P
|
||||
X 2-8 2-8 450 400 300 L 50 50 1 1 P
|
||||
X 1-9 1-9 -450 250 300 R 50 50 1 1 P
|
||||
X 2-9 2-9 450 300 300 L 50 50 1 1 P
|
||||
X 1-10 1-10 -450 150 300 R 50 50 1 1 P
|
||||
X 2-10 2-10 450 200 300 L 50 50 1 1 P
|
||||
X 1-20 1-20 -450 -850 300 R 50 50 1 1 P
|
||||
X 2-20 2-20 450 -800 300 L 50 50 1 1 P
|
||||
X 1-11 1-11 -450 50 300 R 50 50 1 1 P
|
||||
X 2-11 2-11 450 100 300 L 50 50 1 1 P
|
||||
X 1-21 1-21 -450 -950 300 R 50 50 1 1 P
|
||||
X 2-21 2-21 450 -900 300 L 50 50 1 1 P
|
||||
X 1-12 1-12 -450 -50 300 R 50 50 1 1 P
|
||||
X 2-12 2-12 450 0 300 L 50 50 1 1 P
|
||||
X 1-22 1-22 -450 -1050 300 R 50 50 1 1 P
|
||||
X 2-22 2-22 450 -1000 300 L 50 50 1 1 P
|
||||
X 1-13 1-13 -450 -150 300 R 50 50 1 1 P
|
||||
X 2-13 2-13 450 -100 300 L 50 50 1 1 P
|
||||
X 2-23 2-23 450 -1100 300 L 50 50 1 1 P
|
||||
X 1-14 1-14 -450 -250 300 R 50 50 1 1 P
|
||||
X 2-14 2-14 450 -200 300 L 50 50 1 1 P
|
||||
X 1-15 1-15 -450 -350 300 R 50 50 1 1 P
|
||||
X 2-15 2-15 450 -300 300 L 50 50 1 1 P
|
||||
X 1-16 1-16 -450 -450 300 R 50 50 1 1 P
|
||||
X 2-16 2-16 450 -400 300 L 50 50 1 1 P
|
||||
X 1-17 1-17 -450 -550 300 R 50 50 1 1 P
|
||||
X 2-17 2-17 450 -500 300 L 50 50 1 1 P
|
||||
X 1-18 1-18 -450 -650 300 R 50 50 1 1 P
|
||||
X 2-18 2-18 450 -600 300 L 50 50 1 1 P
|
||||
X 1-19 1-19 -450 -750 300 R 50 50 1 1 P
|
||||
X 2-19 2-19 450 -700 300 L 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# gprm1-61
|
||||
#
|
||||
DEF gprm1-61 P 0 40 Y N 1 F N
|
||||
F0 "P" 0 -1700 50 H V C CNN
|
||||
F1 "gprm1-61" 0 0 50 V V C CNN
|
||||
F2 "gprm1-61" 0 0 50 H I C CNN
|
||||
F3 "~" 0 0 50 H I C CNN
|
||||
DRAW
|
||||
S 150 1600 -150 -1600 1 0 0 N
|
||||
X 1-1 1-1 -450 1450 300 R 50 50 1 1 P
|
||||
X 2-1 2-1 450 1500 300 L 50 50 1 1 P
|
||||
X 1-2 1-2 -450 1350 300 R 50 50 1 1 P
|
||||
X 2-2 2-2 450 1400 300 L 50 50 1 1 P
|
||||
X 1-3 1-3 -450 1250 300 R 50 50 1 1 P
|
||||
X 2-3 2-3 450 1300 300 L 50 50 1 1 P
|
||||
X 1-4 1-4 -450 1150 300 R 50 50 1 1 P
|
||||
X 2-4 2-4 450 1200 300 L 50 50 1 1 P
|
||||
X 1-5 1-5 -450 1050 300 R 50 50 1 1 P
|
||||
X 2-5 2-5 450 1100 300 L 50 50 1 1 P
|
||||
X 1-6 1-6 -450 950 300 R 50 50 1 1 P
|
||||
X 2-6 2-6 450 1000 300 L 50 50 1 1 P
|
||||
X 1-7 1-7 -450 850 300 R 50 50 1 1 P
|
||||
X 2-7 2-7 450 900 300 L 50 50 1 1 P
|
||||
X 1-8 1-8 -450 750 300 R 50 50 1 1 P
|
||||
X 2-8 2-8 450 800 300 L 50 50 1 1 P
|
||||
X 1-9 1-9 -450 650 300 R 50 50 1 1 P
|
||||
X 2-9 2-9 450 700 300 L 50 50 1 1 P
|
||||
X 1-10 1-10 -450 550 300 R 50 50 1 1 P
|
||||
X 2-10 2-10 450 600 300 L 50 50 1 1 P
|
||||
X 1-20 1-20 -450 -450 300 R 50 50 1 1 P
|
||||
X 2-20 2-20 450 -400 300 L 50 50 1 1 P
|
||||
X 1-30 1-30 -450 -1450 300 R 50 50 1 1 P
|
||||
X 2-30 2-30 450 -1400 300 L 50 50 1 1 P
|
||||
X 1-11 1-11 -450 450 300 R 50 50 1 1 P
|
||||
X 2-11 2-11 450 500 300 L 50 50 1 1 P
|
||||
X 1-21 1-21 -450 -550 300 R 50 50 1 1 P
|
||||
X 2-21 2-21 450 -500 300 L 50 50 1 1 P
|
||||
X 2-31 2-31 450 -1500 300 L 50 50 1 1 P
|
||||
X 1-12 1-12 -450 350 300 R 50 50 1 1 P
|
||||
X 2-12 2-12 450 400 300 L 50 50 1 1 P
|
||||
X 1-22 1-22 -450 -650 300 R 50 50 1 1 P
|
||||
X 2-22 2-22 450 -600 300 L 50 50 1 1 P
|
||||
X 1-13 1-13 -450 250 300 R 50 50 1 1 P
|
||||
X 2-13 2-13 450 300 300 L 50 50 1 1 P
|
||||
X 1-23 1-23 -450 -750 300 R 50 50 1 1 P
|
||||
X 2-23 2-23 450 -700 300 L 50 50 1 1 P
|
||||
X 1-14 1-14 -450 150 300 R 50 50 1 1 P
|
||||
X 2-14 2-14 450 200 300 L 50 50 1 1 P
|
||||
X 1-24 1-24 -450 -850 300 R 50 50 1 1 P
|
||||
X 2-24 2-24 450 -800 300 L 50 50 1 1 P
|
||||
X 1-15 1-15 -450 50 300 R 50 50 1 1 P
|
||||
X 2-15 2-15 450 100 300 L 50 50 1 1 P
|
||||
X 1-25 1-25 -450 -950 300 R 50 50 1 1 P
|
||||
X 2-25 2-25 450 -900 300 L 50 50 1 1 P
|
||||
X 1-16 1-16 -450 -50 300 R 50 50 1 1 P
|
||||
X 2-16 2-16 450 0 300 L 50 50 1 1 P
|
||||
X 1-26 1-26 -450 -1050 300 R 50 50 1 1 P
|
||||
X 2-26 2-26 450 -1000 300 L 50 50 1 1 P
|
||||
X 1-17 1-17 -450 -150 300 R 50 50 1 1 P
|
||||
X 2-17 2-17 450 -100 300 L 50 50 1 1 P
|
||||
X 1-27 1-27 -450 -1150 300 R 50 50 1 1 P
|
||||
X 2-27 2-27 450 -1100 300 L 50 50 1 1 P
|
||||
X 1-18 1-18 -450 -250 300 R 50 50 1 1 P
|
||||
X 2-18 2-18 450 -200 300 L 50 50 1 1 P
|
||||
X 1-28 1-28 -450 -1250 300 R 50 50 1 1 P
|
||||
X 2-28 2-28 450 -1200 300 L 50 50 1 1 P
|
||||
X 1-19 1-19 -450 -350 300 R 50 50 1 1 P
|
||||
X 2-19 2-19 450 -300 300 L 50 50 1 1 P
|
||||
X 1-29 1-29 -450 -1350 300 R 50 50 1 1 P
|
||||
X 2-29 2-29 450 -1300 300 L 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# HOLE
|
||||
#
|
||||
DEF HOLE HOLE 0 0 N N 1 F N
|
||||
F0 "HOLE" 0 0 60 H V C CNN
|
||||
F1 "HOLE" 0 -100 60 H V C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
$FPLIST
|
||||
hole*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# IPS5451
|
||||
#
|
||||
DEF IPS5451 U 0 40 Y Y 1 F N
|
||||
F0 "U" -350 250 60 H V C CNN
|
||||
F1 "IPS5451" 150 250 60 H V C CNN
|
||||
F2 "TO220-4" 0 0 60 H I C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
ALIAS IPS5451S
|
||||
$FPLIST
|
||||
TO-220
|
||||
SMD220
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -250 200 250 -200 0 1 0 N
|
||||
X GND 1 -50 -500 300 U 50 50 1 1 W
|
||||
X IN 2 -550 -100 300 R 50 50 1 1 I
|
||||
X VCC 3 550 100 300 L 50 50 1 1 W
|
||||
X DG 4 -550 100 300 R 50 50 1 1 O
|
||||
X VOUT 5 550 -100 300 L 50 50 1 1 w
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# IRM-10
|
||||
#
|
||||
DEF IRM-10 UG 0 40 Y Y 1 F N
|
||||
F0 "UG" 0 -300 60 H V C CNN
|
||||
F1 "IRM-10" 0 250 60 H V C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
ALIAS IRM-10-5 IRM-10-3.3 IRM-10-12 IRM-10-15 IRM-10-24
|
||||
$FPLIST
|
||||
IRM-10
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -300 200 300 -200 0 1 0 N
|
||||
X AC_N 1 -600 150 300 R 50 50 1 1 W
|
||||
X AC_L 2 -600 -150 300 R 50 50 1 1 W
|
||||
X GND 3 600 -150 300 L 50 50 1 1 w
|
||||
X VOUT 4 600 150 300 L 50 50 1 1 w
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# JTAG
|
||||
#
|
||||
DEF JTAG P 0 40 Y Y 1 F N
|
||||
F0 "P" -350 650 60 H V C CNN
|
||||
F1 "JTAG" -300 -550 60 H V C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
DRAW
|
||||
S -400 600 300 -500 0 1 0 N
|
||||
X VTREF 1 -700 500 300 R 50 50 1 1 W
|
||||
X VTARGET 2 600 500 300 L 50 50 1 1 W
|
||||
X ~TRST 3 -700 400 300 R 50 50 1 1 I I
|
||||
X GND 4 600 400 300 L 50 50 1 1 W
|
||||
X TDI 5 -700 300 300 R 50 50 1 1 B
|
||||
X GND 6 600 300 300 L 50 50 1 1 W
|
||||
X TMS 7 -700 200 300 R 50 50 1 1 B
|
||||
X GND 8 600 200 300 L 50 50 1 1 W
|
||||
X TCK 9 -700 100 300 R 50 50 1 1 B
|
||||
X GND 10 600 100 300 L 50 50 1 1 W
|
||||
X GND 20 600 -400 300 L 50 50 1 1 W
|
||||
X RTCK 11 -700 0 300 R 50 50 1 1 B
|
||||
X GND 12 600 0 300 L 50 50 1 1 W
|
||||
X TDO 13 -700 -100 300 R 50 50 1 1 B
|
||||
X GND 14 600 -100 300 L 50 50 1 1 W
|
||||
X ~SRST 15 -700 -200 300 R 50 50 1 1 I I
|
||||
X GND 16 600 -200 300 L 50 50 1 1 W
|
||||
X DBGRQ 17 -700 -300 300 R 50 50 1 1 P
|
||||
X GND 18 600 -300 300 L 50 50 1 1 W
|
||||
X DBGACK 19 -700 -400 300 R 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# L6208N
|
||||
#
|
||||
DEF L6208N IC 0 40 Y Y 1 F N
|
||||
F0 "IC" -500 850 50 H V L BNN
|
||||
F1 "L6208N" 0 -900 50 H V L BNN
|
||||
F2 "POWERDIP24" 0 150 50 H I C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
$FPLIST
|
||||
POWERDIP24
|
||||
DIP24*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
T 0 -30 -580 60 0 1 0 GND Normal 0 C C
|
||||
P 2 1 0 0 -500 -800 -500 800 N
|
||||
P 2 1 0 0 -500 800 500 800 N
|
||||
P 2 1 0 0 500 -800 -500 -800 N
|
||||
P 2 1 0 0 500 800 500 -800 N
|
||||
X CLOCK 1 -600 400 100 R 40 40 1 1 I
|
||||
X CW/CWW 2 -600 300 100 R 40 40 1 1 I
|
||||
X SENSE_A 3 600 400 100 L 40 40 1 1 I
|
||||
X RCA 4 600 300 100 L 40 40 1 1 I
|
||||
X OUT1A 5 600 200 100 L 40 40 1 1 O
|
||||
X GND 6 -100 -900 100 U 40 40 1 1 W
|
||||
X GND@1 7 -200 -900 100 U 40 40 1 1 W
|
||||
X OUT1B 8 600 -500 100 L 40 40 1 1 O
|
||||
X RCB 9 600 -400 100 L 40 40 1 1 I
|
||||
X SENSE_B 10 600 -300 100 L 40 40 1 1 I
|
||||
X VS_A 20 600 500 100 L 40 40 1 1 W
|
||||
X VREF_B 11 600 -700 100 L 40 40 1 1 I
|
||||
X OUT2A 21 600 100 100 L 40 40 1 1 O
|
||||
X HALF/FULL 12 -600 100 100 R 40 40 1 1 I
|
||||
X VCP 22 -600 700 100 R 40 40 1 1 W
|
||||
X CONTROL 13 -600 200 100 R 40 40 1 1 I
|
||||
X RESET 23 -600 -400 100 R 40 40 1 1 I
|
||||
X EN 14 -600 -300 100 R 40 40 1 1 I
|
||||
X VREF_A 24 600 0 100 L 40 40 1 1 I
|
||||
X VBOOT 15 -600 600 100 R 40 40 1 1 W
|
||||
X OUT2B 16 600 -600 100 L 40 40 1 1 O
|
||||
X VS_B 17 600 -200 100 L 40 40 1 1 W
|
||||
X GND@2 18 -300 -900 100 U 40 40 1 1 W
|
||||
X GND@3 19 -400 -900 100 U 40 40 1 1 W
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# LM1117MPX-3.3
|
||||
#
|
||||
DEF LM1117MPX-3.3 U 0 40 Y Y 1 F N
|
||||
F0 "U" -200 200 40 H V C CNN
|
||||
F1 "LM1117MPX-3.3" 0 200 40 H V L CNN
|
||||
F2 "SOT223" 0 100 30 H I C CIN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
ALIAS LM317AEMP
|
||||
$FPLIST
|
||||
SOT223*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -250 150 250 -150 0 1 10 f
|
||||
X GND 1 0 -250 100 U 40 40 1 1 W
|
||||
X OUT 2 400 50 150 L 40 40 1 1 w
|
||||
X IN 3 -400 50 150 R 40 40 1 1 W
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# LM7805_TO-220
|
||||
#
|
||||
DEF LM7805_TO-220 U 0 40 Y Y 1 F N
|
||||
F0 "U" -200 200 40 H V C CNN
|
||||
F1 "LM7805_TO-220" 0 200 40 H V L CNN
|
||||
F2 "TO-220" 0 100 30 H V C CIN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
$FPLIST
|
||||
TO*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -250 150 250 -150 0 1 10 f
|
||||
X IN 1 -400 50 150 R 40 40 1 1 I
|
||||
X OUT 2 400 50 150 L 40 40 1 1 w
|
||||
X GND 3 0 -250 100 U 40 40 1 1 W
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# LM7805CT
|
||||
#
|
||||
DEF LM7805CT U 0 40 Y Y 1 F N
|
||||
F0 "U" -200 200 40 H V C CNN
|
||||
F1 "LM7805CT" 0 200 40 H V L CNN
|
||||
F2 "TO-220" 0 100 30 H I C CIN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
ALIAS LM7806CT LM7808CT LM7809CT LM7810CT LM7812CT LM7815CT LM7818CT LM7824CT LM7806ACT LM7808ACT LM7809ACT LM7810ACT LM7812ACT LM7815ACT LM7818ACT LM7824ACT
|
||||
$FPLIST
|
||||
TO*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -250 150 250 -150 0 1 10 f
|
||||
X IN 1 -400 50 150 R 40 40 1 1 I
|
||||
X OUT 2 400 50 150 L 40 40 1 1 w
|
||||
X GND 3 0 -250 100 U 40 40 1 1 W
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# MAX3232
|
||||
#
|
||||
DEF MAX3232 IC 0 40 Y Y 1 F N
|
||||
F0 "IC" -200 450 60 H V C CNN
|
||||
F1 "MAX3232" 100 -900 60 H V C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
$FPLIST
|
||||
DIP16
|
||||
DIP-16
|
||||
SOIC16
|
||||
SOIC-16
|
||||
TSSOP16
|
||||
TSSOP-16
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
T 900 0 -100 60 0 0 0 RS232 Normal 0 C C
|
||||
T 900 0 -550 60 0 0 0 TTL Normal 0 C C
|
||||
P 4 0 0 0 300 -350 50 -350 50 -750 300 -750 N
|
||||
P 4 0 0 0 300 100 50 100 50 -300 300 -300 N
|
||||
S -300 400 300 -800 0 1 0 f
|
||||
X C1+ 1 -500 -100 200 R 50 50 1 1 P
|
||||
X V+ 2 500 300 200 L 50 50 1 1 P
|
||||
X C1- 3 -500 -300 200 R 50 50 1 1 P
|
||||
X C2+ 4 -500 -500 200 R 50 50 1 1 P
|
||||
X C2- 5 -500 -700 200 R 50 50 1 1 P
|
||||
X V- 6 500 200 200 L 50 50 1 1 P
|
||||
X T2_O 7 500 50 200 L 50 50 1 1 O
|
||||
X R2_I 8 500 -150 200 L 50 50 1 1 O
|
||||
X R2_O 9 500 -600 200 L 50 50 1 1 O
|
||||
X T2_I 10 500 -400 200 L 50 50 1 1 I
|
||||
X T1_I 11 500 -500 200 L 50 50 1 1 I
|
||||
X R1_O 12 500 -700 200 L 50 50 1 1 O
|
||||
X R1_I 13 500 -250 200 L 50 50 1 1 I
|
||||
X T1_O 14 500 -50 200 L 50 50 1 1 O
|
||||
X GND 15 -500 100 200 R 50 50 1 1 W
|
||||
X VCC 16 -500 300 200 R 50 50 1 1 W
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# NTE2984
|
||||
#
|
||||
DEF NTE2984 Q 0 0 N Y 1 F N
|
||||
F0 "Q" -80 240 60 H V R CNN
|
||||
F1 "NTE2984" 40 -240 60 H V R CNN
|
||||
F2 "TO220" 0 0 60 H I C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
ALIAS MOSFET_N NTE2987
|
||||
DRAW
|
||||
C 0 0 175 0 1 8 N
|
||||
S 0 -75 0 -150 0 1 0 N
|
||||
S 0 25 0 -25 0 1 0 N
|
||||
S 0 150 0 75 0 1 0 N
|
||||
S 100 -70 140 -70 0 1 8 N
|
||||
S 100 70 140 70 0 1 8 N
|
||||
S 120 30 160 30 0 1 8 N
|
||||
S 140 70 140 -70 0 1 8 N
|
||||
P 2 0 1 8 -50 -100 -50 100 N
|
||||
P 2 0 1 0 100 -100 0 -100 N
|
||||
P 2 0 1 0 100 100 0 100 N
|
||||
P 3 0 1 8 100 -100 100 0 50 0 N
|
||||
P 4 0 1 8 120 -10 160 -10 140 30 120 -10 f
|
||||
P 5 0 1 8 50 30 50 -30 0 0 50 30 50 30 f
|
||||
X G 1 -200 0 149 R 40 40 1 1 I
|
||||
X D 2 100 200 126 D 40 40 1 1 P
|
||||
X S 3 100 -200 118 U 40 40 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# NX3L4051
|
||||
#
|
||||
DEF NX3L4051 DA 0 40 Y Y 1 F N
|
||||
F0 "DA" 3300 1950 60 H V C CNN
|
||||
F1 "NX3L4051" 3100 1750 60 H V C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
DRAW
|
||||
S 300 400 -300 -400 0 1 0 N
|
||||
X S1 ~ -600 250 300 R 50 50 1 1 I
|
||||
X S2 ~ -600 150 300 R 50 50 1 1 I
|
||||
X S3 ~ -600 50 300 R 50 50 1 1 I
|
||||
X Y0 ~ 600 350 300 L 50 50 1 1 B
|
||||
X Y1 ~ 600 250 300 L 50 50 1 1 B
|
||||
X Y2 ~ 600 150 300 L 50 50 1 1 B
|
||||
X Y3 ~ 600 50 300 L 50 50 1 1 B
|
||||
X Y4 ~ 600 -50 300 L 50 50 1 1 B
|
||||
X Y5 ~ 600 -150 300 L 50 50 1 1 B
|
||||
X Y6 ~ 600 -250 300 L 50 50 1 1 B
|
||||
X Y7 ~ 600 -350 300 L 50 50 1 1 B
|
||||
X Z ~ -600 -350 300 R 50 50 1 1 I
|
||||
X ~E ~ -600 -150 300 R 50 50 1 1 I
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# NX3L4051-HX
|
||||
#
|
||||
DEF NX3L4051-HX DA 0 40 Y Y 1 F N
|
||||
F0 "DA" 250 500 60 H V C CNN
|
||||
F1 "NX3L4051-HX" 400 -500 60 H V C CNN
|
||||
F2 "HXQFN-16" 400 700 60 H I C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
DRAW
|
||||
S 300 400 -300 -400 0 1 0 N
|
||||
X Z 1 -600 -350 300 R 50 50 1 1 B
|
||||
X Y7 2 600 -350 300 L 50 50 1 1 B
|
||||
X Y5 3 600 -150 300 L 50 50 1 1 B
|
||||
X ~E 4 -600 -150 300 R 50 50 1 1 I
|
||||
X GND 6 0 -700 300 U 50 50 1 1 W
|
||||
X S3 7 -600 50 300 R 50 50 1 1 I
|
||||
X S2 8 -600 150 300 R 50 50 1 1 I
|
||||
X S1 9 -600 250 300 R 50 50 1 1 I
|
||||
X Y3 10 600 50 300 L 50 50 1 1 B
|
||||
X Y0 11 600 350 300 L 50 50 1 1 B
|
||||
X Y1 12 600 250 300 L 50 50 1 1 B
|
||||
X Y2 13 600 150 300 L 50 50 1 1 B
|
||||
X VCC 14 0 700 300 D 50 50 1 1 W
|
||||
X Y4 15 600 -50 300 L 50 50 1 1 B
|
||||
X Y6 16 600 -250 300 L 50 50 1 1 B
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# PC817
|
||||
#
|
||||
DEF PC817 IC 0 40 Y Y 1 F N
|
||||
F0 "IC" -210 190 40 H V C CNN
|
||||
F1 "PC817" 150 -190 40 H V C CNN
|
||||
F2 "DIP4" -200 -180 30 H I C CIN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
$FPLIST
|
||||
dip4*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -250 150 250 -150 0 1 10 f
|
||||
P 2 0 1 10 -125 -25 -75 -25 N
|
||||
P 2 0 1 0 100 25 175 100 N
|
||||
P 2 0 1 0 175 -100 100 -25 F
|
||||
P 2 0 1 0 175 -100 250 -100 N
|
||||
P 2 0 1 0 175 100 250 100 N
|
||||
P 3 0 1 0 -250 100 -100 100 -100 25 N
|
||||
P 3 0 1 0 -100 -25 -100 -100 -250 -100 N
|
||||
P 3 0 1 20 100 75 100 -75 100 -75 N
|
||||
P 4 0 1 10 -100 -25 -125 25 -75 25 -100 -25 F
|
||||
P 4 0 1 0 -20 10 1 30 1 10 31 40 N
|
||||
P 4 0 1 0 31 40 11 30 21 20 31 40 N
|
||||
P 5 0 1 0 120 -65 140 -45 160 -85 120 -65 120 -65 F
|
||||
P 7 0 1 0 -20 -30 1 -10 1 -30 31 0 11 -10 21 -20 31 0 N
|
||||
X ~ 1 -350 100 100 R 40 40 1 1 P
|
||||
X ~ 2 -350 -100 100 R 40 40 1 1 P
|
||||
X ~ 3 350 -100 100 L 40 40 1 1 P
|
||||
X ~ 4 350 100 100 L 40 40 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# Quartz
|
||||
#
|
||||
DEF Quartz Q 0 40 N Y 1 F N
|
||||
F0 "Q" 0 150 60 H V C CNN
|
||||
F1 "Quartz" 0 -150 60 H V C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
DRAW
|
||||
S -50 100 -50 -100 0 1 0 N
|
||||
S -25 100 25 -100 0 1 0 N
|
||||
S 50 -100 50 100 0 1 0 N
|
||||
X ~ 1 -250 0 200 R 40 40 1 1 P
|
||||
X ~ 2 250 0 200 L 40 40 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# R0603
|
||||
#
|
||||
DEF R0603 R 0 0 N Y 1 F N
|
||||
F0 "R" 80 0 40 V V C CNN
|
||||
F1 "R0603" 7 1 40 V V C CNN
|
||||
F2 "SM0603" -70 0 30 V I C CNN
|
||||
F3 "~" 0 0 30 H V C CNN
|
||||
$FPLIST
|
||||
SM0603
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -40 150 40 -150 0 1 12 N
|
||||
X ~ 1 0 250 100 D 60 60 1 1 P
|
||||
X ~ 2 0 -250 100 U 60 60 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# R1206
|
||||
#
|
||||
DEF R1206 R 0 0 N Y 1 F N
|
||||
F0 "R" 80 0 40 V V C CNN
|
||||
F1 "R1206" 7 1 40 V V C CNN
|
||||
F2 "SM1206" -70 0 30 V I C CNN
|
||||
F3 "~" 0 0 30 H V C CNN
|
||||
$FPLIST
|
||||
SM1206
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -40 150 40 -150 0 1 12 N
|
||||
X ~ 1 0 250 100 D 60 60 1 1 P
|
||||
X ~ 2 0 -250 100 U 60 60 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# RO-XX
|
||||
#
|
||||
DEF RO-XX Q 0 40 Y Y 1 F N
|
||||
F0 "Q" 0 150 60 H V C CNN
|
||||
F1 "RO-XX" 0 -150 60 H V C CNN
|
||||
F2 "SIP-4" -100 50 60 H I C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
DRAW
|
||||
S -250 100 250 -100 0 1 0 N
|
||||
X -Vin 1 -400 50 150 R 50 50 1 1 W
|
||||
X +Vin 2 -400 -50 150 R 50 50 1 1 W
|
||||
X -Vout 3 400 50 150 L 50 50 1 1 P
|
||||
X +Vout 4 400 -50 150 L 50 50 1 1 w
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# RT0805BRB071KL
|
||||
#
|
||||
DEF RT0805BRB071KL R 0 0 N Y 1 F N
|
||||
F0 "R" 80 0 40 V V C CNN
|
||||
F1 "RT0805BRB071KL" -100 0 40 V V C CNN
|
||||
F2 "SM0805" 0 0 30 V I C CNN
|
||||
F3 "~" 0 0 30 H V C CNN
|
||||
$FPLIST
|
||||
SM0603
|
||||
SM0805
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -40 150 40 -150 0 1 12 N
|
||||
X ~ 1 0 250 100 D 60 60 1 1 P
|
||||
X ~ 2 0 -250 100 U 60 60 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# ST3232
|
||||
#
|
||||
DEF ST3232 IC 0 40 Y Y 1 F N
|
||||
F0 "IC" -200 450 60 H V C CNN
|
||||
F1 "ST3232" 100 -900 60 H V C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
$FPLIST
|
||||
DIP16
|
||||
DIP-16
|
||||
SOIC16
|
||||
SOIC-16
|
||||
SO-16*
|
||||
SO16*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
T 900 0 -100 60 0 0 0 RS232 Normal 0 C C
|
||||
T 900 0 -550 60 0 0 0 TTL Normal 0 C C
|
||||
P 4 0 0 0 300 -350 50 -350 50 -750 300 -750 N
|
||||
P 4 0 0 0 300 100 50 100 50 -300 300 -300 N
|
||||
S -300 400 300 -800 0 1 0 f
|
||||
X C1+ 1 -500 -100 200 R 50 50 1 1 P
|
||||
X V+ 2 500 300 200 L 50 50 1 1 P
|
||||
X C1- 3 -500 -300 200 R 50 50 1 1 P
|
||||
X C2+ 4 -500 -500 200 R 50 50 1 1 P
|
||||
X C2- 5 -500 -700 200 R 50 50 1 1 P
|
||||
X V- 6 500 200 200 L 50 50 1 1 P
|
||||
X T2_O 7 500 50 200 L 50 50 1 1 O
|
||||
X R2_I 8 500 -150 200 L 50 50 1 1 O
|
||||
X R2_O 9 500 -600 200 L 50 50 1 1 O
|
||||
X T2_I 10 500 -400 200 L 50 50 1 1 I
|
||||
X T1_I 11 500 -500 200 L 50 50 1 1 I
|
||||
X R1_O 12 500 -700 200 L 50 50 1 1 O
|
||||
X R1_I 13 500 -250 200 L 50 50 1 1 I
|
||||
X T1_O 14 500 -50 200 L 50 50 1 1 O
|
||||
X GND 15 -500 100 200 R 50 50 1 1 W
|
||||
X VCC 16 -500 300 200 R 50 50 1 1 W
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# TLE5205
|
||||
#
|
||||
DEF TLE5205 U 0 40 Y Y 1 F N
|
||||
F0 "U" 150 400 60 H V C CNN
|
||||
F1 "TLE5205" 0 0 60 H V C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
$FPLIST
|
||||
TO220*
|
||||
TO-220*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -400 300 400 -300 0 1 0 N
|
||||
X OUT1 1 700 100 300 L 50 50 1 1 w
|
||||
X EF 2 -700 150 300 R 50 50 1 1 O
|
||||
X IN1 3 -700 0 300 R 50 50 1 1 I
|
||||
X GND 4 0 -600 300 U 50 50 1 1 W
|
||||
X IN2 5 -700 -150 300 R 50 50 1 1 I
|
||||
X Vs 6 0 600 300 D 50 50 1 1 W
|
||||
X OUT2 7 700 -100 300 L 50 50 1 1 w
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# TSIC-506
|
||||
#
|
||||
DEF TSIC-506 TD 0 40 Y Y 1 F N
|
||||
F0 "TD" 0 250 60 H V C CNN
|
||||
F1 "TSIC-506" 0 -250 60 H V C CNN
|
||||
F2 "TO220" 0 0 60 H I C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
$FPLIST
|
||||
TO220_VERT*
|
||||
TO220*
|
||||
to-220*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -100 150 100 -150 0 1 0 N
|
||||
X GND 1 -400 100 300 R 50 50 1 1 W
|
||||
X DAT 2 -400 0 300 R 50 50 1 1 O
|
||||
X VDD 3 -400 -100 300 R 50 50 1 1 W
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# USB-MICRO-B
|
||||
#
|
||||
DEF USB-MICRO-B CON 0 40 Y Y 1 F N
|
||||
F0 "CON" -250 450 60 H V C CNN
|
||||
F1 "USB-MICRO-B" -50 -500 60 H V C CNN
|
||||
F2 "MICRO-B-USB" 0 0 60 H I C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
$FPLIST
|
||||
USB-Mini-B-Jack
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -350 400 350 -400 0 1 0 N
|
||||
X VBUS 1 -550 300 200 R 50 50 1 1 P
|
||||
X D- 2 -550 150 200 R 50 50 1 1 B
|
||||
X D+ 3 -550 0 200 R 50 50 1 1 B
|
||||
X ID 4 -550 -150 200 R 50 50 1 1 P
|
||||
X GND 5 -550 -300 200 R 50 50 1 1 P
|
||||
X SHELL1 6 550 300 200 L 50 50 1 1 P
|
||||
X SHELL2 7 550 150 200 L 50 50 1 1 P
|
||||
X SHELL3 8 550 -150 200 L 50 50 1 1 P
|
||||
X SHELL4 9 550 -300 200 L 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# USB-MINI-B
|
||||
#
|
||||
DEF USB-MINI-B CON 0 40 Y Y 1 F N
|
||||
F0 "CON" -250 450 60 H V C CNN
|
||||
F1 "USB-MINI-B" -50 -500 60 H V C CNN
|
||||
F2 "MICRO-B_USB" 0 0 60 H I C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
$FPLIST
|
||||
USB-Mini-B-Jack
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -350 400 350 -400 0 1 0 N
|
||||
X VBUS 1 -550 300 200 R 50 50 1 1 P
|
||||
X D- 2 -550 150 200 R 50 50 1 1 B
|
||||
X D+ 3 -550 0 200 R 50 50 1 1 B
|
||||
X ID 4 -550 -150 200 R 50 50 1 1 P
|
||||
X GND 5 -550 -300 200 R 50 50 1 1 P
|
||||
X SHELL1 6 550 300 200 L 50 50 1 1 P
|
||||
X SHELL2 7 550 150 200 L 50 50 1 1 P
|
||||
X SHELL3 8 550 -150 200 L 50 50 1 1 P
|
||||
X SHELL4 9 550 -300 200 L 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# USBLC6-2
|
||||
#
|
||||
DEF USBLC6-2 U 0 40 Y Y 1 F N
|
||||
F0 "U" -150 -300 60 H V C CNN
|
||||
F1 "USBLC6-2" 0 -200 60 H V C CNN
|
||||
F2 "SOT23_6" 0 0 60 H I C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
$FPLIST
|
||||
SOT666*
|
||||
SOT23-6*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -250 150 250 -150 0 1 0 N
|
||||
X I/O1 1 -550 0 300 R 50 50 1 1 P
|
||||
X GND 2 -550 100 300 R 50 50 1 1 W
|
||||
X I/O2 3 -550 -100 300 R 50 50 1 1 P
|
||||
X I/O2 4 550 -100 300 L 50 50 1 1 P
|
||||
X VBUS 5 550 100 300 L 50 50 1 1 W
|
||||
X I/O1 6 550 0 300 L 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
#End Library
|
||||
1875
kicad/termorez_NX3L4051/my_modules.mod
Normal file
BIN
kicad/termorez_NX3L4051/soldering.pdf
Normal file
6470
kicad/termorez_NX3L4051/soldering.svg
Normal file
|
After Width: | Height: | Size: 222 KiB |
3696
kicad/termorez_NX3L4051/termorez-B.Cu.svg
Normal file
|
After Width: | Height: | Size: 82 KiB |
833
kicad/termorez_NX3L4051/termorez-B.SilkS.svg
Normal file
@ -0,0 +1,833 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
|
||||
width="41.9989cm" height="29.7002cm" viewBox="0 0 165350 116930 ">
|
||||
<title>SVG Picture created as termorez-B.SilkS.svg date 2018/07/12 11:27:21 </title>
|
||||
<desc>Picture generated by PCBNEW </desc>
|
||||
<g style="fill:#000000; fill-opacity:1;stroke:#000000; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round; "
|
||||
transform="translate(0 0) scale(1 1)">
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:-0.000393701; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:59.0551; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
<path d="M126767 11023
|
||||
L125979 11023
|
||||
" />
|
||||
<path d="M126767 24409
|
||||
L126767 11023
|
||||
" />
|
||||
<path d="M125979 24409
|
||||
L126767 24409
|
||||
" />
|
||||
<path d="M108657 11023
|
||||
L125979 11023
|
||||
" />
|
||||
<path d="M108657 24409
|
||||
L108657 11023
|
||||
" />
|
||||
<path d="M125979 24409
|
||||
L108657 24409
|
||||
" />
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:80; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
<path d="M120950 15900
|
||||
L120950 17100
|
||||
" />
|
||||
<path d="M120950 17100
|
||||
L123750 17100
|
||||
" />
|
||||
<path d="M123750 17100
|
||||
L123750 15900
|
||||
" />
|
||||
<path d="M120950 14700
|
||||
L120950 14400
|
||||
" />
|
||||
<path d="M120950 14400
|
||||
L121550 13500
|
||||
" />
|
||||
<path d="M121550 13500
|
||||
L123150 13500
|
||||
" />
|
||||
<path d="M123150 13500
|
||||
L123750 14400
|
||||
" />
|
||||
<path d="M123750 14400
|
||||
L123750 14700
|
||||
" />
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:50; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
<path d="M122650 19300
|
||||
L122750 19300
|
||||
" />
|
||||
<path d="M122750 19300
|
||||
L122750 18400
|
||||
" />
|
||||
<path d="M122750 18400
|
||||
L122650 18400
|
||||
" />
|
||||
<path d="M122650 19300
|
||||
L122650 18400
|
||||
" />
|
||||
<path d="M122650 18400
|
||||
L122000 18400
|
||||
" />
|
||||
<path d="M121300 19300
|
||||
L120650 19300
|
||||
" />
|
||||
<path d="M120650 19300
|
||||
L120650 18400
|
||||
" />
|
||||
<path d="M120650 18400
|
||||
L121300 18400
|
||||
" />
|
||||
<path d="M122000 19300
|
||||
L122650 19300
|
||||
" />
|
||||
<circle cx="117450" cy="19550" r="50" />
|
||||
<path d="M117900 19550
|
||||
L117500 19550
|
||||
" />
|
||||
<path d="M117500 19550
|
||||
L117500 18950
|
||||
" />
|
||||
<path d="M117500 18950
|
||||
L117900 18950
|
||||
" />
|
||||
<path d="M118300 18950
|
||||
L118700 18950
|
||||
" />
|
||||
<path d="M118700 18950
|
||||
L118700 19550
|
||||
" />
|
||||
<path d="M118700 19550
|
||||
L118300 19550
|
||||
" />
|
||||
<circle cx="118000" cy="18100" r="50" />
|
||||
<path d="M117550 18100
|
||||
L117950 18100
|
||||
" />
|
||||
<path d="M117950 18100
|
||||
L117950 18700
|
||||
" />
|
||||
<path d="M117950 18700
|
||||
L117550 18700
|
||||
" />
|
||||
<path d="M117150 18700
|
||||
L116750 18700
|
||||
" />
|
||||
<path d="M116750 18700
|
||||
L116750 18100
|
||||
" />
|
||||
<path d="M116750 18100
|
||||
L117150 18100
|
||||
" />
|
||||
<circle cx="115950" cy="19550" r="50" />
|
||||
<path d="M116400 19550
|
||||
L116000 19550
|
||||
" />
|
||||
<path d="M116000 19550
|
||||
L116000 18950
|
||||
" />
|
||||
<path d="M116000 18950
|
||||
L116400 18950
|
||||
" />
|
||||
<path d="M116800 18950
|
||||
L117200 18950
|
||||
" />
|
||||
<path d="M117200 18950
|
||||
L117200 19550
|
||||
" />
|
||||
<path d="M117200 19550
|
||||
L116800 19550
|
||||
" />
|
||||
<circle cx="116550" cy="18850" r="50" />
|
||||
<path d="M116550 18400
|
||||
L116550 18800
|
||||
" />
|
||||
<path d="M116550 18800
|
||||
L115950 18800
|
||||
" />
|
||||
<path d="M115950 18800
|
||||
L115950 18400
|
||||
" />
|
||||
<path d="M115950 18000
|
||||
L115950 17600
|
||||
" />
|
||||
<path d="M115950 17600
|
||||
L116550 17600
|
||||
" />
|
||||
<path d="M116550 17600
|
||||
L116550 18000
|
||||
" />
|
||||
<circle cx="123300" cy="17450" r="50" />
|
||||
<path d="M123300 17900
|
||||
L123300 17500
|
||||
" />
|
||||
<path d="M123300 17500
|
||||
L123900 17500
|
||||
" />
|
||||
<path d="M123900 17500
|
||||
L123900 17900
|
||||
" />
|
||||
<path d="M123900 18300
|
||||
L123900 18700
|
||||
" />
|
||||
<path d="M123900 18700
|
||||
L123300 18700
|
||||
" />
|
||||
<path d="M123300 18700
|
||||
L123300 18300
|
||||
" />
|
||||
<circle cx="122600" cy="17450" r="50" />
|
||||
<path d="M122150 17450
|
||||
L122550 17450
|
||||
" />
|
||||
<path d="M122550 17450
|
||||
L122550 18050
|
||||
" />
|
||||
<path d="M122550 18050
|
||||
L122150 18050
|
||||
" />
|
||||
<path d="M121750 18050
|
||||
L121350 18050
|
||||
" />
|
||||
<path d="M121350 18050
|
||||
L121350 17450
|
||||
" />
|
||||
<path d="M121350 17450
|
||||
L121750 17450
|
||||
" />
|
||||
<circle cx="115950" cy="16200" r="50" />
|
||||
<path d="M115950 16650
|
||||
L115950 16250
|
||||
" />
|
||||
<path d="M115950 16250
|
||||
L116550 16250
|
||||
" />
|
||||
<path d="M116550 16250
|
||||
L116550 16650
|
||||
" />
|
||||
<path d="M116550 17050
|
||||
L116550 17450
|
||||
" />
|
||||
<path d="M116550 17450
|
||||
L115950 17450
|
||||
" />
|
||||
<path d="M115950 17450
|
||||
L115950 17050
|
||||
" />
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:120; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
<path d="M125350 12650
|
||||
L125350 20650
|
||||
" />
|
||||
<path d="M125350 20650
|
||||
L124350 20650
|
||||
" />
|
||||
<path d="M124350 20650
|
||||
L124350 12650
|
||||
" />
|
||||
<path d="M124350 12650
|
||||
L125350 12650
|
||||
" />
|
||||
<path d="M124350 13650
|
||||
L125350 13650
|
||||
" />
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:59.0551; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
<path d="M115843 19870
|
||||
L116040 20106
|
||||
" />
|
||||
<path d="M116040 20106
|
||||
L116158 20106
|
||||
" />
|
||||
<path d="M116158 20106
|
||||
L115843 19712
|
||||
" />
|
||||
<path d="M115843 19712
|
||||
L115843 19870
|
||||
" />
|
||||
<path d="M114859 20066
|
||||
L114859 20027
|
||||
" />
|
||||
<path d="M114859 20027
|
||||
L114859 19909
|
||||
" />
|
||||
<path d="M114859 19909
|
||||
L115016 19909
|
||||
" />
|
||||
<path d="M116040 20933
|
||||
L116040 21090
|
||||
" />
|
||||
<path d="M116040 21090
|
||||
L115883 21090
|
||||
" />
|
||||
<path d="M114859 21090
|
||||
L114859 20933
|
||||
" />
|
||||
<path d="M115016 21090
|
||||
L114859 21090
|
||||
" />
|
||||
<path d="M116806 15929
|
||||
L116609 15693
|
||||
" />
|
||||
<path d="M116609 15693
|
||||
L116491 15693
|
||||
" />
|
||||
<path d="M116491 15693
|
||||
L116806 16087
|
||||
" />
|
||||
<path d="M116806 16087
|
||||
L116806 15929
|
||||
" />
|
||||
<path d="M117790 15733
|
||||
L117790 15772
|
||||
" />
|
||||
<path d="M117790 15772
|
||||
L117790 15890
|
||||
" />
|
||||
<path d="M117790 15890
|
||||
L117633 15890
|
||||
" />
|
||||
<path d="M116609 14866
|
||||
L116609 14709
|
||||
" />
|
||||
<path d="M116609 14709
|
||||
L116766 14709
|
||||
" />
|
||||
<path d="M117790 14709
|
||||
L117790 14866
|
||||
" />
|
||||
<path d="M117633 14709
|
||||
L117790 14709
|
||||
" />
|
||||
<path d="M113629 17943
|
||||
L113393 18140
|
||||
" />
|
||||
<path d="M113393 18140
|
||||
L113393 18258
|
||||
" />
|
||||
<path d="M113393 18258
|
||||
L113787 17943
|
||||
" />
|
||||
<path d="M113787 17943
|
||||
L113629 17943
|
||||
" />
|
||||
<path d="M113433 16959
|
||||
L113472 16959
|
||||
" />
|
||||
<path d="M113472 16959
|
||||
L113590 16959
|
||||
" />
|
||||
<path d="M113590 16959
|
||||
L113590 17116
|
||||
" />
|
||||
<path d="M112566 18140
|
||||
L112409 18140
|
||||
" />
|
||||
<path d="M112409 18140
|
||||
L112409 17983
|
||||
" />
|
||||
<path d="M112409 16959
|
||||
L112566 16959
|
||||
" />
|
||||
<path d="M112409 17116
|
||||
L112409 16959
|
||||
" />
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:80; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
<path d="M122045 14780
|
||||
L122045 15104
|
||||
L122064 15142
|
||||
L122083 15161
|
||||
L122121 15180
|
||||
L122197 15180
|
||||
L122235 15161
|
||||
L122254 15142
|
||||
L122273 15104
|
||||
L122273 14780
|
||||
" />
|
||||
<path d="M122654 14780
|
||||
L122464 14780
|
||||
L122445 14971
|
||||
L122464 14952
|
||||
L122502 14933
|
||||
L122597 14933
|
||||
L122635 14952
|
||||
L122654 14971
|
||||
L122673 15009
|
||||
L122673 15104
|
||||
L122654 15142
|
||||
L122635 15161
|
||||
L122597 15180
|
||||
L122502 15180
|
||||
L122464 15161
|
||||
L122445 15142
|
||||
" />
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:50; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
<path d="M121457 18957
|
||||
L121442 18971
|
||||
L121400 18985
|
||||
L121371 18985
|
||||
L121328 18971
|
||||
L121300 18942
|
||||
L121285 18914
|
||||
L121271 18857
|
||||
L121271 18814
|
||||
L121285 18757
|
||||
L121300 18728
|
||||
L121328 18700
|
||||
L121371 18685
|
||||
L121400 18685
|
||||
L121442 18700
|
||||
L121457 18714
|
||||
" />
|
||||
<path d="M121742 18985
|
||||
L121571 18985
|
||||
" />
|
||||
<path d="M121657 18985
|
||||
L121657 18685
|
||||
L121628 18728
|
||||
L121600 18757
|
||||
L121571 18771
|
||||
" />
|
||||
<path d="M121857 18714
|
||||
L121871 18700
|
||||
L121900 18685
|
||||
L121971 18685
|
||||
L122000 18700
|
||||
L122014 18714
|
||||
L122028 18742
|
||||
L122028 18771
|
||||
L122014 18814
|
||||
L121842 18985
|
||||
L122028 18985
|
||||
" />
|
||||
<path d="M118058 19363
|
||||
L117975 19244
|
||||
" />
|
||||
<path d="M117915 19363
|
||||
L117915 19113
|
||||
L118010 19113
|
||||
L118034 19125
|
||||
L118046 19136
|
||||
L118058 19160
|
||||
L118058 19196
|
||||
L118046 19220
|
||||
L118034 19232
|
||||
L118010 19244
|
||||
L117915 19244
|
||||
" />
|
||||
<path d="M118201 19220
|
||||
L118177 19208
|
||||
L118165 19196
|
||||
L118153 19172
|
||||
L118153 19160
|
||||
L118165 19136
|
||||
L118177 19125
|
||||
L118201 19113
|
||||
L118248 19113
|
||||
L118272 19125
|
||||
L118284 19136
|
||||
L118296 19160
|
||||
L118296 19172
|
||||
L118284 19196
|
||||
L118272 19208
|
||||
L118248 19220
|
||||
L118201 19220
|
||||
L118177 19232
|
||||
L118165 19244
|
||||
L118153 19267
|
||||
L118153 19315
|
||||
L118165 19339
|
||||
L118177 19351
|
||||
L118201 19363
|
||||
L118248 19363
|
||||
L118272 19351
|
||||
L118284 19339
|
||||
L118296 19315
|
||||
L118296 19267
|
||||
L118284 19244
|
||||
L118272 19232
|
||||
L118248 19220
|
||||
" />
|
||||
<path d="M117308 18513
|
||||
L117225 18394
|
||||
" />
|
||||
<path d="M117165 18513
|
||||
L117165 18263
|
||||
L117260 18263
|
||||
L117284 18275
|
||||
L117296 18286
|
||||
L117308 18310
|
||||
L117308 18346
|
||||
L117296 18370
|
||||
L117284 18382
|
||||
L117260 18394
|
||||
L117165 18394
|
||||
" />
|
||||
<path d="M117391 18263
|
||||
L117558 18263
|
||||
L117451 18513
|
||||
" />
|
||||
<path d="M116558 19363
|
||||
L116475 19244
|
||||
" />
|
||||
<path d="M116415 19363
|
||||
L116415 19113
|
||||
L116510 19113
|
||||
L116534 19125
|
||||
L116546 19136
|
||||
L116558 19160
|
||||
L116558 19196
|
||||
L116546 19220
|
||||
L116534 19232
|
||||
L116510 19244
|
||||
L116415 19244
|
||||
" />
|
||||
<path d="M116772 19113
|
||||
L116725 19113
|
||||
L116701 19125
|
||||
L116689 19136
|
||||
L116665 19172
|
||||
L116653 19220
|
||||
L116653 19315
|
||||
L116665 19339
|
||||
L116677 19351
|
||||
L116701 19363
|
||||
L116748 19363
|
||||
L116772 19351
|
||||
L116784 19339
|
||||
L116796 19315
|
||||
L116796 19255
|
||||
L116784 19232
|
||||
L116772 19220
|
||||
L116748 19208
|
||||
L116701 19208
|
||||
L116677 19220
|
||||
L116665 19232
|
||||
L116653 19255
|
||||
" />
|
||||
<path d="M116136 18158
|
||||
L116255 18075
|
||||
" />
|
||||
<path d="M116136 18015
|
||||
L116386 18015
|
||||
L116386 18110
|
||||
L116375 18134
|
||||
L116363 18146
|
||||
L116339 18158
|
||||
L116303 18158
|
||||
L116279 18146
|
||||
L116267 18134
|
||||
L116255 18110
|
||||
L116255 18015
|
||||
" />
|
||||
<path d="M116386 18384
|
||||
L116386 18265
|
||||
L116267 18253
|
||||
L116279 18265
|
||||
L116291 18289
|
||||
L116291 18348
|
||||
L116279 18372
|
||||
L116267 18384
|
||||
L116244 18396
|
||||
L116184 18396
|
||||
L116160 18384
|
||||
L116148 18372
|
||||
L116136 18348
|
||||
L116136 18289
|
||||
L116148 18265
|
||||
L116160 18253
|
||||
" />
|
||||
<path d="M123510 18058
|
||||
L123498 18046
|
||||
L123486 18010
|
||||
L123486 17986
|
||||
L123498 17951
|
||||
L123522 17927
|
||||
L123546 17915
|
||||
L123594 17903
|
||||
L123629 17903
|
||||
L123677 17915
|
||||
L123701 17927
|
||||
L123725 17951
|
||||
L123736 17986
|
||||
L123736 18010
|
||||
L123725 18046
|
||||
L123713 18058
|
||||
" />
|
||||
<path d="M123629 18201
|
||||
L123641 18177
|
||||
L123653 18165
|
||||
L123677 18153
|
||||
L123689 18153
|
||||
L123713 18165
|
||||
L123725 18177
|
||||
L123736 18201
|
||||
L123736 18248
|
||||
L123725 18272
|
||||
L123713 18284
|
||||
L123689 18296
|
||||
L123677 18296
|
||||
L123653 18284
|
||||
L123641 18272
|
||||
L123629 18248
|
||||
L123629 18201
|
||||
L123617 18177
|
||||
L123605 18165
|
||||
L123582 18153
|
||||
L123534 18153
|
||||
L123510 18165
|
||||
L123498 18177
|
||||
L123486 18201
|
||||
L123486 18248
|
||||
L123498 18272
|
||||
L123510 18284
|
||||
L123534 18296
|
||||
L123582 18296
|
||||
L123605 18284
|
||||
L123617 18272
|
||||
L123629 18248
|
||||
" />
|
||||
<path d="M121908 17839
|
||||
L121896 17851
|
||||
L121860 17863
|
||||
L121836 17863
|
||||
L121801 17851
|
||||
L121777 17827
|
||||
L121765 17803
|
||||
L121753 17755
|
||||
L121753 17720
|
||||
L121765 17672
|
||||
L121777 17648
|
||||
L121801 17625
|
||||
L121836 17613
|
||||
L121860 17613
|
||||
L121896 17625
|
||||
L121908 17636
|
||||
" />
|
||||
<path d="M122027 17863
|
||||
L122075 17863
|
||||
L122098 17851
|
||||
L122110 17839
|
||||
L122134 17803
|
||||
L122146 17755
|
||||
L122146 17660
|
||||
L122134 17636
|
||||
L122122 17625
|
||||
L122098 17613
|
||||
L122051 17613
|
||||
L122027 17625
|
||||
L122015 17636
|
||||
L122003 17660
|
||||
L122003 17720
|
||||
L122015 17744
|
||||
L122027 17755
|
||||
L122051 17767
|
||||
L122098 17767
|
||||
L122122 17755
|
||||
L122134 17744
|
||||
L122146 17720
|
||||
" />
|
||||
<path d="M116136 16808
|
||||
L116255 16725
|
||||
" />
|
||||
<path d="M116136 16665
|
||||
L116386 16665
|
||||
L116386 16760
|
||||
L116375 16784
|
||||
L116363 16796
|
||||
L116339 16808
|
||||
L116303 16808
|
||||
L116279 16796
|
||||
L116267 16784
|
||||
L116255 16760
|
||||
L116255 16665
|
||||
" />
|
||||
<path d="M116303 17022
|
||||
L116136 17022
|
||||
" />
|
||||
<path d="M116398 16963
|
||||
L116220 16903
|
||||
L116220 17058
|
||||
" />
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:120; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:107; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
<path d="M125541 13834
|
||||
L126222 13834
|
||||
L126222 13997
|
||||
L126190 14037
|
||||
L126158 14058
|
||||
L126093 14078
|
||||
L125995 14078
|
||||
L125931 14058
|
||||
L125898 14037
|
||||
L125866 13997
|
||||
L125866 13834
|
||||
" />
|
||||
<path d="M125995 14445
|
||||
L125541 14445
|
||||
" />
|
||||
<path d="M126255 14343
|
||||
L125768 14241
|
||||
L125768 14506
|
||||
" />
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:120; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:15; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:14.75; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
<path d="M115381 21432
|
||||
L115381 21373
|
||||
L115395 21373
|
||||
L115403 21376
|
||||
L115409 21381
|
||||
L115412 21387
|
||||
L115414 21398
|
||||
L115414 21406
|
||||
L115412 21418
|
||||
L115409 21423
|
||||
L115403 21429
|
||||
L115395 21432
|
||||
L115381 21432
|
||||
" />
|
||||
<path d="M115437 21415
|
||||
L115465 21415
|
||||
" />
|
||||
<path d="M115431 21432
|
||||
L115451 21373
|
||||
L115471 21432
|
||||
" />
|
||||
<path d="M115521 21432
|
||||
L115487 21432
|
||||
" />
|
||||
<path d="M115504 21432
|
||||
L115504 21373
|
||||
L115499 21381
|
||||
L115493 21387
|
||||
L115487 21390
|
||||
" />
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:15; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:14.75; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
<path d="M117131 14421
|
||||
L117131 14362
|
||||
L117145 14362
|
||||
L117153 14364
|
||||
L117159 14370
|
||||
L117162 14376
|
||||
L117164 14387
|
||||
L117164 14395
|
||||
L117162 14407
|
||||
L117159 14412
|
||||
L117153 14418
|
||||
L117145 14421
|
||||
L117131 14421
|
||||
" />
|
||||
<path d="M117187 14404
|
||||
L117215 14404
|
||||
" />
|
||||
<path d="M117181 14421
|
||||
L117201 14362
|
||||
L117221 14421
|
||||
" />
|
||||
<path d="M117235 14362
|
||||
L117271 14362
|
||||
L117251 14384
|
||||
L117260 14384
|
||||
L117266 14387
|
||||
L117268 14390
|
||||
L117271 14395
|
||||
L117271 14409
|
||||
L117268 14415
|
||||
L117266 14418
|
||||
L117260 14421
|
||||
L117243 14421
|
||||
L117237 14418
|
||||
L117235 14415
|
||||
" />
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:15; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:14.75; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
<path d="M112067 17481
|
||||
L112126 17481
|
||||
L112126 17495
|
||||
L112123 17503
|
||||
L112118 17509
|
||||
L112112 17512
|
||||
L112101 17514
|
||||
L112093 17514
|
||||
L112081 17512
|
||||
L112076 17509
|
||||
L112070 17503
|
||||
L112067 17495
|
||||
L112067 17481
|
||||
" />
|
||||
<path d="M112084 17537
|
||||
L112084 17565
|
||||
" />
|
||||
<path d="M112067 17531
|
||||
L112126 17551
|
||||
L112067 17571
|
||||
" />
|
||||
<path d="M112121 17587
|
||||
L112123 17590
|
||||
L112126 17596
|
||||
L112126 17610
|
||||
L112123 17616
|
||||
L112121 17618
|
||||
L112115 17621
|
||||
L112109 17621
|
||||
L112101 17618
|
||||
L112067 17585
|
||||
L112067 17621
|
||||
" />
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:15; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 14 KiB |
2910
kicad/termorez_NX3L4051/termorez-F.Cu.svg
Normal file
|
After Width: | Height: | Size: 68 KiB |
514
kicad/termorez_NX3L4051/termorez-F.SilkS.svg
Normal file
@ -0,0 +1,514 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
|
||||
width="41.9989cm" height="29.7002cm" viewBox="0 0 165350 116930 ">
|
||||
<title>SVG Picture created as termorez-F.SilkS.svg date 2018/07/12 11:27:24 </title>
|
||||
<desc>Picture generated by PCBNEW </desc>
|
||||
<g style="fill:#000000; fill-opacity:1;stroke:#000000; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round; "
|
||||
transform="translate(0 0) scale(1 1)">
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:-0.000393701; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:59.0551; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
<path d="M126767 11023
|
||||
L125979 11023
|
||||
" />
|
||||
<path d="M126767 24409
|
||||
L126767 11023
|
||||
" />
|
||||
<path d="M125979 24409
|
||||
L126767 24409
|
||||
" />
|
||||
<path d="M108657 11023
|
||||
L125979 11023
|
||||
" />
|
||||
<path d="M108657 24409
|
||||
L108657 11023
|
||||
" />
|
||||
<path d="M125979 24409
|
||||
L108657 24409
|
||||
" />
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:60; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
<path d="M117700 20500
|
||||
L117700 17000
|
||||
" />
|
||||
<path d="M117700 17000
|
||||
L116300 17000
|
||||
" />
|
||||
<path d="M116300 17000
|
||||
L116300 20500
|
||||
" />
|
||||
<path d="M116300 20500
|
||||
L117700 20500
|
||||
" />
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:50; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
<circle cx="116500" cy="20300" r="141.421" />
|
||||
<path d="M117250 20500
|
||||
L117250 20200
|
||||
" />
|
||||
<path d="M117250 20200
|
||||
L116750 20200
|
||||
" />
|
||||
<path d="M116750 20200
|
||||
L116750 20500
|
||||
" />
|
||||
<circle cx="119150" cy="18600" r="50" />
|
||||
<path d="M119150 18150
|
||||
L119150 18550
|
||||
" />
|
||||
<path d="M119150 18550
|
||||
L119750 18550
|
||||
" />
|
||||
<path d="M119750 18550
|
||||
L119750 18150
|
||||
" />
|
||||
<path d="M119750 17750
|
||||
L119750 17350
|
||||
" />
|
||||
<path d="M119750 17350
|
||||
L119150 17350
|
||||
" />
|
||||
<path d="M119150 17350
|
||||
L119150 17750
|
||||
" />
|
||||
<circle cx="119150" cy="20000" r="50" />
|
||||
<path d="M119150 19550
|
||||
L119150 19950
|
||||
" />
|
||||
<path d="M119150 19950
|
||||
L119750 19950
|
||||
" />
|
||||
<path d="M119750 19950
|
||||
L119750 19550
|
||||
" />
|
||||
<path d="M119750 19150
|
||||
L119750 18750
|
||||
" />
|
||||
<path d="M119750 18750
|
||||
L119150 18750
|
||||
" />
|
||||
<path d="M119150 18750
|
||||
L119150 19150
|
||||
" />
|
||||
<path d="M114700 18550
|
||||
L113800 18550
|
||||
" />
|
||||
<path d="M113800 18550
|
||||
L113800 19050
|
||||
" />
|
||||
<path d="M113800 19050
|
||||
L114700 19050
|
||||
" />
|
||||
<path d="M114700 19050
|
||||
L114700 18550
|
||||
" />
|
||||
<path d="M123650 16350
|
||||
L123650 17250
|
||||
" />
|
||||
<path d="M123650 17250
|
||||
L124150 17250
|
||||
" />
|
||||
<path d="M124150 17250
|
||||
L124150 16350
|
||||
" />
|
||||
<path d="M124150 16350
|
||||
L123650 16350
|
||||
" />
|
||||
<path d="M115400 19200
|
||||
L114500 19200
|
||||
" />
|
||||
<path d="M114500 19200
|
||||
L114500 19700
|
||||
" />
|
||||
<path d="M114500 19700
|
||||
L115400 19700
|
||||
" />
|
||||
<path d="M115400 19700
|
||||
L115400 19200
|
||||
" />
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:120; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
<path d="M120100 22500
|
||||
L112100 22500
|
||||
" />
|
||||
<path d="M112100 22500
|
||||
L112100 23500
|
||||
" />
|
||||
<path d="M112100 23500
|
||||
L120100 23500
|
||||
" />
|
||||
<path d="M120100 23500
|
||||
L120100 22500
|
||||
" />
|
||||
<path d="M119100 23500
|
||||
L119100 22500
|
||||
" />
|
||||
<path d="M110600 22350
|
||||
L110600 14350
|
||||
" />
|
||||
<path d="M110600 14350
|
||||
L109600 14350
|
||||
" />
|
||||
<path d="M109600 14350
|
||||
L109600 22350
|
||||
" />
|
||||
<path d="M109600 22350
|
||||
L110600 22350
|
||||
" />
|
||||
<path d="M109600 21350
|
||||
L110600 21350
|
||||
" />
|
||||
<path d="M112531 13492
|
||||
L120531 13492
|
||||
" />
|
||||
<path d="M120531 13492
|
||||
L120531 12492
|
||||
" />
|
||||
<path d="M120531 12492
|
||||
L112531 12492
|
||||
" />
|
||||
<path d="M112531 12492
|
||||
L112531 13492
|
||||
" />
|
||||
<path d="M113531 12492
|
||||
L113531 13492
|
||||
" />
|
||||
<path d="M124350 23350
|
||||
L125350 23350
|
||||
" />
|
||||
<path d="M125350 23350
|
||||
L125350 21350
|
||||
" />
|
||||
<path d="M125350 21350
|
||||
L124350 21350
|
||||
" />
|
||||
<path d="M124350 21350
|
||||
L124350 23350
|
||||
" />
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:50; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
<path d="M117528 20685
|
||||
L117528 20928
|
||||
L117514 20957
|
||||
L117500 20971
|
||||
L117471 20985
|
||||
L117414 20985
|
||||
L117385 20971
|
||||
L117371 20957
|
||||
L117357 20928
|
||||
L117357 20685
|
||||
" />
|
||||
<path d="M117085 20785
|
||||
L117085 20985
|
||||
" />
|
||||
<path d="M117157 20671
|
||||
L117228 20885
|
||||
L117042 20885
|
||||
" />
|
||||
<path d="M119860 18110
|
||||
L119848 18122
|
||||
L119836 18158
|
||||
L119836 18182
|
||||
L119848 18217
|
||||
L119872 18241
|
||||
L119896 18253
|
||||
L119944 18265
|
||||
L119979 18265
|
||||
L120027 18253
|
||||
L120051 18241
|
||||
L120075 18217
|
||||
L120086 18182
|
||||
L120086 18158
|
||||
L120075 18122
|
||||
L120063 18110
|
||||
" />
|
||||
<path d="M119836 17872
|
||||
L119836 18015
|
||||
" />
|
||||
<path d="M119836 17944
|
||||
L120086 17944
|
||||
L120051 17967
|
||||
L120027 17991
|
||||
L120015 18015
|
||||
" />
|
||||
<path d="M120086 17717
|
||||
L120086 17694
|
||||
L120075 17670
|
||||
L120063 17658
|
||||
L120039 17646
|
||||
L119991 17634
|
||||
L119932 17634
|
||||
L119884 17646
|
||||
L119860 17658
|
||||
L119848 17670
|
||||
L119836 17694
|
||||
L119836 17717
|
||||
L119848 17741
|
||||
L119860 17753
|
||||
L119884 17765
|
||||
L119932 17777
|
||||
L119991 17777
|
||||
L120039 17765
|
||||
L120063 17753
|
||||
L120075 17741
|
||||
L120086 17717
|
||||
" />
|
||||
<path d="M119886 19391
|
||||
L119886 19510
|
||||
L120136 19510
|
||||
" />
|
||||
<path d="M119886 19177
|
||||
L119886 19320
|
||||
" />
|
||||
<path d="M119886 19248
|
||||
L120136 19248
|
||||
L120101 19272
|
||||
L120077 19296
|
||||
L120065 19320
|
||||
" />
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:45; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
<path d="M114280 18440
|
||||
L114340 18345
|
||||
" />
|
||||
<path d="M114382 18440
|
||||
L114382 18240
|
||||
L114314 18240
|
||||
L114297 18250
|
||||
L114288 18259
|
||||
L114280 18278
|
||||
L114280 18307
|
||||
L114288 18326
|
||||
L114297 18335
|
||||
L114314 18345
|
||||
L114382 18345
|
||||
" />
|
||||
<path d="M114211 18259
|
||||
L114202 18250
|
||||
L114185 18240
|
||||
L114142 18240
|
||||
L114125 18250
|
||||
L114117 18259
|
||||
L114108 18278
|
||||
L114108 18297
|
||||
L114117 18326
|
||||
L114220 18440
|
||||
L114108 18440
|
||||
" />
|
||||
<path d="M123359 16830
|
||||
L123454 16890
|
||||
" />
|
||||
<path d="M123359 16932
|
||||
L123559 16932
|
||||
L123559 16864
|
||||
L123550 16847
|
||||
L123540 16838
|
||||
L123521 16830
|
||||
L123492 16830
|
||||
L123473 16838
|
||||
L123464 16847
|
||||
L123454 16864
|
||||
L123454 16932
|
||||
" />
|
||||
<path d="M123559 16770
|
||||
L123559 16658
|
||||
L123483 16718
|
||||
L123483 16692
|
||||
L123473 16675
|
||||
L123464 16667
|
||||
L123445 16658
|
||||
L123397 16658
|
||||
L123378 16667
|
||||
L123369 16675
|
||||
L123359 16692
|
||||
L123359 16744
|
||||
L123369 16761
|
||||
L123378 16770
|
||||
" />
|
||||
<path d="M114930 19990
|
||||
L114990 19895
|
||||
" />
|
||||
<path d="M115032 19990
|
||||
L115032 19790
|
||||
L114964 19790
|
||||
L114947 19800
|
||||
L114938 19809
|
||||
L114930 19828
|
||||
L114930 19857
|
||||
L114938 19876
|
||||
L114947 19885
|
||||
L114964 19895
|
||||
L115032 19895
|
||||
" />
|
||||
<path d="M114758 19990
|
||||
L114861 19990
|
||||
" />
|
||||
<path d="M114810 19990
|
||||
L114810 19790
|
||||
L114827 19819
|
||||
L114844 19838
|
||||
L114861 19847
|
||||
" />
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:120; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:107; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
<path d="M120965 23358
|
||||
L120965 22677
|
||||
L120802 22677
|
||||
L120762 22709
|
||||
L120741 22741
|
||||
L120721 22806
|
||||
L120721 22904
|
||||
L120741 22968
|
||||
L120762 23001
|
||||
L120802 23033
|
||||
L120965 23033
|
||||
" />
|
||||
<path d="M120313 23358
|
||||
L120558 23358
|
||||
" />
|
||||
<path d="M120436 23358
|
||||
L120436 22677
|
||||
L120476 22774
|
||||
L120517 22839
|
||||
L120558 22871
|
||||
" />
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:120; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:107; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
<path d="M110791 21165
|
||||
L111472 21165
|
||||
L111472 21002
|
||||
L111440 20962
|
||||
L111408 20941
|
||||
L111343 20921
|
||||
L111245 20921
|
||||
L111181 20941
|
||||
L111148 20962
|
||||
L111116 21002
|
||||
L111116 21165
|
||||
" />
|
||||
<path d="M111408 20758
|
||||
L111440 20737
|
||||
L111472 20697
|
||||
L111472 20595
|
||||
L111440 20554
|
||||
L111408 20534
|
||||
L111343 20513
|
||||
L111278 20513
|
||||
L111181 20534
|
||||
L110791 20778
|
||||
L110791 20513
|
||||
" />
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:120; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:107; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
<path d="M114347 14300
|
||||
L114347 13619
|
||||
L114183 13619
|
||||
L114143 13651
|
||||
L114122 13684
|
||||
L114102 13748
|
||||
L114102 13846
|
||||
L114122 13911
|
||||
L114143 13943
|
||||
L114183 13975
|
||||
L114347 13975
|
||||
" />
|
||||
<path d="M113959 13619
|
||||
L113694 13619
|
||||
L113837 13878
|
||||
L113776 13878
|
||||
L113735 13911
|
||||
L113715 13943
|
||||
L113694 14008
|
||||
L113694 14170
|
||||
L113715 14235
|
||||
L113735 14267
|
||||
L113776 14300
|
||||
L113898 14300
|
||||
L113939 14267
|
||||
L113959 14235
|
||||
" />
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:120; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:107; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
<path d="M125541 22665
|
||||
L126222 22665
|
||||
L126222 22502
|
||||
L126190 22462
|
||||
L126158 22441
|
||||
L126093 22421
|
||||
L125995 22421
|
||||
L125931 22441
|
||||
L125898 22462
|
||||
L125866 22502
|
||||
L125866 22665
|
||||
" />
|
||||
<path d="M126222 22054
|
||||
L126222 22136
|
||||
L126190 22176
|
||||
L126158 22197
|
||||
L126060 22237
|
||||
L125931 22258
|
||||
L125671 22258
|
||||
L125606 22237
|
||||
L125574 22217
|
||||
L125541 22176
|
||||
L125541 22095
|
||||
L125574 22054
|
||||
L125606 22034
|
||||
L125671 22013
|
||||
L125833 22013
|
||||
L125898 22034
|
||||
L125931 22054
|
||||
L125963 22095
|
||||
L125963 22176
|
||||
L125931 22217
|
||||
L125898 22237
|
||||
L125833 22258
|
||||
" />
|
||||
</g>
|
||||
<g style="fill:#000000; fill-opacity:0.0;
|
||||
stroke:#000000; stroke-width:120; stroke-opacity:1;
|
||||
stroke-linecap:round; stroke-linejoin:round;">
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 9.0 KiB |
BIN
kicad/termorez_NX3L4051/termorez-drl_map.pdf
Normal file
23
kicad/termorez_NX3L4051/termorez-rescue.lib
Normal file
@ -0,0 +1,23 @@
|
||||
EESchema-LIBRARY Version 2.3
|
||||
#encoding utf-8
|
||||
#
|
||||
# LM317AEMP-RESCUE-termorez
|
||||
#
|
||||
DEF LM317AEMP-RESCUE-termorez U 0 40 Y Y 1 F N
|
||||
F0 "U" -200 200 50 H V C CNN
|
||||
F1 "LM317AEMP-RESCUE-termorez" 0 200 50 H V L CNN
|
||||
F2 "SOT-223" 0 100 50 H V C CIN
|
||||
F3 "" 0 0 50 H V C CNN
|
||||
$FPLIST
|
||||
SOT*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -250 150 250 -150 0 1 10 f
|
||||
X ADJ 1 0 -250 150 U 50 50 1 1 W
|
||||
X OUT 2 400 50 150 L 50 50 1 1 P
|
||||
X IN 3 -400 50 150 R 50 50 1 1 W
|
||||
X OUT 4 400 -60 150 L 50 50 1 1 w
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
#End Library
|
||||
BIN
kicad/termorez_NX3L4051/termorez.Cu.pdf
Normal file
5408
kicad/termorez_NX3L4051/termorez.Cu.svg
Normal file
|
After Width: | Height: | Size: 189 KiB |
171
kicad/termorez_NX3L4051/termorez.cmp
Normal file
@ -0,0 +1,171 @@
|
||||
Cmp-Mod V01 Created by CvPcb (2013-feb-26)-stable date = Сб 27 дек 2014 18:49:59
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /53576FC3;
|
||||
Reference = C8;
|
||||
ValeurCmp = 0.33u;
|
||||
IdModule = SM0805;
|
||||
EndCmp
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /53576FB6;
|
||||
Reference = C9;
|
||||
ValeurCmp = 0.1u;
|
||||
IdModule = SM0805;
|
||||
EndCmp
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /5357821E;
|
||||
Reference = C10;
|
||||
ValeurCmp = 1u;
|
||||
IdModule = SM0805;
|
||||
EndCmp
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /5357750C;
|
||||
Reference = C12;
|
||||
ValeurCmp = 47u;
|
||||
IdModule = SM1206POL;
|
||||
EndCmp
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /54759E36;
|
||||
Reference = DA1;
|
||||
ValeurCmp = NX3L4051-HX;
|
||||
IdModule = HXQFN16;
|
||||
EndCmp
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /5475A2C1;
|
||||
Reference = DA2;
|
||||
ValeurCmp = NX3L4051-HX;
|
||||
IdModule = HXQFN16;
|
||||
EndCmp
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /5475A2C7;
|
||||
Reference = DA3;
|
||||
ValeurCmp = NX3L4051-HX;
|
||||
IdModule = HXQFN16;
|
||||
EndCmp
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /53577523;
|
||||
Reference = L1;
|
||||
ValeurCmp = BMB2A0300AN1;
|
||||
IdModule = SM0805;
|
||||
EndCmp
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /53579853;
|
||||
Reference = P1;
|
||||
ValeurCmp = контакт 1;
|
||||
IdModule = SIL-8;
|
||||
EndCmp
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /5475974D;
|
||||
Reference = P2;
|
||||
ValeurCmp = контакт 2a;
|
||||
IdModule = SIL-8;
|
||||
EndCmp
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /5475975B;
|
||||
Reference = P3;
|
||||
ValeurCmp = контакт 2б;
|
||||
IdModule = SIL-8;
|
||||
EndCmp
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /5357BA72;
|
||||
Reference = P4;
|
||||
ValeurCmp = MCU;
|
||||
IdModule = SIL-8;
|
||||
EndCmp
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /5357ABB4;
|
||||
Reference = P6;
|
||||
ValeurCmp = 5V;
|
||||
IdModule = SIL-2;
|
||||
EndCmp
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /53579396;
|
||||
Reference = R1;
|
||||
ValeurCmp = 10k;
|
||||
IdModule = SM0603;
|
||||
EndCmp
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /535793A8;
|
||||
Reference = R2;
|
||||
ValeurCmp = 10k;
|
||||
IdModule = SM0603;
|
||||
EndCmp
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /5357C8F8;
|
||||
Reference = R3;
|
||||
ValeurCmp = 47k;
|
||||
IdModule = SM0603;
|
||||
EndCmp
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /53562118;
|
||||
Reference = R4;
|
||||
ValeurCmp = 1k 0.1% (RT0805BRB071KL);
|
||||
IdModule = SM0805;
|
||||
EndCmp
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /547C0DD9;
|
||||
Reference = R5;
|
||||
ValeurCmp = 1k 0.1% (RT0805BRB071KL);
|
||||
IdModule = SM0805;
|
||||
EndCmp
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /547C0DE4;
|
||||
Reference = R6;
|
||||
ValeurCmp = 1k 0.1% (RT0805BRB071KL);
|
||||
IdModule = SM0805;
|
||||
EndCmp
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /547C0DEA;
|
||||
Reference = R7;
|
||||
ValeurCmp = 1k 0.1% (RT0805BRB071KL);
|
||||
IdModule = SM0805;
|
||||
EndCmp
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /547C0DF0;
|
||||
Reference = R8;
|
||||
ValeurCmp = 1k 0.1% (RT0805BRB071KL);
|
||||
IdModule = SM0805;
|
||||
EndCmp
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /524D62C1;
|
||||
Reference = U4;
|
||||
ValeurCmp = AD7794/7795;
|
||||
IdModule = SSOP24;
|
||||
EndCmp
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /535787B7;
|
||||
Reference = U5;
|
||||
ValeurCmp = LM1117-33;
|
||||
IdModule = SOT223;
|
||||
EndCmp
|
||||
|
||||
BeginCmp
|
||||
TimeStamp = /549EDA1E;
|
||||
Reference = X1;
|
||||
ValeurCmp = GND_CONNECTOR;
|
||||
IdModule = GND_connector;
|
||||
EndCmp
|
||||
|
||||
EndListe
|
||||
1878
kicad/termorez_NX3L4051/termorez.kicad_pcb
Normal file
477
kicad/termorez_NX3L4051/termorez.net
Normal file
@ -0,0 +1,477 @@
|
||||
(export (version D)
|
||||
(design
|
||||
(source /home/eddy/Docs/SAO/BTA/MIRROR_CONTROL_termo/Project/termorez_NX3L4051/termorez.sch)
|
||||
(date "Вт 10 июл 2018 14:30:35")
|
||||
(tool "Eeschema 4.0.7")
|
||||
(sheet (number 1) (name /) (tstamps /)
|
||||
(title_block
|
||||
(title noname.sch)
|
||||
(company)
|
||||
(rev)
|
||||
(date "27 dec 2014")
|
||||
(source termorez.sch)
|
||||
(comment (number 1) (value ""))
|
||||
(comment (number 2) (value ""))
|
||||
(comment (number 3) (value ""))
|
||||
(comment (number 4) (value "")))))
|
||||
(components
|
||||
(comp (ref U4)
|
||||
(value AD7794/7795)
|
||||
(libsource (lib my_elements) (part AD7794/7795))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 524D62C1))
|
||||
(comp (ref R4)
|
||||
(value "1k 0.1% (RT0805BRB071KL)")
|
||||
(footprint SM0805)
|
||||
(libsource (lib device) (part R))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 53562118))
|
||||
(comp (ref C12)
|
||||
(value 47u)
|
||||
(footprint Capacitor_Tantalum_SMD.pretty:CP_EIA-3216-12_Kemet-S)
|
||||
(libsource (lib device) (part CP1))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 5357750C))
|
||||
(comp (ref L1)
|
||||
(value BMB2A0300AN1)
|
||||
(libsource (lib termorez-cache) (part INDUCTOR_SMALL))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 53577523))
|
||||
(comp (ref C9)
|
||||
(value 0.1u)
|
||||
(footprint Capacitor_SMD.pretty:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder)
|
||||
(libsource (lib device) (part C))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 53576FB6))
|
||||
(comp (ref C8)
|
||||
(value 0.1u)
|
||||
(footprint Capacitor_SMD.pretty:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder)
|
||||
(libsource (lib device) (part C))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 53576FC3))
|
||||
(comp (ref U5)
|
||||
(value LM1117-33)
|
||||
(footprint SOT-223)
|
||||
(libsource (lib termorez-rescue) (part LM317AEMP-RESCUE-termorez))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 535787B7))
|
||||
(comp (ref R1)
|
||||
(value 10k)
|
||||
(libsource (lib device) (part R))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 53579396))
|
||||
(comp (ref R2)
|
||||
(value 10k)
|
||||
(libsource (lib device) (part R))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 535793A8))
|
||||
(comp (ref P1)
|
||||
(value conn1)
|
||||
(libsource (lib termorez-cache) (part CONN_8))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 53579853))
|
||||
(comp (ref P6)
|
||||
(value 5V)
|
||||
(libsource (lib termorez-cache) (part CONN_2))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 5357ABB4))
|
||||
(comp (ref P4)
|
||||
(value MCU)
|
||||
(libsource (lib termorez-cache) (part CONN_8))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 5357BA72))
|
||||
(comp (ref R3)
|
||||
(value 47k)
|
||||
(libsource (lib device) (part R))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 5357C8F8))
|
||||
(comp (ref P2)
|
||||
(value conn2a)
|
||||
(libsource (lib termorez-cache) (part CONN_8))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 5475974D))
|
||||
(comp (ref P3)
|
||||
(value conn2b)
|
||||
(libsource (lib termorez-cache) (part CONN_8))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 5475975B))
|
||||
(comp (ref DA1)
|
||||
(value NX3L4051-HX)
|
||||
(footprint HXQFN-16)
|
||||
(libsource (lib my_elements) (part NX3L4051-HX))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 54759E36))
|
||||
(comp (ref DA3)
|
||||
(value NX3L4051-HX)
|
||||
(footprint HXQFN-16)
|
||||
(libsource (lib my_elements) (part NX3L4051-HX))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 5475A2C7))
|
||||
(comp (ref DA2)
|
||||
(value NX3L4051-HX)
|
||||
(footprint HXQFN-16)
|
||||
(libsource (lib my_elements) (part NX3L4051-HX))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 5475A2C1))
|
||||
(comp (ref C10)
|
||||
(value 1u)
|
||||
(libsource (lib device) (part C))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 5357821E))
|
||||
(comp (ref R5)
|
||||
(value "1k 0.1% (RT0805BRB071KL)")
|
||||
(footprint SM0805)
|
||||
(libsource (lib device) (part R))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 547C0DD9))
|
||||
(comp (ref R6)
|
||||
(value "1k 0.1% (RT0805BRB071KL)")
|
||||
(footprint SM0805)
|
||||
(libsource (lib device) (part R))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 547C0DE4))
|
||||
(comp (ref R7)
|
||||
(value "1k 0.1% (RT0805BRB071KL)")
|
||||
(footprint SM0805)
|
||||
(libsource (lib device) (part R))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 547C0DEA))
|
||||
(comp (ref R8)
|
||||
(value "1k 0.1% (RT0805BRB071KL)")
|
||||
(footprint SM0805)
|
||||
(libsource (lib device) (part R))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 547C0DF0))
|
||||
(comp (ref X1)
|
||||
(value GND_CONNECTOR)
|
||||
(footprint GND_CONNECTOR)
|
||||
(libsource (lib my_elements) (part GND_CONNECTOR))
|
||||
(sheetpath (names /) (tstamps /))
|
||||
(tstamp 549EDA1E)))
|
||||
(libparts
|
||||
(libpart (lib my_elements) (part AD7794/7795)
|
||||
(footprints
|
||||
(fp TSSOP24)
|
||||
(fp SSOP24))
|
||||
(fields
|
||||
(field (name Reference) U)
|
||||
(field (name Value) AD7794/7795)
|
||||
(field (name Footprint) TSSOP24))
|
||||
(pins
|
||||
(pin (num 1) (name SCLK) (type passive))
|
||||
(pin (num 2) (name CLC) (type passive))
|
||||
(pin (num 3) (name !CS) (type passive))
|
||||
(pin (num 5) (name "AIN6(+)/P1") (type BiDi))
|
||||
(pin (num 6) (name "AIN6(-)/P2") (type BiDi))
|
||||
(pin (num 7) (name "AIN1(+)") (type input))
|
||||
(pin (num 8) (name "AIN1(-)") (type input))
|
||||
(pin (num 9) (name "AIN2(+)") (type input))
|
||||
(pin (num 10) (name "AIN2(-)") (type input))
|
||||
(pin (num 11) (name "AIN3(+)") (type input))
|
||||
(pin (num 12) (name "AIN3(-)") (type input))
|
||||
(pin (num 13) (name "REFIN1(+)") (type input))
|
||||
(pin (num 14) (name "REFIN1(-)") (type input))
|
||||
(pin (num 15) (name "AIN5(+)/IOUT2") (type input))
|
||||
(pin (num 16) (name "AIN5(-)/IOUT1") (type input))
|
||||
(pin (num 17) (name "AIN4(+)/REFIN2(+)") (type input))
|
||||
(pin (num 18) (name "AIN4(-)/REFIN2(-)") (type input))
|
||||
(pin (num 19) (name PSW) (type input))
|
||||
(pin (num 20) (name GND) (type power_in))
|
||||
(pin (num 21) (name AVDD) (type power_in))
|
||||
(pin (num 22) (name DVDD) (type power_in))
|
||||
(pin (num 23) (name DOUT/!RDY) (type passive))
|
||||
(pin (num 24) (name DIN) (type passive))))
|
||||
(libpart (lib device) (part C)
|
||||
(description "Unpolarized capacitor")
|
||||
(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 termorez-cache) (part CONN_2)
|
||||
(fields
|
||||
(field (name Reference) P)
|
||||
(field (name Value) CONN_2))
|
||||
(pins
|
||||
(pin (num 1) (name P1) (type passive))
|
||||
(pin (num 2) (name PM) (type passive))))
|
||||
(libpart (lib termorez-cache) (part CONN_8)
|
||||
(fields
|
||||
(field (name Reference) P)
|
||||
(field (name Value) CONN_8))
|
||||
(pins
|
||||
(pin (num 1) (name P1) (type passive))
|
||||
(pin (num 2) (name P2) (type passive))
|
||||
(pin (num 3) (name P3) (type passive))
|
||||
(pin (num 4) (name P4) (type passive))
|
||||
(pin (num 5) (name P5) (type passive))
|
||||
(pin (num 6) (name P6) (type passive))
|
||||
(pin (num 7) (name P7) (type passive))
|
||||
(pin (num 8) (name P8) (type passive))))
|
||||
(libpart (lib device) (part CP1)
|
||||
(description "Polarised capacitor")
|
||||
(footprints
|
||||
(fp CP_*))
|
||||
(fields
|
||||
(field (name Reference) C)
|
||||
(field (name Value) CP1))
|
||||
(pins
|
||||
(pin (num 1) (name ~) (type passive))
|
||||
(pin (num 2) (name ~) (type passive))))
|
||||
(libpart (lib my_elements) (part GND_CONNECTOR)
|
||||
(footprints
|
||||
(fp GND_connector)
|
||||
(fp GND*))
|
||||
(fields
|
||||
(field (name Reference) X)
|
||||
(field (name Value) GND_CONNECTOR)
|
||||
(field (name Footprint) GND_connector))
|
||||
(pins
|
||||
(pin (num 1) (name GND1) (type passive))
|
||||
(pin (num 2) (name GND2) (type passive))))
|
||||
(libpart (lib termorez-cache) (part INDUCTOR_SMALL)
|
||||
(footprints
|
||||
(fp Choke_*)
|
||||
(fp *Coil*))
|
||||
(fields
|
||||
(field (name Reference) L)
|
||||
(field (name Value) INDUCTOR_SMALL))
|
||||
(pins
|
||||
(pin (num 1) (name 1) (type input))
|
||||
(pin (num 2) (name 2) (type input))))
|
||||
(libpart (lib termorez-rescue) (part LM317AEMP-RESCUE-termorez)
|
||||
(footprints
|
||||
(fp SOT*))
|
||||
(fields
|
||||
(field (name Reference) U)
|
||||
(field (name Value) LM317AEMP-RESCUE-termorez)
|
||||
(field (name Footprint) SOT-223))
|
||||
(pins
|
||||
(pin (num 1) (name ADJ) (type power_in))
|
||||
(pin (num 2) (name OUT) (type passive))
|
||||
(pin (num 3) (name IN) (type power_in))
|
||||
(pin (num 4) (name OUT) (type power_out))))
|
||||
(libpart (lib my_elements) (part NX3L4051-HX)
|
||||
(fields
|
||||
(field (name Reference) DA)
|
||||
(field (name Value) NX3L4051-HX)
|
||||
(field (name Footprint) HXQFN-16))
|
||||
(pins
|
||||
(pin (num 1) (name Z) (type BiDi))
|
||||
(pin (num 2) (name Y7) (type BiDi))
|
||||
(pin (num 3) (name Y5) (type BiDi))
|
||||
(pin (num 4) (name ~E) (type input))
|
||||
(pin (num 6) (name GND) (type power_in))
|
||||
(pin (num 7) (name S3) (type input))
|
||||
(pin (num 8) (name S2) (type input))
|
||||
(pin (num 9) (name S1) (type input))
|
||||
(pin (num 10) (name Y3) (type BiDi))
|
||||
(pin (num 11) (name Y0) (type BiDi))
|
||||
(pin (num 12) (name Y1) (type BiDi))
|
||||
(pin (num 13) (name Y2) (type BiDi))
|
||||
(pin (num 14) (name VCC) (type power_in))
|
||||
(pin (num 15) (name Y4) (type BiDi))
|
||||
(pin (num 16) (name Y6) (type BiDi))))
|
||||
(libpart (lib device) (part R)
|
||||
(description Resistor)
|
||||
(footprints
|
||||
(fp R_*)
|
||||
(fp R_*))
|
||||
(fields
|
||||
(field (name Reference) R)
|
||||
(field (name Value) R))
|
||||
(pins
|
||||
(pin (num 1) (name ~) (type passive))
|
||||
(pin (num 2) (name ~) (type passive)))))
|
||||
(libraries
|
||||
(library (logical termorez-rescue)
|
||||
(uri termorez-rescue.lib))
|
||||
(library (logical device)
|
||||
(uri /usr/share/kicad/library/device.lib))
|
||||
(library (logical my_elements)
|
||||
(uri my_elements.lib))
|
||||
(library (logical termorez-cache)
|
||||
(uri /home/eddy/Docs/SAO/BTA/MIRROR_CONTROL_termo/Project/termorez_NX3L4051/termorez-cache.lib)))
|
||||
(nets
|
||||
(net (code 1) (name "Net-(DA1-Pad1)")
|
||||
(node (ref U4) (pin 7))
|
||||
(node (ref U4) (pin 16))
|
||||
(node (ref DA1) (pin 1)))
|
||||
(net (code 2) (name +3V3)
|
||||
(node (ref L1) (pin 2))
|
||||
(node (ref C10) (pin 1))
|
||||
(node (ref U4) (pin 21)))
|
||||
(net (code 3) (name "Net-(C8-Pad1)")
|
||||
(node (ref C8) (pin 1))
|
||||
(node (ref U5) (pin 3))
|
||||
(node (ref P6) (pin 2)))
|
||||
(net (code 4) (name VDD)
|
||||
(node (ref U5) (pin 4))
|
||||
(node (ref C9) (pin 1))
|
||||
(node (ref L1) (pin 1))
|
||||
(node (ref DA2) (pin 14))
|
||||
(node (ref C12) (pin 1))
|
||||
(node (ref U5) (pin 2))
|
||||
(node (ref U4) (pin 22))
|
||||
(node (ref DA1) (pin 14))
|
||||
(node (ref DA3) (pin 14)))
|
||||
(net (code 5) (name "Net-(DA3-Pad1)")
|
||||
(node (ref DA3) (pin 1))
|
||||
(node (ref U4) (pin 13))
|
||||
(node (ref R4) (pin 1)))
|
||||
(net (code 6) (name "Net-(DA2-Pad1)")
|
||||
(node (ref U4) (pin 8))
|
||||
(node (ref U4) (pin 15))
|
||||
(node (ref DA2) (pin 1)))
|
||||
(net (code 7) (name DGND)
|
||||
(node (ref U4) (pin 2))
|
||||
(node (ref U4) (pin 3))
|
||||
(node (ref P4) (pin 5))
|
||||
(node (ref U5) (pin 1))
|
||||
(node (ref R3) (pin 2))
|
||||
(node (ref P6) (pin 1))
|
||||
(node (ref C12) (pin 2))
|
||||
(node (ref C8) (pin 2))
|
||||
(node (ref X1) (pin 1))
|
||||
(node (ref C9) (pin 2)))
|
||||
(net (code 8) (name "Net-(R1-Pad1)")
|
||||
(node (ref U4) (pin 5))
|
||||
(node (ref R1) (pin 1)))
|
||||
(net (code 9) (name "Net-(DA1-Pad2)")
|
||||
(node (ref DA1) (pin 2))
|
||||
(node (ref P1) (pin 8)))
|
||||
(net (code 10) (name AGND)
|
||||
(node (ref R1) (pin 2))
|
||||
(node (ref R2) (pin 2))
|
||||
(node (ref U4) (pin 14))
|
||||
(node (ref DA2) (pin 6))
|
||||
(node (ref C10) (pin 2))
|
||||
(node (ref U4) (pin 9))
|
||||
(node (ref U4) (pin 10))
|
||||
(node (ref U4) (pin 20))
|
||||
(node (ref U4) (pin 11))
|
||||
(node (ref U4) (pin 12))
|
||||
(node (ref X1) (pin 2))
|
||||
(node (ref U4) (pin 17))
|
||||
(node (ref U4) (pin 18))
|
||||
(node (ref U4) (pin 19))
|
||||
(node (ref DA3) (pin 6))
|
||||
(node (ref R8) (pin 2))
|
||||
(node (ref DA1) (pin 6)))
|
||||
(net (code 11) (name "Net-(R2-Pad1)")
|
||||
(node (ref R2) (pin 1))
|
||||
(node (ref U4) (pin 6)))
|
||||
(net (code 12) (name "Net-(DA2-Pad10)")
|
||||
(node (ref DA2) (pin 10))
|
||||
(node (ref P2) (pin 6)))
|
||||
(net (code 13) (name "Net-(DA2-Pad15)")
|
||||
(node (ref DA2) (pin 15))
|
||||
(node (ref P2) (pin 2)))
|
||||
(net (code 14) (name "Net-(DA2-Pad13)")
|
||||
(node (ref P2) (pin 3))
|
||||
(node (ref DA2) (pin 13)))
|
||||
(net (code 15) (name "Net-(DA2-Pad12)")
|
||||
(node (ref P2) (pin 4))
|
||||
(node (ref DA2) (pin 12)))
|
||||
(net (code 16) (name "Net-(DA2-Pad11)")
|
||||
(node (ref P2) (pin 5))
|
||||
(node (ref DA2) (pin 11)))
|
||||
(net (code 17) (name "Net-(DA2-Pad3)")
|
||||
(node (ref DA2) (pin 3))
|
||||
(node (ref P2) (pin 7)))
|
||||
(net (code 18) (name "Net-(DA2-Pad16)")
|
||||
(node (ref DA2) (pin 16))
|
||||
(node (ref P2) (pin 1)))
|
||||
(net (code 19) (name "Net-(DA2-Pad2)")
|
||||
(node (ref P2) (pin 8))
|
||||
(node (ref DA2) (pin 2)))
|
||||
(net (code 20) (name "Net-(DA3-Pad16)")
|
||||
(node (ref P3) (pin 1))
|
||||
(node (ref DA3) (pin 16)))
|
||||
(net (code 21) (name "Net-(DA1-Pad13)")
|
||||
(node (ref P1) (pin 3))
|
||||
(node (ref DA1) (pin 13)))
|
||||
(net (code 22) (name /EN)
|
||||
(node (ref DA1) (pin 4))
|
||||
(node (ref DA3) (pin 4))
|
||||
(node (ref R3) (pin 1))
|
||||
(node (ref DA2) (pin 4))
|
||||
(node (ref P4) (pin 4)))
|
||||
(net (code 23) (name "Net-(DA1-Pad11)")
|
||||
(node (ref P1) (pin 5))
|
||||
(node (ref DA1) (pin 11)))
|
||||
(net (code 24) (name "Net-(DA1-Pad12)")
|
||||
(node (ref P1) (pin 4))
|
||||
(node (ref DA1) (pin 12)))
|
||||
(net (code 25) (name "Net-(DA1-Pad15)")
|
||||
(node (ref DA1) (pin 15))
|
||||
(node (ref P1) (pin 2)))
|
||||
(net (code 26) (name "Net-(DA1-Pad10)")
|
||||
(node (ref DA1) (pin 10))
|
||||
(node (ref P1) (pin 6)))
|
||||
(net (code 27) (name "Net-(DA1-Pad3)")
|
||||
(node (ref DA1) (pin 3))
|
||||
(node (ref P1) (pin 7)))
|
||||
(net (code 28) (name "Net-(DA1-Pad16)")
|
||||
(node (ref DA1) (pin 16))
|
||||
(node (ref P1) (pin 1)))
|
||||
(net (code 29) (name "Net-(R6-Pad2)")
|
||||
(node (ref R6) (pin 2))
|
||||
(node (ref R7) (pin 2)))
|
||||
(net (code 30) (name "Net-(R5-Pad1)")
|
||||
(node (ref R5) (pin 1))
|
||||
(node (ref R6) (pin 1)))
|
||||
(net (code 31) (name "Net-(R4-Pad2)")
|
||||
(node (ref R5) (pin 2))
|
||||
(node (ref R4) (pin 2)))
|
||||
(net (code 32) (name "Net-(R7-Pad1)")
|
||||
(node (ref R7) (pin 1))
|
||||
(node (ref R8) (pin 1)))
|
||||
(net (code 33) (name "Net-(DA3-Pad3)")
|
||||
(node (ref P3) (pin 7))
|
||||
(node (ref DA3) (pin 3)))
|
||||
(net (code 34) (name "Net-(DA3-Pad15)")
|
||||
(node (ref P3) (pin 2))
|
||||
(node (ref DA3) (pin 15)))
|
||||
(net (code 35) (name "Net-(DA3-Pad11)")
|
||||
(node (ref P3) (pin 5))
|
||||
(node (ref DA3) (pin 11)))
|
||||
(net (code 36) (name "Net-(DA3-Pad12)")
|
||||
(node (ref DA3) (pin 12))
|
||||
(node (ref P3) (pin 4)))
|
||||
(net (code 37) (name "Net-(DA3-Pad10)")
|
||||
(node (ref DA3) (pin 10))
|
||||
(node (ref P3) (pin 6)))
|
||||
(net (code 38) (name "Net-(DA3-Pad13)")
|
||||
(node (ref P3) (pin 3))
|
||||
(node (ref DA3) (pin 13)))
|
||||
(net (code 39) (name "Net-(DA3-Pad2)")
|
||||
(node (ref DA3) (pin 2))
|
||||
(node (ref P3) (pin 8)))
|
||||
(net (code 40) (name /SC)
|
||||
(node (ref U4) (pin 1))
|
||||
(node (ref P4) (pin 8)))
|
||||
(net (code 41) (name /A2)
|
||||
(node (ref DA3) (pin 7))
|
||||
(node (ref P4) (pin 3))
|
||||
(node (ref DA2) (pin 7))
|
||||
(node (ref DA1) (pin 7)))
|
||||
(net (code 42) (name /A1)
|
||||
(node (ref DA1) (pin 8))
|
||||
(node (ref DA3) (pin 8))
|
||||
(node (ref DA2) (pin 8))
|
||||
(node (ref P4) (pin 2)))
|
||||
(net (code 43) (name /A0)
|
||||
(node (ref DA3) (pin 9))
|
||||
(node (ref DA2) (pin 9))
|
||||
(node (ref P4) (pin 1))
|
||||
(node (ref DA1) (pin 9)))
|
||||
(net (code 44) (name /SDO)
|
||||
(node (ref U4) (pin 24))
|
||||
(node (ref P4) (pin 7)))
|
||||
(net (code 45) (name /SDI)
|
||||
(node (ref U4) (pin 23))
|
||||
(node (ref P4) (pin 6)))))
|
||||
77
kicad/termorez_NX3L4051/termorez.pro
Normal file
@ -0,0 +1,77 @@
|
||||
update=Пн 09 июл 2018 16:39:44
|
||||
last_client=kicad
|
||||
[cvpcb]
|
||||
version=1
|
||||
NetIExt=net
|
||||
[cvpcb/libraries]
|
||||
EquName1=devcms
|
||||
[pcbnew]
|
||||
version=1
|
||||
LastNetListRead=termorez.net
|
||||
UseCmpFile=1
|
||||
PadDrill=0.6
|
||||
PadSizeH=1
|
||||
PadSizeV=1
|
||||
PcbTextSizeV=1
|
||||
PcbTextSizeH=1
|
||||
PcbTextThickness=0.3
|
||||
ModuleTextSizeV=1
|
||||
ModuleTextSizeH=1
|
||||
ModuleTextSizeThickness=0.15
|
||||
SolderMaskClearance=0
|
||||
SolderMaskMinWidth=0
|
||||
DrawSegmentWidth=0.2
|
||||
BoardOutlineThickness=0.15
|
||||
ModuleOutlineThickness=0.15
|
||||
[pcbnew/libraries]
|
||||
LibDir=/home/eddy/kicad
|
||||
LibName1=sockets
|
||||
LibName2=connect
|
||||
LibName3=discret
|
||||
LibName4=pin_array
|
||||
LibName5=divers
|
||||
LibName6=libcms
|
||||
LibName7=display
|
||||
LibName8=led
|
||||
LibName9=dip_sockets
|
||||
LibName10=pga_sockets
|
||||
LibName11=valves
|
||||
LibName12=sil16
|
||||
LibName13=tinkerforge
|
||||
LibName14=my_modules
|
||||
[eeschema]
|
||||
version=1
|
||||
LibDir=/usr/share/kicad;/usr/share/kicad/library;/home/eddy/kicad
|
||||
[eeschema/libraries]
|
||||
LibName1=termorez-rescue
|
||||
LibName2=power
|
||||
LibName3=device
|
||||
LibName4=transistors
|
||||
LibName5=conn
|
||||
LibName6=linear
|
||||
LibName7=regul
|
||||
LibName8=74xx
|
||||
LibName9=cmos4000
|
||||
LibName10=adc-dac
|
||||
LibName11=memory
|
||||
LibName12=xilinx
|
||||
LibName13=microcontrollers
|
||||
LibName14=dsp
|
||||
LibName15=microchip
|
||||
LibName16=analog_switches
|
||||
LibName17=motorola
|
||||
LibName18=texas
|
||||
LibName19=intel
|
||||
LibName20=audio
|
||||
LibName21=interface
|
||||
LibName22=digital-audio
|
||||
LibName23=philips
|
||||
LibName24=display
|
||||
LibName25=cypress
|
||||
LibName26=siliconi
|
||||
LibName27=opto
|
||||
LibName28=atmel
|
||||
LibName29=contrib
|
||||
LibName30=valves
|
||||
LibName31=my_elements
|
||||
LibName32=library/stm32
|
||||
1109
kicad/termorez_NX3L4051/termorez.sch
Normal file
43
src/netdaemon/Makefile
Normal file
@ -0,0 +1,43 @@
|
||||
# run `make DEF=...` to add extra defines
|
||||
PROGRAM := netdaemon
|
||||
LDFLAGS := -fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,--discard-all -pthread
|
||||
SRCS := $(wildcard *.c)
|
||||
DEFINES := $(DEF) -D_GNU_SOURCE -D_XOPEN_SOURCE=1111
|
||||
DEFINES += -DEBUG
|
||||
# baudrate for USB<->UART converter
|
||||
DEFINES += -DBAUD_RATE=B115200
|
||||
OBJDIR := mk
|
||||
CFLAGS += -O2 -Wall -Werror -Wextra -Wno-trampolines
|
||||
OBJS := $(addprefix $(OBJDIR)/, $(SRCS:%.c=%.o))
|
||||
DEPS := $(OBJS:.o=.d)
|
||||
CC = gcc
|
||||
|
||||
all : $(OBJDIR) $(PROGRAM)
|
||||
|
||||
$(PROGRAM) : $(OBJS)
|
||||
@echo -e "\t\tLD $(PROGRAM)"
|
||||
$(CC) $(LDFLAGS) $(OBJS) -o $(PROGRAM)
|
||||
|
||||
$(OBJDIR):
|
||||
mkdir $(OBJDIR)
|
||||
|
||||
ifneq ($(MAKECMDGOALS),clean)
|
||||
-include $(DEPS)
|
||||
endif
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
@echo -e "\t\tCC $<"
|
||||
$(CC) -MD -c $(LDFLAGS) $(CFLAGS) $(DEFINES) -o $@ $<
|
||||
|
||||
clean:
|
||||
@echo -e "\t\tCLEAN"
|
||||
@rm -f $(OBJS) $(DEPS)
|
||||
@rmdir $(OBJDIR) 2>/dev/null || true
|
||||
|
||||
xclean: clean
|
||||
@rm -f $(PROGRAM)
|
||||
|
||||
gentags:
|
||||
CFLAGS="$(CFLAGS) $(DEFINES)" geany -g $(PROGRAM).c.tags *[hc] 2>/dev/null
|
||||
|
||||
.PHONY: gentags clean xclean
|
||||
12
src/netdaemon/Readme.md
Normal file
@ -0,0 +1,12 @@
|
||||
BTA mirror temperature network daemon
|
||||
==================
|
||||
|
||||
Gather information from temperature sensors and send it over ethernet by network request like
|
||||
hostname:4444/Tx
|
||||
where x is 0 for upper sensors, 1 for lower and 2 for T measured by main controller.
|
||||
|
||||
Answer format: "X Y T t", where
|
||||
|
||||
- X and Y are cartesian coordinates relative to mirror center (decimeters),
|
||||
- T is measured temperature (degrees Celsium),
|
||||
- t is UNIX-time of last measurement.
|
||||
86
src/netdaemon/cmdlnopts.c
Normal file
@ -0,0 +1,86 @@
|
||||
/* geany_encoding=koi8-r
|
||||
* cmdlnopts.c - the only function that parse cmdln args and returns glob parameters
|
||||
*
|
||||
* Copyright 2018 Edward V. Emelianoff <eddy@sao.ru>
|
||||
*
|
||||
* 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 of the License, 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; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <math.h>
|
||||
#include "cmdlnopts.h"
|
||||
#include "usefull_macros.h"
|
||||
|
||||
/*
|
||||
* here are global parameters initialisation
|
||||
*/
|
||||
int help;
|
||||
glob_pars G;
|
||||
|
||||
// default values for Gdefault & help
|
||||
#define DEFAULT_COMDEV "/dev/ttyUSB0"
|
||||
#define DEFAULT_PORT "4444"
|
||||
|
||||
// DEFAULTS
|
||||
// default global parameters
|
||||
glob_pars const Gdefault = {
|
||||
.device = DEFAULT_COMDEV,
|
||||
.port = DEFAULT_PORT,
|
||||
.terminal = 0,
|
||||
.rest_pars = NULL,
|
||||
.rest_pars_num = 0
|
||||
};
|
||||
|
||||
/*
|
||||
* Define command line options by filling structure:
|
||||
* name has_arg flag val type argptr help
|
||||
*/
|
||||
myoption cmdlnopts[] = {
|
||||
// common options
|
||||
{"help", NO_ARGS, NULL, 'h', arg_int, APTR(&help), _("show this help")},
|
||||
{"device", NEED_ARG, NULL, 'i', arg_string, APTR(&G.device), _("serial device name (default: " DEFAULT_COMDEV ")")},
|
||||
{"port", NEED_ARG, NULL, 'p', arg_string, APTR(&G.port), _("network port to connect (default: " DEFAULT_PORT ")")},
|
||||
{"terminal",NO_ARGS, NULL, 't', arg_int, APTR(&G.terminal), _("run as terminal")},
|
||||
end_option
|
||||
};
|
||||
|
||||
/**
|
||||
* Parse command line options and return dynamically allocated structure
|
||||
* to global parameters
|
||||
* @param argc - copy of argc from main
|
||||
* @param argv - copy of argv from main
|
||||
* @return allocated structure with global parameters
|
||||
*/
|
||||
glob_pars *parse_args(int argc, char **argv){
|
||||
int i;
|
||||
void *ptr;
|
||||
ptr = memcpy(&G, &Gdefault, sizeof(G)); assert(ptr);
|
||||
// format of help: "Usage: progname [args]\n"
|
||||
change_helpstring("Usage: %s [args] [logfile name]\n\n\tWhere args are:\n");
|
||||
// parse arguments
|
||||
parseargs(&argc, &argv, cmdlnopts);
|
||||
if(help) showhelp(-1, cmdlnopts);
|
||||
if(argc > 0){
|
||||
G.rest_pars_num = argc;
|
||||
G.rest_pars = calloc(argc, sizeof(char*));
|
||||
for (i = 0; i < argc; i++)
|
||||
G.rest_pars[i] = strdup(argv[i]);
|
||||
}
|
||||
return &G;
|
||||
}
|
||||
|
||||
42
src/netdaemon/cmdlnopts.h
Normal file
@ -0,0 +1,42 @@
|
||||
/* geany_encoding=koi8-r
|
||||
* cmdlnopts.h - comand line options for parceargs
|
||||
*
|
||||
* Copyright 2018 Edward V. Emelianoff <eddy@sao.ru>
|
||||
*
|
||||
* 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 of the License, 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; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef __CMDLNOPTS_H__
|
||||
#define __CMDLNOPTS_H__
|
||||
|
||||
#include "parseargs.h"
|
||||
#include "term.h"
|
||||
|
||||
/*
|
||||
* here are some typedef's for global data
|
||||
*/
|
||||
typedef struct{
|
||||
char *device; // serial device name
|
||||
char *port; // port to connect
|
||||
int terminal; // run as terminal
|
||||
int rest_pars_num; // number of rest parameters
|
||||
char** rest_pars; // the rest parameters: array of char*
|
||||
} glob_pars;
|
||||
|
||||
|
||||
glob_pars *parse_args(int argc, char **argv);
|
||||
#endif // __CMDLNOPTS_H__
|
||||
72
src/netdaemon/datapoints.xy
Normal file
@ -0,0 +1,72 @@
|
||||
/*
|
||||
* geany_encoding=koi8-r
|
||||
* datapoints.xy - coordinates of sensors
|
||||
*
|
||||
* Copyright 2018 Edward V. Emelianov <eddy@sao.ru, edward.emelianoff@gmail.com>
|
||||
*
|
||||
* 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 of the License, 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; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Unload# X,dm Y,dm Controller# Sensors Pair#
|
||||
* 3 -3 -5 4 0
|
||||
* 6 3 5 2 0
|
||||
* 7 13 -4 1 0
|
||||
* 9 3 -13 1 1,2
|
||||
* 11 -9 -9 4 1
|
||||
* 13 -13 4 3 0
|
||||
* 15 -3 13 3 1,2
|
||||
* 17 9 9 2 1
|
||||
* 21 15 -12 1 3
|
||||
* 24 -3 -20 4 2
|
||||
* 27 -18 -7 3 3
|
||||
* 30 -15 12 3 4
|
||||
* 33 3 20 2 2
|
||||
* 36 18 7 2 3
|
||||
* 38 25 -10 1 4
|
||||
* 40 16 -21 1 5
|
||||
* 42 4 -26 4 3
|
||||
* 44 -11 -25 4 4
|
||||
* 46 -21 -17 4 5
|
||||
* 48 -26 -5 3 5
|
||||
* 50 -25 10 3 6
|
||||
* 52 -16 21 3 7
|
||||
* 54 -4 26 2 4
|
||||
* 56 11 25 2 5
|
||||
* 58 21 17 2 6
|
||||
* 60 26 5 1 6
|
||||
*/
|
||||
|
||||
// sensors groups coordinates: [Nsensor][Ncontroller][xy]
|
||||
static const int SensCoords[8][8][2] = {
|
||||
// sensor 0, unloads: none,7,6,13,3
|
||||
{{0,0},{13,-4},{3,5},{-13,4},{-3,-5}},
|
||||
// sensor 1, unloads: none,9,17,15,11
|
||||
{{0,0},{3,-13},{9,9},{-3,13},{-9,-9}},
|
||||
// sensor 2, unloads: none,9,33,15,24
|
||||
{{0,0},{3,-13},{3,20},{-3,13},{-3,-20}},
|
||||
// sensor 3, unloads: none,21,36,27,42
|
||||
{{0,0},{15,-12},{18,7},{-18,-7},{4,-26}},
|
||||
// sensor 4, unloads: none,38,54,30,44
|
||||
{{0,0},{25,-10},{-4,26},{-15,12},{-11,-25}},
|
||||
// sensor 5, unloads: none,40,56,48,46
|
||||
{{0,0},{16,-21},{11,25},{-26,-5},{-21,-17}},
|
||||
// sensor 6, unloads: none,60,58,50
|
||||
{{0,0},{26,5},{21,17},{-25,10}},
|
||||
// sensor 7, unloads: none,none,none,52
|
||||
{{0,0},{0,0},{0,0},{-16,21}},
|
||||
};
|
||||
72
src/netdaemon/main.c
Normal file
@ -0,0 +1,72 @@
|
||||
/* geany_encoding=koi8-r
|
||||
* main.c
|
||||
*
|
||||
* Copyright 2018 Edward V. Emelianov <eddy@sao.ru, edward.emelianoff@gmail.com>
|
||||
*
|
||||
* 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 of the License, 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; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
#include "usefull_macros.h"
|
||||
#include <signal.h>
|
||||
#include <sys/wait.h> // wait
|
||||
#include <sys/prctl.h> //prctl
|
||||
#include "cmdlnopts.h"
|
||||
#include "socket.h"
|
||||
|
||||
void signals(int signo){
|
||||
restore_console();
|
||||
restore_tty();
|
||||
putlog("exit with status %d", signo);
|
||||
exit(signo);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv){
|
||||
initial_setup();
|
||||
signal(SIGTERM, signals); // kill (-15) - quit
|
||||
signal(SIGHUP, SIG_IGN); // hup - ignore
|
||||
signal(SIGINT, signals); // ctrl+C - quit
|
||||
signal(SIGQUIT, signals); // ctrl+\ - quit
|
||||
signal(SIGTSTP, SIG_IGN); // ignore ctrl+Z
|
||||
glob_pars *G = parse_args(argc, argv);
|
||||
if(G->rest_pars_num)
|
||||
openlogfile(G->rest_pars[0]);
|
||||
#ifndef EBUG
|
||||
if(daemon(1, 0)){
|
||||
ERR("daemon()");
|
||||
}
|
||||
while(1){ // guard for dead processes
|
||||
pid_t childpid = fork();
|
||||
if(childpid){
|
||||
putlog("create child with PID %d\n", childpid);
|
||||
DBG("Created child with PID %d\n", childpid);
|
||||
wait(NULL);
|
||||
putlog("child %d died\n", childpid);
|
||||
WARNX("Child %d died\n", childpid);
|
||||
sleep(1);
|
||||
}else{
|
||||
prctl(PR_SET_PDEATHSIG, SIGTERM); // send SIGTERM to child when parent dies
|
||||
break; // go out to normal functional
|
||||
}
|
||||
}
|
||||
#endif
|
||||
try_connect(G->device);
|
||||
if(check_sensors()){
|
||||
putlog("no sensors detected");
|
||||
if(!G->terminal) signals(15); // there's not main controller connected to given terminal
|
||||
}
|
||||
if(G->terminal) run_terminal();
|
||||
else daemonize(G->port);
|
||||
return 0;
|
||||
}
|
||||
5315
src/netdaemon/netdaemon.c.tags
Normal file
32
src/netdaemon/netdaemon.geany
Normal file
@ -0,0 +1,32 @@
|
||||
[editor]
|
||||
line_wrapping=false
|
||||
line_break_column=100
|
||||
auto_continue_multiline=true
|
||||
|
||||
[file_prefs]
|
||||
final_new_line=true
|
||||
ensure_convert_new_lines=true
|
||||
strip_trailing_spaces=true
|
||||
replace_tabs=true
|
||||
|
||||
[indentation]
|
||||
indent_width=4
|
||||
indent_type=0
|
||||
indent_hard_tab_width=4
|
||||
detect_indent=false
|
||||
detect_indent_width=false
|
||||
indent_mode=3
|
||||
|
||||
[project]
|
||||
name=netdaemon
|
||||
base_path=/home/eddy/Docs/SAO/BTA/MIRROR_CONTROL_termo/Project/netdaemon
|
||||
|
||||
[long line marker]
|
||||
long_line_behaviour=1
|
||||
long_line_column=100
|
||||
|
||||
[files]
|
||||
current_page=-1
|
||||
|
||||
[VTE]
|
||||
last_dir=/home/eddy
|
||||
497
src/netdaemon/parseargs.c
Normal file
@ -0,0 +1,497 @@
|
||||
/* geany_encoding=koi8-r
|
||||
* parseargs.c - parsing command line arguments & print help
|
||||
*
|
||||
* Copyright 2013 Edward V. Emelianoff <eddy@sao.ru>
|
||||
*
|
||||
* 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 of the License, 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; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <stdio.h> // printf
|
||||
#include <getopt.h> // getopt_long
|
||||
#include <stdlib.h> // calloc, exit, strtoll
|
||||
#include <assert.h> // assert
|
||||
#include <string.h> // strdup, strchr, strlen
|
||||
#include <strings.h>// strcasecmp
|
||||
#include <limits.h> // INT_MAX & so on
|
||||
#include <libintl.h>// gettext
|
||||
#include <ctype.h> // isalpha
|
||||
#include "parseargs.h"
|
||||
#include "usefull_macros.h"
|
||||
|
||||
char *helpstring = "%s\n";
|
||||
|
||||
/**
|
||||
* Change standard help header
|
||||
* MAY consist ONE "%s" for progname
|
||||
* @param str (i) - new format
|
||||
*/
|
||||
void change_helpstring(char *s){
|
||||
int pcount = 0, scount = 0;
|
||||
char *str = s;
|
||||
// check `helpstring` and set it to default in case of error
|
||||
for(; pcount < 2; str += 2){
|
||||
if(!(str = strchr(str, '%'))) break;
|
||||
if(str[1] != '%') pcount++; // increment '%' counter if it isn't "%%"
|
||||
else{
|
||||
str += 2; // pass next '%'
|
||||
continue;
|
||||
}
|
||||
if(str[1] == 's') scount++; // increment "%s" counter
|
||||
};
|
||||
if(pcount > 1 || pcount != scount){ // amount of pcount and/or scount wrong
|
||||
/// "îÅÐÒÁ×ÉÌØÎÙÊ ÆÏÒÍÁÔ ÓÔÒÏËÉ ÐÏÍÏÝÉ"
|
||||
ERRX(_("Wrong helpstring!"));
|
||||
}
|
||||
helpstring = s;
|
||||
}
|
||||
|
||||
/**
|
||||
* Carefull atoll/atoi
|
||||
* @param num (o) - returning value (or NULL if you wish only check number) - allocated by user
|
||||
* @param str (i) - string with number must not be NULL
|
||||
* @param t (i) - T_INT for integer or T_LLONG for long long (if argtype would be wided, may add more)
|
||||
* @return TRUE if conversion sone without errors, FALSE otherwise
|
||||
*/
|
||||
static bool myatoll(void *num, char *str, argtype t){
|
||||
long long tmp, *llptr;
|
||||
int *iptr;
|
||||
char *endptr;
|
||||
assert(str);
|
||||
assert(num);
|
||||
tmp = strtoll(str, &endptr, 0);
|
||||
if(endptr == str || *str == '\0' || *endptr != '\0')
|
||||
return FALSE;
|
||||
switch(t){
|
||||
case arg_longlong:
|
||||
llptr = (long long*) num;
|
||||
*llptr = tmp;
|
||||
break;
|
||||
case arg_int:
|
||||
default:
|
||||
if(tmp < INT_MIN || tmp > INT_MAX){
|
||||
/// "ãÅÌÏÅ ×ÎÅ ÄÏÐÕÓÔÉÍÏÇÏ ÄÉÁÐÁÚÏÎÁ"
|
||||
WARNX(_("Integer out of range"));
|
||||
return FALSE;
|
||||
}
|
||||
iptr = (int*)num;
|
||||
*iptr = (int)tmp;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// the same as myatoll but for double
|
||||
// There's no NAN & INF checking here (what if they would be needed?)
|
||||
static bool myatod(void *num, const char *str, argtype t){
|
||||
double tmp, *dptr;
|
||||
float *fptr;
|
||||
char *endptr;
|
||||
assert(str);
|
||||
tmp = strtod(str, &endptr);
|
||||
if(endptr == str || *str == '\0' || *endptr != '\0')
|
||||
return FALSE;
|
||||
switch(t){
|
||||
case arg_double:
|
||||
dptr = (double *) num;
|
||||
*dptr = tmp;
|
||||
break;
|
||||
case arg_float:
|
||||
default:
|
||||
fptr = (float *) num;
|
||||
*fptr = (float)tmp;
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get index of current option in array options
|
||||
* @param opt (i) - returning val of getopt_long
|
||||
* @param options (i) - array of options
|
||||
* @return index in array
|
||||
*/
|
||||
static int get_optind(int opt, myoption *options){
|
||||
int oind;
|
||||
myoption *opts = options;
|
||||
assert(opts);
|
||||
for(oind = 0; opts->name && opts->val != opt; oind++, opts++);
|
||||
if(!opts->name || opts->val != opt) // no such parameter
|
||||
showhelp(-1, options);
|
||||
return oind;
|
||||
}
|
||||
|
||||
/**
|
||||
* reallocate new value in array of multiple repeating arguments
|
||||
* @arg paptr - address of pointer to array (**void)
|
||||
* @arg type - its type (for realloc)
|
||||
* @return pointer to new (next) value
|
||||
*/
|
||||
void *get_aptr(void *paptr, argtype type){
|
||||
int i = 1;
|
||||
void **aptr = *((void***)paptr);
|
||||
if(aptr){ // there's something in array
|
||||
void **p = aptr;
|
||||
while(*p++) ++i;
|
||||
}
|
||||
size_t sz = 0;
|
||||
switch(type){
|
||||
default:
|
||||
case arg_none:
|
||||
/// "îÅ ÍÏÇÕ ÉÓÐÏÌØÚÏ×ÁÔØ ÎÅÓËÏÌØËÏ ÐÁÒÁÍÅÔÒÏ× ÂÅÚ ÁÒÇÕÍÅÎÔÏ×!"
|
||||
ERRX("Can't use multiple args with arg_none!");
|
||||
break;
|
||||
case arg_int:
|
||||
sz = sizeof(int);
|
||||
break;
|
||||
case arg_longlong:
|
||||
sz = sizeof(long long);
|
||||
break;
|
||||
case arg_double:
|
||||
sz = sizeof(double);
|
||||
break;
|
||||
case arg_float:
|
||||
sz = sizeof(float);
|
||||
break;
|
||||
case arg_string:
|
||||
sz = 0;
|
||||
break;
|
||||
/* case arg_function:
|
||||
sz = sizeof(argfn *);
|
||||
break;*/
|
||||
}
|
||||
aptr = realloc(aptr, (i + 1) * sizeof(void*));
|
||||
*((void***)paptr) = aptr;
|
||||
aptr[i] = NULL;
|
||||
if(sz){
|
||||
aptr[i - 1] = malloc(sz);
|
||||
}else
|
||||
aptr[i - 1] = &aptr[i - 1];
|
||||
return aptr[i - 1];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Parse command line arguments
|
||||
* ! If arg is string, then value will be strdup'ed!
|
||||
*
|
||||
* @param argc (io) - address of argc of main(), return value of argc stay after `getopt`
|
||||
* @param argv (io) - address of argv of main(), return pointer to argv stay after `getopt`
|
||||
* BE CAREFUL! if you wanna use full argc & argv, save their original values before
|
||||
* calling this function
|
||||
* @param options (i) - array of `myoption` for arguments parcing
|
||||
*
|
||||
* @exit: in case of error this function show help & make `exit(-1)`
|
||||
*/
|
||||
void parseargs(int *argc, char ***argv, myoption *options){
|
||||
char *short_options, *soptr;
|
||||
struct option *long_options, *loptr;
|
||||
size_t optsize, i;
|
||||
myoption *opts = options;
|
||||
// check whether there is at least one options
|
||||
assert(opts);
|
||||
assert(opts[0].name);
|
||||
// first we count how much values are in opts
|
||||
for(optsize = 0; opts->name; optsize++, opts++);
|
||||
// now we can allocate memory
|
||||
short_options = calloc(optsize * 3 + 1, 1); // multiply by three for '::' in case of args in opts
|
||||
long_options = calloc(optsize + 1, sizeof(struct option));
|
||||
opts = options; loptr = long_options; soptr = short_options;
|
||||
// in debug mode check the parameters are not repeated
|
||||
#ifdef EBUG
|
||||
char **longlist = MALLOC(char*, optsize);
|
||||
char *shortlist = MALLOC(char, optsize);
|
||||
#endif
|
||||
// fill short/long parameters and make a simple checking
|
||||
for(i = 0; i < optsize; i++, loptr++, opts++){
|
||||
// check
|
||||
assert(opts->name); // check name
|
||||
#ifdef EBUG
|
||||
longlist[i] = strdup(opts->name);
|
||||
#endif
|
||||
if(opts->has_arg){
|
||||
assert(opts->type != arg_none); // check error with arg type
|
||||
assert(opts->argptr); // check pointer
|
||||
}
|
||||
if(opts->type != arg_none) // if there is a flag without arg, check its pointer
|
||||
assert(opts->argptr);
|
||||
// fill long_options
|
||||
// don't do memcmp: what if there would be different alignment?
|
||||
loptr->name = opts->name;
|
||||
loptr->has_arg = (opts->has_arg < MULT_PAR) ? opts->has_arg : 1;
|
||||
loptr->flag = opts->flag;
|
||||
loptr->val = opts->val;
|
||||
// fill short options if they are:
|
||||
if(!opts->flag && opts->val){
|
||||
#ifdef EBUG
|
||||
shortlist[i] = (char) opts->val;
|
||||
#endif
|
||||
*soptr++ = opts->val;
|
||||
if(loptr->has_arg) // add ':' if option has required argument
|
||||
*soptr++ = ':';
|
||||
if(loptr->has_arg == 2) // add '::' if option has optional argument
|
||||
*soptr++ = ':';
|
||||
}
|
||||
}
|
||||
// sort all lists & check for repeating
|
||||
#ifdef EBUG
|
||||
int cmpstringp(const void *p1, const void *p2){
|
||||
return strcmp(* (char * const *) p1, * (char * const *) p2);
|
||||
}
|
||||
int cmpcharp(const void *p1, const void *p2){
|
||||
return (int)(*(char * const)p1 - *(char *const)p2);
|
||||
}
|
||||
qsort(longlist, optsize, sizeof(char *), cmpstringp);
|
||||
qsort(shortlist,optsize, sizeof(char), cmpcharp);
|
||||
char *prevl = longlist[0], prevshrt = shortlist[0];
|
||||
for(i = 1; i < optsize; ++i){
|
||||
if(longlist[i]){
|
||||
if(prevl){
|
||||
if(strcmp(prevl, longlist[i]) == 0) ERRX("double long arguments: --%s", prevl);
|
||||
}
|
||||
prevl = longlist[i];
|
||||
}
|
||||
if(shortlist[i]){
|
||||
if(prevshrt){
|
||||
if(prevshrt == shortlist[i]) ERRX("double short arguments: -%c", prevshrt);
|
||||
}
|
||||
prevshrt = shortlist[i];
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// now we have both long_options & short_options and can parse `getopt_long`
|
||||
while(1){
|
||||
int opt;
|
||||
int oindex = 0, optind = 0; // oindex - number of option in argv, optind - number in options[]
|
||||
if((opt = getopt_long(*argc, *argv, short_options, long_options, &oindex)) == -1) break;
|
||||
if(opt == '?'){
|
||||
opt = optopt;
|
||||
optind = get_optind(opt, options);
|
||||
if(options[optind].has_arg == NEED_ARG || options[optind].has_arg == MULT_PAR)
|
||||
showhelp(optind, options); // need argument
|
||||
}
|
||||
else{
|
||||
if(opt == 0 || oindex > 0) optind = oindex;
|
||||
else optind = get_optind(opt, options);
|
||||
}
|
||||
opts = &options[optind];
|
||||
// if(opt == 0 && opts->has_arg == NO_ARGS) continue; // only long option changing integer flag
|
||||
// now check option
|
||||
if(opts->has_arg == NEED_ARG || opts->has_arg == MULT_PAR)
|
||||
if(!optarg) showhelp(optind, options); // need argument
|
||||
void *aptr;
|
||||
if(opts->has_arg == MULT_PAR){
|
||||
aptr = get_aptr(opts->argptr, opts->type);
|
||||
}else
|
||||
aptr = opts->argptr;
|
||||
bool result = TRUE;
|
||||
// even if there is no argument, but argptr != NULL, think that optarg = "1"
|
||||
if(!optarg) optarg = "1";
|
||||
switch(opts->type){
|
||||
default:
|
||||
case arg_none:
|
||||
if(opts->argptr) *((int*)aptr) += 1; // increment value
|
||||
break;
|
||||
case arg_int:
|
||||
result = myatoll(aptr, optarg, arg_int);
|
||||
break;
|
||||
case arg_longlong:
|
||||
result = myatoll(aptr, optarg, arg_longlong);
|
||||
break;
|
||||
case arg_double:
|
||||
result = myatod(aptr, optarg, arg_double);
|
||||
break;
|
||||
case arg_float:
|
||||
result = myatod(aptr, optarg, arg_float);
|
||||
break;
|
||||
case arg_string:
|
||||
result = (*((void**)aptr) = (void*)strdup(optarg));
|
||||
break;
|
||||
case arg_function:
|
||||
result = ((argfn)aptr)(optarg);
|
||||
break;
|
||||
}
|
||||
if(!result){
|
||||
showhelp(optind, options);
|
||||
}
|
||||
}
|
||||
*argc -= optind;
|
||||
*argv += optind;
|
||||
}
|
||||
|
||||
/**
|
||||
* compare function for qsort
|
||||
* first - sort by short options; second - sort arguments without sort opts (by long options)
|
||||
*/
|
||||
static int argsort(const void *a1, const void *a2){
|
||||
const myoption *o1 = (myoption*)a1, *o2 = (myoption*)a2;
|
||||
const char *l1 = o1->name, *l2 = o2->name;
|
||||
int s1 = o1->val, s2 = o2->val;
|
||||
int *f1 = o1->flag, *f2 = o2->flag;
|
||||
// check if both options has short arg
|
||||
if(f1 == NULL && f2 == NULL && s1 && s2){ // both have short arg
|
||||
return (s1 - s2);
|
||||
}else if((f1 != NULL || !s1) && (f2 != NULL || !s2)){ // both don't have short arg - sort by long
|
||||
return strcmp(l1, l2);
|
||||
}else{ // only one have short arg -- return it
|
||||
if(f2 || !s2) return -1; // a1 have short - it is 'lesser'
|
||||
else return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show help information based on myoption->help values
|
||||
* @param oindex (i) - if non-negative, show only help by myoption[oindex].help
|
||||
* @param options (i) - array of `myoption`
|
||||
*
|
||||
* @exit: run `exit(-1)` !!!
|
||||
*/
|
||||
void showhelp(int oindex, myoption *options){
|
||||
int max_opt_len = 0; // max len of options substring - for right indentation
|
||||
const int bufsz = 255;
|
||||
char buf[bufsz+1];
|
||||
myoption *opts = options;
|
||||
assert(opts);
|
||||
assert(opts[0].name); // check whether there is at least one options
|
||||
if(oindex > -1){ // print only one message
|
||||
opts = &options[oindex];
|
||||
printf(" ");
|
||||
if(!opts->flag && isalpha(opts->val)) printf("-%c, ", opts->val);
|
||||
printf("--%s", opts->name);
|
||||
if(opts->has_arg == 1) printf("=arg");
|
||||
else if(opts->has_arg == 2) printf("[=arg]");
|
||||
printf(" %s\n", _(opts->help));
|
||||
exit(-1);
|
||||
}
|
||||
// header, by default is just "progname\n"
|
||||
printf("\n");
|
||||
if(strstr(helpstring, "%s")) // print progname
|
||||
printf(helpstring, __progname);
|
||||
else // only text
|
||||
printf("%s", helpstring);
|
||||
printf("\n");
|
||||
// count max_opt_len
|
||||
do{
|
||||
int L = strlen(opts->name);
|
||||
if(max_opt_len < L) max_opt_len = L;
|
||||
}while((++opts)->name);
|
||||
max_opt_len += 14; // format: '-S , --long[=arg]' - get addition 13 symbols
|
||||
opts = options;
|
||||
// count amount of options
|
||||
int N; for(N = 0; opts->name; ++N, ++opts);
|
||||
if(N == 0) exit(-2);
|
||||
// Now print all help (sorted)
|
||||
opts = options;
|
||||
qsort(opts, N, sizeof(myoption), argsort);
|
||||
do{
|
||||
int p = sprintf(buf, " "); // a little indent
|
||||
if(!opts->flag && opts->val) // .val is short argument
|
||||
p += snprintf(buf+p, bufsz-p, "-%c, ", opts->val);
|
||||
p += snprintf(buf+p, bufsz-p, "--%s", opts->name);
|
||||
if(opts->has_arg == 1) // required argument
|
||||
p += snprintf(buf+p, bufsz-p, "=arg");
|
||||
else if(opts->has_arg == 2) // optional argument
|
||||
p += snprintf(buf+p, bufsz-p, "[=arg]");
|
||||
assert(p < max_opt_len); // there would be magic if p >= max_opt_len
|
||||
printf("%-*s%s\n", max_opt_len+1, buf, _(opts->help)); // write options & at least 2 spaces after
|
||||
++opts;
|
||||
}while(--N);
|
||||
printf("\n\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/**
|
||||
* get suboptions from parameter string
|
||||
* @param str - parameter string
|
||||
* @param opt - pointer to suboptions structure
|
||||
* @return TRUE if all OK
|
||||
*/
|
||||
bool get_suboption(char *str, mysuboption *opt){
|
||||
int findsubopt(char *par, mysuboption *so){
|
||||
int idx = 0;
|
||||
if(!par) return -1;
|
||||
while(so[idx].name){
|
||||
if(strcasecmp(par, so[idx].name) == 0) return idx;
|
||||
++idx;
|
||||
}
|
||||
return -1; // badarg
|
||||
}
|
||||
bool opt_setarg(mysuboption *so, int idx, char *val){
|
||||
mysuboption *soptr = &so[idx];
|
||||
bool result = FALSE;
|
||||
void *aptr = soptr->argptr;
|
||||
switch(soptr->type){
|
||||
default:
|
||||
case arg_none:
|
||||
if(soptr->argptr) *((int*)aptr) += 1; // increment value
|
||||
result = TRUE;
|
||||
break;
|
||||
case arg_int:
|
||||
result = myatoll(aptr, val, arg_int);
|
||||
break;
|
||||
case arg_longlong:
|
||||
result = myatoll(aptr, val, arg_longlong);
|
||||
break;
|
||||
case arg_double:
|
||||
result = myatod(aptr, val, arg_double);
|
||||
break;
|
||||
case arg_float:
|
||||
result = myatod(aptr, val, arg_float);
|
||||
break;
|
||||
case arg_string:
|
||||
result = (*((void**)aptr) = (void*)strdup(val));
|
||||
break;
|
||||
case arg_function:
|
||||
result = ((argfn)aptr)(val);
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
char *tok;
|
||||
bool ret = FALSE;
|
||||
char *tmpbuf;
|
||||
tok = strtok_r(str, ":,", &tmpbuf);
|
||||
do{
|
||||
char *val = strchr(tok, '=');
|
||||
int noarg = 0;
|
||||
if(val == NULL){ // no args
|
||||
val = "1";
|
||||
noarg = 1;
|
||||
}else{
|
||||
*val++ = '\0';
|
||||
if(!*val || *val == ':' || *val == ','){ // no argument - delimeter after =
|
||||
val = "1"; noarg = 1;
|
||||
}
|
||||
}
|
||||
int idx = findsubopt(tok, opt);
|
||||
if(idx < 0){
|
||||
/// "îÅÐÒÁ×ÉÌØÎÙÊ ÐÁÒÁÍÅÔÒ: %s"
|
||||
WARNX(_("Wrong parameter: %s"), tok);
|
||||
goto returning;
|
||||
}
|
||||
if(noarg && opt[idx].has_arg == NEED_ARG){
|
||||
/// "%s: ÎÅÏÂÈÏÄÉÍ ÁÒÇÕÍÅÎÔ!"
|
||||
WARNX(_("%s: argument needed!"), tok);
|
||||
goto returning;
|
||||
}
|
||||
if(!opt_setarg(opt, idx, val)){
|
||||
/// "îÅÐÒÁ×ÉÌØÎÙÊ ÁÒÇÕÍÅÎÔ \"%s\" ÐÁÒÁÍÅÔÒÁ \"%s\""
|
||||
WARNX(_("Wrong argument \"%s\" of parameter \"%s\""), val, tok);
|
||||
goto returning;
|
||||
}
|
||||
}while((tok = strtok_r(NULL, ":,", &tmpbuf)));
|
||||
ret = TRUE;
|
||||
returning:
|
||||
return ret;
|
||||
}
|
||||
124
src/netdaemon/parseargs.h
Normal file
@ -0,0 +1,124 @@
|
||||
/* geany_encoding=koi8-r
|
||||
* parseargs.h - headers for parsing command line arguments
|
||||
*
|
||||
* Copyright 2013 Edward V. Emelianoff <eddy@sao.ru>
|
||||
*
|
||||
* 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 of the License, 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; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
#pragma once
|
||||
#ifndef __PARSEARGS_H__
|
||||
#define __PARSEARGS_H__
|
||||
|
||||
#include <stdbool.h>// bool
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE true
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE false
|
||||
#endif
|
||||
|
||||
// macro for argptr
|
||||
#define APTR(x) ((void*)x)
|
||||
|
||||
// if argptr is a function:
|
||||
typedef bool(*argfn)(void *arg);
|
||||
|
||||
/*
|
||||
* type of getopt's argument
|
||||
* WARNING!
|
||||
* My function change value of flags by pointer, so if you want to use another type
|
||||
* make a latter conversion, example:
|
||||
* char charg;
|
||||
* int iarg;
|
||||
* myoption opts[] = {
|
||||
* {"value", 1, NULL, 'v', arg_int, &iarg, "char val"}, ..., end_option};
|
||||
* ..(parse args)..
|
||||
* charg = (char) iarg;
|
||||
*/
|
||||
typedef enum {
|
||||
arg_none = 0, // no arg
|
||||
arg_int, // integer
|
||||
arg_longlong, // long long
|
||||
arg_double, // double
|
||||
arg_float, // float
|
||||
arg_string, // char *
|
||||
arg_function // parse_args will run function `bool (*fn)(char *optarg, int N)`
|
||||
} argtype;
|
||||
|
||||
/*
|
||||
* Structure for getopt_long & help
|
||||
* BE CAREFUL: .argptr is pointer to data or pointer to function,
|
||||
* conversion depends on .type
|
||||
*
|
||||
* ATTENTION: string `help` prints through macro PRNT(), bu default it is gettext,
|
||||
* but you can redefine it before `#include "parseargs.h"`
|
||||
*
|
||||
* if arg is string, then value wil be strdup'ed like that:
|
||||
* char *str;
|
||||
* myoption opts[] = {{"string", 1, NULL, 's', arg_string, &str, "string val"}, ..., end_option};
|
||||
* *(opts[1].str) = strdup(optarg);
|
||||
* in other cases argptr should be address of some variable (or pointer to allocated memory)
|
||||
*
|
||||
* NON-NULL argptr should be written inside macro APTR(argptr) or directly: (void*)argptr
|
||||
*
|
||||
* !!!LAST VALUE OF ARRAY SHOULD BE `end_option` or ZEROS !!!
|
||||
*
|
||||
*/
|
||||
typedef enum{
|
||||
NO_ARGS = 0, // first three are the same as in getopt_long
|
||||
NEED_ARG = 1,
|
||||
OPT_ARG = 2,
|
||||
MULT_PAR
|
||||
} hasarg;
|
||||
|
||||
typedef struct{
|
||||
// these are from struct option:
|
||||
const char *name; // long option's name
|
||||
hasarg has_arg; // 0 - no args, 1 - nesessary arg, 2 - optionally arg, 4 - need arg & key can repeat (args are stored in null-terminated array)
|
||||
int *flag; // NULL to return val, pointer to int - to set its value of val (function returns 0)
|
||||
int val; // short opt name (if flag == NULL) or flag's value
|
||||
// and these are mine:
|
||||
argtype type; // type of argument
|
||||
void *argptr; // pointer to variable to assign optarg value or function `bool (*fn)(char *optarg, int N)`
|
||||
const char *help; // help string which would be shown in function `showhelp` or NULL
|
||||
} myoption;
|
||||
|
||||
/*
|
||||
* Suboptions structure, almost the same like myoption
|
||||
* used in parse_subopts()
|
||||
*/
|
||||
typedef struct{
|
||||
const char *name;
|
||||
hasarg has_arg;
|
||||
argtype type;
|
||||
void *argptr;
|
||||
} mysuboption;
|
||||
|
||||
// last string of array (all zeros)
|
||||
#define end_option {0,0,0,0,0,0,0}
|
||||
#define end_suboption {0,0,0,0}
|
||||
|
||||
extern const char *__progname;
|
||||
|
||||
void showhelp(int oindex, myoption *options);
|
||||
void parseargs(int *argc, char ***argv, myoption *options);
|
||||
void change_helpstring(char *s);
|
||||
bool get_suboption(char *str, mysuboption *opt);
|
||||
|
||||
#endif // __PARSEARGS_H__
|
||||
331
src/netdaemon/socket.c
Normal file
@ -0,0 +1,331 @@
|
||||
/*
|
||||
* geany_encoding=koi8-r
|
||||
* socket.c - socket IO
|
||||
*
|
||||
* Copyright 2018 Edward V. Emelianov <eddy@sao.ru, edward.emelianoff@gmail.com>
|
||||
*
|
||||
* 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 of the License, 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; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*
|
||||
*/
|
||||
#include "usefull_macros.h"
|
||||
#include "socket.h"
|
||||
#include "term.h"
|
||||
#include <netdb.h> // addrinfo
|
||||
#include <arpa/inet.h> // inet_ntop
|
||||
#include <pthread.h>
|
||||
#include <limits.h> // INT_xxx
|
||||
#include <signal.h> // pthread_kill
|
||||
#include <unistd.h> // daemon
|
||||
#include <sys/syscall.h> // syscall
|
||||
|
||||
#include "datapoints.xy" // sensors coordinates
|
||||
|
||||
#define BUFLEN (10240)
|
||||
// Max amount of connections
|
||||
#define BACKLOG (30)
|
||||
|
||||
// temperatures: T0, T1, N2
|
||||
static char strT[3][BUFLEN];
|
||||
|
||||
/**************** COMMON FUNCTIONS ****************/
|
||||
/**
|
||||
* wait for answer from socket
|
||||
* @param sock - socket fd
|
||||
* @return 0 in case of error or timeout, 1 in case of socket ready
|
||||
*/
|
||||
static int waittoread(int sock){
|
||||
fd_set fds;
|
||||
struct timeval timeout;
|
||||
int rc;
|
||||
timeout.tv_sec = 1; // wait not more than 1 second
|
||||
timeout.tv_usec = 0;
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(sock, &fds);
|
||||
do{
|
||||
rc = select(sock+1, &fds, NULL, NULL, &timeout);
|
||||
if(rc < 0){
|
||||
if(errno != EINTR){
|
||||
WARN("select()");
|
||||
return 0;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}while(1);
|
||||
if(FD_ISSET(sock, &fds)) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**************** SERVER FUNCTIONS ****************/
|
||||
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
/**
|
||||
* Send data over socket
|
||||
* @param sock - socket fd
|
||||
* @param webquery - ==1 if this is web query
|
||||
* @param Nsens - 0 for upper sensors, 1 for lower and 2 for inner (N2)
|
||||
* @return 1 if all OK
|
||||
*/
|
||||
static int send_data(int sock, int webquery, int Nsens){
|
||||
if(Nsens < 0 || Nsens > 2) return 0;
|
||||
DBG("webq=%d", webquery);
|
||||
ssize_t L, Len;
|
||||
char tbuf[BUFLEN];
|
||||
char *buf;
|
||||
// fill transfer buffer
|
||||
buf = strT[Nsens];
|
||||
Len = strlen(buf);
|
||||
// OK buffer ready, prepare to send it
|
||||
if(webquery){
|
||||
L = snprintf((char*)tbuf, BUFLEN,
|
||||
"HTTP/2.0 200 OK\r\n"
|
||||
"Access-Control-Allow-Origin: *\r\n"
|
||||
"Access-Control-Allow-Methods: GET, POST\r\n"
|
||||
"Access-Control-Allow-Credentials: true\r\n"
|
||||
"Content-type: text/plain\r\nContent-Length: %zd\r\n\r\n", Len);
|
||||
if(L < 0){
|
||||
WARN("sprintf()");
|
||||
return 0;
|
||||
}
|
||||
if(L != write(sock, tbuf, L)){
|
||||
WARN("write");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
// send data
|
||||
//DBG("send %zd bytes\nBUF: %s", Len, buf);
|
||||
if(Len != write(sock, buf, Len)){
|
||||
WARN("write()");
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
// search a first word after needle without spaces
|
||||
static char* stringscan(char *str, char *needle){
|
||||
char *a, *e;
|
||||
char *end = str + strlen(str);
|
||||
a = strstr(str, needle);
|
||||
if(!a) return NULL;
|
||||
a += strlen(needle);
|
||||
while (a < end && (*a == ' ' || *a == '\r' || *a == '\t' || *a == '\r')) a++;
|
||||
if(a >= end) return NULL;
|
||||
e = strchr(a, ' ');
|
||||
if(e) *e = 0;
|
||||
return a;
|
||||
}
|
||||
|
||||
static void *handle_socket(void *asock){
|
||||
//putlog("handle_socket(): getpid: %d, pthread_self: %lu, tid: %lu",getpid(), pthread_self(), syscall(SYS_gettid));
|
||||
FNAME();
|
||||
int sock = *((int*)asock);
|
||||
int webquery = 0; // whether query is web or regular
|
||||
char buff[BUFLEN];
|
||||
int Nsens = -1;
|
||||
ssize_t rd;
|
||||
double t0 = dtime();
|
||||
while(dtime() - t0 < SOCKET_TIMEOUT){
|
||||
if(!waittoread(sock)){ // no data incoming
|
||||
continue;
|
||||
}
|
||||
if(!(rd = read(sock, buff, BUFLEN-1))){
|
||||
//putlog("socket closed. Exit");
|
||||
break;
|
||||
}
|
||||
//putlog("client send %zd bytes", rd);
|
||||
DBG("Got %zd bytes", rd);
|
||||
if(rd < 0){ // error
|
||||
//putlog("some error occured");
|
||||
DBG("Nothing to read from fd %d (ret: %zd)", sock, rd);
|
||||
break;
|
||||
}
|
||||
// add trailing zero to be on the safe side
|
||||
buff[rd] = 0;
|
||||
// now we should check what do user want
|
||||
char *got, *found = buff;
|
||||
if((got = stringscan(buff, "GET")) || (got = stringscan(buff, "POST"))){ // web query
|
||||
webquery = 1;
|
||||
char *slash = strchr(got, '/');
|
||||
if(slash) found = slash + 1;
|
||||
// web query have format GET /some.resource
|
||||
}
|
||||
// here we can process user data
|
||||
printf("user send: %s\nfound=%s", buff,found);
|
||||
if(strlen(found) == 2 && found[0] == 'T'){
|
||||
Nsens = found[1] - '0';
|
||||
if(Nsens < 0 || Nsens > 2) break; // wrong query
|
||||
pthread_mutex_lock(&mutex);
|
||||
if(!send_data(sock, webquery, Nsens)){
|
||||
putlog("can't send data, some error occured");
|
||||
}
|
||||
pthread_mutex_unlock(&mutex);
|
||||
break;
|
||||
}else break; // here can be more parsers
|
||||
}
|
||||
close(sock);
|
||||
//DBG("closed");
|
||||
//putlog("socket closed, exit");
|
||||
pthread_exit(NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// main socket server
|
||||
static void *server(void *asock){
|
||||
putlog("server(): getpid: %d, pthread_self: %lu, tid: %lu",getpid(), pthread_self(), syscall(SYS_gettid));
|
||||
int sock = *((int*)asock);
|
||||
if(listen(sock, BACKLOG) == -1){
|
||||
putlog("listen() failed");
|
||||
WARN("listen");
|
||||
return NULL;
|
||||
}
|
||||
while(1){
|
||||
socklen_t size = sizeof(struct sockaddr_in);
|
||||
struct sockaddr_in their_addr;
|
||||
int newsock;
|
||||
if(!waittoread(sock)) continue;
|
||||
newsock = accept(sock, (struct sockaddr*)&their_addr, &size);
|
||||
if(newsock <= 0){
|
||||
putlog("accept() failed");
|
||||
WARN("accept()");
|
||||
continue;
|
||||
}
|
||||
struct sockaddr_in* pV4Addr = (struct sockaddr_in*)&their_addr;
|
||||
struct in_addr ipAddr = pV4Addr->sin_addr;
|
||||
char str[INET_ADDRSTRLEN];
|
||||
inet_ntop(AF_INET, &ipAddr, str, INET_ADDRSTRLEN);
|
||||
//putlog("get connection from %s", str);
|
||||
red("Got connection from %s\n", str);
|
||||
pthread_t handler_thread;
|
||||
if(pthread_create(&handler_thread, NULL, handle_socket, (void*) &newsock)){
|
||||
putlog("server(): pthread_create() failed");
|
||||
WARN("pthread_create()");
|
||||
}else{
|
||||
DBG("Thread created, detouch");
|
||||
pthread_detach(handler_thread); // don't care about thread state
|
||||
}
|
||||
}
|
||||
putlog("server(): UNREACHABLE CODE REACHED!");
|
||||
}
|
||||
|
||||
// data gathering & socket parsing
|
||||
static void daemon_(int sock){
|
||||
if(sock < 0) return;
|
||||
pthread_t sock_thread;
|
||||
if(pthread_create(&sock_thread, NULL, server, (void*) &sock)){
|
||||
putlog("daemon_(): pthread_create() failed");
|
||||
ERR("pthread_create()");
|
||||
}
|
||||
double tgot = 0.;
|
||||
do{
|
||||
if(pthread_kill(sock_thread, 0) == ESRCH){ // died
|
||||
WARNX("Sockets thread died");
|
||||
putlog("Sockets thread died");
|
||||
pthread_join(sock_thread, NULL);
|
||||
if(pthread_create(&sock_thread, NULL, server, (void*) &sock)){
|
||||
putlog("daemon_(): new pthread_create() failed");
|
||||
ERR("pthread_create()");
|
||||
}
|
||||
}
|
||||
usleep(1000); // sleep a little or thread's won't be able to lock mutex
|
||||
if(dtime() - tgot < T_INTERVAL) continue;
|
||||
// get data
|
||||
int i;
|
||||
char bufs[3][BUFLEN]; // temporary buffers
|
||||
char *ptrs[3] = {bufs[0], bufs[1], bufs[2]};
|
||||
size_t lens[3] = {BUFLEN, BUFLEN, BUFLEN}; // free space
|
||||
for(i = 0; i < 8; ++i){ // scan over controllers
|
||||
if(poll_sensors(i)){
|
||||
int N, p;
|
||||
for(p = 0; p < 2; ++p) for(N = 0; N < 8; ++ N){
|
||||
double T = t_last[p][N][i];
|
||||
char **buf;
|
||||
size_t *len;
|
||||
//DBG("T%d [%d][%d] = %g",i, p,N,T);
|
||||
if(T > -100. && T < 100.){ // fill buffer
|
||||
size_t l;
|
||||
if(i == 0){
|
||||
buf = &ptrs[2]; len = &lens[2];
|
||||
// Nsens Npair T time
|
||||
l = snprintf(*buf, *len, "%d\t%d\t%.2f\t%ld\n", N, p, T,
|
||||
tmeasured[p][N][i]);
|
||||
}else{
|
||||
buf = &ptrs[p]; len = &lens[p];
|
||||
// x y T time
|
||||
l = snprintf(*buf, *len, "%d\t%d\t%.2f\t%ld\n", SensCoords[N][i][0],
|
||||
SensCoords[N][i][1], T, tmeasured[p][N][i]);
|
||||
}
|
||||
*len -= l;
|
||||
*buf += l;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
DBG("BUF0:\n%s\nBUF1:\n%s\nBUF2:\n%s", bufs[0],bufs[1],bufs[2]);
|
||||
tgot = dtime();
|
||||
// copy temporary buffers to main
|
||||
pthread_mutex_lock(&mutex);
|
||||
memcpy(strT, bufs, sizeof(strT));
|
||||
pthread_mutex_unlock(&mutex);
|
||||
}while(1);
|
||||
putlog("daemon_(): UNREACHABLE CODE REACHED!");
|
||||
}
|
||||
|
||||
/**
|
||||
* Run daemon service
|
||||
*/
|
||||
void daemonize(char *port){
|
||||
FNAME();
|
||||
int sock = -1;
|
||||
struct addrinfo hints, *res, *p;
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_family = AF_INET;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
hints.ai_flags = AI_PASSIVE;
|
||||
if(getaddrinfo(NULL, port, &hints, &res) != 0){
|
||||
ERR("getaddrinfo");
|
||||
}
|
||||
struct sockaddr_in *ia = (struct sockaddr_in*)res->ai_addr;
|
||||
char str[INET_ADDRSTRLEN];
|
||||
inet_ntop(AF_INET, &(ia->sin_addr), str, INET_ADDRSTRLEN);
|
||||
DBG("canonname: %s, port: %u, addr: %s\n", res->ai_canonname, ntohs(ia->sin_port), str);
|
||||
// loop through all the results and bind to the first we can
|
||||
for(p = res; p != NULL; p = p->ai_next){
|
||||
if((sock = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1){
|
||||
WARN("socket");
|
||||
continue;
|
||||
}
|
||||
int reuseaddr = 1;
|
||||
if(setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(int)) == -1){
|
||||
ERR("setsockopt");
|
||||
}
|
||||
if(bind(sock, p->ai_addr, p->ai_addrlen) == -1){
|
||||
close(sock);
|
||||
WARN("bind");
|
||||
continue;
|
||||
}
|
||||
break; // if we get here, we have a successfull connection
|
||||
}
|
||||
if(p == NULL){
|
||||
putlog("failed to bind socket, exit");
|
||||
// looped off the end of the list with no successful bind
|
||||
ERRX("failed to bind socket");
|
||||
}
|
||||
freeaddrinfo(res);
|
||||
daemon_(sock);
|
||||
close(sock);
|
||||
putlog("socket closed, exit");
|
||||
signals(0);
|
||||
}
|
||||
|
||||
32
src/netdaemon/socket.h
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* geany_encoding=koi8-r
|
||||
* socket.h
|
||||
*
|
||||
* Copyright 2017 Edward V. Emelianov <eddy@sao.ru, edward.emelianoff@gmail.com>
|
||||
*
|
||||
* 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 of the License, 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; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
#ifndef __SOCKET_H__
|
||||
#define __SOCKET_H__
|
||||
|
||||
// timeout for socket closing
|
||||
#define SOCKET_TIMEOUT (5.0)
|
||||
|
||||
void daemonize(char *port);
|
||||
|
||||
#endif // __SOCKET_H__
|
||||
228
src/netdaemon/term.c
Normal file
@ -0,0 +1,228 @@
|
||||
/* geany_encoding=koi8-r
|
||||
* client.c - terminal parser
|
||||
*
|
||||
* Copyright 2018 Edward V. Emelianoff <eddy@sao.ru>
|
||||
*
|
||||
* 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 of the License, 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; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
#include "usefull_macros.h"
|
||||
#include "term.h"
|
||||
#include <strings.h> // strncasecmp
|
||||
#include <time.h> // time(NULL)
|
||||
#include <limits.h> // INT_MAX, INT_MIN
|
||||
|
||||
#define BUFLEN 1024
|
||||
|
||||
// == 1 if given controller (except 0) presents on CAN bus
|
||||
int8_t ctrlr_present[8] = {1,0,0};
|
||||
// UNIX time of temperatures measurement: [Ngroup][Nsensor][Ncontroller]
|
||||
time_t tmeasured[2][8][8];
|
||||
// last temperatures read: [Ngroup][Nsensor][Ncontroller]
|
||||
double t_last[2][8][8];
|
||||
|
||||
/**
|
||||
* read strings from terminal (ending with '\n') with timeout
|
||||
* @param L - its length
|
||||
* @return NULL if nothing was read or pointer to static buffer
|
||||
*/
|
||||
static char *read_string(){
|
||||
size_t r = 0, l;
|
||||
static char buf[BUFLEN];
|
||||
int LL = BUFLEN - 1;
|
||||
char *ptr = NULL;
|
||||
static char *optr = NULL;
|
||||
if(optr && *optr){
|
||||
ptr = optr;
|
||||
optr = strchr(optr, '\n');
|
||||
if(optr) ++optr;
|
||||
//DBG("got data, roll to next; ptr=%s\noptr=%s",ptr,optr);
|
||||
return ptr;
|
||||
}
|
||||
ptr = buf;
|
||||
double d0 = dtime();
|
||||
do{
|
||||
if((l = read_tty(ptr, LL))){
|
||||
r += l; LL -= l; ptr += l;
|
||||
if(ptr[-1] == '\n') break;
|
||||
d0 = dtime();
|
||||
}
|
||||
}while(dtime() - d0 < WAIT_TMOUT && LL);
|
||||
if(r){
|
||||
buf[r] = 0;
|
||||
//DBG("r=%zd, got string: %s", r, buf);
|
||||
optr = strchr(buf, '\n');
|
||||
if(optr) ++optr;
|
||||
return buf;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to connect to `device` at BAUD_RATE speed
|
||||
* @return connection speed if success or 0
|
||||
*/
|
||||
void try_connect(char *device){
|
||||
if(!device) return;
|
||||
char tmpbuf[4096];
|
||||
fflush(stdout);
|
||||
tty_init(device);
|
||||
read_tty(tmpbuf, 4096); // clear rbuf
|
||||
putlog("Connected to %s", device);
|
||||
}
|
||||
|
||||
/**
|
||||
* run terminal emulation: send user's commands and show answers
|
||||
*/
|
||||
void run_terminal(){
|
||||
green(_("Work in terminal mode without echo\n"));
|
||||
int rb;
|
||||
char buf[BUFLEN];
|
||||
size_t l;
|
||||
setup_con();
|
||||
while(1){
|
||||
if((l = read_tty(buf, BUFLEN - 1))){
|
||||
buf[l] = 0;
|
||||
printf("%s", buf);
|
||||
}
|
||||
if((rb = read_console())){
|
||||
buf[0] = (char) rb;
|
||||
write_tty(buf, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* parser
|
||||
* @param buf (i) - data frame ending with \n or \0,
|
||||
* format: Tx_y=N (x - controller No, y - sensor No in pair, N - temperature*100
|
||||
* @param N - controller number
|
||||
* @return 1 if all OK
|
||||
*/
|
||||
static int parse_answer(char *buf, int N){
|
||||
if(!buf) return 0;
|
||||
++buf;
|
||||
// safely read integer from buffer
|
||||
int getint(){
|
||||
char *endptr;
|
||||
if(!buf || !*buf) return INT_MIN;
|
||||
long l = strtol(buf, &endptr, 10);
|
||||
if(l < INT_MIN || l > INT_MAX) return INT_MIN;
|
||||
if(endptr == buf) return INT_MIN; // NAN
|
||||
buf = endptr;
|
||||
return (int)l;
|
||||
}
|
||||
int i = getint(buf);
|
||||
//DBG("buf: %s", buf);
|
||||
//DBG("controller #%d", i);
|
||||
if(i != N) return 0;
|
||||
if(*buf != '_') return 0; // wrong format
|
||||
++buf;
|
||||
//DBG("buf: %s", buf);
|
||||
int v = getint(buf);
|
||||
//DBG("sensor #%d", v);
|
||||
if(v < 0 || v > 81) return 0;
|
||||
i = v/10; v -= i*10;
|
||||
//DBG("i=%d, v=%d", i,v);
|
||||
if((v & 1) != v) return 0;
|
||||
if(*buf != '=' ) return 0;
|
||||
++buf;
|
||||
int T = getint(buf);
|
||||
if(T < -27300 || T > 30000){
|
||||
t_last[v][i][N] = -300.;
|
||||
return 0;
|
||||
}
|
||||
t_last[v][i][N] = ((double)T) / 100.;
|
||||
tmeasured[v][i][N] = time(NULL);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* send command over tty & check answer
|
||||
* @param N - controller number
|
||||
* @param cmd - command
|
||||
* @return 0 if all OK
|
||||
*/
|
||||
static int send_cmd(int N, char cmd){
|
||||
if(N < 0 || N > 7) return 1;
|
||||
char buf[4] = {(char)N + '0', cmd, '\n', 0};
|
||||
char *rtn;
|
||||
//DBG("send cmd %s", buf);
|
||||
if(write_tty(buf, 3)) return 1;
|
||||
if((rtn = read_string())){
|
||||
if(*rtn == cmd) return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Poll sensor for new dataportion
|
||||
* @param N - number of controller (1..7)
|
||||
* @return: 0 if no data received or controller is absent, 1 if valid data received
|
||||
*/
|
||||
int poll_sensors(int N){
|
||||
if(!ctrlr_present[N]) return 0;
|
||||
char *ans;
|
||||
if(send_cmd(N, CMD_MEASURE_T)){ // start polling
|
||||
WARNX(_("can't request temperature"));
|
||||
return 0;
|
||||
}
|
||||
int ngot = 0;
|
||||
double t0 = dtime();
|
||||
while(dtime() - t0 < T_POLLING_TMOUT && ngot < 16){ // timeout reached or got data from all
|
||||
if((ans = read_string())){ // parse new data
|
||||
//DBG("got %s", ans);
|
||||
if(*ans == 'T'){ // data from sensor
|
||||
//DBG("ptr: %s", ans);
|
||||
ngot += parse_answer(ans, N);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* check whether connected device is main Thermal controller
|
||||
* @return 1 if NO
|
||||
*/
|
||||
int check_sensors(){
|
||||
green(_("Check if there's a sensors...\n"));
|
||||
int i, v, N, found = 0;
|
||||
char *ans;
|
||||
for(N=0;N<8;++N)for(i=0;i<8;++i)for(v=0;v<2;++v) t_last[v][i][N] = -300.; // clear data
|
||||
for(i = 1; i < 8; ++i){
|
||||
//red("i = %d\n", i);
|
||||
double t0 = dtime();
|
||||
while(dtime() - t0 < POLLING_TMOUT){
|
||||
if(send_cmd(i, CMD_PING)) continue;
|
||||
if((ans = read_string())){
|
||||
//DBG("got: %s", ans);
|
||||
if(0 == strncmp(ans, ANS_PONG, sizeof(ANS_PONG)-1)){
|
||||
//DBG("PONG from %d", ans[sizeof(ANS_PONG)-1] - '0');
|
||||
if(i == ans[sizeof(ANS_PONG)-1] - '0'){
|
||||
++found;
|
||||
ctrlr_present[i] = 1;
|
||||
green(_("Found controller #%d\n"), i);
|
||||
putlog("Found controller #%d", i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(found) return 0;
|
||||
WARNX(_("No sensors detected!"));
|
||||
return 1;
|
||||
}
|
||||
58
src/netdaemon/term.h
Normal file
@ -0,0 +1,58 @@
|
||||
/* geany_encoding=koi8-r
|
||||
* term.h
|
||||
*
|
||||
* Copyright 2018 Edward V. Emelianov <eddy@sao.ru, edward.emelianoff@gmail.com>
|
||||
*
|
||||
* 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 of the License, 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; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
#pragma once
|
||||
#ifndef __TERM_H__
|
||||
#define __TERM_H__
|
||||
|
||||
#define FRAME_MAX_LENGTH (300)
|
||||
#define MAX_MEMORY_DUMP_SIZE (0x800 * 4)
|
||||
// Terminal timeout (seconds)
|
||||
#define WAIT_TMOUT (0.5)
|
||||
// Main controller polling timeout - 1 second
|
||||
#define POLLING_TMOUT (1.0)
|
||||
// Thermal polling timeout: 5 seconds
|
||||
#define T_POLLING_TMOUT (5.0)
|
||||
// T measurement time interval - 1 minute
|
||||
#define T_INTERVAL (60.0)
|
||||
|
||||
// Protocol
|
||||
#define CMD_SENSORS_OFF 'F'
|
||||
#define CMD_MEASURE_T 'T'
|
||||
#define CMD_PING 'P'
|
||||
#define ANS_PONG "PONG"
|
||||
|
||||
extern int8_t ctrlr_present[8];
|
||||
extern time_t tmeasured[2][8][8];
|
||||
extern double t_last[2][8][8];
|
||||
|
||||
// communication errors
|
||||
typedef enum{
|
||||
TRANS_SUCCEED = 0, // no errors
|
||||
TRANS_ERROR, // some error occured
|
||||
TRANS_TIMEOUT // no data in WAIT_TMOUT
|
||||
} trans_status;
|
||||
|
||||
void run_terminal();
|
||||
void try_connect(char *device);
|
||||
int poll_sensors(int N);
|
||||
int check_sensors();
|
||||
|
||||
#endif // __TERM_H__
|
||||
434
src/netdaemon/usefull_macros.c
Normal file
@ -0,0 +1,434 @@
|
||||
/*
|
||||
* usefull_macros.h - a set of usefull functions: memory, color etc
|
||||
*
|
||||
* Copyright 2013 Edward V. Emelianoff <eddy@sao.ru>
|
||||
*
|
||||
* 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 of the License, 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; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "usefull_macros.h"
|
||||
#include <time.h>
|
||||
#include <linux/limits.h> // PATH_MAX
|
||||
|
||||
/**
|
||||
* function for different purposes that need to know time intervals
|
||||
* @return double value: time in seconds
|
||||
*/
|
||||
double dtime(){
|
||||
double t;
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
t = tv.tv_sec + ((double)tv.tv_usec)/1e6;
|
||||
return t;
|
||||
}
|
||||
|
||||
/******************************************************************************\
|
||||
* Coloured terminal
|
||||
\******************************************************************************/
|
||||
int globErr = 0; // errno for WARN/ERR
|
||||
|
||||
// pointers to coloured output printf
|
||||
int (*red)(const char *fmt, ...);
|
||||
int (*green)(const char *fmt, ...);
|
||||
int (*_WARN)(const char *fmt, ...);
|
||||
|
||||
/*
|
||||
* format red / green messages
|
||||
* name: r_pr_, g_pr_
|
||||
* @param fmt ... - printf-like format
|
||||
* @return number of printed symbols
|
||||
*/
|
||||
int r_pr_(const char *fmt, ...){
|
||||
va_list ar; int i;
|
||||
printf(RED);
|
||||
va_start(ar, fmt);
|
||||
i = vprintf(fmt, ar);
|
||||
va_end(ar);
|
||||
printf(OLDCOLOR);
|
||||
return i;
|
||||
}
|
||||
int g_pr_(const char *fmt, ...){
|
||||
va_list ar; int i;
|
||||
printf(GREEN);
|
||||
va_start(ar, fmt);
|
||||
i = vprintf(fmt, ar);
|
||||
va_end(ar);
|
||||
printf(OLDCOLOR);
|
||||
return i;
|
||||
}
|
||||
/*
|
||||
* print red error/warning messages (if output is a tty)
|
||||
* @param fmt ... - printf-like format
|
||||
* @return number of printed symbols
|
||||
*/
|
||||
int r_WARN(const char *fmt, ...){
|
||||
va_list ar; int i = 1;
|
||||
fprintf(stderr, RED);
|
||||
va_start(ar, fmt);
|
||||
if(globErr){
|
||||
errno = globErr;
|
||||
vwarn(fmt, ar);
|
||||
errno = 0;
|
||||
}else
|
||||
i = vfprintf(stderr, fmt, ar);
|
||||
va_end(ar);
|
||||
i++;
|
||||
fprintf(stderr, OLDCOLOR "\n");
|
||||
return i;
|
||||
}
|
||||
|
||||
static const char stars[] = "****************************************";
|
||||
/*
|
||||
* notty variants of coloured printf
|
||||
* name: s_WARN, r_pr_notty
|
||||
* @param fmt ... - printf-like format
|
||||
* @return number of printed symbols
|
||||
*/
|
||||
int s_WARN(const char *fmt, ...){
|
||||
va_list ar; int i;
|
||||
i = fprintf(stderr, "\n%s\n", stars);
|
||||
va_start(ar, fmt);
|
||||
if(globErr){
|
||||
errno = globErr;
|
||||
vwarn(fmt, ar);
|
||||
errno = 0;
|
||||
}else
|
||||
i = +vfprintf(stderr, fmt, ar);
|
||||
va_end(ar);
|
||||
i += fprintf(stderr, "\n%s\n", stars);
|
||||
i += fprintf(stderr, "\n");
|
||||
return i;
|
||||
}
|
||||
int r_pr_notty(const char *fmt, ...){
|
||||
va_list ar; int i;
|
||||
i = printf("\n%s\n", stars);
|
||||
va_start(ar, fmt);
|
||||
i += vprintf(fmt, ar);
|
||||
va_end(ar);
|
||||
i += printf("\n%s\n", stars);
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this function in the beginning of main() to setup locale & coloured output
|
||||
*/
|
||||
void initial_setup(){
|
||||
// setup coloured output
|
||||
if(isatty(STDOUT_FILENO)){ // make color output in tty
|
||||
red = r_pr_; green = g_pr_;
|
||||
}else{ // no colors in case of pipe
|
||||
red = r_pr_notty; green = printf;
|
||||
}
|
||||
if(isatty(STDERR_FILENO)) _WARN = r_WARN;
|
||||
else _WARN = s_WARN;
|
||||
// Setup locale
|
||||
setlocale(LC_ALL, "");
|
||||
setlocale(LC_NUMERIC, "C");
|
||||
#if defined GETTEXT_PACKAGE && defined LOCALEDIR
|
||||
bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
|
||||
textdomain(GETTEXT_PACKAGE);
|
||||
#endif
|
||||
}
|
||||
|
||||
/******************************************************************************\
|
||||
* Memory
|
||||
\******************************************************************************/
|
||||
/*
|
||||
* safe memory allocation for macro ALLOC
|
||||
* @param N - number of elements to allocate
|
||||
* @param S - size of single element (typically sizeof)
|
||||
* @return pointer to allocated memory area
|
||||
*/
|
||||
void *my_alloc(size_t N, size_t S){
|
||||
void *p = calloc(N, S);
|
||||
if(!p) ERR("malloc");
|
||||
//assert(p);
|
||||
return p;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mmap file to a memory area
|
||||
*
|
||||
* @param filename (i) - name of file to mmap
|
||||
* @return stuct with mmap'ed file or die
|
||||
*/
|
||||
mmapbuf *My_mmap(char *filename){
|
||||
int fd;
|
||||
char *ptr;
|
||||
size_t Mlen;
|
||||
struct stat statbuf;
|
||||
/// "îÅ ÚÁÄÁÎÏ ÉÍÑ ÆÁÊÌÁ!"
|
||||
if(!filename){
|
||||
WARNX(_("No filename given!"));
|
||||
return NULL;
|
||||
}
|
||||
if((fd = open(filename, O_RDONLY)) < 0){
|
||||
/// "îÅ ÍÏÇÕ ÏÔËÒÙÔØ %s ÄÌÑ ÞÔÅÎÉÑ"
|
||||
WARN(_("Can't open %s for reading"), filename);
|
||||
return NULL;
|
||||
}
|
||||
if(fstat (fd, &statbuf) < 0){
|
||||
/// "îÅ ÍÏÇÕ ×ÙÐÏÌÎÉÔØ stat %s"
|
||||
WARN(_("Can't stat %s"), filename);
|
||||
close(fd);
|
||||
return NULL;
|
||||
}
|
||||
Mlen = statbuf.st_size;
|
||||
if((ptr = mmap (0, Mlen, PROT_READ, MAP_PRIVATE, fd, 0)) == MAP_FAILED){
|
||||
/// "ïÛÉÂËÁ mmap"
|
||||
WARN(_("Mmap error for input"));
|
||||
close(fd);
|
||||
return NULL;
|
||||
}
|
||||
/// "îÅ ÍÏÇÕ ÚÁËÒÙÔØ mmap'ÎÕÔÙÊ ÆÁÊÌ"
|
||||
if(close(fd)) WARN(_("Can't close mmap'ed file"));
|
||||
mmapbuf *ret = MALLOC(mmapbuf, 1);
|
||||
ret->data = ptr;
|
||||
ret->len = Mlen;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void My_munmap(mmapbuf *b){
|
||||
if(munmap(b->data, b->len)){
|
||||
/// "îÅ ÍÏÇÕ munmap"
|
||||
ERR(_("Can't munmap"));
|
||||
}
|
||||
FREE(b);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************\
|
||||
* Terminal in no-echo mode
|
||||
\******************************************************************************/
|
||||
static struct termios oldt, newt; // terminal flags
|
||||
static int console_changed = 0;
|
||||
// run on exit:
|
||||
void restore_console(){
|
||||
if(console_changed)
|
||||
tcsetattr(STDIN_FILENO, TCSANOW, &oldt); // return terminal to previous state
|
||||
console_changed = 0;
|
||||
}
|
||||
|
||||
// initial setup:
|
||||
void setup_con(){
|
||||
if(console_changed) return;
|
||||
tcgetattr(STDIN_FILENO, &oldt);
|
||||
newt = oldt;
|
||||
newt.c_lflag &= ~(ICANON | ECHO);
|
||||
if(tcsetattr(STDIN_FILENO, TCSANOW, &newt) < 0){
|
||||
/// "îÅ ÍÏÇÕ ÎÁÓÔÒÏÉÔØ ËÏÎÓÏÌØ"
|
||||
WARN(_("Can't setup console"));
|
||||
tcsetattr(STDIN_FILENO, TCSANOW, &oldt);
|
||||
signals(0); //quit?
|
||||
}
|
||||
console_changed = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read character from console without echo
|
||||
* @return char readed
|
||||
*/
|
||||
int read_console(){
|
||||
int rb;
|
||||
struct timeval tv;
|
||||
int retval;
|
||||
fd_set rfds;
|
||||
FD_ZERO(&rfds);
|
||||
FD_SET(STDIN_FILENO, &rfds);
|
||||
tv.tv_sec = 0; tv.tv_usec = 10000;
|
||||
retval = select(1, &rfds, NULL, NULL, &tv);
|
||||
if(!retval) rb = 0;
|
||||
else {
|
||||
if(FD_ISSET(STDIN_FILENO, &rfds)) rb = getchar();
|
||||
else rb = 0;
|
||||
}
|
||||
return rb;
|
||||
}
|
||||
|
||||
/**
|
||||
* getchar() without echo
|
||||
* wait until at least one character pressed
|
||||
* @return character readed
|
||||
*/
|
||||
int mygetchar(){ // getchar() without need of pressing ENTER
|
||||
int ret;
|
||||
do ret = read_console();
|
||||
while(ret == 0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************\
|
||||
* TTY with select()
|
||||
\******************************************************************************/
|
||||
static struct termio oldtty, tty; // TTY flags
|
||||
static int comfd = -1; // TTY fd
|
||||
|
||||
// run on exit:
|
||||
void restore_tty(){
|
||||
if(comfd == -1) return;
|
||||
ioctl(comfd, TCSANOW, &oldtty ); // return TTY to previous state
|
||||
close(comfd);
|
||||
comfd = -1;
|
||||
}
|
||||
|
||||
#ifndef BAUD_RATE
|
||||
#define BAUD_RATE B4800
|
||||
#endif
|
||||
// init:
|
||||
void tty_init(char *comdev){
|
||||
DBG("\nOpen port...\n");
|
||||
do{
|
||||
comfd = open(comdev,O_RDWR|O_NOCTTY|O_NONBLOCK);
|
||||
}while (comfd == -1 && errno == EINTR);
|
||||
if(comfd < 0){
|
||||
WARN("Can't use port %s\n",comdev);
|
||||
signals(-1); // quit?
|
||||
}
|
||||
// make exclusive open
|
||||
if(ioctl(comfd, TIOCEXCL)){
|
||||
WARN(_("Can't do exclusive open"));
|
||||
close(comfd);
|
||||
signals(2);
|
||||
}
|
||||
DBG(" OK\nGet current settings... ");
|
||||
if(ioctl(comfd,TCGETA,&oldtty) < 0){ // Get settings
|
||||
/// "îÅ ÍÏÇÕ ÐÏÌÕÞÉÔØ ÎÁÓÔÒÏÊËÉ"
|
||||
WARN(_("Can't get settings"));
|
||||
signals(-1);
|
||||
}
|
||||
tty = oldtty;
|
||||
tty.c_lflag = 0; // ~(ICANON | ECHO | ECHOE | ISIG)
|
||||
tty.c_oflag = 0;
|
||||
tty.c_cflag = BAUD_RATE|CS8|CREAD|CLOCAL; // 9.6k, 8N1, RW, ignore line ctrl
|
||||
tty.c_cc[VMIN] = 0; // non-canonical mode
|
||||
tty.c_cc[VTIME] = 5;
|
||||
if(ioctl(comfd,TCSETA,&tty) < 0){
|
||||
/// "îÅ ÍÏÇÕ ÕÓÔÁÎÏ×ÉÔØ ÎÁÓÔÒÏÊËÉ"
|
||||
WARN(_("Can't set settings"));
|
||||
signals(-1);
|
||||
}
|
||||
DBG(" OK\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* Read data from TTY
|
||||
* @param buff (o) - buffer for data read
|
||||
* @param length - buffer len
|
||||
* @return amount of bytes read
|
||||
*/
|
||||
size_t read_tty(char *buff, size_t length){
|
||||
ssize_t L = 0, l;
|
||||
char *ptr = buff;
|
||||
fd_set rfds;
|
||||
struct timeval tv;
|
||||
int retval;
|
||||
do{
|
||||
l = 0;
|
||||
FD_ZERO(&rfds);
|
||||
FD_SET(comfd, &rfds);
|
||||
// wait for 100ms
|
||||
tv.tv_sec = 0; tv.tv_usec = 100000;
|
||||
retval = select(comfd + 1, &rfds, NULL, NULL, &tv);
|
||||
if (!retval) break;
|
||||
if(FD_ISSET(comfd, &rfds)){
|
||||
if((l = read(comfd, ptr, length)) < 1){
|
||||
return 0;
|
||||
}
|
||||
ptr += l; L += l;
|
||||
length -= l;
|
||||
}
|
||||
}while(l);
|
||||
return (size_t)L;
|
||||
}
|
||||
|
||||
int write_tty(char *buff, size_t length){
|
||||
ssize_t L = write(comfd, buff, length);
|
||||
if((size_t)L != length){
|
||||
/// "ïÛÉÂËÁ ÚÁÐÉÓÉ!"
|
||||
WARN("Write error");
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Safely convert data from string to double
|
||||
*
|
||||
* @param num (o) - double number read from string
|
||||
* @param str (i) - input string
|
||||
* @return 1 if success, 0 if fails
|
||||
*/
|
||||
int str2double(double *num, const char *str){
|
||||
double res;
|
||||
char *endptr;
|
||||
if(!str) return 0;
|
||||
res = strtod(str, &endptr);
|
||||
if(endptr == str || *str == '\0' || *endptr != '\0'){
|
||||
/// "îÅÐÒÁ×ÉÌØÎÙÊ ÆÏÒÍÁÔ ÞÉÓÌÁ double!"
|
||||
WARNX("Wrong double number format!");
|
||||
return FALSE;
|
||||
}
|
||||
if(num) *num = res; // you may run it like myatod(NULL, str) to test wether str is double number
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
FILE *Flog = NULL; // log file descriptor
|
||||
char *logname = NULL;
|
||||
time_t log_open_time = 0;
|
||||
/**
|
||||
* Try to open log file
|
||||
* if failed show warning message
|
||||
*/
|
||||
void openlogfile(char *name){
|
||||
if(!name){
|
||||
WARNX(_("Need filename"));
|
||||
return;
|
||||
}
|
||||
green(_("Try to open log file %s in append mode\n"), name);
|
||||
if(!(Flog = fopen(name, "a"))){
|
||||
WARN(_("Can't open log file"));
|
||||
return;
|
||||
}
|
||||
log_open_time = time(NULL);
|
||||
logname = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save message to log file, rotate logs every 24 hours
|
||||
*/
|
||||
int putlog(const char *fmt, ...){
|
||||
if(!Flog) return 0;
|
||||
time_t t_now = time(NULL);
|
||||
if(t_now - log_open_time > 86400){ // rotate log
|
||||
fprintf(Flog, "\n\t\t%sRotate log\n", ctime(&t_now));
|
||||
fclose(Flog);
|
||||
char newname[PATH_MAX];
|
||||
snprintf(newname, PATH_MAX, "%s.old", logname);
|
||||
if(rename(logname, newname)) WARN("rename()");
|
||||
openlogfile(logname);
|
||||
if(!Flog) return 0;
|
||||
}
|
||||
int i = fprintf(Flog, "\n\t\t%s", ctime(&t_now));
|
||||
va_list ar;
|
||||
va_start(ar, fmt);
|
||||
i = vfprintf(Flog, fmt, ar);
|
||||
va_end(ar);
|
||||
fprintf(Flog, "\n");
|
||||
fflush(Flog);
|
||||
return i;
|
||||
}
|
||||
140
src/netdaemon/usefull_macros.h
Normal file
@ -0,0 +1,140 @@
|
||||
/*
|
||||
* usefull_macros.h - a set of usefull macros: memory, color etc
|
||||
*
|
||||
* Copyright 2013 Edward V. Emelianoff <eddy@sao.ru>
|
||||
*
|
||||
* 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 of the License, 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; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef __USEFULL_MACROS_H__
|
||||
#define __USEFULL_MACROS_H__
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <errno.h>
|
||||
#include <err.h>
|
||||
#include <locale.h>
|
||||
#if defined GETTEXT_PACKAGE && defined LOCALEDIR
|
||||
/*
|
||||
* GETTEXT
|
||||
*/
|
||||
#include <libintl.h>
|
||||
#define _(String) gettext(String)
|
||||
#define gettext_noop(String) String
|
||||
#define N_(String) gettext_noop(String)
|
||||
#else
|
||||
#define _(String) (String)
|
||||
#define N_(String) (String)
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <termios.h>
|
||||
#include <termio.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
// unused arguments with -Wall -Werror
|
||||
#define _U_ __attribute__((__unused__))
|
||||
|
||||
/*
|
||||
* Coloured messages output
|
||||
*/
|
||||
#define RED "\033[1;31;40m"
|
||||
#define GREEN "\033[1;32;40m"
|
||||
#define OLDCOLOR "\033[0;0;0m"
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE (0)
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE (1)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ERROR/WARNING messages
|
||||
*/
|
||||
extern int globErr;
|
||||
extern void signals(int sig);
|
||||
#define ERR(...) do{globErr=errno; _WARN(__VA_ARGS__); signals(9);}while(0)
|
||||
#define ERRX(...) do{globErr=0; _WARN(__VA_ARGS__); signals(9);}while(0)
|
||||
#define WARN(...) do{globErr=errno; _WARN(__VA_ARGS__);}while(0)
|
||||
#define WARNX(...) do{globErr=0; _WARN(__VA_ARGS__);}while(0)
|
||||
|
||||
/*
|
||||
* print function name, debug messages
|
||||
* debug mode, -DEBUG
|
||||
*/
|
||||
#ifdef EBUG
|
||||
#define FNAME() fprintf(stderr, "\n%s (%s, line %d)\n", __func__, __FILE__, __LINE__)
|
||||
#define DBG(...) do{fprintf(stderr, "%s (%s, line %d): ", __func__, __FILE__, __LINE__); \
|
||||
fprintf(stderr, __VA_ARGS__); \
|
||||
fprintf(stderr, "\n");} while(0)
|
||||
#else
|
||||
#define FNAME() do{}while(0)
|
||||
#define DBG(...) do{}while(0)
|
||||
#endif //EBUG
|
||||
|
||||
/*
|
||||
* Memory allocation
|
||||
*/
|
||||
#define ALLOC(type, var, size) type * var = ((type *)my_alloc(size, sizeof(type)))
|
||||
#define MALLOC(type, size) ((type *)my_alloc(size, sizeof(type)))
|
||||
#define FREE(ptr) do{if(ptr){free(ptr); ptr = NULL;}}while(0)
|
||||
|
||||
#ifndef DBL_EPSILON
|
||||
#define DBL_EPSILON (2.2204460492503131e-16)
|
||||
#endif
|
||||
|
||||
double dtime();
|
||||
|
||||
// functions for color output in tty & no-color in pipes
|
||||
extern int (*red)(const char *fmt, ...);
|
||||
extern int (*_WARN)(const char *fmt, ...);
|
||||
extern int (*green)(const char *fmt, ...);
|
||||
void * my_alloc(size_t N, size_t S);
|
||||
void initial_setup();
|
||||
|
||||
// mmap file
|
||||
typedef struct{
|
||||
char *data;
|
||||
size_t len;
|
||||
} mmapbuf;
|
||||
mmapbuf *My_mmap(char *filename);
|
||||
void My_munmap(mmapbuf *b);
|
||||
|
||||
void restore_console();
|
||||
void setup_con();
|
||||
int read_console();
|
||||
int mygetchar();
|
||||
|
||||
void restore_tty();
|
||||
void tty_init(char *comdev);
|
||||
size_t read_tty(char *buff, size_t length);
|
||||
int write_tty(char *buff, size_t length);
|
||||
|
||||
int str2double(double *num, const char *str);
|
||||
|
||||
void openlogfile(char *name);
|
||||
int putlog(const char *fmt, ...);
|
||||
#endif // __USEFULL_MACROS_H__
|
||||