Device structure. More...
#include <device.h>
Data Fields | |
NUTDEVICE * | dev_next |
Link to the next device structure. | |
char | dev_name [9] |
Unique device name. | |
uint8_t | dev_type |
Type of interface. | |
uintptr_t | dev_base |
Hardware base address. | |
uint8_t | 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. |
Device structure.
Each device driver provides a global variable of this type. Applications use NutRegisterDevice() to bind the device driver to the application code. Except this call, applications refer to device drivers by the name of the device when using standard C functions like _open() or fopen().
More than one device driver may be available for the same hardware device. Typically these drivers provide the same name for the device and applications must not refer to more than one device driver with the same name.
Link to the next device structure.
Definition at line 169 of file device.h.
Referenced by MmCardMount(), NutDeviceLookup(), NutIpOutput(), NutRegisterDevice(), and SpiMmcMount().
char _NUTDEVICE::dev_name[9] |
Unique device name.
Definition at line 174 of file device.h.
Referenced by cs8900Init(), CSNicInit(), DebugInit(), DebugWrite(), MmCardMount(), NicInit(), NutDeviceLookup(), NutNetIfSetup(), NutRegisterDevice(), and SpiMmcMount().
Type of interface.
May be any of the following:
Definition at line 187 of file device.h.
Referenced by AceInit(), AhdlcAt91IOCtl(), AhdlcAvrIOCtl(), MmCardMount(), NutDhcpIfConfig(), NutIpOutput(), NutNetIfAddMcastAddr(), NutNetIfConfig2(), NutNetIfDelMcastAddr(), SpiMmcMount(), and UartAvrInit().
Hardware base address.
Will be set by calling NutRegisterDevice(). On some device drivers this address may be fixed.
Definition at line 195 of file device.h.
Referenced by AceInit(), AceIOCtl(), AceOutput(), AhdlcAt91Init(), AhdlcAvrClose(), AhdlcAvrInit(), AhdlcAvrIOCtl(), AhdlcAvrOpen(), AhdlcAvrPut(), At91DevDebugIOCtl(), cs8900Init(), CSNicInit(), NutRegisterDevice(), SJAInit(), UartAvrInit(), UartAvrIOCtl(), and UartAvrOutput().
Interrupt registration number.
Will be set by calling NutRegisterDevice(). On some device drivers the interrupt may be fixed.
Definition at line 202 of file device.h.
Referenced by AceInit(), NutRegisterDevice(), and UartAvrInit().
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.
Definition at line 209 of file device.h.
Referenced by AceFlush(), AceInit(), AceInput(), AceIOCtl(), AceOutput(), AcePut(), AceRead(), AceSize(), AhdlcAt91IOCtl(), AhdlcAvrInit(), AhdlcAvrIOCtl(), AhdlcRx(), AtCanInput(), AtCanSetAccCode(), AtCanSetAccMask(), AtCanSetBaudrate(), CAN_RxAvail(), CAN_RxFrame(), CAN_SetFilter(), CAN_SetRxTimeout(), CAN_SetSpeed(), CAN_TryRxFrame(), CAN_TryTxFrame(), CAN_TxFrame(), CAN_TxFree(), cs8900Init(), CSNicInit(), CSNICrx(), EmacRxThread(), MmCardIOCtl(), MmCardMount(), MmCardUnmount(), NicInit(), NicRx(), NicRxAsix(), NicRxLanc(), NutArpCacheQuery(), NutArpCacheUpdate(), NutArpInput(), NutArpOutput(), NutDhcpClient(), NutDhcpIfConfig(), NutEtherOutput(), NutIgmpInput(), NutIpInput(), NutIpOutput(), NutNetIfAddMcastAddr(), NutNetIfConfig2(), NutNetIfDelMcastAddr(), NutNetIfSetup(), NutPppOutput(), NutRegisterSpiDevice(), NutTcpConnect(), NutUdpOutput(), PhatSectorFlush(), PhatSectorLoad(), PhatVolMount(), RawFsMount(), RxThread(), SJAInit(), SJAInput(), SJASetAccCode(), SJASetAccMask(), SJASetBaudrate(), Spi7segInit(), Spi7SegPush(), Spi7segPutc(), SpiAt45dCommand(), SpiAt45dInit(), SpiAt45dPageErase(), SpiAt45dPageRead(), SpiAt45dPageWrite(), SpiAt45dStatus(), SpiAt45dWaitReady(), SpiMmcBlockRead(), SpiMmcBlockWrite(), SpiMmcIOCtl(), SpiMmcMount(), UartAvrFlush(), UartAvrInit(), UartAvrInput(), UartAvrOutput(), UartAvrPut(), UartAvrRead(), UartAvrSize(), UFlashAttach(), UFlashDetach(), and upnp_Init().
void* _NUTDEVICE::dev_dcb |
Driver control block.
Points to a device specific information block.
Definition at line 216 of file device.h.
Referenced by AceFlush(), AceInit(), AceInput(), AceIOCtl(), AceOpen(), AceOutput(), AcePut(), AceRead(), AhdlcAt91Init(), AhdlcAt91IOCtl(), AhdlcAt91Put(), AhdlcAt91Read(), AhdlcAvrInit(), AhdlcAvrIOCtl(), AhdlcAvrPut(), AhdlcAvrRead(), AhdlcOutput(), AhdlcRx(), AllocFirstCluster(), AsixInit(), AsixOutput(), At91DevDebugOpen(), AtCanInit(), AtCanInput(), AtCanOutput(), CAN_Tx(), cs8900Init(), cs8900Output(), CSNicInit(), CSNicOutput(), CSNICrx(), DmInit(), DmOutput(), EmacInit(), EmacOutput(), EmacRxThread(), FeederThread(), GenCharSize(), IpcpClose(), IpcpLowerDown(), IpcpLowerUp(), IpcpOpen(), IpcpRxConfAck(), IpcpRxConfReq(), IpcpRxProtRej(), IpcpRxTermAck(), IpcpRxTermReq(), IpcpTxConfReq(), IsFixedRootDir(), LancInit(), LancOutput(), LcpClose(), LcpLowerDown(), LcpLowerUp(), LcpOpen(), LcpRxProtRej(), LcpTxConfReq(), LcpTxProtRej(), NicInit(), NicOutput(), NicRx(), NicRxAsix(), NicRxLanc(), NutBlockDeviceIOCtl(), NutBlockDeviceOpen(), NutBlockDeviceRead(), NutBlockDeviceWrite(), NutBlockDeviceWrite_P(), NutIpcpInput(), NutLcpInput(), NutNetIfConfig2(), NutPppInput(), NutPppOutput(), NutPppSm(), PapRxAuthAck(), PapRxAuthNak(), PapTxAuthReq(), Phat12GetClusterLink(), Phat12ReleaseChain(), Phat12SetClusterLink(), Phat16GetClusterLink(), Phat16ReleaseChain(), Phat16SetClusterLink(), Phat32GetClusterLink(), Phat32ReleaseChain(), Phat32SetClusterLink(), PhatClusterSector(), PhatDirCreate(), PhatDirEntryUpdate(), PhatDirOpen(), PhatDirReleaseChain(), PhatFilePosSet(), PhatFileRead(), PhatFileWrite(), PhatSectorFlush(), PhatSectorLoad(), PhatVolMount(), PhatVolUnmount(), RawFsFileRead(), RawFsFileWrite(), RawFsMount(), RawFsUnmount(), RxThread(), Sc16is752UsartProcessChannelInterrupt(), SJAInit(), SJAInput(), SJAOutput(), Spi7segDot(), Spi7segInit(), Spi7SegPush(), Spi7segPutc(), SpiAt45dInit(), SpiAt45dPageErase(), SpiAt45dPageRead(), SpiAt45dPages(), SpiAt45dPageSize(), SpiAt45dPageWrite(), SpiMmcBlockRead(), SpiMmcBlockWrite(), SpiMmcIOCtl(), SpiMmcMount(), TermInit(), TermIOCtl(), TermOpen(), UartAvrFlush(), UartAvrInit(), UartAvrInput(), UartAvrIOCtl(), UartAvrOpen(), UartAvrPut(), UartAvrRead(), UFlashFormat(), UsartClose(), UsartInit(), UsartIOCtl(), UsartOpen(), UsartRead(), UsartSize(), VsCodecBeep(), VsCodecClose(), VsCodecIOCtl(), VsCodecOpen(), VsCodecRead(), VsCodecReg(), VsCodecWaitReady(), VsCodecWrite(), VsDecoderBufferInit(), VsDecoderSetBass(), VsDecoderSetVolume(), wlandrv_IOCTL(), wlandrv_PutPacket(), and WlanInit().
int(* _NUTDEVICE::dev_init)(NUTDEVICE *) |
Driver initialization routine.
This routine is called during device registration.
Definition at line 223 of file device.h.
Referenced by NutInit(), and NutRegisterDevice().
int(* _NUTDEVICE::dev_ioctl)(NUTDEVICE *, int, void *) |
Driver control function.
Used to modify or query device specific settings.
Definition at line 230 of file device.h.
Referenced by _ioctl(), _seek(), _tell(), AhdlcRx(), closedir(), MmCardMount(), MmCardUnmount(), NutBlockDeviceClose(), NutBlockDeviceOpen(), NutNetIfAddMcastAddr(), NutNetIfConfig2(), NutNetIfDelMcastAddr(), opendir(), PhatSectorRead(), PhatVolMount(), RawFsMount(), readdir(), rename(), SpiMmcMount(), SpiMmcUnmount(), and stat().
int(* _NUTDEVICE::dev_read)(NUTFILE *, void *, int) |
Read from device.
Definition at line 235 of file device.h.
Referenced by _read(), and PhatSectorRead().
int(* _NUTDEVICE::dev_write)(NUTFILE *, CONST void *, int) |
int(* _NUTDEVICE::dev_write_P)(NUTFILE *, PGM_P, int) |
NUTFILE*(* _NUTDEVICE::dev_open)(NUTDEVICE *, CONST char *, int, int) |
int(* _NUTDEVICE::dev_close)(NUTFILE *) |
long(* _NUTDEVICE::dev_size)(NUTFILE *) |