Changed from MCP23S17 to MCP23017. Lots of changes.

Doesn't really work because of timing stuff.
This commit is contained in:
2019-11-10 14:45:33 +01:00
parent 88655b543d
commit 2ea2ec479a
14 changed files with 423 additions and 156 deletions

View File

@ -4,7 +4,8 @@
#include <SD.h>
#include <list>
#include <map>
#include <MCP23S17/MCP23S17.h>
#include <Adafruit_MCP23017.h>
#include "spi_master.h"
#define SCI_MODE 0x00
#define SCI_STATUS 0x01
@ -23,11 +24,6 @@
#define SM_CANCEL 0x0008
#define SS_DO_NOT_JUMP 0x8000
#define XRESET PIN_VS1053_XRESET
#define DREQ PIN_VS1053_DREQ
#define XCS PIN_VS1053_XCS
#define XDCS PIN_VS1053_XDCS
class Player {
private:
enum state { uninitialized, idle, playing, stopping,
@ -81,10 +77,11 @@ private:
uint8_t _volume;
uint16_t _stop_delay;
uint32_t _skip_to;
MCP* _mcp;
Adafruit_MCP23017* _mcp;
SPIMaster* _spi;
unsigned long _stopped_at;
public:
Player(MCP* m);
Player(Adafruit_MCP23017* m, SPIMaster* s);
void vol_up();
void vol_down();
void track_next();