Go to the documentation of this file.
19 #ifndef DFPLAYER_TYPES_H
20 #define DFPLAYER_TYPES_H
dfplayer_mode_t
Enumeration of the playback modes supported by the DFPlayer.
uint8_t len
Length of the frame in the buffer.
dfplayer_file_t file
Currently played song.
uint8_t buf[6]
Data buffer for response from DFPlayer.
mutex_t mutex
Used to mutual exclusive access.
dfplayer_rx_state_t state
Current state of the DFPlayer.
gpio_t busy_pin
GPIO connected to the DFPlayer's busy pin.
@ DFPLAYER_EQ_JAZZ
The "Jazz" equalizer setting.
@ DFPLAYER_RX_STATE_LENGTH
Waiting for length (0x06)
@ DFPLAYER_MODE_NORMAL
Normal playback.
@ DFPLAYER_SOURCE_AUX
No idea, the data sheet never mentions AUX again.
dfplayer_rx_state_t
Enumeration of the RX states of the DFPlayer driver.
@ DFPLAYER_SOURCE_NUMOF
Number of supported playback modes.
@ DFPLAYER_MODE_REPEAT
Repeating a single file.
@ DFPLAYER_MODE_RANDOM
Playing all files in random order.
dfplayer_eq_t
Enumeration of the equalizer settings supported by the DFPlayer.
@ DFPLAYER_EQ_NORMAL
The "Normal" equalizer setting.
@ DFPLAYER_EQ_CLASSIC
The "Classic" equalizer setting.
unsigned int uart_t
Define default UART type identifier.
dfplayer_state_t
Enumeration of the detectable states of the DFPlayer.
Low-level UART peripheral driver interface definition.
dfplayer_source_t
Enumeration of the different sources for playback supported.
@ DFPLAYER_EQ_NUMOF
Number of supported equalizer settings.
@ DFPLAYER_RX_STATE_START
Waiting for start symbol (0x7e)
@ DFPLAYER_MODE_REPEAT_DIR
Repeating a directory.
dfplayer_cb_done_t cb_done
Function to call when playing a track completed.
@ DFPLAYER_SOURCE_SLEEP
No idea, the data sheet is extremely vague on this.
@ DFPLAYER_MODE_UNKOWN
No idea, the data sheet is vague.
@ DFPLAYER_SCHEME_NUMOF
Number of naming schemes supported.
Initialization parameters of a DFPlayer Mini device descriptor.
@ DFPLAYER_SOURCE_FLASH
Read files from NOR flash.
uint16_t number
Number of the file (naming scheme "MP3/1337.mp3")
@ DFPLAYER_EQ_BASE
The "Base" equalizer setting.
@ DFPLAYER_STATE_PLAYING
Currently playing a file.
@ DFPLAYER_EQ_ROCK
The "Rock" equalizer setting.
@ DFPLAYER_MODE_NUMOF
Number of supported playback modes.
dfplayer_scheme_t scheme
Used naming scheme.
Mutex for thread synchronization.
Low-level GPIO peripheral driver interface definitions.
@ DFPLAYER_RX_STATE_NUMOF
Number of RX states.
@ DFPLAYER_SOURCE_SDCARD
Read files from SD card.
uint32_t last_event_us
Time stamp of the last event in µs.
void(* dfplayer_cb_src_t)(dfplayer_t *dev, dfplayer_source_set_t srcs)
Signature of the function called when a medium was inserted/ejected.
uint8_t file
Name of the file (naming scheme "42/123.mp3")
void(* dfplayer_cb_done_t)(dfplayer_t *dev, dfplayer_source_t src, uint16_t track)
Signature of the function called when a playback of track completed.
uint8_t folder
Folder of the file (naming scheme "42/123.mp3")
mutex_t sync
Used to wait on ISR.
@ DFPLAYER_RX_STATE_DATA
Receiving data.
uint8_t volume
Initial volume.
uint8_t flags
Flags storing info about the driver state.
dfplayer_source_set_t srcs
Set of available playback sources.
@ DFPLAYER_SCHEME_FOLDER_FILE
Naming scheme <folder>/<file>
gpio_t busy_pin
GPIO connected to the DFPlayer's busy pin.
@ DFPLAYER_STATE_NUMOF
Number of DFPlayer states supported by the driver.
@ DFPLAYER_EQ_POP
The "Pop" equalizer setting.
uart_t uart
UART interface connected to the DFPlayer.
@ DFPLAYER_STATE_PAUSED
Playback is paused, can be resumed.
@ DFPLAYER_SOURCE_USB
Read files from USB storage.
@ DFPLAYER_STATE_STOPPED
No file playing.
@ DFPLAYER_RX_STATE_VERSION
Waiting for version (0xff)
Data structure representing a file on the DFPlayer.
uint8_t dfplayer_source_set_t
Set of DFPlayer playback sources.
dfplayer_cb_src_t cb_src
Function to call when set of available playback sources changes.
Types used by the kernel.
uart_t uart
UART interface connected to the DFPlayer.
A DFPlayer Mini device descriptor.
@ DFPLAYER_SCHEME_MP3_FILE
Naming scheme MP3/<number>
dfplayer_scheme_t
Enumeration of the different naming schemes.