You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/esp_blockdev/include/esp_blockdev.h
+49-36Lines changed: 49 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,6 @@
11
11
#include<stdarg.h>
12
12
#include<stdbool.h>
13
13
#include"esp_err.h"
14
-
#include"sdkconfig.h"
15
14
16
15
#ifdef__cplusplus
17
16
extern"C" {
@@ -28,34 +27,23 @@ extern "C" {
28
27
29
28
/**
30
29
* @brief Block device I/O control commands
30
+
*
31
+
* The commands are grouped into two categories: system and user.
32
+
* The system commands are used for internal device management and are not expected to be used by the user (values 0-127).
33
+
* The user commands are used for user-specific operations and are expected to be defined by the user (values 128-255).
31
34
*/
32
-
typedefenum {
33
-
ESP_BLOCKDEV_CMD_ERASE, /*!< perform device specific ERASE operation */
34
-
ESP_BLOCKDEV_CMD_TRIM, /*!< perform device specific TRIM operation */
35
-
ESP_BLOCKDEV_CMD_DISCARD, /*!< perform device specific DISCARD operation */
36
-
ESP_BLOCKDEV_CMD_SANITIZE, /*!< perform device specific SANITIZE operation */
37
-
ESP_BLOCKDEV_CMD_SECTOR_SIZE, /*!< get device sector size (not necessarily equal to specific block size) */
38
-
ESP_BLOCKDEV_CMD_DBG_INFO, /*!< get device debug information */
39
-
ESP_BLOCKDEV_CMD_STATISTICS/*!< get device operation statistics */
40
-
} esp_blockdev_ioctl_cmd_t;
35
+
36
+
#defineESP_BLOCKDEV_CMD_SYSTEM_BASE 0x00 /*!< System commands base value */
37
+
#defineESP_BLOCKDEV_CMD_USER_BASE 0x80 /*!< User commands base value */
38
+
39
+
#defineESP_BLOCKDEV_CMD_MARK_DELETED ESP_BLOCKDEV_CMD_SYSTEM_BASE /*!< mark given range as invalid, data to be deleted/overwritten eventually */
40
+
#defineESP_BLOCKDEV_CMD_ERASE_CONTENTS ESP_BLOCKDEV_CMD_SYSTEM_BASE + 1 /*!< erase required range and set the contents to the device's default bit values */
41
41
42
42
typedefstructesp_blockdev_cmd_arg_erase_t {
43
43
uint64_tstart_addr; /*!< IN - starting address of the disk space to erase/trim/discard/sanitize (in bytes), must be a multiple of erase block size */
44
44
size_terase_len; /*!< IN - size of the area to erase/trim/discard/sanitize (in bytes), must be a multiple of erase block size */
* This structure defines an interface for a generic block-device capable of common disk operations and providing properties important
210
+
* for the device's deployment into the target component stack.
211
+
*
212
+
* @note The device context pointer is used to store the device-specific context. It is not used by the BDL layer and is intended to be used by the device implementation.
213
+
* @note The ops pointer holds the address of the device operations structure which can be shared by multiple device instances of the same type (driver).
0 commit comments