1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #ifndef __RT_DEF_H__
- #define __RT_DEF_H__
- #include "stdio.h"
- /* RT-Thread basic data type definitions */
- #ifndef RT_USING_ARCH_DATA_TYPE
- typedef int8_t rt_int8_t; /**< 8bit integer type */
- typedef int16_t rt_int16_t; /**< 16bit integer type */
- typedef int32_t rt_int32_t; /**< 32bit integer type */
- typedef uint8_t rt_uint8_t; /**< 8bit unsigned integer type */
- typedef uint16_t rt_uint16_t; /**< 16bit unsigned integer type */
- typedef uint32_t rt_uint32_t; /**< 32bit unsigned integer type */
- #ifdef ARCH_CPU_64BIT
- typedef signed long rt_int64_t; /**< 64bit integer type */
- typedef unsigned long rt_uint64_t; /**< 64bit unsigned integer type */
- #else
- typedef int64_t rt_int64_t; /**< 64bit integer type */
- typedef uint64_t rt_uint64_t; /**< 64bit unsigned integer type */
- #endif
- #endif
- 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 */
- typedef rt_base_t rt_err_t; /**< Type for error number */
- typedef rt_uint32_t rt_time_t; /**< Type for time stamp */
- typedef rt_uint32_t rt_tick_t; /**< Type for tick count */
- typedef rt_base_t rt_flag_t; /**< Type for flags */
- typedef rt_ubase_t rt_size_t; /**< Type for size number */
- typedef rt_ubase_t rt_dev_t; /**< Type for device */
- typedef rt_base_t rt_off_t; /**< Type for offset */
- /* RT-Thread error code definitions */
- #define RT_EOK 0 /**< There is no error */
- #define RT_ERROR 1 /**< A generic error happens */
- #define RT_ETIMEOUT 2 /**< Timed out */
- #define RT_EFULL 3 /**< The resource is full */
- #define RT_EEMPTY 4 /**< The resource is empty */
- #define RT_ENOMEM 5 /**< No memory */
- #define RT_ENOSYS 6 /**< No system */
- #define RT_EBUSY 7 /**< Busy */
- #define RT_EIO 8 /**< IO error */
- #define RT_EINTR 9 /**< Interrupted system call */
- #define RT_EINVAL 10 /**< Invalid argument */
- #define rt_inline static __inline
- #endif
|