From 1dadec53a7a61eae9d37ba2aabf96efea1ad0ac9 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Wed, 10 Aug 2016 02:16:02 +0200 Subject: templates: nodemcu-arduino: better symbol names. o Adding some documentation to the readme. Adding a small flow chart illustrating how the tool work with a schematic, netlist and template to generate a header file. --- doc/CMakeLists.txt | 24 +++++ doc/flow.svg | 235 +++++++++++++++++++++++++++++++++++++++++++++++++ doc/flow.tikz | 29 ++++++ doc/template-qtikz.tex | 15 ++++ doc/template-tex.tex | 15 ++++ 5 files changed, 318 insertions(+) create mode 100644 doc/CMakeLists.txt create mode 100644 doc/flow.svg create mode 100644 doc/flow.tikz create mode 100644 doc/template-qtikz.tex create mode 100644 doc/template-tex.tex (limited to 'doc') diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt new file mode 100644 index 0000000..9c7fdb7 --- /dev/null +++ b/doc/CMakeLists.txt @@ -0,0 +1,24 @@ +function(add_tikz_target TIKZ_FILE TEMPLATE) + get_filename_component(basename ${TIKZ_FILE} NAME_WE) + set(pdf_file "${basename}.pdf") + set(svg_file "${basename}.svg") + + add_custom_command(OUTPUT ${pdf_file} + COMMAND echo "'\\def\\\\tikzfile{${CMAKE_CURRENT_SOURCE_DIR}/${TIKZ_FILE}}'" > tmp.tex + COMMAND echo "'\\input{${CMAKE_CURRENT_SOURCE_DIR}/template-tex.tex}}'" >> tmp.tex + COMMAND pdflatex -jobname ${basename} -file-line-error -interaction nonstopmode tmp.tex >/dev/null + COMMAND cmake -E remove tmp.tex + MAIN_DEPENDENCY ${TIKZ_FILE} + COMMENT "Generating ${pdf_file}" + ) + + add_custom_command(OUTPUT ${svg_file} + COMMAND pdf2svg ${pdf_file} ${svg_file} + COMMAND cmake -E copy_if_different ${svg_file} ${CMAKE_CURRENT_SOURCE_DIR}/${svg_file} + MAIN_DEPENDENCY ${pdf_file} + COMMENT "Generating ${svg_file}" + ) +endfunction() + +add_tikz_target(flow.tikz template-qtikz.tex) +add_custom_target(doc DEPENDS flow.svg) diff --git a/doc/flow.svg b/doc/flow.svg new file mode 100644 index 0000000..688e300 --- /dev/null +++ b/doc/flow.svg @@ -0,0 +1,235 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/flow.tikz b/doc/flow.tikz new file mode 100644 index 0000000..4c6c49e --- /dev/null +++ b/doc/flow.tikz @@ -0,0 +1,29 @@ +\begin{tikzpicture} +[ +major/.style={rectangle,draw,rounded corners, thick, align=center, minimum size=20mm}, +minor/.style={rectangle,draw,rounded corners, thick, minimum width=40mm, minimum height=15mm} +] + +\node (generate-header)[major] {\texttt{generate-header}}; +\node (netlist)[major, above=5em of generate-header] {Netlist\\\texttt{foo.net}}; +\node (schematic)[major, above=5em of netlist] {Schematic\\\texttt{foo.sch}}; +\node (header)[major, below=5em of generate-header] {Header\\\texttt{foo.h}}; +\node (template)[major, left=5em of netlist] {Template\\\texttt{my-template}}; + +\draw [-Straight Barb, thick] + (schematic.south) -- (netlist.north) + node[above, midway] {}; + +\draw [-Straight Barb, thick] + (netlist.south) -- (generate-header.north) + node[above, near end] {}; + +\draw [-Straight Barb, thick] + (generate-header.south) -- (header.north) + node[above, midway] {}; + +\draw [-Straight Barb, thick] + (template.south) |- (generate-header.west) + node[above, near end] {}; + +\end{tikzpicture} diff --git a/doc/template-qtikz.tex b/doc/template-qtikz.tex new file mode 100644 index 0000000..45a9e74 --- /dev/null +++ b/doc/template-qtikz.tex @@ -0,0 +1,15 @@ +\documentclass{standalone} +\usepackage{tikz} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{backgrounds} +\usetikzlibrary{calc} +\usetikzlibrary{fit} +\usetikzlibrary{positioning} + +\usepackage{flowchart} + +\tikzstyle{every picture}+=[font=\sffamily] + +\begin{document} +<> +\end{document} diff --git a/doc/template-tex.tex b/doc/template-tex.tex new file mode 100644 index 0000000..5329710 --- /dev/null +++ b/doc/template-tex.tex @@ -0,0 +1,15 @@ +\documentclass{standalone} +\usepackage{tikz} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{backgrounds} +\usetikzlibrary{calc} +\usetikzlibrary{fit} +\usetikzlibrary{positioning} + +\usepackage{flowchart} + +\tikzstyle{every picture}+=[font=\sffamily] + +\begin{document} +\input{\tikzfile} +\end{document} -- cgit v1.2.3