Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

monitor SD Card insert #11533

Closed
holgerlembke started this conversation in Question - Community Help
Discussion options

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.

grafik

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!

You must be logged in to vote

Replies: 4 comments

Comment options

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.

You must be logged in to vote
0 replies
Comment options

Thanks for the fast and disappointing answer.

So no nice icon...

grafik

You must be logged in to vote
0 replies
Comment options

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.

You must be logged in to vote
0 replies
Comment options

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.)

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /