/LIN_slave_portable_Arduino

Portable LIN Slave Node Emulation

Primary LanguageC++MIT LicenseMIT

Portable LIN Slave Node Emulation

This Arduino library implements a Local Interconnect Network slave node emulation. For an explanation of the LIN bus and protocol e.g. see https://en.wikipedia.org/wiki/Local_Interconnect_Network.

The class structure is very flexible and aims at supporting different Serial interfaces and architectures. It can easily be ported to other boards - in which case a pull request is highly appreciated...

For a similar Arduino libary for LIN master emulation see https://github.com/gicking/LIN_master_portable_Arduino

Supported functionality

  • multiple, simultaneous LIN nodes
  • background handling of frames via user-defined callback functions
  • supports HardwareSerial and SoftwareSerial, if available

Supported Boards (with additional LIN hardware)

Test Matrix

Test Matrix

Notes

  • the handler() method must be called faster than bytes are received (~0.5ms @ 19.2kBaud). Optionally it can be called from within serialEvent()
  • In general, framing errors are not stored by Arduino Serial implementations. In these cases, frame synchronization is via a configurable inter-frame pause.
  • For the following boards BREAK detection via framing errors is supported:
    • AVR via NeoHWSerial library, which supports custom UART ISRs.
    • ESP32, which natively supports a onReceiveError() method
  • for AVR you must not use both Serial and NeoHWSerial instances in the same sketch. If possible use only NeoHWSerial, else you have to disable LIN_slave_NeoHWSerial_AVR.* and enable LIN_slave_HardwareSerial.* via macros
  • ESP8266 and ESP32 SoftwareSerial drops BREAK (=0x00 without stop bit) altogether. Therefore these platforms only support HardwareSerial

Library Reference

See library reference

Have fun!, Georg


Revision History

v1.0 (pending)

  • initial release