riot_sys::bindgen

Function mtd_write_sector

Source
pub unsafe extern "C" fn mtd_write_sector(
    mtd: *mut mtd_dev_t,
    src: *const c_void,
    sector: u32,
    num: u32,
) -> c_int
Expand description

@brief Write data to a MTD device with whole sector writes

The MTD layer will take care of splitting up the transaction into multiple writes if it is required by the underlying storage media.

The sectors will be erased before writing if needed.

@param mtd Device to write to @param[in] src Buffer to write @param[in] sector Sector number to start writing to @param[in] num Number of sectors to write

@retval 0 on success @retval <0 value on error @retval -ENODEV if @p mtd is not a valid device @retval -ENOTSUP if operation is not supported on @p mtd @retval -EOVERFLOW if @p addr or @p count are not valid, i.e. outside memory, @retval -EIO if I/O error occurred @retval -EINVAL if parameters are invalid