pub unsafe extern "C" fn flash_ex_op(
dev: *const device,
code: u16,
in_: usize,
out: *mut c_void,
) -> i32
Expand description
@brief Execute flash extended operation on given device
Besides of standard flash operations like write or erase, flash controllers also support additional features like write protection or readout protection. These features are not available in every flash controller, what’s more controllers can implement it in a different way.
It doesn’t make sense to add a separate flash API function for every flash controller feature, because it could be unique (supported on small number of flash controllers) or the API won’t be able to represent the same feature on every flash controller.
@param dev Flash device @param code Operation which will be executed on the device. @param in Pointer to input data used by operation. If operation doesn’t need any input data it could be NULL. @param out Pointer to operation output data. If operation doesn’t produce any output it could be NULL.
@retval 0 on success. @retval -ENOTSUP if given device doesn’t support extended operation. @retval -ENOSYS if support for extended operations is not enabled in Kconfig @retval negative value on extended operation errors.