Awesome
LIN
Introduction
LIN is a compiler (written in java) that will parse LIN Node capability and LIN description files and generate C source code that implements the LIN 2.2 spec for slave or master nodes.
Download
- Latest release (v0.3.1-beta).
- Previous releases can be found on the GitHub releases page.
Install
Windows
- Extract the downloaded zip file into the path "C:\Program Files\LIN-v0.3.1-beta"
- The final folder structure should look something like this.
- C:\Program Files\LIN-v0.3.1-beta
- bin
- LIN
- LIN.bat
- lib
- LIN-v0.3.1-beta.jar
- bin
- C:\Program Files\LIN-v0.3.1-beta
- Then finally add "C:\Program Files\LIN-v0.3.1-beta\bin" to the environment PATH variable.
- Here is a short video on how to do this in this video he adds C:\Python27 just type C:\Program Files\LIN-v0.3.1-beta\bin instead. You should also make sure that Java is also on your PATH variable as well.
Unix
- Extract the downloaded zip file where ever you feel fit.
- I put it in /opt/LIN-v0.3.1-beta
- Add that location to your PATH so you can run the LIN-v0.3.1-beta/bin/LIN bash script.
Supported Targets
- PIC24FJXXGA00X family.
- PIC24FJXXGB00X family.
- Support for others should not be too difficult to add.
Dependencies
- Java 1.8 the compiler is written in Java 1.8.
- antlr4 is used to generated the parsers for LIN Node capability and LIN description files.
- string template (usually packaged with antlr4) is used as a template engine to generate the C drivers.
- jcommander used to make command line tools more user-friendly.
Usage
Usage: LIN [options] source files...
Options:
-h, --help
Show help this message.
Default: false
-o, --output
Output directory.
Default: gen
* -t, --target
The target device.
* -i, --target-interface
The target device's interface.
-v, --version
Display compiler version information.
Default: false
Examples
Generate a master node from a LIN Node capability file.
LIN -t PIC24FJ64GB002 -i UART1 CEM.ncf
- This will generate two files gen/CEM.h and gen/CEM.c that targets the PIC24FJ64GB002 and uses the first UART module, you will include these files in your master node project.