27 static const uint8_t BufferLength = 10;
28 static const uint8_t MinimumTimeMs = 20;
29 static const uint8_t ResponseTimeoutMs = 20;
32 static const uint8_t PacketOffsetCmd = 3;
33 static const uint8_t PacketOffsetArg = 5;
34 static const uint8_t PacketOffsetCkSum = 7;
87 void begin(
bool bootWait=
true);
133 void copyBigend(uint8_t *thebuf, uint16_t data);
135 uint16_t calculateChecksum(uint8_t *thebuf);
140 const uint8_t _busyPin;
141 uint8_t _sendBuf[BufferLength];
142 uint32_t _lastCmdSent;
DFPlayerMini(Stream &serial, const uint8_t busyPin=0)
Play track arg from (SD card)
Enter low power sleep mode.
Indicates broken serial comms.
DFPResponse query(Cmd cmd, uint8_t tries=3)
Get file current Flash [No response].
Messaged received and is valid.
void sendCmd(Cmd cmd, uint16_t arg=0)
Get some meaningless status code.
Set when we start receiving, should not remain at end.
Set device, arg 1-5 (U, SD, AUX, SLEEP, FLASH)
Set EQ, arg 0-5 (normal=0, pop, rock, jazz, classical, bass)
Loop track arg = boolean !state.
Response was not validated (bad cksum, header etc)
Message timed out (DFPlayerMini::ResponseTimeoutMs ms passed)
void begin(bool bootWait=true)