MCPcopy Create free account
hub / github.com/LowPowerLab/SPIFlash / readDeviceId

Method readDeviceId

SPIFlash.cpp:116–128  ·  view source on GitHub ↗

Get the manufacturer and device ID bytes (as a short word)

Source from the content-addressed store, hash-verified

114
115/// Get the manufacturer and device ID bytes (as a short word)
116uint16_t SPIFlash::readDeviceId()
117{
118#if defined(__AVR_ATmega32U4__) // Arduino Leonardo, MoteinoLeo
119 command(SPIFLASH_IDREAD); // Read JEDEC ID
120#else
121 select();
122 SPI.transfer(SPIFLASH_IDREAD);
123#endif
124 uint16_t jedecid = SPI.transfer(0) << 8;
125 jedecid |= SPI.transfer(0);
126 unselect();
127 return jedecid;
128}
129
130/// Get the 64 bit unique identifier, stores it in UNIQUEID[8]. Only needs to be called once, ie after initialize
131/// Returns the byte pointer to the UNIQUEID byte array

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected