Closed huntc closed 3 years ago
https://github.com/titanclass/thingy91-lorawan-nbiot/pull/2/commits/4a9f6730e329758f4bc7a78be3f221466cbcfb81 shows the positive impact of this abstraction.
@jonas-schievink @Dirbaio We now have tests for the NVMC via nRF52840-hal-tests, and things appear to be working! I want to go through things finely before converting from a draft PR, and write an example. I also want to do some boundary checks via my tests. Your feedback is appreciated!
This PR is complete and ready for a thorough review.
bors r+
The embedded-storage traits are implemented to provide a higher-level abstraction for reading and writing from/to flash storage. In the first instance, support is provided for the nRF52 boards and the nRF9160, but other boards should be relatively easy to support if required in the future.
Sample usage of writing to flash given some 32 bit aligned slice of bytes:
An example of establishing the
Nvmc
on the nRF9160:...where CONFIG points to flash:
...which can be expressed in a memory layout:
Testing on the nRF52840 device can be achieved via
cargo test --test nvmc
from within thenrf52840-hal-tests
folder.Fixes #336
TODO:
ReadNorFlash
methodsNorFlash
methodsInstance
for the nRF52840Instance
for the nRF9160