mirror of https://github.com/ARMmbed/mbed-os.git
Some Doxygen fixes in MBRBlockDevice and BlockDevice
parent
c27dabe765
commit
7dde6773f9
|
@ -91,7 +91,7 @@ public:
|
||||||
* @param buffer Buffer to write blocks to
|
* @param buffer Buffer to write blocks to
|
||||||
* @param addr Address of block to begin reading from
|
* @param addr Address of block to begin reading from
|
||||||
* @param size Size to read in bytes, must be a multiple of read block size
|
* @param size Size to read in bytes, must be a multiple of read block size
|
||||||
* @return 0 on success, negative error code on failure
|
* @return 0 on success or a negative error code on failure
|
||||||
*/
|
*/
|
||||||
virtual int read(void *buffer, bd_addr_t addr, bd_size_t size) = 0;
|
virtual int read(void *buffer, bd_addr_t addr, bd_size_t size) = 0;
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ public:
|
||||||
* @param buffer Buffer of data to write to blocks
|
* @param buffer Buffer of data to write to blocks
|
||||||
* @param addr Address of block to begin writing to
|
* @param addr Address of block to begin writing to
|
||||||
* @param size Size to write in bytes, must be a multiple of program block size
|
* @param size Size to write in bytes, must be a multiple of program block size
|
||||||
* @return 0 on success, negative error code on failure
|
* @return 0 on success or a negative error code on failure
|
||||||
*/
|
*/
|
||||||
virtual int program(const void *buffer, bd_addr_t addr, bd_size_t size) = 0;
|
virtual int program(const void *buffer, bd_addr_t addr, bd_size_t size) = 0;
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ public:
|
||||||
*
|
*
|
||||||
* @param addr Address of block to begin erasing
|
* @param addr Address of block to begin erasing
|
||||||
* @param size Size to erase in bytes, must be a multiple of erase block size
|
* @param size Size to erase in bytes, must be a multiple of erase block size
|
||||||
* @return 0 on success, negative error code on failure
|
* @return 0 on success or a negative error code on failure
|
||||||
*/
|
*/
|
||||||
virtual int erase(bd_addr_t addr, bd_size_t size)
|
virtual int erase(bd_addr_t addr, bd_size_t size)
|
||||||
{
|
{
|
||||||
|
@ -131,7 +131,7 @@ public:
|
||||||
*
|
*
|
||||||
* @param addr Address of block to mark as unused
|
* @param addr Address of block to mark as unused
|
||||||
* @param size Size to mark as unused in bytes, must be a multiple of erase block size
|
* @param size Size to mark as unused in bytes, must be a multiple of erase block size
|
||||||
* @return 0 on success, negative error code on failure
|
* @return 0 on success or a negative error code on failure
|
||||||
*/
|
*/
|
||||||
virtual int trim(bd_addr_t addr, bd_size_t size)
|
virtual int trim(bd_addr_t addr, bd_size_t size)
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,52 +41,6 @@ enum {
|
||||||
/** Block device for managing a Master Boot Record
|
/** Block device for managing a Master Boot Record
|
||||||
* https://en.wikipedia.org/wiki/Master_boot_record
|
* https://en.wikipedia.org/wiki/Master_boot_record
|
||||||
*
|
*
|
||||||
* Here is an example of partitioning a heap backed block device
|
|
||||||
* @code
|
|
||||||
* #include "mbed.h"
|
|
||||||
* #include "HeapBlockDevice.h"
|
|
||||||
* #include "MBRBlockDevice.h"
|
|
||||||
*
|
|
||||||
* // Create a block device with 64 blocks of size 512
|
|
||||||
* HeapBlockDevice mem(64*512, 512);
|
|
||||||
*
|
|
||||||
* // Partition into two partitions with ~half the blocks
|
|
||||||
* MBRBlockDevice::partition(&mem, 1, 0x83, 0*512, 32*512);
|
|
||||||
* MBRBlockDevice::partition(&mem, 2, 0x83, 32*512);
|
|
||||||
*
|
|
||||||
* // Create a block device that maps to the first 32 blocks (excluding MBR block)
|
|
||||||
* MBRBlockDevice part1(&mem, 1);
|
|
||||||
*
|
|
||||||
* // Create a block device that maps to the last 32 blocks
|
|
||||||
* MBRBlockDevice part2(&mem, 2);
|
|
||||||
* @endcode
|
|
||||||
*
|
|
||||||
* Here is a more realistic example where the MBRBlockDevice is used
|
|
||||||
* to partition a region of space on an SD card. When plugged into a computer,
|
|
||||||
* the partitions will be recognized appropriately.
|
|
||||||
* @code
|
|
||||||
* #include "mbed.h"
|
|
||||||
* #include "SDBlockDevice.h"
|
|
||||||
* #include "MBRBlockDevice.h"
|
|
||||||
* #include "FATFileSystem.h"
|
|
||||||
*
|
|
||||||
* // Create an SD card
|
|
||||||
* SDBlockDevice sd(s0, s1, s2, s3);
|
|
||||||
*
|
|
||||||
* // Create a partition with 1 GB of space
|
|
||||||
* MBRBlockDevice::partition(&sd, 1, 0x83, 0, 1024*1024);
|
|
||||||
*
|
|
||||||
* // Create the block device that represents the partition
|
|
||||||
* MBRBlockDevice part1(&sd, 1);
|
|
||||||
*
|
|
||||||
* // Format the partition with a FAT filesystem
|
|
||||||
* FATFileSystem::format(&part1);
|
|
||||||
*
|
|
||||||
* // Create the FAT filesystem instance, files can now be written to
|
|
||||||
* // the FAT filesystem in partition 1
|
|
||||||
* FATFileSystem fat("fat", &part1);
|
|
||||||
* @endcode
|
|
||||||
*
|
|
||||||
* @note
|
* @note
|
||||||
* The MBR partition table is relatively limited:
|
* The MBR partition table is relatively limited:
|
||||||
* - At most 4 partitions are supported
|
* - At most 4 partitions are supported
|
||||||
|
@ -98,7 +52,7 @@ public:
|
||||||
*
|
*
|
||||||
* @param bd Block device to partition
|
* @param bd Block device to partition
|
||||||
* @param part Partition to use, 1-4
|
* @param part Partition to use, 1-4
|
||||||
* @param type 8-bit partition type to identitfy partition's contents
|
* @param type 8-bit partition type to identify partition's contents
|
||||||
* @param start Start block address to map to block 0 of partition,
|
* @param start Start block address to map to block 0 of partition,
|
||||||
* negative addresses are calculated from the end of the
|
* negative addresses are calculated from the end of the
|
||||||
* underlying block devices. Block 0 is implicitly ignored
|
* underlying block devices. Block 0 is implicitly ignored
|
||||||
|
@ -112,7 +66,7 @@ public:
|
||||||
*
|
*
|
||||||
* @param bd Block device to partition
|
* @param bd Block device to partition
|
||||||
* @param part Partition to use, 1-4
|
* @param part Partition to use, 1-4
|
||||||
* @param type 8-bit partition type to identitfy partition's contents
|
* @param type 8-bit partition type to identify partition's contents
|
||||||
* @param start Start block address to map to block 0 of partition,
|
* @param start Start block address to map to block 0 of partition,
|
||||||
* negative addresses are calculated from the end of the
|
* negative addresses are calculated from the end of the
|
||||||
* underlying block devices. Block 0 is implicitly ignored
|
* underlying block devices. Block 0 is implicitly ignored
|
||||||
|
@ -158,7 +112,7 @@ public:
|
||||||
* @param buffer Buffer to read blocks into
|
* @param buffer Buffer to read blocks into
|
||||||
* @param addr Address of block to begin reading from
|
* @param addr Address of block to begin reading from
|
||||||
* @param size Size to read in bytes, must be a multiple of read block size
|
* @param size Size to read in bytes, must be a multiple of read block size
|
||||||
* @return 0 on success, negative error code on failure
|
* @return 0 on success or a negative error code on failure
|
||||||
*/
|
*/
|
||||||
virtual int read(void *buffer, bd_addr_t addr, bd_size_t size);
|
virtual int read(void *buffer, bd_addr_t addr, bd_size_t size);
|
||||||
|
|
||||||
|
@ -169,7 +123,7 @@ public:
|
||||||
* @param buffer Buffer of data to write to blocks
|
* @param buffer Buffer of data to write to blocks
|
||||||
* @param addr Address of block to begin writing to
|
* @param addr Address of block to begin writing to
|
||||||
* @param size Size to write in bytes, must be a multiple of program block size
|
* @param size Size to write in bytes, must be a multiple of program block size
|
||||||
* @return 0 on success, negative error code on failure
|
* @return 0 on success or a negative error code on failure
|
||||||
*/
|
*/
|
||||||
virtual int program(const void *buffer, bd_addr_t addr, bd_size_t size);
|
virtual int program(const void *buffer, bd_addr_t addr, bd_size_t size);
|
||||||
|
|
||||||
|
@ -180,7 +134,7 @@ public:
|
||||||
*
|
*
|
||||||
* @param addr Address of block to begin erasing
|
* @param addr Address of block to begin erasing
|
||||||
* @param size Size to erase in bytes, must be a multiple of erase block size
|
* @param size Size to erase in bytes, must be a multiple of erase block size
|
||||||
* @return 0 on success, negative error code on failure
|
* @return 0 on success or a negative error code on failure
|
||||||
*/
|
*/
|
||||||
virtual int erase(bd_addr_t addr, bd_size_t size);
|
virtual int erase(bd_addr_t addr, bd_size_t size);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue