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

_NUTDEVICE Struct Reference
[Device I/ODevice I/O]

Device structure. More...


Data Fields

NUTDEVICEdev_next
 Link to the next device structure.

u_char dev_name [9]
 Unique device name.

u_char dev_type
 Type of interface.

u_short dev_base
 Hardware base address.

u_char dev_irq
 Interrupt registration number.

void * dev_icb
 Interface control block.

void * dev_dcb
 Driver control block.

int(* dev_init )(NUTDEVICE *)
 Driver initialization routine.

int(* dev_ioctl )(NUTDEVICE *, int, void *)
 Driver control function.

int(* dev_read )(NUTFILE *, void *, int)
 Read from device.

int(* dev_write )(NUTFILE *, CONST void *, int)
 Write to device.

int(* dev_write_P )(NUTFILE *, PGM_P, int)
 Write to device.

NUTFILE *(* dev_open )(NUTDEVICE *, CONST char *, int, int)
 Open a device or file.

int(* dev_close )(NUTFILE *)
 Close a device or file.

long(* dev_size )(NUTFILE *)
 Request file size.


Detailed Description

Device structure.

Examples:

rs232d/rs232d.c.


Field Documentation

u_short _NUTDEVICE::dev_base
 

Hardware base address.

Will be set by calling NutRegisterDevice(). On some device drivers this address may be fixed.

int(* _NUTDEVICE::dev_close)(NUTFILE *)
 

Close a device or file.

void* _NUTDEVICE::dev_dcb
 

Driver control block.

Points to a device specific information block.

void* _NUTDEVICE::dev_icb
 

Interface control block.

With stream devices, this points to the IFSTREAM structure and with network devices this is a pointer to the IFNET structure.

int(* _NUTDEVICE::dev_init)(NUTDEVICE *)
 

Driver initialization routine.

With stream devices this is called during NutDeviceOpen(). For network devices this routine is called within NutNetIfConfig().

int(* _NUTDEVICE::dev_ioctl)(NUTDEVICE *, int, void *)
 

Driver control function.

Used to modify or query device specific settings.

u_char _NUTDEVICE::dev_irq
 

Interrupt registration number.

Will be set by calling NutRegisterDevice(). On some device drivers the interrupt may be fixed.

u_char _NUTDEVICE::dev_name[9]
 

Unique device name.

NUTDEVICE* _NUTDEVICE::dev_next
 

Link to the next device structure.

NUTFILE*(* _NUTDEVICE::dev_open)(NUTDEVICE *, CONST char *, int, int)
 

Open a device or file.

int(* _NUTDEVICE::dev_read)(NUTFILE *, void *, int)
 

Read from device.

long(* _NUTDEVICE::dev_size)(NUTFILE *)
 

Request file size.

u_char _NUTDEVICE::dev_type
 

Type of interface.

May be any of the following:

  • IFTYP_RAM
  • IFTYP_ROM
  • IFTYP_STREAM
  • IFTYP_NET
  • IFTYP_TCPSOCK
  • IFTYP_CHAR

int(* _NUTDEVICE::dev_write)(NUTFILE *, CONST void *, int)
 

Write to device.

int(* _NUTDEVICE::dev_write_P)(NUTFILE *, PGM_P, int)
 

Write to device.


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