|
wiced_result_t(* | init )(wiced_block_device_t *device, wiced_block_device_write_mode_t write_mode) |
| Initialises the block device. More...
|
|
wiced_result_t(* | deinit )(wiced_block_device_t *device) |
| De-initialises the block device. More...
|
|
wiced_result_t(* | erase )(wiced_block_device_t *device, uint32_t start_address, uint32_t size) |
| Erases a block on the device. More...
|
|
wiced_result_t(* | write )(wiced_block_device_t *device, uint32_t start_address, const uint8_t *data, uint32_t size) |
| Writes data to the device. More...
|
|
wiced_result_t(* | flush )(wiced_block_device_t *device) |
| Flushes data to the device. More...
|
|
wiced_result_t(* | read )(wiced_block_device_t *device, uint32_t start_address, uint8_t *data, uint32_t size) |
| Reads data from the device. More...
|
|
wiced_result_t(* | status )(wiced_block_device_t *device, wiced_block_device_status_t *status) |
| Get the current status of the device. More...
|
|
wiced_result_t(* | register_callback )(wiced_block_device_t *device, wiced_block_device_status_change_callback_t callback) |
| Register a callback which the device will call when there is a status change. More...
|
|
De-initialises the block device.
Must have been previously initialized with the "init" function
- Parameters
-
[in] | device | - The block device to de-initialize |
- Returns
- WICED_SUCCESS on success
Erases a block on the device.
This function may not be implemented, so you MUST check whether it is NULL before using it.
- Parameters
-
[in] | device | - The device on which to erase |
[in] | start_address | - The start address - must be located on the start of a erase block boundary |
[in] | size | - The number of bytes to erase - must match the size of a whole number of erase blocks |
- Returns
- WICED_SUCCESS on success, Error on failure or if start/end are not on an erase block boundary
Flushes data to the device.
This function may not be implemented, so you MUST check whether it is NULL before using it.
If write_behind == BLOCK_DEVICE_WRITE_BEHIND_ALLOWED then this will write any pending data to the device before returning
- Parameters
-
[in] | device | - The device to flush |
- Returns
- WICED_SUCCESS on success, Error on failure or if start/end are not on an write block boundary
Initialises the block device.
This must be run before accessing any of the other driver functions or any of the structure variables, except those in init_data.
- Parameters
-
[in] | device | - The block device to initialize - elements init_data, driver and device_specific_data must be valid. |
[in] | write_mode | - Determines whether write is allowed, and whether write-behind is allowed |
- Returns
- WICED_SUCCESS on success
Reads data from the device.
- Parameters
-
[in] | device | - The device from which to read |
[in] | start_address | - The start address - must be located on the start of a read block boundary |
[out] | data | - The buffer which will receive the data |
[in] | size | - The number of bytes to read - must match the size of a whole number of read blocks |
- Returns
- WICED_SUCCESS on success, Error on failure or if start/end are not on an read block boundary
Register a callback which the device will call when there is a status change.
- Parameters
-
[in] | device | - The device to query |
[in] | callback | - The callback function |
- Returns
- WICED_SUCCESS on success, Error on failure or if start/end are not on an read block boundary
Get the current status of the device.
- Parameters
-
[in] | device | - The device to query |
[out] | status | - Variable which receives the status |
- Returns
- WICED_SUCCESS on success, Error on failure or if start/end are not on an read block boundary
Writes data to the device.
Check whether device requires erasing via the erase_block_size element. If erasing is required, it must be done before writing.
write_behind == BLOCK_DEVICE_WRITE_BEHIND_ALLOWED then this may return immediately with data in write queue
- Parameters
-
[in] | device | - The device to which to write |
[in] | start_address | - The start address - must be located on the start of a write block boundary |
[in] | data | - The buffer containing the data to write |
[in] | size | - The number of bytes to write - must match the size of a whole number of write blocks |
- Returns
- WICED_SUCCESS on success, Error on failure or if start/end are not on an write block boundary
The documentation for this struct was generated from the following file: