Skip to content

Commit

Permalink
docu: add poll for WIP finish in example
Browse files Browse the repository at this point in the history
  • Loading branch information
akaeba committed Apr 1, 2023
1 parent 10e9ae7 commit 6f807c6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ world application would be sent this SPI packet to the physically SPI core inste
### Limits

* No timing behavior
* emulated with [WIP](https://github.com/akaeba/spi_flash_model/blob/main/spi_flash_model.h#L32) poll constant


## Releases
Expand Down Expand Up @@ -149,6 +150,12 @@ int main ()
spi[8] = 0x89;
spi[9] = 0xAB;
sfm (&spiFlash, spi, 10); // access flash model
// poll for WIP
for ( uint8_t i = 0; i < SFM_WIP_RETRY_IDLE; i++ ) {
spiLen = 2;
spi[0] = 0x05;
sfm(&spiFlash, spi, spiLen); // read state reg, needed for WIP poll
}

/* dump current flash content to check write */
sfm_dump (&spiFlash, 0x0, 0x10);
Expand Down

0 comments on commit 6f807c6

Please sign in to comment.