jonas-schievink / spi-memory

An embedded-hal driver for various SPI Flash and EEPROM chips
BSD Zero Clause License
23 stars 22 forks source link

Support more thorough device identification #16

Closed tstellanova closed 4 years ago

jonas-schievink commented 4 years ago

Thanks! Doesn't the meaning of the company ID code depend on the number of continuation bytes before it though?

tstellanova commented 4 years ago

Thanks! Doesn't the meaning of the company ID code depend on the number of continuation bytes before it though?

What we could do is handle this similar to the description here: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka14408.html as in, store a count of continuation codes (which indicates which bank the manufacturer's code is in). This could be a separate field in the Identification struct, and consumers of the API could check it if desired.

jonas-schievink commented 4 years ago

Yeah that sounds like a good idea then! I was thinking of removing this feature altogether (https://github.com/jonas-schievink/spi-memory/issues/6), but it seems like it has some uses, so if we can fix it and make it actually useful then even better.

jonas-schievink commented 4 years ago

For some reason the CI status doesn't show up here, but it's passing: https://travis-ci.org/github/jonas-schievink/spi-memory/builds/666952763

Thanks for the PR!