RT-Thread RTOS  1.0.0
An open source embedded real-time operating system
Basic Definitions

Defines

#define RT_VERSION   1L
#define RT_SUBVERSION   0L
#define RT_REVISION   0L
#define RT_TRUE   1
#define RT_FALSE   0
#define RT_ALIGN(size, align)   (((size) + (align) - 1) & ~((align) - 1))
#define RT_ALIGN_DOWN(size, align)   ((size) & ~((align) - 1))
#define RT_NULL   ((void *)0)

Typedefs

typedef signed char rt_int8_t
typedef signed short rt_int16_t
typedef signed long rt_int32_t
typedef unsigned char rt_uint8_t
typedef unsigned short rt_uint16_t
typedef unsigned long rt_uint32_t
typedef int rt_bool_t
typedef long rt_base_t
typedef unsigned long rt_ubase_t
typedef rt_base_t rt_err_t
typedef rt_uint32_t rt_time_t
typedef rt_uint32_t rt_tick_t
typedef rt_base_t rt_flag_t
typedef rt_ubase_t rt_size_t
typedef rt_ubase_t rt_dev_t
typedef rt_base_t rt_off_t

Detailed Description

These are the basic definitions which used in RT-Thread RTOS. In general, RT-Thread kernel uses its own definition of the basic data types, such as rt_uint32_t, rt_uint8_t, etc., which does not depend on the compiler or architecture.


Define Documentation

#define RT_VERSION   1L

major version number

#define RT_SUBVERSION   0L

minor version number

#define RT_REVISION   0L

revise version number

#define RT_TRUE   1

boolean true

#define RT_FALSE   0

boolean fails

#define RT_ALIGN (   size,
  align 
)    (((size) + (align) - 1) & ~((align) - 1))

Return the most contiguous size aligned at specified width. RT_ALIGN(13, 4) would return 16.

#define RT_ALIGN_DOWN (   size,
  align 
)    ((size) & ~((align) - 1))

Return the down number of aligned at specified width. RT_ALIGN_DOWN(13, 4) would return 12.

#define RT_NULL   ((void *)0)

Similar as the NULL in C library.


Typedef Documentation

typedef signed char rt_int8_t

8bit integer type

typedef signed short rt_int16_t

16bit integer type

typedef signed long rt_int32_t

32bit integer type

typedef unsigned char rt_uint8_t

8bit unsigned integer type

typedef unsigned short rt_uint16_t

16bit unsigned integer type

typedef unsigned long rt_uint32_t

32bit unsigned integer type

typedef int rt_bool_t

boolean type

typedef long rt_base_t

Nbit CPU related date type

typedef unsigned long rt_ubase_t

Nbit unsigned CPU related data type

Type for error number

Type for time stamp

Type for tick count

Type for flags

Type for size number

Type for device

Type for offset

 All Data Structures Variables