Loading...
Searching...
No Matches
dfplayer_types.h File Reference

Types used in the DFPlayer Mini Device Driver. More...

Detailed Description

Types used in the DFPlayer Mini Device Driver.

Author
Marian Buschsieweke maria.nosp@m.n.bu.nosp@m.schsi.nosp@m.ewek.nosp@m.e@ovg.nosp@m.u.de

Definition in file dfplayer_types.h.

#include <stdbool.h>
#include <stdint.h>
#include "mutex.h"
#include "periph/gpio.h"
#include "periph/uart.h"
+ Include dependency graph for dfplayer_types.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dfplayer_params_t
 Initialization parameters of a DFPlayer Mini device descriptor. More...
 
struct  dfplayer_file_t
 Data structure representing a file on the DFPlayer. More...
 
struct  dfplayer
 A DFPlayer Mini device descriptor. More...
 
enum  dfplayer_rx_state_t {
  DFPLAYER_RX_STATE_START , DFPLAYER_RX_STATE_VERSION , DFPLAYER_RX_STATE_LENGTH , DFPLAYER_RX_STATE_DATA ,
  DFPLAYER_RX_STATE_NUMOF
}
 Enumeration of the RX states of the DFPlayer driver. More...
 
enum  dfplayer_eq_t {
  DFPLAYER_EQ_NORMAL , DFPLAYER_EQ_POP , DFPLAYER_EQ_ROCK , DFPLAYER_EQ_JAZZ ,
  DFPLAYER_EQ_CLASSIC , DFPLAYER_EQ_BASE , DFPLAYER_EQ_NUMOF
}
 Enumeration of the equalizer settings supported by the DFPlayer. More...
 
enum  dfplayer_mode_t {
  DFPLAYER_MODE_UNKOWN , DFPLAYER_MODE_REPEAT_DIR , DFPLAYER_MODE_REPEAT , DFPLAYER_MODE_RANDOM ,
  DFPLAYER_MODE_NORMAL , DFPLAYER_MODE_NUMOF
}
 Enumeration of the playback modes supported by the DFPlayer. More...
 
enum  dfplayer_source_t {
  DFPLAYER_SOURCE_USB , DFPLAYER_SOURCE_SDCARD , DFPLAYER_SOURCE_AUX , DFPLAYER_SOURCE_SLEEP ,
  DFPLAYER_SOURCE_FLASH , DFPLAYER_SOURCE_NUMOF
}
 Enumeration of the different sources for playback supported. More...
 
enum  dfplayer_state_t { DFPLAYER_STATE_PLAYING , DFPLAYER_STATE_PAUSED , DFPLAYER_STATE_STOPPED , DFPLAYER_STATE_NUMOF }
 Enumeration of the detectable states of the DFPlayer. More...
 
enum  dfplayer_scheme_t { DFPLAYER_SCHEME_FOLDER_FILE , DFPLAYER_SCHEME_MP3_FILE , DFPLAYER_SCHEME_NUMOF }
 Enumeration of the different naming schemes. More...
 
typedef uint8_t dfplayer_source_set_t
 Set of DFPlayer playback sources.
 
typedef struct dfplayer dfplayer_t
 A DFPlayer Mini device descriptor.
 
typedef 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.
 
typedef void(* dfplayer_cb_src_t) (dfplayer_t *dev, dfplayer_source_set_t srcs)
 Signature of the function called when a medium was inserted/ejected.
 

Typedef Documentation

◆ dfplayer_cb_done_t

typedef 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.

Parameters
devDevice descriptor of the DFPlayer triggering the event
srcSource medium the track was played from
trackThe number of the track that was played
Warning
This function is called from interrupt context

Definition at line 119 of file dfplayer_types.h.

◆ dfplayer_cb_src_t

typedef void(* dfplayer_cb_src_t) (dfplayer_t *dev, dfplayer_source_set_t srcs)

Signature of the function called when a medium was inserted/ejected.

Parameters
devDevice descriptor of the DFPlayer triggering the event
srcsSet of sources currently available for playback
Warning
This function is called from interrupt context

Definition at line 130 of file dfplayer_types.h.

◆ dfplayer_source_set_t

typedef uint8_t dfplayer_source_set_t

Set of DFPlayer playback sources.

Definition at line 103 of file dfplayer_types.h.

◆ dfplayer_t

typedef struct dfplayer dfplayer_t

A DFPlayer Mini device descriptor.

Definition at line 108 of file dfplayer_types.h.

Enumeration Type Documentation

◆ dfplayer_eq_t

Enumeration of the equalizer settings supported by the DFPlayer.

Enumerator
DFPLAYER_EQ_NORMAL 

The "Normal" equalizer setting.

DFPLAYER_EQ_POP 

The "Pop" equalizer setting.

DFPLAYER_EQ_ROCK 

The "Rock" equalizer setting.

DFPLAYER_EQ_JAZZ 

The "Jazz" equalizer setting.

DFPLAYER_EQ_CLASSIC 

The "Classic" equalizer setting.

DFPLAYER_EQ_BASE 

The "Base" equalizer setting.

DFPLAYER_EQ_NUMOF 

Number of supported equalizer settings.

Definition at line 47 of file dfplayer_types.h.

◆ dfplayer_mode_t

Enumeration of the playback modes supported by the DFPlayer.

Enumerator
DFPLAYER_MODE_UNKOWN 

No idea, the data sheet is vague.

DFPLAYER_MODE_REPEAT_DIR 

Repeating a directory.

DFPLAYER_MODE_REPEAT 

Repeating a single file.

DFPLAYER_MODE_RANDOM 

Playing all files in random order.

DFPLAYER_MODE_NORMAL 

Normal playback.

DFPLAYER_MODE_NUMOF 

Number of supported playback modes.

Definition at line 60 of file dfplayer_types.h.

◆ dfplayer_rx_state_t

Enumeration of the RX states of the DFPlayer driver.

Enumerator
DFPLAYER_RX_STATE_START 

Waiting for start symbol (0x7e)

DFPLAYER_RX_STATE_VERSION 

Waiting for version (0xff)

DFPLAYER_RX_STATE_LENGTH 

Waiting for length (0x06)

DFPLAYER_RX_STATE_DATA 

Receiving data.

DFPLAYER_RX_STATE_NUMOF 

Number of RX states.

Definition at line 36 of file dfplayer_types.h.

◆ dfplayer_scheme_t

Enumeration of the different naming schemes.

Enumerator
DFPLAYER_SCHEME_FOLDER_FILE 

Naming scheme <folder>/<file>

DFPLAYER_SCHEME_MP3_FILE 

Naming scheme MP3/<number>

DFPLAYER_SCHEME_NUMOF 

Number of naming schemes supported.

Definition at line 94 of file dfplayer_types.h.

◆ dfplayer_source_t

Enumeration of the different sources for playback supported.

Enumerator
DFPLAYER_SOURCE_USB 

Read files from USB storage.

DFPLAYER_SOURCE_SDCARD 

Read files from SD card.

DFPLAYER_SOURCE_AUX 

No idea, the data sheet never mentions AUX again.

DFPLAYER_SOURCE_SLEEP 

No idea, the data sheet is extremely vague on this.

DFPLAYER_SOURCE_FLASH 

Read files from NOR flash.

DFPLAYER_SOURCE_NUMOF 

Number of supported playback modes.

Definition at line 72 of file dfplayer_types.h.

◆ dfplayer_state_t

Enumeration of the detectable states of the DFPlayer.

Enumerator
DFPLAYER_STATE_PLAYING 

Currently playing a file.

DFPLAYER_STATE_PAUSED 

Playback is paused, can be resumed.

DFPLAYER_STATE_STOPPED 

No file playing.

DFPLAYER_STATE_NUMOF 

Number of DFPlayer states supported by the driver.

Definition at line 84 of file dfplayer_types.h.