Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
|
Disk Access APIs . More...
Functions | |
int | disk_access_init (const char *pdrv) |
perform any initialization | |
int | disk_access_status (const char *pdrv) |
Get the status of disk. | |
int | disk_access_read (const char *pdrv, uint8_t *data_buf, uint32_t start_sector, uint32_t num_sector) |
read data from disk | |
int | disk_access_write (const char *pdrv, const uint8_t *data_buf, uint32_t start_sector, uint32_t num_sector) |
write data to disk | |
int | disk_access_ioctl (const char *pdrv, uint8_t cmd, void *buff) |
Get/Configure disk parameters. | |
Disk Access APIs .
int disk_access_init | ( | const char * | pdrv | ) |
#include <zephyr/storage/disk_access.h>
perform any initialization
This call is made by the consumer before doing any IO calls so that the disk or the backing device can do any initialization. Although still supported for legacy compatibility, users should instead call disk_access_ioctl with the IOCTL DISK_IOCTL_CTRL_INIT.
Disk initialization is reference counted, so only the first successful call to initialize a uninitialized (or previously de-initialized) disk will actually initialize the disk
[in] | pdrv | Disk name |
int disk_access_ioctl | ( | const char * | pdrv, |
uint8_t | cmd, | ||
void * | buff ) |
#include <zephyr/storage/disk_access.h>
Get/Configure disk parameters.
Function to get disk parameters and make any special device requests.
[in] | pdrv | Disk name |
[in] | cmd | DISK_IOCTL_* code describing the request |
[in] | buff | Command data buffer |
int disk_access_read | ( | const char * | pdrv, |
uint8_t * | data_buf, | ||
uint32_t | start_sector, | ||
uint32_t | num_sector ) |
#include <zephyr/storage/disk_access.h>
read data from disk
Function to read data from disk to a memory buffer.
Note: if he disk is of NVMe type, user will need to ensure data_buf pointer is 4-bytes aligned.
[in] | pdrv | Disk name |
[in] | data_buf | Pointer to the memory buffer to put data. |
[in] | start_sector | Start disk sector to read from |
[in] | num_sector | Number of disk sectors to read |
int disk_access_status | ( | const char * | pdrv | ) |
#include <zephyr/storage/disk_access.h>
Get the status of disk.
This call is used to get the status of the disk
[in] | pdrv | Disk name |
int disk_access_write | ( | const char * | pdrv, |
const uint8_t * | data_buf, | ||
uint32_t | start_sector, | ||
uint32_t | num_sector ) |
#include <zephyr/storage/disk_access.h>
write data to disk
Function write data from memory buffer to disk.
Note: if he disk is of NVMe type, user will need to ensure data_buf pointer is 4-bytes aligned.
[in] | pdrv | Disk name |
[in] | data_buf | Pointer to the memory buffer |
[in] | start_sector | Start disk sector to write to |
[in] | num_sector | Number of disk sectors to write |