aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2016-08-10 02:16:02 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2016-08-10 02:16:02 +0200
commit1dadec53a7a61eae9d37ba2aabf96efea1ad0ac9 (patch)
tree0c09a731271c3a714534556ed36cf2843064d2ff /README.md
parentfd0e6e3aa0e7523a36011a2f0264737772aa5e24 (diff)
downloadkicad-utils-1dadec53a7a61eae9d37ba2aabf96efea1ad0ac9.tar.gz
kicad-utils-1dadec53a7a61eae9d37ba2aabf96efea1ad0ac9.tar.bz2
kicad-utils-1dadec53a7a61eae9d37ba2aabf96efea1ad0ac9.tar.xz
kicad-utils-1dadec53a7a61eae9d37ba2aabf96efea1ad0ac9.zip
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.
Diffstat (limited to 'README.md')
-rw-r--r--README.md76
1 files changed, 76 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..af174b6
--- /dev/null
+++ b/README.md
@@ -0,0 +1,76 @@
+Kicad utils contains utilities for automating your Kicad workflow.
+
+# generate-header
+
+Generate header is a tool to generate header files from your schematics to ensure that your schematic and
+pin mapping always is correct.
+
+![flow]
+
+[flow]: doc/flow.svg "Flow with generate-header"
+
+## Command line usage
+
+You can use the generate-header tool as a standalone command line tool like this:
+
+ generate-header -n schematic/foo.net -r U1 -t intel-quark-d2000 -o firmware/schematic.h
+
+The usage is summarized like this:
+
+ usage: generate-header -n <net file> -r <ref> -t <template> [-l <template lib dir>] [-o <out file>]
+
+## CMake integration
+
+Put this in your `CMakeLists.txt`:
+
+ find_package(KicadUtils)
+
+ kicad_generate_header(
+ OUTPUT schematic.h
+ NET schematic/intel-quark-d2000.net
+ REF U1
+ TEMPLATE intel-quark-d2000)
+
+and `schematic.h` will automatically be generated. CMake now knows that `schematic.h` is generated and depends on
+`schematic/intel-quark-d2000.net`.
+
+# Templates
+
+The templates are simply Python files that map from the part's pin number to a platform-specific symbol. The
+`kicad-utils` KiCAD library contains parts with pins that act as documentation for what the pins mean. If you don't use
+the `kicad-utils` library, make sure that your pin usage matches what is used in the library.
+
+For example the `nodemcu-arduino` template will assume that the part follows the pin ordering and usage for the
+`NODEMCU` part in the library and that it used the Arduino IDE with the ESP8266 board package. The generated header file
+will look like this:
+
+ namespace schematic {
+
+ static const int AD0 = D0;
+ ...
+ }
+
+
+# Building
+
+## Antlr4
+
+Kicad utils needs a fork of Antlr4 with better CMake support.
+
+ mkdir thirdparty/antlr4/build
+ cd thirdparty/antlr4/build
+ cmake .. \
+ -DCMAKE_INSTALL_PREFIX=$HOME/opt/antlr4-cpp
+ make
+ make install
+
+## Kicad utils
+
+ mkdir build
+ cd build
+ cmake .. \
+ -DAntlr4_DIR=$HOME/opt/antlr4-cpp/lib/cmake/Antlr4 \
+ -DCMAKE_INSTALL_PREFIX=$HOME/opt/kicad-utils \
+ -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=YES
+ make
+ make install