@@ -15,39 +15,9 @@ To configure this class, please see our [BlockDevice configuration documentation
15
15
16
16
[ ![ 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 )
17
17
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 )
51
21
52
22
### Related content
53
23
0 commit comments