ESP32-vs1053_ext icon indicating copy to clipboard operation
ESP32-vs1053_ext copied to clipboard

Access of GPIO > 31

Open tcfkat opened this issue 4 years ago • 0 comments

You said that accessing GPIO > 31 for (D)CS is not possible ... yes, it is. I changed the lines in vs1053_ext.h:

`protected: // Expandend beyond GPIO32. tcfkat 20210222

inline void DCS_HIGH() {(dcs_pin&0x20)?(GPIO.out1_w1ts.data=1<<(dcs_pin-32)):(GPIO.out_w1ts=1<<dcs_pin);}

inline void DCS_LOW() {(dcs_pin&0x20)?(GPIO.out1_w1tc.data=1<<(dcs_pin-32)):(GPIO.out_w1tc=1<<dcs_pin);}

inline void CS_HIGH() {(cs_pin&0x20)?(GPIO.out1_w1ts.data=1<<(cs_pin-32)):(GPIO.out_w1ts=1<<cs_pin);}

inline void CS_LOW() {(cs_pin&0x20)?(GPIO.out1_w1tc.data=1<<(cs_pin-32)):(GPIO.out_w1tc=1<<cs_pin);}`

And in vs1053_ext.cpp:

`void VS1053::begin(){

pinMode(dreq_pin, INPUT); // DREQ is an input

pinMode(cs_pin, OUTPUT); // The SCI and SDI signals

pinMode(dcs_pin, OUTPUT);

DCS_HIGH(); //Does not work for me: digitalWrite(dcs_pin, HIGH); tcfkat 20210221

CS_HIGH(); //Does not work for me: digitalWrite(cs_pin, HIGH); tcfkat 20210221`

Best regards

tcfkat avatar Feb 22 '21 21:02 tcfkat