Generic Character Device
[Device Driver API.]

Collaboration diagram for Generic Character Device:


Detailed Description

Character Device Driver Template.

Extensively commented source code of a Nut/OS character device driver. It doesn't drive any specific device, but can be used as a template when adding new device drivers.


Data Structures

struct  DEVDCB
 Device driver's private data structure. More...

Defines

#define GENDEV_SPORT
#define GENDEV_DPORT
#define GENDEV_SIGNAL

Functions

long GenCharSize (NUTFILE *fp)
 Retrieves the number of characters in input buffer.

Variables

NUTDEVICE devGenChar
 Device information structure.


Function Documentation

long GenCharSize NUTFILE fp  ) 
 

Retrieves the number of characters in input buffer.

This function is called by the low level size routine of the C runtime library, using the _NUTDEVICE::dev_size entry.

Parameters:
fp Pointer to a _NUTFILE structure, obtained by a previous call to UsartOpen().
Returns:
The number of bytes currently stored in input buffer.


© 2000-2006 by egnite Software GmbH - visit http://www.ethernut.de/