greiman / SdFat

Arduino FAT16/FAT32 exFAT Library
MIT License
1.08k stars 505 forks source link

CS as a function? #154

Open kostuch opened 5 years ago

kostuch commented 5 years ago

Hi, Not an issue, but rather question. I have a device based on ESP8266 where I use I2C expander PCF8575 to have more I/O. CS_PIN input of SDCard reader is connected to one of expander output. I can set/reset this pin calling functions in PCF library. But I can not use direct digitalWrite(CS_PIN), as this is pad on the external chip. I wonder if it possible to hook an external function (via callback maybe?) to allow different initialization and CS manipulation. I did it some time ago, but it was very dirty hack and I lost my sources during upgrade.

Regards

greiman commented 5 years ago

I suspect you could make it work.

Be aware that I will soon release SdFat-beta as SdFat V 2.0. It has different internals.

kostuch commented 5 years ago

OK, so I'll wait for a new release, then I'll try to implement it in more elegant way than before.