writedevice

Description:

Write bytes to a device specified by its s_device-struct. This function does not check any access-conflicts with other tasks thus it must not be called from user-space. User program-code may access devices through device-files over the open-function.

Function Prototype:

unsigned long k_writedevice (struct s_device * device, unsigned char * buffer, unsigned long buffersize, unsigned long offset);

Parameters:

device

A pointer to a struct of type s_device which represents the device to be accessed in memory. This struct is retrieved when opening a device with the getdevice-function.

buffer

A pointer to a buffer in memory with the data to be written.

buffersize

The size in bytes of the buffer.

offset

The offset of a blockdevice where the write-operation should start. (This parameter is ignored by character-devices).

Return Values:

Returns the count of bytes written from the device.


See also getdevice, readdevice