eZ80 Serial Driver


DDK Sample Design
ZiLOG Application Note
How to create and install a XINU driver for eZ80 family of processors
Author: Andrei Kovalev
FAE ZiLOG Germany

control

Usage:int control( int hcom, int category, char *arg1, char *arg2 );
Parameters:
int hcomthe communication device descriptor obtained from open()
int categorythe specific operation code. This may be one of the following constants defined in the com.h header file:
GET_INQthe number of bytes available in the input queue is returned (the input queue usage)
GET_OUQthe number of bytes ready to be sent is returned (the output queue usage)
GET_OV the count of overflow conditions in the buffers, when this value is not zero, then a data loss happened
SET_RATEset the serial baudrate of the communication channel, which is suppolied in the 1st argument arg1, this value must be between 50 and 625000
SET_LINEset the line control register value to that is suppolied in the 1st argument arg1, see eZ80 Product Specification for information on this value
SET_FLOWset the serial flow control to the type specified in the 1st argument arg1, this can be one of the COM_FLOW_NONE, COM_FLOW_SOFT, COM_FLOW_HARD
char *arg1the first optional argument of the operation defined with the category parameter
char *arg2the second optional argument of the operation defined with the category parameter
Return value:the value of the parameter requested
Description:Sets or returns the value of a requested device parameter. The function is used to tune the communication device for specific working conditions. The function returns the information on the current parameter settings of the device configuration or the status of the device.

getc

Usage:int getc( int hcom );
Parameters:
int hcomthe communication device descriptor obtained from open()
Return value:on success this function returns a single character, promoted to an int in an unsigned manner. On failure it returns SYSERR
Description:This function reads one byte from the device specified by the device descriptor.

Documenation Index
Home | Downloads | eZ80 Module

1