-
Couldn't load subscription status.
- Fork 7.7k
monitor SD Card insert #11533
-
Moin.
I'm playing around with the WaveShare ESP32-S3 1.8inch AMOLED Touch Display Development Board. It is a nice little thingy, just saying if you have 40ドル on hand.
I want to monitor the SD Card insert/remove event. Sadly, the SD slot has not wired the CD signal.
I tried playing around with "SD_MMC.begin()" to see if a card is inserted and "SD_MMC.readRAW()" to see if it has been removed, but that does not feel right (much to high level).
Any idea how to monitor the insert/remove event more on the low level side?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 4 comments
-
There is no way to currently do that. Maybe @P-R-O-C-H-Y can think of a way to detect that card is missing when attempted to be accessed, or some way to confirm that is in the slot, but we have not implemented anything of the sort yet.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi @holgerlembke, I guess there is not much more to do other the check return of SD_MMC.begin() and try to read something. You can use the exists method on ten root of the sd. So if the card was mounted and the exists fails, the card is no longer mounted. Of course having the CardDetect pin available and connencted to GPIO would be the best solution, as you can also have interrupts on that.
Beta Was this translation helpful? Give feedback.
All reactions
-
Oh, exists(), I'll try that.
Still, looks ugly. https://github.com/holgerlembke/WaveShareFrameWork/blob/ca6b3e3e696ac101829f765227e0d3fe8638217b/FFsRtc.ino#L20
For the WaveShare ESP32-S3 1.8inch AMOLED: they already have added a port extender because no free gpio... TCA9554/8-bit is fully used for important stuff.
(I dont really see why they routed the RTC IRQ to the TCA9554, because, well, the TCA has no IRQ routed so the RTC hardware IRQ will end there. What could I archive with that IRQ if I need to read it from the TCA? A wake up event could be better done in software. But what do I know.)
Beta Was this translation helpful? Give feedback.