Get the manufacturer and device ID bytes (as a short word)
| 114 | |
| 115 | /// Get the manufacturer and device ID bytes (as a short word) |
| 116 | uint16_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 |
nothing calls this directly
no outgoing calls
no test coverage detected