#led-display #led #hal #led-controller #tm1637 #low-level #tm1638

no-std tmledkey-hal-drv

HAL based driver for Titan Micro 7 segment LED controllers and key scanners

3 unstable releases

0.1.1 Jan 15, 2020
0.1.0 Dec 31, 2019
0.0.2 Oct 24, 2019
0.0.1 Oct 24, 2019

#758 in Embedded development

Custom license

49KB
1K SLoC

Titan Micro LED controller driver

crates.io Released API docs

Titan Micro is a Chinese manufacturer that produce several type of controllers for 7 segment LED displays with additional keyboard key scan functionality.

At least next controller variants are exist on the market:

  • TM1636 - 2 wire interface, 4 displays, 16 keys
  • TM1637 (popular) - 2 wire interface, 6 displays, 16 keys
  • TM1638 (popular) - 3 wire interface, 8 displays (10 segments), 24 keys
  • TM1639 - 3 wire interface, 8 displays (12 segments ?), 8 keys
  • TM1640 - 2 wire interface, 16 displays, no keys

This driver implements low level functions to send/read data with 2 or 3 wire interface. User friendly API would be implemented for popular controller models later.

Project status and future plans

Available functionality:

  • Support 2 and 3 wire interfaces, tested on TM1637 and TM1698
  • Writing bytes to MCU
  • Reading key scan bytes from MCU
  • Basic utility and animation features are present

Hardware crate was tested on:

  • TM1637 clock module
  • TM1638 module with 8 displays, 8 buttons and 8 additional LEDs
  • STM32 Blue Pill
  • Raspberry Pi

Current functionality looks stable, but implementation is extremely low level. That is mostly because I see no reason to do more friendly API until HAL and it's implementations would stabilize. Right now my goal is to keep it stable and working between HAL updates.

I really do hope that complexity of API is not a big issue. Current HAL state and embedded programming is suited only for hardcore, crazy, masochist developers who should be OK with my code.

Examples

This is how code from examples works.

Click on image to view animation.

TM1637 example

TM1638 example

Licensing

This product is licenses under almost MIT license but with plumbus exception.

Dependencies

~71KB