read unlimited # of bytes
| 159 | |
| 160 | /// read unlimited # of bytes |
| 161 | void SPIFlash::readBytes(uint32_t addr, void* buf, uint16_t len) { |
| 162 | command(SPIFLASH_ARRAYREAD); |
| 163 | SPI.transfer(addr >> 16); |
| 164 | SPI.transfer(addr >> 8); |
| 165 | SPI.transfer(addr); |
| 166 | SPI.transfer(0); //"dont care" |
| 167 | for (uint16_t i = 0; i < len; ++i) |
| 168 | ((uint8_t*) buf)[i] = SPI.transfer(0); |
| 169 | unselect(); |
| 170 | } |
| 171 | |
| 172 | /// Send a command to the flash chip, pass TRUE for isWrite when its a write command |
| 173 | void SPIFlash::command(uint8_t cmd, boolean isWrite){ |
nothing calls this directly
no outgoing calls
no test coverage detected