Download DM5810/DM6810 Driver for Linux Driver Version 2.0.x User`s Manual

Transcript
IOCTL Interface:
None.
ReadByte6810
bool ReadByte6810(u_int8_t offset, u_int8_t *data_p);
Description:
Read an 8-bit value from the given offset within a DM6810 board's I/O memory.
NOTE:
It is strongly suggested that you use other library functions instead of directly
accessing a board's registers.
Parameters:
offset:
Offset within I/O memory to read.
data_p:
Address where data read should be stored. Nothing is written here if the
function fails.
Return Value:
true:
Success.
false:
Failure with errno set as follows:
EINVAL
offset is not valid.
EOPNOTSUPP
offset is valid but it represents a write-only register.
Please see the ioctl(2) man page for information on other possible values
errno may have in this case.
IOCTL Interface:
dm6810_ioctl_argument_t ioctl_request;
int file_descriptor;
int status;
/*
* Before calling ioctl(), file_descriptor must be set up.
* here.
*/
This is not shown
/*
* Read the IRQ Status Register at base I/O address + 17
*/
ioctl_request.access_8.offset = 0x11;
/*
* This value does not matter because it is ignored making the request.
* However after ioctl() returns, the structure member will contain the
* register contents.
*/
DM5810/DM6810 Driver for Linux
40