Nut/OS API


Detailed Description

Ethernut Operating System API.

Nut/OS is a small real time operating system aimed at 8-bit CPUs.

It supports the following features:

A reasonably large hardware resource might be:


Modules

 Thread Management
 Coperative multi-threading support.
 Thread States
 Thread operating states.
 Event Management
 Thread synchronization support.
 Heap Management
 Dynamic memory management.
 Banked Memory Management
 Banked RAM support.
 I/O Management
 Input and output device functions.
 Device I/O
 Input and output device functions.
 Timer Management
 Asynchronous timer support.

Defines

#define __byte_swap2(val)
#define __byte_swap4(val)
#define htonl(x)   __byte_swap4(x)
 Convert long value from host to network byte order.
#define htons(x)   __byte_swap2(x)
 Convert short value from host to network byte order.
#define ntohl(x)   __byte_swap4(x)
 Convert long value from network to host byte order.
#define ntohs(x)   __byte_swap2(x)
 Convert short value from network to host byte order.
#define NUTMEM_ALIGNMENT   sizeof(int)
#define NUTMEM_BOTTOM_ALIGN(s)   ((s) & ~(NUTMEM_ALIGNMENT - 1))
 Return the next lower aligned value.
#define NUTMEM_TOP_ALIGN(s)   NUTMEM_BOTTOM_ALIGN((s + (NUTMEM_ALIGNMENT - 1)))
 Return the next higher aligned value.

Typedefs

typedef void * HANDLE
 Void pointer.
typedef unsigned short reg_t
 Signed register type.
typedef unsigned char u_char
 Unsigned 8-bit value.
typedef unsigned int u_int
 Unsigned int value.
typedef unsigned long u_long
 Unsigned 32-bit value.
typedef unsigned long long u_longlong
 Unsigned 64-bit value.
typedef unsigned short u_short
 Unsigned 16-bit value.
typedef unsigned int uptr_t
 Unsigned pointer value type.
typedef unsigned short ureg_t
 Unsigned register type.


Define Documentation

#define __byte_swap2 ( val   ) 

Value:

((((val) & 0xff) << 8) |        \
     (((val) & 0xff00) >> 8))

#define __byte_swap4 ( val   ) 

Value:

((((val) & 0xff) << 24) |       \
     (((val) & 0xff00) << 8) |      \
     (((val) & 0xff0000) >> 8) |    \
     (((val) & 0xff000000) >> 24))


Typedef Documentation

typedef unsigned short reg_t

Signed register type.

Similar to ureg_t, but for signed values from -128 to +127.

typedef unsigned char u_char

Unsigned 8-bit value.

Todo:
We should switch to stdint.h as suggested by Dirk Kaufmann. See feature request #1282721.
Examples:
bt-lego/bt-lego.c, bt-remoteprog/demo-rprog.c, btstreamer/receiver/btreceiver.c, btstreamer/streamer/btstreamer.c, mhop_blink/mhop_blink.c, and sensor-app/senso.c.

typedef unsigned int uptr_t

Unsigned pointer value type.

The size of this type is at least the size of a memory pointer. For CPUs with 16 address bits this will be an unsigned short.

typedef unsigned short ureg_t

Unsigned register type.

The size of this type is equal to the size of a register, the hardware datapath or whatever might fit to give optimum performance for values from 0 to 255.

Typically 8 bit CPUs will use unsigned characters, 16 bit CPUs will use unsigned shorts etc.


Generated on Wed Apr 29 11:12:30 2009 for BTnut System Software by doxygen 1.5.1