Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages | Examples

Device I/O
[I/O Management]


Detailed Description

Input and output device functions.


Data Structures

struct  _IFSTREAM
 Stream interface information structure. More...

struct  _IFSTREAM
 Stream interface information structure. More...

struct  _NUTDEVICE
 Device structure. More...

struct  _NUTDEVICE
 Device structure. More...

struct  _NUTVIRTUALDEVICE
 Virtual device structure. More...

struct  _NUTVIRTUALDEVICE
 Virtual device structure. More...


Defines

#define WAIT5
#define WAIT50
#define WAIT100
#define WAIT250
#define WAIT500
#define IFTYP_RAM
 RAM device.

#define IFTYP_ROM
 ROM device.

#define IFTYP_STREAM
 Stream device.

#define IFTYP_NET
 Net device.

#define IFTYP_TCPSOCK
 TCP socket.

#define IFTYP_CHAR
 Character stream device.

#define IFTYP_CAN
 CAN device.


Typedefs

typedef _NUTDEVICE NUTDEVICE
 Device structure type.

typedef _NUTVIRTUALDEVICE NUTVIRTUALDEVICE
 Device structure type.

typedef _IFSTREAM IFSTREAM
 Stream interface type.


Functions

NUTDEVICENutDeviceLookup (CONST char *name)
 Find device entry by name.

int NutRegisterDevice (NUTDEVICE *dev, uptr_t base, u_char irq)
 Register and initialize a device.


Variables

NUTDEVICEnutDeviceList
 Linked list of all registered devices.


Function Documentation

NUTDEVICE* NutDeviceLookup CONST char *  name  ) 
 

Find device entry by name.

Parameters:
name Unique device name.
Returns:
Pointer to the NUTDEVICE structure.

int NutRegisterDevice NUTDEVICE dev,
uptr_t  base,
u_char  irq
 

Register and initialize a device.

Initializes the device and adds it to the system device list. Applications should call this function during initialization for each device they intend to use.

Parameters:
dev Pointer to the NUTDEVICE structure, which is provided by the device driver. This structure contains a hardware device name, which must be unique among all registered devices. Drivers may operate in a different mode using the same hardware, like interrupt driven or polling UART drivers. Only one of those drivers can be registered, because they specify the same hardware device name.
base Hardware base address of this device. Set to 0, if the device driver has a fixed hardware address.
irq Hardware interrupt used by this device. Set to 0, if the device driver doesn't support configurable interupts.
Returns:
0 if the device has been registered for the first time and initialization was successful. The function returns -1 if any device with the same name had been registered previously, if the NUTDEVICE structure is invalid or if the device initialization failed.


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