Data Structures | |
struct | _NUTDEVICE |
Device structure. More... | |
struct | _NUTDEVICE |
Device structure. More... | |
Defines | |
#define | IFTYP_RAM 0 |
RAM device. | |
#define | IFTYP_ROM 1 |
ROM device. | |
#define | IFTYP_STREAM 2 |
Stream device. | |
#define | IFTYP_NET 3 |
Net device. | |
Typedefs | |
typedef _NUTDEVICE | NUTDEVICE |
Device structure type. | |
Functions | |
NUTDEVICE * | NutDeviceLookup (CONST char *name) |
Find device entry by name. | |
int | NutRegisterDevice (NUTDEVICE *dev, u_short base, u_char irq) |
Register a device. | |
NUTDEVICE * | NutDeviceOpen (CONST char *name) |
Open a stream device by name. | |
int | NutDeviceClose (NUTDEVICE *dev) |
Closes a previously opened stream device. | |
int | NutDeviceRead (NUTDEVICE *dev, void *data, int size) |
Read up to a specified number of bytes from a device. | |
int | NutDeviceReadTran (NUTDEVICE *dev, void *data, int size) |
Read up to a specified number of bytes from a device translating non printables. | |
int | NutDeviceGetLine (NUTDEVICE *dev, void *data, int size) |
Get a line from a specified device. | |
int | NutDeviceWrite (NUTDEVICE *dev, CONST void *data, int len) |
Write a buffer to a specified device. | |
int | NutDeviceWriteTran (NUTDEVICE *dev, CONST void *data) |
Write a buffer to a specified device. | |
int | NutDeviceWrite_P (NUTDEVICE *dev, PGM_P data, int len) |
Write a buffer in program space to a specified device. | |
int | NutDeviceIOCtl (NUTDEVICE *dev, int req, void *conf) |
Perform device specific control functions. | |
Variables | |
NUTDEVICE * | nutDeviceList = 0 |
Linked list of all registered devices. |
|
Closes a previously opened stream device. The calling thread may be suspended until all buffered output data has been sent.
|
|
Get a line from a specified device. Reads a string from the specified device. Characters are read up to and including the first newline character, up to the end of the stream, or until the number of characters read is equal to the specified size, whichever comes first.
|
|
Perform device specific control functions.
|
|
Find device entry by name.
|
|
Open a stream device by name. This function must be called after registering the device with NutRegisterDevice() and before calling any read or write function.
|
|
Read up to a specified number of bytes from a device. The function may read fewer than the given number of bytes.
|
|
Read up to a specified number of bytes from a device translating non printables. This call works like NutDeviceRead(), but translates character codes below 33, above 126 or equal 34 into their hex representation prepended by a backslash and the letter x. Backslashes are duplicated and the complete string is terminated by character code zero. This offers the ability to store binary data in printable strings.
|
|
Write a buffer to a specified device. This is a raw output without any character translation like EOL (end of line).
|
|
Write a buffer in program space to a specified device. This is a raw output without any character translation like EOL (end of line).
|
|
Write a buffer to a specified device. This is a raw output without any character translation like EOL (end of line).
|
|
Register 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. Once registered, stream devices must be accessed by calling NutDeviceOpen() first. However, network devices should not be opened but configured by calling NutNetIfConfig() or NutNetAutoConfig(). If called for a device, which had been registered previously, this function will update the base address and interrupt number. However, most device drivers do not expect these itemes being changed and may crash.
|