https://github.com/boblehibou/pico_tm1637_driver
Higher level functions to write to TM1637 chips in multiple ways (PIO, TM1637 arrays, bitbang, etc.) in PICO-SDK based projects.
https://github.com/boblehibou/pico_tm1637_driver
7-segment 7-segment-display 7-segment-display-module c driver embedded microcontroller pico-sdk pio raspberry-pi raspberry-pi-pico raspberrypi rp2040 rp2040w rp2350 rp235x tm1637 tm1637display
Last synced: 6 months ago
JSON representation
Higher level functions to write to TM1637 chips in multiple ways (PIO, TM1637 arrays, bitbang, etc.) in PICO-SDK based projects.
- Host: GitHub
- URL: https://github.com/boblehibou/pico_tm1637_driver
- Owner: boblehibou
- Created: 2025-04-01T01:30:59.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-04-01T14:18:31.000Z (6 months ago)
- Last Synced: 2025-04-01T15:35:01.061Z (6 months ago)
- Topics: 7-segment, 7-segment-display, 7-segment-display-module, c, driver, embedded, microcontroller, pico-sdk, pio, raspberry-pi, raspberry-pi-pico, raspberrypi, rp2040, rp2040w, rp2350, rp235x, tm1637, tm1637display
- Language: C
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSES/GPL-3.0-only.txt
Awesome Lists containing this project
README
# PICO-SDK PIO Based Drivers for Writing to TM1637 Components
Original repo : [BobLeHibou's pico_tm1637_driver on Codeberg](https://codeberg.org/boblehibou/pico_tm1637_driver)
## The Project
This project aims to provide a clear and general implementation of the communication protocol used to communicate with a component based on the TM1637 chip, for PICO-SDK projects.
Special care is being taken to provide easy and reliable code inclusion in CMake projects.# Usage
```cmake
...
add_subdirectory(path/to/pico_tm1637_driver/cloned/repo)
# OR (recommended) for automated git-cloning
include(FetchContent)
FetchContent_Declare(
pico_tm1637_driver
GIT_REPOSITORY https://codeberg.org/boblehibou/pico_tm1637_driver.git
GIT_TAG origin/main # or any branch/tag that suits your project
)
FetchContent_MakeAvailable(pico_tm1637_driver)
...
target_link_libraries(
...
pico_tm1637_driver # probably the one you want
# OR
pico_tm1637_multiple # might be useful if you have more than two TM1637 units to address
# OR
pico_tm1637_single # useful for understanding the protocol but probably not what you want in practice
...
)
...
```In source, in most cases, it should be sufficient to include the single high-level header like so :
```c
#include "pico_tm1637_driver.h"
// OR
#include "pico_tm1637_multiple.h"
// OR
#include "pico_tm1637_single.h"
// It is technically possible to include all three but use cases are improbable.
```In case one wants to access the contents of the generated .pio.h file, one can include it as follows. If you do not know why you might want this, you probably don't need it.
```c
#include "pico_tm1637_driver.pio.h"
```# Implementation
At the PIO level, only the serial communication is implemented, only adding the signposting signals and IO delays over the raw data.
This choice implies that this implementation will not be as efficient as usecase-specific implementations but will make it easy to understand, modify and extend.Both PIO state machine queues are used for writing only.
## PIO Encoding
Please refer to the comments in the .pio file in the src directory.
# Contributing and Sharing
Pull requests are welcome.
The main public-facing repo is hosted on [Codeberg](https://codeberg.org/boblehibou/pico_tm1637_driver).
Other repositories may not receive as much attention as the former.## Note
This project stemmed from a specific application from which extracting a general driver required minimal effort.
The more interest this project receives the more likely I am to provide support and new features.
Therefore, if you are using this project, I suggest letting me know by following/watching it. :)