File nut/include/sys/device.h


Included Files


Preprocessor definitions

#define _SYS_DEVICE_H_

#define WAIT5 5

#define WAIT50 50

#define WAIT100 100

#define WAIT250 250

#define WAIT500 500

#define IFTYP_RAM 0

#define IFTYP_ROM 1

#define IFTYP_STREAM 2

#define IFTYP_NET 3

#define IFTYP_TCPSOCK 4

#define IFTYP_CHAR 5

#define IFTYP_CAN 6

#define IFTYP_BLKIO 7

#define IFTYP_FS 16


Typedef NUTDEVICE

typedef struct _NUTDEVICE NUTDEVICE
See: Type struct _NUTDEVICE

Type struct _NUTDEVICE

struct _NUTDEVICE
struct _NUTDEVICE  
   {  
      NUTDEVICE* dev_next;  
      char dev_name[9];  
      uint8_t dev_type;  
      uintptr_t dev_base;  
      uint8_t dev_irq;  
      void* dev_icb;  
      void* dev_dcb;  
      int (*dev_init)(NUTDEVICE*);  
      int (*dev_ioctl)(NUTDEVICE*,int,void*);  
      int (*dev_read)(NUTFILE*,void*,int);  
      int (*dev_write)(NUTFILE*,const void*,int);  
      int (*dev_write_P)(NUTFILE*,const char*,int);  
      NUTFILE* (*dev_open)(NUTDEVICE*,const char*,int,int);  
      int (*dev_close)(NUTFILE*);  
      long (*dev_size)(NUTFILE*);  
   }  

Typedef NUTVIRTUALDEVICE

typedef struct _NUTVIRTUALDEVICE NUTVIRTUALDEVICE
See: Type struct _NUTVIRTUALDEVICE

Type struct _NUTVIRTUALDEVICE

struct _NUTVIRTUALDEVICE
struct _NUTVIRTUALDEVICE  
   {  
      NUTVIRTUALDEVICE* vdv_next;  
      NUTVIRTUALDEVICE* vdv_zero;  
      uint8_t vdv_type;  
      int (*vdv_read)(void*,void*,int);  
      int (*vdv_write)(void*,const void*,int);  
      int (*vdv_write_P)(void*,const char*,int);  
      int (*vdv_ioctl)(void*,int,void*);  
   }  

Typedef IFSTREAM

typedef struct _IFSTREAM IFSTREAM
See: Type struct _IFSTREAM

Type struct _IFSTREAM

struct _IFSTREAM
struct _IFSTREAM  
   {  
      int (*if_input)(NUTDEVICE*);  
      int (*if_output)(NUTDEVICE*);  
      int (*if_flush)(NUTDEVICE*);  
      volatile uint8_t if_rx_idx;  
      uint8_t if_rd_idx;  
      volatile uint8_t if_tx_idx;  
      uint8_t if_wr_idx;  
      volatile uint8_t if_tx_act;  
      uint8_t if_last_eol;  
      uint8_t if_rx_buf[256];  
      uint8_t if_tx_buf[256];  
   }  

External Variables

nutDeviceList
extern NUTDEVICE* nutDeviceList
Defined in: nut/os/devreg.c