Skip to content

Commit 078d7bc

Browse files
author
Amanda Butler
authored
Merge pull request #913 from juhaylinen/flashiap-example
Move the FlashIAPBlockDevice example to an external repo
2 parents 594a87d + 590aac3 commit 078d7bc

File tree

1 file changed

+3
-33
lines changed

1 file changed

+3
-33
lines changed

docs/api/storage/FlashIAPBlockDevice.md

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,39 +15,9 @@ To configure this class, please see our [BlockDevice configuration documentation
1515

1616
[![View code](https://www.mbed.com/embed/?type=library)](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_flash_i_a_p_block_device.html)
1717

18-
### FlashIAPBlockDevicesBlockDevice example:
19-
20-
``` cpp TODO
21-
#include "mbed.h"
22-
#include "FlashIAPBlockDevice.h"
23-
24-
// Create flash block device.
25-
FlashIAPBlockDevice bd;
26-
27-
int main() {
28-
printf("FlashIAPBlockDevice test\n");
29-
30-
// Initialize the FLASHIAP device and print the memory layout
31-
bd.init();
32-
printf("Flash block device size: %llu\n", bd.size());
33-
printf("Flash block device read size: %llu\n", bd.get_read_size());
34-
printf("Flash block device program size: %llu\n", bd.get_program_size());
35-
printf("Flash block device erase size: %llu\n", bd.get_erase_size());
36-
37-
// Write "Hello World!" to the first block
38-
char *buffer = (char*)malloc(bd.get_erase_size());
39-
sprintf(buffer, "Hello World!\n");
40-
bd.erase(0, bd.get_erase_size());
41-
bd.program(buffer, 0, bd.get_erase_size());
42-
43-
// Read back what was stored
44-
bd.read(buffer, 0, bd.get_erase_size());
45-
printf("%s", buffer);
46-
47-
// Deinitialize the device
48-
bd.deinit();
49-
}
50-
```
18+
### FlashIAPBlockDevice example
19+
20+
[![View code](https://www.mbed.com/embed/?url=https://github.com/ARMmbed/mbed-os-examples-docs_only/blob/master/blockdevices/FlashIAPBlockDevice/)](https://github.com/ARMmbed/mbed-os-examples-docs_only/blob/master/blockdevices/FlashIAPBlockDevice/main.cpp)
5121

5222
### Related content
5323

0 commit comments

Comments
 (0)