Enum Command

Source
#[repr(u8)]
pub enum Command {
Show 48 variants Next = 1, Previous = 2, PlayTrack = 3, VolumeUp = 4, VolumeDown = 5, SetVolume = 6, SetEQ = 7, PlayLoopTrack = 8, SetPlaybackSource = 9, EnterSleepMode = 10, EnterNormalMode = 11, Reset = 12, Play = 13, Pause = 14, PlayTrackInFolder = 15, ConfigAudioAmp = 16, PlayLoopAll = 17, PlayTrackInMp3Folder = 18, StartAdvertisement = 19, PlayTrackLargeFolder = 20, StopAdvertisement = 21, Stop = 22, PlayLoopFolder = 23, PlayRandom = 24, LoopCurrentTrack = 25, SetDAC = 26, NotifyPushMedia = 58, NotifyPullOutMedia = 59, NotifyFinishTrackUSBFlash = 60, NotifyFinishTrackSD = 61, NotifyFinishTrackUSBHost = 62, QueryAvailableSources = 63, NotifyError = 64, NotifyReply = 65, QueryStatus = 66, QueryVolume = 67, QueryEQ = 68, ReservedQueryPlaybackMode = 69, ReservedQuerySwVersion = 70, QueryTrackCntUSB = 71, QueryTrackCntSD = 72, ReservedQueryTrackCntPC = 73, ReservedQueryKeepOn = 74, QueryCurrentTrackUSBFlash = 75, QueryCurrentTrackSD = 76, QueryCurrentTrackUSBHost = 77, QueryFolderTrackCnt = 78, QueryFolderCnt = 79,
}
Expand description

Commands supported by the DFPlayer module

Variants§

§

Next = 1

Play next file

§

Previous = 2

Play previous file

§

PlayTrack = 3

Specify Track number to play (1-2999)

§

VolumeUp = 4

Increase Volume

§

VolumeDown = 5

Decrease Volume

§

SetVolume = 6

Set specific volume value, 0-30

§

SetEQ = 7

Select equalizer

§

PlayLoopTrack = 8

Select track to play in loop

§

SetPlaybackSource = 9

Select the Playback source (USDB/SD)

§

EnterSleepMode = 10

Enter Sleep/StandBy Mode

§

EnterNormalMode = 11

Normal mode per DFRobot, but it’s reported it does nothing

§

Reset = 12

Reset the device

§

Play = 13

Start Playback

§

Pause = 14

Pause Current Playback

§

PlayTrackInFolder = 15

Specify Track to play in a folder, 99 folders 255 tracks each max

§

ConfigAudioAmp = 16

Configure the audio amplifier gain settings, MSB enables amp, LS sets gain 0-31

§

PlayLoopAll = 17

Play all tracks in a loop

§

PlayTrackInMp3Folder = 18

Play track number in MP3 folder, max 65536 tracks, 3000 recommended max

§

StartAdvertisement = 19

Play track number in ADVERT folder, max 3000 tracks

§

PlayTrackLargeFolder = 20

Play track of large folder, 1-3000 valid names

§

StopAdvertisement = 21

Stop playing ADVERT track if one is active

§

Stop = 22

Stop all playback including advertisement

§

PlayLoopFolder = 23

Play tracks from a folder on repeat, max 99 folders, 255 files each

§

PlayRandom = 24

Play random tracks from all media available in the current source

§

LoopCurrentTrack = 25

If a track is playing, control loop playback enable (0x1 enable, 0x0 disable)

§

SetDAC = 26

Control whether the DAC is powered on or off

§

NotifyPushMedia = 58

Only sent by module when media is connected

§

NotifyPullOutMedia = 59

Only sent by module when media is removed

§

NotifyFinishTrackUSBFlash = 60

Only sent by module when track in USB Flash finished playing

§

NotifyFinishTrackSD = 61

Only sent by module when track in SD card finished playing

§

NotifyFinishTrackUSBHost = 62

Only sent by module when track in USB Host link stopped playing

§

QueryAvailableSources = 63

List the available sources. For the DFPlayer Mini, it’s essentially only the SD card

§

NotifyError = 64

Only sent by module when an error occurs

§

NotifyReply = 65

Sent as ACK response when feedback is enabled

§

QueryStatus = 66

Returns status of module

§

QueryVolume = 67

Returns current volume setting

§

QueryEQ = 68

Returns current EQ setting

§

ReservedQueryPlaybackMode = 69

Returns current playback mode

§

ReservedQuerySwVersion = 70

Returns software version

§

QueryTrackCntUSB = 71

Returns number of tracks on USB storage

§

QueryTrackCntSD = 72

Returns number of tracks on SD card

§

ReservedQueryTrackCntPC = 73

Returns number of tracks on PC

§

ReservedQueryKeepOn = 74

Query the keep-on setting

§

QueryCurrentTrackUSBFlash = 75

Returns current track number on USB flash

§

QueryCurrentTrackSD = 76

Returns current track number on SD card

§

QueryCurrentTrackUSBHost = 77

Returns current track number on USB host

§

QueryFolderTrackCnt = 78

Returns number of tracks in current folder

§

QueryFolderCnt = 79

Returns number of folders available

Trait Implementations§

Source§

impl Clone for Command

Source§

fn clone(&self) -> Command

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Command

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Command

Source§

fn eq(&self, other: &Command) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<u8> for Command

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: u8) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Copy for Command

Source§

impl StructuralPartialEq for Command

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.