summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/pinoutikz/pinoutikz.sty
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pgf/contrib/pinoutikz/pinoutikz.sty')
-rw-r--r--graphics/pgf/contrib/pinoutikz/pinoutikz.sty50
1 files changed, 32 insertions, 18 deletions
diff --git a/graphics/pgf/contrib/pinoutikz/pinoutikz.sty b/graphics/pgf/contrib/pinoutikz/pinoutikz.sty
index 30656c6143..0aafc9e188 100644
--- a/graphics/pgf/contrib/pinoutikz/pinoutikz.sty
+++ b/graphics/pgf/contrib/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}%
{%