|
Digole Display Driver
Display driver for Digole Serial OLED/LCD displays
|
Functions | |
| int | writen (int fd, unsigned char *ptr, int nbytes) |
| write n bytes of data to a file descriptor | |
| int | readn (int fd, unsigned char *ptr, int nbytes) |
| read n bytes of data from a file descriptor | |
| int readn | ( | int | fd, |
| unsigned char * | ptr, | ||
| int | nbytes | ||
| ) |
read n bytes of data from a file descriptor
On Linux, since read is not guaranteed to read all of the bytes available in one call, we continously read the specified number of bytes from the descriptor into the data buffer provided.
| [in] | fd | the file descriptor to read from |
| [in,out] | ptr | the address of the data buffer to read into |
| [in] | nbytes | the number of bytes to read |
| int writen | ( | int | fd, |
| unsigned char * | ptr, | ||
| int | nbytes | ||
| ) |
write n bytes of data to a file descriptor
On Linux, since write is not guaranteed to write all of the bytes provided, we keep track of the number of bytes written and retry sending the data as needed.
| [in] | fd | the file descriptor to write to |
| [in] | ptr | the address of the data buffer to write |
| [in] | nbytes | the number of bytes to write |
1.7.6.1