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

Method writeByte

SPIFlash.cpp:220–227  ·  view source on GitHub ↗

Write 1 byte to flash memory WARNING: you can only write to previously erased memory locations (see datasheet) use the block erase commands to first clear memory (write 0xFFs)

Source from the content-addressed store, hash-verified

218/// WARNING: you can only write to previously erased memory locations (see datasheet)
219/// use the block erase commands to first clear memory (write 0xFFs)
220void SPIFlash::writeByte(uint32_t addr, uint8_t byt) {
221 command(SPIFLASH_BYTEPAGEPROGRAM, true); // Byte/Page Program
222 SPI.transfer(addr >> 16);
223 SPI.transfer(addr >> 8);
224 SPI.transfer(addr);
225 SPI.transfer(byt);
226 unselect();
227}
228
229/// write multiple bytes to flash memory (up to 64K)
230/// WARNING: you can only write to previously erased memory locations (see datasheet)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected