Debian Codegraph @

texmf-dist/doc/latex/pinoutikz/pinoutikz_doc_en.tex

raw
1 \documentclass[english,a4paper,10pt]{article}
2 \usepackage{fontspec}
3 \usepackage[bookmarks=true,bookmarksopen=true,colorlinks=true,hyperfootnotes=false,filecolor=black,linkcolor=blue,urlcolor=blue,pdfauthor={Robert Blazek},pdftitle={pinouTikz},pdfsubject={package for strings of tokens},pdfkeywords={pinouTikz,latex,chip,pinout},pdfcreator={LaTeX}]{hyperref}
4 \usepackage[margin=1.9cm]{geometry}
5 \usepackage{libertine}
6 \usepackage[scale=0.85]{noto-mono}
7 \usepackage[bottom]{footmisc}
8 \usepackage{amsmath,amssymb,amsfonts,color,eurosym,xspace,babel,listings}
9 \usepackage{pinoutikz}
10 \makeatletter
11 \definecolor{@xs@bckgcolor}{rgb}{0.9,1,1}
12 \definecolor{@xs@keywordspinouTikz}{rgb}{0,0,0.9}
13 \definecolor{@xs@keywordslatex}{rgb}{1,0,0}
14 \definecolor{@xs@arguments}{rgb}{0,0,0}
15 \definecolor{@xs@comments}{rgb}{0.5,0.5,0.5}
16 \definecolor{violet}{rgb}{0.66,0,0.66}
17 \lstset{%
18 language=[AlLaTeX]TeX,%
19 morekeywords={numexpr,detokenize},%
20 float=hbp,%
21 basicstyle=\small\ttfamily,%
22 identifierstyle=\color{@xs@arguments},%
23 keywordstyle=\color{@xs@keywordslatex},%
24 commentstyle=\itshape\color{@xs@comments},%
25 columns=fixed,%
26 tabsize=4,%
27 frame=single,%
28 extendedchars=true,%
29 showspaces=false,%
30 showstringspaces=false,%
31 numbers=left,%
32 numberstyle=\tiny\ttfamily,%
33 breaklines=true,%
34 breakindent=3em,%
35 backgroundcolor=\color{@xs@bckgcolor},%
36 breakautoindent=true,%
37 captionpos=t,%
38 xleftmargin=1em,%
39 xrightmargin=1em,%
40 lineskip=0pt,%
41 numbersep=1em,%
42 classoffset=1,%
43 morekeywords={% macros and commands of pinouTikz
44 PDIP,%
45 pctPDIP,%
46 PLCC,%
47 pctPLCC,%
48 TQFP,%
49 pctTQFP,%
50 SOP},%
51 keywordstyle=\color{@xs@keywordspinouTikz},%
52 classoffset=0}
53 \makeatother
54
55 \newcommand\guill[1]{"#1"}
56 \newcommand\argu[1]{$\langle$\textit{#1}$\rangle$}
57 \newcommand\ARGU[1]{\texttt{\{}\argu{#1}\texttt{\}}}
58 \newcommand\arguC[1]{\texttt{[}\argu{#1}\texttt{]}}
59 \newcommand\arguCC[2]{\texttt{[}\argu{#1}{,}\argu{#2}\texttt{]}}
60 \newcommand\arguD[1]{\texttt{(}\argu{#1}\texttt{)}}
61 \newcommand\texte[1]{\texttt{text}${}_{#1}$}
62 \newcommand\etoile{$\langle$\texttt{[*]}$\rangle$}
63 \newenvironment{Conditions}[1][1cm]%
64 {\begin{list}%
65 {$\vartriangleright$}%
66 {\setlength{\leftmargin}{#1}
67 \setlength{\itemsep}{0pt}
68 \setlength{\parsep}{0pt}
69 \setlength{\topsep}{2ptplus3ptminus2pt}
70 }}%
71 {\end{list}}
72 \renewcommand\th{${}^\text{th}$\xspace}
73 \newcommand\US{syntax unit\xspace}
74 \newcommand\USs{syntax units\xspace}
75 \newcommand\pinouTikz{\textsf{pinouTikz}\xspace}
76 \newcommand\styleexemple{\small\baselineskip1.03\baselineskip\vskip\baselineskip\relax}
77 \newcommand\styleexercice{\footnotesize}
78 \newcommand\verbinline{\lstinline[basicstyle=\normalsize\ttfamily]}
79 \newcommand\colorise{\color{violet}}
80 \begin{document}
81 \setlength{\parindent}{0pt}
82 \begin{titlepage}
83 \null\par\vfill
84 \begin{center}
85 \begin{minipage}{0.75\linewidth}
86 \begin{center}
87 \Huge\bfseries \pinoutikzname\par\vspace{5pt}
88 \small v\pinoutikzversion\par\vspace{25pt}
89 \normalsize User's manual
90 \end{center}
91 \end{minipage}
92 \end{center}
93 \vspace{1cm}
94 \begin{center}
95 Robert {\sc Blazek}\par\small
96 \href{mailto:[email protected]}{\nolinkurl{[email protected]}}\par\vspace{5pt}
97 %\xstringenglishdate
98 \end{center}
99 \vfill\hrulefill
100 \begin{center}
101 \begin{minipage}{0.85\linewidth}
102 \noindent
103 \hfill\textbf{\textit{Abstract}}\hfill{}\medskip\par
104 This package which requires $\varepsilon$-\TeX{}, provides macros for creating pinout diagrams of chips.
105
106 \end{minipage}
107 \end{center}
108 \hrulefill\vfill{}
109 \end{titlepage}
110
111 \tableofcontents
112
113 \section{Introduction}
114 \subsection{Description}
115 This package defines macros for generating symbolic pinout diagrams for different package classes, such as DIP, PLCC, etc.
116
117 \subsection{Motivation}
118 Whoever has ever had to do with FPGA or MCUs (whether for living or leisure), it's just natural he or she might have been in a need to document some pins. So was my case and since I failed in finding any package in \LaTeX{} to suit my needs, I opted for creating one myself.
119
120 I hope others will find it as useful as it was to me and my colleagues.
121
122 This is my first latex package documentation ever - and since I hate reinventing the wheel - this manual has been based upon that of \textbf{xstrings} - with the courtesy of the author, of course.
123
124 \section{The macros}
125 For a better understanding, let's see first the macros with the simpler arguments possible. No special catcode, no exotic token, no control sequence either: only alphanumeric chars will be contained in the arguments.\medskip
126
127 In the following chapters, all the macros will be presented this way:
128 \begin{itemize}
129 \item a short description of the operation;
130 \item the operation under special conditions. For each conditions considered, the operation described has priority on that (those) below;
131 \item finally, several examples are given. I tried to find them most easily comprehensible and most representative of the situations met in normal use.
132 \end{itemize}\smallskip
133
134 \textbf{Important}: in the following, a \argu{number} can be an integer written with numeric chars, a counter, or the result of an arithmetic operation made with the command \verbinline|\numexpr|.\smallskip
135
136 All the macros of \pinouTikz are displayed in {\makeatletter\color{@xs@keywordspinouTikz}blue}.
137
138 \subsection{The pinout diagrams}
139 \subsubsection{\ttfamily\textbackslash PDIP}
140 \verbinline|\PDIP|\arguD{pincount}\ARGU{pinarray}
141 \smallskip
142
143 Draws a PDIP package with generic number of pins, as a standalone glyph.
144
145 \verbinline|\pctPDIP|\arguD{pincount}\ARGU{pinarray}
146 \smallskip
147
148 Draws a PDIP package with generic number of pins, as a picture sub-element.
149
150 \begin{itemize}
151 \item \argu{pincount} the number of pins of a DIP package and should be an even number.
152 \item \ARGU{pinarray} is a comma-separated list of pins - each pin definition is as follows: \argu{pinnumber}/\ARGU{pinlabel}.
153 \end{itemize}
154
155 %% 4-pin example, as a glyph
156 \begin{lstlisting}
157 \begin{figure}
158 \centering
159 \PDIP(4){%
160 1/{E},2/B,3/NC,4/C}
161 \caption{NPN-Transistor, 4-pin PDIP package, as a glyph} \label{fig:X_DIP4}
162 \end{figure}
163 \end{lstlisting}%
164
165 %% 4-pin example
166 \begin{figure}[ht!]
167 \centering
168 \PDIP(4){%
169 1/{E},
170 2/B,
171 3/NC,
172 4/C
173 }%
174 \caption{NPN-Transistor, 4-pin PDIP package, as a glyph} \label{fig:X_DIP4}
175 \end{figure}
176
177 %% 4-pin example, within a picture
178 \begin{lstlisting}
179 \begin{figure}[ht!]
180 \centering
181 \begin{tikzpicture}
182 % an arbitrary picture laid over the PDIP diagram
183 \draw[thick,rounded corners=8pt](0,0)-- (0,2)-- (1,3.25)-- (2,2)-- (2,0)-- (0,2)-- (2,2)-- (0,0);
184 % a PDIP diagram itself
185 \pctPDIP(4){%
186 1/{E},
187 2/B,
188 3/NC,
189 4/C
190 }%
191 % a PDIP diagram itself
192 \begin{scope}[shift={(3.5,0.5)}]
193 \pctPDIP(4){%
194 1/{E},
195 2/B,
196 3/NC,
197 4/C
198 }%
199 \end{scope}
200 \end{tikzpicture}
201 \caption{NPN-Transistor, 4-pin PDIP package, placed within another picture, twice} \label{fig:X_DIP8}
202 \end{figure}
203 \end{lstlisting}%
204
205 %% 4-pin example, within a picture
206 \begin{figure}[ht!]
207 \centering
208 \begin{tikzpicture}
209 % an arbitrary picture laid over the PDIP diagram
210 \draw[thick,rounded corners=8pt](0,0)-- (0,2)-- (1,3.25)-- (2,2)-- (2,0)-- (0,2)-- (2,2)-- (0,0);
211 % a PDIP diagram itself
212 \pctPDIP(4){%
213 1/{E},
214 2/B,
215 3/NC,
216 4/C
217 }%
218 % a PDIP diagram itself
219 \begin{scope}[shift={(3.5,0.5)}]
220 \pctPDIP(4){%
221 1/{E},
222 2/B,
223 3/NC,
224 4/C
225 }%
226 \end{scope}
227 \end{tikzpicture}
228 \caption{NPN-Transistor, 4-pin PDIP package, placed within another picture, twice} \label{fig:X_DIP8}
229 \end{figure}
230
231 %% 8-pin example
232 %\begin{minipage}[t]{0.65\linewidth}
233 \begin{lstlisting}
234 \begin{figure}
235 \centering
236 \PDIP(8){%
237 1/CLK,
238 2/A,
239 3/B,
240 4/GND,
241 5/Y,
242 6/{\FormatPinLabel{~Y~}/RESET},
243 7/NC,
244 8/$V_{cc}$%
245 }
246 \caption{TTL logic chip, 8-pin PDIP package, as a glyph} \label{fig:X_DIP8}
247 \end{figure}
248 \end{lstlisting}%
249
250 %% 8-pin example
251 \begin{figure}[ht!]
252 \centering
253 \PDIP(8){%
254 1/CLK,
255 2/A,
256 3/B,
257 4/GND,
258 5/Y,
259 6/{\FormatPinLabel{~Y~}/RESET},
260 7/NC,
261 8/$V_{cc}$%
262 }
263 \caption{TTL logic chip, 8-pin PDIP package, as a glyph} \label{fig:X_DIP8}
264 \end{figure}
265 %\end{minipage}\hfill
266
267 %% 14-pin example
268 \begin{figure}[ht!]
269 \centering
270 \PDIP(14){%
271 1/A1,
272 2/B1,
273 3/\FormatPinLabel{\#1 AND/~OR~/GPIO1},
274 4/Y1,
275 5/C1,
276 6/\FormatPinLabel{\#2 AND/~OR~/GPIO2},
277 7/GND,
278 8/PCLK,
279 9/PDAT,
280 10/A2,
281 11/B2,
282 12/\FormatPinLabel{\#2 INV/~SME~/GPIO3},
283 13/C2,
284 14/$V_{cc}$}
285 \caption{Generic programmable TTL logic chip, 14-pin PDIP package} \label{fig:X_DIP14}
286 \end{figure}
287
288 %% 14-pin example
289 \begin{minipage}[t]{0.65\linewidth}
290 \begin{lstlisting}
291 \begin{figure}[ht!]
292 \centering
293 \PDIP(14){%
294 1/A1,
295 2/B1,
296 3/\FormatPinLabel{\#1 AND/~OR~/GPIO1},
297 4/Y1,
298 5/C1,
299 6/\FormatPinLabel{\#2 AND/~OR~/GPIO2},
300 7/GND,
301 8/PCLK,
302 9/PDAT,
303 10/A2,
304 11/B2,
305 12/\FormatPinLabel{\#2 INV/~SME~/GPIO3},
306 13/C2,
307 14/$V_{cc}$}
308 \caption{Generic programmable TTL logic chip, 14-pin PDIP package} \label{fig:X_DIP14}
309 \end{figure}
310 \end{lstlisting}%
311 \end{minipage}\hfill
312
313 \subsubsection{\ttfamily\textbackslash TQFP}
314 \verbinline|\TQFP|\arguD{pinnumber}\ARGU{pinarray}
315 \smallskip
316
317 Draws a TQFP package with generic number of pins, as a standalone glyph.
318
319 \verbinline|\pctTQFP|\arguD{pinnumber}\ARGU{pinarray}
320 \smallskip
321
322 Draws a TQFP package with generic number of pins, as a picture sub-element.
323
324 \begin{itemize}
325 \item \argu{pincount} the number of pins of a DIP package and should be an even number.
326 \item \ARGU{pinarray} is a comma-separated list of pins - each pin definition is as follows: \argu{pinnumber}/\ARGU{pinlabel}.
327 \end{itemize}
328
329 %% 32-pin TQFP example
330 \begin{minipage}[t]{0.65\linewidth}
331 \begin{lstlisting}
332 \begin{figure}[ht!]
333 \centering
334 \TQFP(32){%
335 1/{PD.0/RTX1},
336 2/{PA.0/STX1},
337 3/PA.1,
338 4/PA.2,
339 5/PA.3,
340 6/PA.4,
341 7/PA.5,
342 8/GND,
343 9/PA.6,
344 10/PA.7,
345 11/{PB.0/RTX1},
346 12/{PB.1/STX1},
347 13/PB.2,
348 14/PB.3,
349 15/PB.4,
350 16/PB.5,
351 17/PB.6,
352 18/PB.7,
353 19/\FormatPinLabel{PC.0/~ALE~/PLPBC0},
354 20/PC.1,
355 21/PC.2,
356 22/PC.3,
357 23/PC.4,
358 24/PC.5,
359 25/PC.6,
360 26/PC.7,
361 27/XTAL1/PD.3,
362 28/XTAL2/PD.4,
363 29/RST,
364 30/PD.1,
365 31/PD.2,
366 32/$V_{cc}$}
367 \caption{A generic MCU chip, 32-pin TQFP package} \label{fig:X_TQFP32}
368 \end{figure}
369 \end{lstlisting}%
370 \end{minipage}\hfill
371
372 %% 32-pin TQFP example
373 \begin{figure}[ht!]
374 \centering
375 \TQFP(32){%
376 1/{PD.0/RTX1},
377 2/{PA.0/STX1},
378 3/PA.1,
379 4/PA.2,
380 5/PA.3,
381 6/PA.4,
382 7/PA.5,
383 8/GND,
384 9/PA.6,
385 10/PA.7,
386 11/{PB.0/RTX1},
387 12/{PB.1/STX1},
388 13/PB.2,
389 14/PB.3,
390 15/PB.4,
391 16/PB.5,
392 17/PB.6,
393 18/PB.7,
394 19/\FormatPinLabel{PC.0/~ALE~/PLPBC0},
395 20/PC.1,
396 21/PC.2,
397 22/PC.3,
398 23/PC.4,
399 24/PC.5,
400 25/PC.6,
401 26/PC.7,
402 27/XTAL1/PD.3,
403 28/XTAL2/PD.4,
404 29/RST,
405 30/PD.1,
406 31/PD.2,
407 32/$V_{cc}$}
408 \caption{A generic MCU chip, 32-pin TQFP package} \label{fig:X_TQFP32}
409 \end{figure}
410
411 \subsubsection{\ttfamily\textbackslash PLCC}
412 \verbinline|\PLCC|\arguD{pinnumber}\ARGU{pinarray}
413 \smallskip
414
415 Draws a PLCC package with generic number of pins.
416
417 \verbinline|\pctPLCC|\arguD{pinnumber}\ARGU{pinarray}
418 \smallskip
419
420 Draws a PLCC package with generic number of pins, as a picture sub-element.
421
422 \begin{itemize}
423 \item \argu{pincount} the number of pins of a DIP package and should be an even number.
424 \item \ARGU{pinarray} is a comma-separated list of pins - each pin definition is as follows: \argu{pinnumber}/\ARGU{pinlabel}.
425 \end{itemize}
426
427 %% 28-pin PLCC example
428 \begin{minipage}[t]{0.65\linewidth}
429 \begin{lstlisting}
430 \begin{figure}[ht!]
431 \centering
432 \PLCC(28){%
433 1/{PD.0/RTX1},
434 2/{PA.0/STX1},
435 3/PA.1,
436 4/PA.2,
437 5/PA.3,
438 6/PA.4,
439 7/PA.5,
440 8/GND,
441 9/PA.6,
442 10/PA.7,
443 11/{PB.0/RTX1},
444 12/{PB.1/STX1},
445 13/PB.2,
446 14/PB.3,
447 15/PB.4,
448 16/PB.5,
449 17/PB.6,
450 18/PB.7,
451 19/\FormatPinLabel{PC.0/~ALE~/PLPBC0},
452 20/PC.1,
453 21/PC.2,
454 22/PC.3,
455 23/{XTAL1/PD.3},
456 24/{XTAL2/PD.4},
457 25/RST,
458 26/PD.1,
459 27/PD.2,
460 28/$V_{cc}$}
461 \caption{A generic MCU chip, 28-pin PLCC package} \label{fig:X_PLCC28}
462 \end{figure}
463 \end{lstlisting}%
464 \end{minipage}\hfill
465
466 %% 28-pin PLCC example
467 \begin{figure}[ht!]
468 \centering
469 \PLCC(28){%
470 1/{PD.0/RTX1},
471 2/{PA.0/STX1},
472 3/PA.1,
473 4/PA.2,
474 5/PA.3,
475 6/PA.4,
476 7/PA.5,
477 8/GND,
478 9/PA.6,
479 10/PA.7,
480 11/{PB.0/RTX1},
481 12/{PB.1/STX1},
482 13/PB.2,
483 14/PB.3,
484 15/PB.4,
485 16/PB.5,
486 17/PB.6,
487 18/PB.7,
488 19/\FormatPinLabel{PC.0/~ALE~/PLPBC0},
489 20/PC.1,
490 21/PC.2,
491 22/PC.3,
492 23/{XTAL1/PD.3},
493 24/{XTAL2/PD.4},
494 25/RST,
495 26/PD.1,
496 27/PD.2,
497 28/$V_{cc}$}
498 \caption{A generic MCU chip, 28-pin PLCC package} \label{fig:X_PLCC28}
499 \end{figure}
500
501 %% Examples for PDIP packages
502 \begin{minipage}[t]{0.35\linewidth}
503 \styleexemple
504 \end{minipage}%
505
506
507 %\bigskip\bigskip
508 \begin{center}
509 $\star$\par
510 $\star$\quad$\star$
511 \end{center}
512 \par\nobreak\bigskip\bigskip
513 That's all, I hope you will find this package useful!\par\nobreak
514 Please, send me an \href{mailto:[email protected]}{email} if you find a bug or if you have any idea of improvement\ldots\par\nobreak\medskip
515 Robert Blazek
516 \end{document}