Giter Site home page Giter Site logo

loconet's Introduction

Overview

The EmbededLocoNet Library provides functions that manage the sending and receiving of LocoNet packets.

As bytes are received from the LocoNet by an interrupt driven handler, they are stored in a circular FIFO buffer. The LocoNet.receive() method returns the head packet from the buffer, or NULL if no valid packets have arrived.

When packets are sent successfully, by default they are also appended to the circular receive buffer so they can be handled in the same manner as if they had been received from another device.

It maintains statistics about the transmission and reception of packets. Also, it discards any invalid packets it receives, incrementing an RxErrors statistic accordingly.

Hardware Resource Dependencies

This library uses TIMER1 & ICP (UNO) and/or TIMER5 and ICP5 (MEGA) resources and associated interrupt handler hooks. On the STM32, it uses TIM2 and the EXTI10-15 interrupts handler hooks. On the ESP8266, the implementation uses TIMER1 and associated interrupt handler hooks.

Of the AVR "mega" and "tiny" range of microcontrollers, this library only works on those that have an Input Capture Unit (ICP) associated with a 16-Bit Timer/Counter.

It's known to work with:

  • UNO (ATmega328)
  • MEGA (ATmega2560)
  • Leonardo, LeoStick, Arduino Pro Micro (ATmega32U4)
  • Various AVRTiny Boards (ATTiny84, ATTiny84A, ATTiny841)
  • Blue Pill (STM32F1 w/ libopencm3 and Arduino Stubs)
  • NodeMCU v1.0 (ESP8266 core for Arduino)

As of 2020-03-28 - Hans Tanner added the capability to change the polarity of the Rx and Tx electrical signal (depending on your circuitry) in the utility/ln_config.h file. The is controlled using the two #defines LN_SW_UART_RX_INVERTED and LN_SW_UART_TX_INVERTED

Contributing

Update the version in two places:

  1. library.properties - used by the Arduino IDE via https://github.com/arduino/library-registry#adding-a-library-to-library-manager
  2. library.json - used by PlatformIO, see https://docs.platformio.org/en/latest/manifests/library-json/index.html

Releasing

Arduino IDE: add a tag or GitHub Release matching the version number in library.properties. See the documentation.

For PlatformIO, see documentation about publishing.

IMPORTANT

Some message formats used in this code are Copyright Digitrax, Inc. and/or Elektronik GmbH and are used with permission as part of the MRRwA project. That permission does not extend to uses in other software products. See the LICENSE file for more information.

loconet's People

Contributors

kiwi64ajs avatar merdeka avatar deltaphi avatar bjoernrennfanz avatar plocher avatar mbslk1 avatar digital-moba avatar evili avatar dirkjankrijnders avatar rehevkor5 avatar devel-bobm avatar michael71 avatar roelandkluit avatar per1234 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.