riot_sys

Function mtd_write

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

@brief Write data to a MTD device

@p addr + @p count must be inside a page boundary. @p addr can be anywhere but the buffer cannot overlap two pages.

Both parameters must be multiples of the device’s write size.

@param mtd the device to write to @param[in] src the buffer to write @param[in] addr the start address to write to @param[in] count the number of bytes to write

@retval 0 on success @retval <0 if an error occurred @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, or overlapping two pages @retval -EIO if I/O error occurred @retval -EINVAL if parameters are invalid (invalid alignment for instance)