diff options
author | Karl Berry <karl@freefriends.org> | 2019-12-02 21:58:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-12-02 21:58:31 +0000 |
commit | 8df13fd48100cd18141b466e7286b8afc18486e0 (patch) | |
tree | 0617eca873eb5b9f45e75861ca902a722db7101e /Master/texmf-dist/tex/latex | |
parent | 0fe8f6d1c939037fe88ed07bd52373bce394ad2f (diff) |
pinoutikz (2dec19)
git-svn-id: svn://tug.org/texlive/trunk@52999 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/pinoutikz/pinoutikz.sty | 50 |
1 files changed, 32 insertions, 18 deletions
diff --git a/Master/texmf-dist/tex/latex/pinoutikz/pinoutikz.sty b/Master/texmf-dist/tex/latex/pinoutikz/pinoutikz.sty index 30656c61435..0aafc9e188f 100644 --- a/Master/texmf-dist/tex/latex/pinoutikz/pinoutikz.sty +++ b/Master/texmf-dist/tex/latex/pinoutikz/pinoutikz.sty @@ -38,7 +38,7 @@ \usetikzlibrary{shapes.misc, shapes.geometric} \def\pinoutikzname {pinouTikz} -\def\pinoutikzversion {1.1.0} +\def\pinoutikzversion {1.1.1} \def\pinoutikzdate {2019/11/25} %% Formatt a pin name @@ -58,15 +58,30 @@ } %% package rectangle -\def\CASE(#1)#2#3#4 {% +\def\CASE(#1)#2 {% +% \CASE(#3){\width*.5-0.75*.5,\width*.5-0.75*.5}{\width cm + 0.75 cm}{\height cm + 0.75 cm} + \def\edgecount{4} + \pgfmathparse{#2/\edgecount-1}\let\cntpinsl\pgfmathresult + \pgfmathparse{#2/\edgecount}\let\cntstr\pgfmathresult + \pgfmathparse{#2-1}\let\cntpinsr\pgfmathresult + \pgfmathparse{\cntstr*.4+.4}\let\height\pgfmathresult + \pgfmathparse{\height}\let\width\pgfmathresult \ifthenelse{\equal{#1}{TQFP}}{% - \node[draw=black, rectangle,minimum width=#3,minimum height=#4,line width=1.5pt, chamfered rectangle, chamfered rectangle corners={north west, north east, south east, south west}] at (#2) (case) {}; - \draw (-.39 cm,#4-1.15cm) circle (1.5mm); + \pgfmathparse{\width*.5-0.75*.5}\let\posx\pgfmathresult + \pgfmathparse{\height*.5-0.75*.5}\let\posy\pgfmathresult + \pgfmathparse{\width cm + 0.75 cm}\let\widthB\pgfmathresult + \pgfmathparse{\height cm + 0.75 cm}\let\heightB\pgfmathresult + \node[draw=black, rectangle,minimum width=\widthB,minimum height=\heightB,line width=1.5pt, chamfered rectangle, chamfered rectangle corners={north west, north east, south east, south west}] at (\posy,\posy) (case) {}; + \draw (-.44 cm,\height cm + 0.75 cm-1.1cm) circle (1.25mm); }{}% \ifthenelse{\equal{#1}{PLCC}}{% - \node[draw=black, rectangle,minimum width=#3,minimum height=#4,line width=1.5pt, chamfered rectangle, chamfered rectangle corners={north west}] at (#2) (case) {}; - %\node[draw=black, circle,minimum size=1.5mm] at (#3*.5 cm,#4-1.25cm) (mark) {}; - }{}% + \pgfmathparse{\width*.5-0.75*.5}\let\posx\pgfmathresult + \pgfmathparse{\height*.5-0.75*.5}\let\posy\pgfmathresult + \pgfmathparse{\width cm + 0.75 cm}\let\widthB\pgfmathresult + \pgfmathparse{\height cm + 0.75 cm}\let\heightB\pgfmathresult + \node[draw=black, rectangle,minimum width=\widthB,minimum height=\heightB,line width=1.5pt, chamfered rectangle, chamfered rectangle corners={north west}] at (\posx,\posy) (case) {}; + \draw (\posx,\posy+\height*.5-.2) circle (1.25mm); + }{}% } %% PIN diagram with label decoding @@ -116,7 +131,7 @@ \pgfmathparse{#1-1}\let\cntpinsr\pgfmathresult \pgfmathparse{\cntstr*.5}\let\height\pgfmathresult \draw[line width=1.5pt] (0,-0.5) rectangle (1.88,\height); - \draw (0.80,\height) arc (180:360:2mm); + \draw (0.75 cm,\height cm) arc (180:360:2mm); %iterate through pin definitions \foreach \pinnum/\i in {#2}% {% @@ -131,29 +146,28 @@ \pgfmathparse{(\pinidx-\cntstr)*0.5}\let\ypin\pgfmathresult \PIN[right](1.88,\ypin){\i}{\pinnum} } -% \fi } } \end{scope} \end{tikzpicture} } -% #1 - pin count -% #2 - pin array -% #3 - case type -% #4 - pin offset +% Generic 4-edged package diagram +% @param#1 - pin count +% @param#2 - pin array +% @param#3 - case type +% @param#4 - pin offset \def\GENFOUREDGE(#1)#2#3#4{% \sffamily \textsf{% \def\pins{{#2}} - \pgfmathparse{#1/4-1}\let\cntpinsl\pgfmathresult - \pgfmathparse{#1/4}\let\cntstr\pgfmathresult + \def\edgecount{4} + \pgfmathparse{#1/\edgecount-1}\let\cntpinsl\pgfmathresult + \pgfmathparse{#1/\edgecount}\let\cntstr\pgfmathresult \pgfmathparse{#1-1}\let\cntpinsr\pgfmathresult \pgfmathparse{\cntstr*.4+.4}\let\height\pgfmathresult \pgfmathparse{\height}\let\width\pgfmathresult - %\draw[line width=1.5pt] (-0.75,-0.75) rectangle (\width,\height); -% \node[draw=black, rectangle,minimum width=\width cm + 0.75 cm,minimum height=\height cm + 0.75 cm,line width=1.5pt, chamfered rectangle, chamfered rectangle corners={north west}] at (\width*.5-0.75*.5,\width*.5-0.75*.5) (case) {}; - \CASE(#3){\width*.5-0.75*.5,\width*.5-0.75*.5}{\width cm + 0.75 cm}{\height cm + 0.75 cm} + \CASE(#3){#1} %iterate through pin definitions \foreach \pinnum/\i in {#2}% {% |