LEDComm  1.0
LEDComm
Author
Kevin L. Pauba (klpau.nosp@m.ba@g.nosp@m.mail..nosp@m.com).
Version
1.0.0

Introduction

LEDComm is a library that allows you to use a single LED for slow (around 30 baud), very short range wireless (less than an inch), bidirectional asynchronous serial communications. The signalling allows for half-duplex operation, 7- or 8-bits per character (transferred in MSB first/big-endian order) and optional odd, even, mark or space parity. A description of its operation is provided at http://mecrisp.sourceforge.net/ledcomm.htm (kudos to the author of the page, Matthias Koch, for the inspiration!).

This code has only been tested with ChibiOS/RT V2.6.x (stable) on ST_NUCLEO_L152RE and ST_NUCLEO_F401RE boards but should work on any STM32 board without modification (using ChibiOS, of course). With the appropriate setting of an EXT configuration, it should work on any platform supported by ChibiOS.

LEDComm was developed as part of a project to collect data from honey bee hives. I wanted an effective (and cheap) way to exchange data between the hive boxes that didn't involve wires. Just as Giovanni Di Sirio has shared ChibiOS with the community, I offer this small contribution in return.

Using the LEDComm Library

The LEDComm library depends on a few HAL modules so the following manifest constants in halconf.h must be set to TRUE:

  • HAL_USE_PAL
  • HAL_USE_EXT
  • HAL_USE_GPT

Additionally, the LEDComm library depends on a few ChibiOS modules so the following manifest constants in chconf.h must be set to TRUE:

  • CH_USE_QUEUES
  • CH_USE_EVENTS

In order to use the LEDComm driver the source code must be extracted in the $(CHIBIOS)/ext directory. Your project Makefile must be modified by adding $(CHIBIOS)/ext/ledcomm-X.Y.Z/ledcomm.c to the CSRC variable and $(CHIBIOS)/ext/ledcomm-X.Y.Z to the INCDIR variable.

You must then copy the $(CHIBIOS)/ext/ledcomm-X.Y.Z/templates/ledcommconf.h configuration header to your project directory and modify the hardware configuration as desired.

Some example applications are provided in the $(CHIBIOS)/ext/ledcomm-X.Y.Z/examples/ directory.