Crates.io | dfplayer-async |
lib.rs | dfplayer-async |
version | 0.4.0 |
created_at | 2025-03-11 20:05:20.070856+00 |
updated_at | 2025-07-06 19:38:16.677453+00 |
description | A simple embedded-hal-async driver for the DFPlayer mini MP3 module. |
homepage | |
repository | https://github.com/1-rafael-1/dfplayer-async/ |
max_upload_size | |
id | 1588447 |
size | 64,991 |
An async no_std Rust driver for the DFPlayer Mini MP3 module, designed for embedded systems.
This driver is based on the excellent work from dfplayer-serial by José Fernando Morales Vargas. Published with the original author's kind permission as the original repository is currently not maintained.
Based on the original driver, this version has been reworked. See tags for changes, in case You are interested.
This driver has been tested with:
Despite using different chips, both modules apparently follow the same protocol and work with this driver. Other compatible modules should work as well, but your mileage may vary.
Add to your Cargo.toml
:
[dependencies]
dfplayer-async = "0.3.0"
The repository contains complete working examples:
examples/src/basic.rs
- Shows how to initialize the driver and control playback, including:
examples/src/query.rs
- Demonstrates how to query information from the device:
The examples assume a Raspberry Pi Pico with specific pin connections:
To use the DFPlayer Mini:
The DFPlayer expects MP3 files to be organized in a specific way. For basic usage:
0001-song.mp3
, 0002-song.mp3
, etc.For more advanced organization, you can create folders and use the play_from_folder
method.
Licensed under the MIT License - see the LICENSE file for details.