this will describe how to generate the output files form the sources.

requirements
============

to be able to generate the outputs, you need following software:

- make: takes care of generating the output files
- [QEDA](http://qeda.org/): to generate footprints for the parts
- [KiCad](https://www.kicad.org/): EDA software used for schematic capture and board layout
- [PcbDraw](https://github.com/yaqwsx/PcbDraw): to generate board layout rendering
- [KiKit](https://github.com/yaqwsx/KiKit): to generate fabrications files (Gerber, Excellon)
- [KiAuto](https://github.com/INTI-CMNB/KiAuto): to generate schematic printout (PDF)
- [KiBoM](https://github.com/SchrodingersGat/KiBoM): to generate Bill of Material (CSV)

compiling
=========

to generate schematic, BoM, board render, and fabrication output, run `make`.

library
-------

almost all of the symbols and footprints used in the schematic and board layout are defined in the [QEDA](http://qeda.org/) format and generated for the CAD software.
the `library` folder contains the QEDA parts definitions.

to install QEDA using NPM from the official repository:
~~~
sudo npm install -g qeda
~~~

to install QEDA from the sources:
~~~
git clone https://github.com/qeda/qeda
cd qeda
npm install
sudo npm install --global
~~~

to generate the parts:
~~~
make lib
~~~

this will use the parts definition (.yaml files) in the `library` to generate the symbols (.sym files) and footprints used by KiCAD in the `kicad` folder.

schematic
---------

the `.kicad_sch` file is the schematic source file.
it has been drawn using the [KiCAD eeschema](https://www.kicad.org/) schematic editor.

it uses standard symbols, and the ones in the `kicad/` folder.
most symbols are generated by QEDA as described above.

to export as pdf:
~~~
make print
~~~

BOM
---

to export the bill of material (as CSV):
~~~
make bom
~~~

board
-----

the `.kicad_brd` file is the board layout source file.
it has been drawn using the [KiCAD pcbnew](https://docs.kicad.org/6.0/en/pcbnew/pcbnew.html) PCB editor.

it uses the footprints from the `kicad/` folder.
most footprints are generated by QEDA as described above.

to export gerber files for PCB manufacturer (and photo preview + overview document):
~~~
make fabrication
~~~

versioning
----------

the source schematic and board layout do not include version information.
when generating schematic or board fabrication output, a copy of the source files with date and version information is done as `.versioned.` files.
the date corresponds to the last changes (i.e. commit).
the version is formatted as `v.r`:

- `v` corresponds to the major version information defined in `version`
- `r` corresponds to the total number of changes done to the source files
