📄 basetype.h
字号:
/*----------------------------------------------------------------
[BASIC]
{
[FILENAME] basetype.h
[CONTENT] base date type definition
[AUTHOR] Wangdq
[VERSION] 070705.01
[COMPANY] CEC Huada Electronic Design CO.,LTD
}
[MOD]
{
2007.07.05 Create this file
}
----------------------------------------------------------------*/
#ifndef __BASETYPE_H__
#define __BASETYPE_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "setting.h"
/*--------------------------------------------------------------
Basic Data Type Defination
----------------------------------------------------------------*/
#if (__COMPILER_TYPE__ == COMPILER_VC6)
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed int s32_t;
typedef unsigned int u32_t;
typedef signed short s16_t;
typedef unsigned short u16_t;
typedef char s8_t;
typedef unsigned char u8_t;
#define int64_t_C(c) (c ## i64)
#define uint64_t_C(c) (c ## i64)
#ifndef reg_t
typedef uint32_t reg_t;
#endif
#ifndef time_t
typedef long time_t;
#endif
#ifndef timel_t
typedef int64_t timel_t;
#endif
#ifndef offset_t
typedef long offset_t;
#endif
#ifndef offsetl_t
typedef int64_t offsetl_t;
#endif
#ifndef size_t
typedef uint32_t size_t;
#endif
#define inline __inline
#elif (__COMPILER_TYPE__ == COMPILER_ARM)
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed int s32_t;
typedef unsigned int u32_t;
typedef signed short s16_t;
typedef unsigned short u16_t;
typedef char s8_t;
typedef unsigned char u8_t;
#define int64_t_C(c) (c ## i64)
#define uint64_t_C(c) (c ## i64)
#ifndef reg_t
typedef uint32_t reg_t;
#endif
#ifndef time_t
typedef long time_t;
#endif
#ifndef offset_t
typedef long offset_t;
#endif
#ifndef size_t
typedef uint32_t size_t;
#endif
#endif /* _COMPILER_TYPE_ */
/*--------------------------------------------------------------
Some Common Data Type Defination
----------------------------------------------------------------*/
#ifndef BYTE
typedef uint8_t BYTE;
#endif
#ifndef WORD
typedef uint16_t WORD;
#endif
#ifndef DWORD
typedef uint32_t DWORD;
#endif
#ifndef BOOL
typedef uint8_t BOOL;
#endif
#ifndef bool
typedef uint8_t bool;
#endif
/*--------------------------------------------------------------
Basic Constant Data Defination
----------------------------------------------------------------*/
#ifndef TRUE
# define TRUE 1
#endif
#ifndef FALSE
# define FALSE 0
#endif
#ifndef true
# define true 1
#endif
#ifndef false
# define false 0
#endif
#ifndef YES
# define YES 1
#endif
#ifndef NO
# define NO 0
#endif
#ifndef NULL
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void *)0)
#endif
#endif
#ifndef M_PI
# define M_PI 3.14159265358979323846
#endif
#ifndef INT16_MIN
# define INT16_MIN (-0x7fff-1)
#endif
#ifndef INT16_MAX
# define INT16_MAX 0x7fff
#endif
#ifndef INT32_MIN
# define INT32_MIN (-0x7fffffff-1)
#endif
#ifndef INT32_MAX
# define INT32_MAX 0x7fffffff
#endif
#ifndef UINT32_MAX
# define UINT32_MAX 0xffffffff
#endif
#ifndef INT64_MIN
# define INT64_MIN (-0x7fffffffffffffff-1)
#endif
#ifndef INT64_MAX
# define INT64_MAX int64_t_C(9223372036854775807)
#endif
#ifndef UINT64_MAX
# define UINT64_MAX uint64_t_C(0xFFFFFFFFFFFFFFFF)
#endif
#ifndef INT_MAX
# define INT_MAX INT32_MAX
#endif
#ifndef UINT_MAX
# define UINT_MAX UINT32_MAX
#endif
#ifndef INT_BIT
# if INT_MAX != 2147483647
# define INT_BIT 64
# else
# define INT_BIT 32
# endif
#endif
#ifndef SEEK_SET
# define SEEK_SET 0 /* seek to an absolute position */
# define SEEK_CUR 1 /* seek relative to current position */
# define SEEK_END 2 /* seek relative to end of file */
#endif /* ifndef SEEK_SET */
/*--------------------------------------------------------------
Function Return Status Value Definatio
----------------------------------------------------------------*/
typedef int32_t Status;
#define SUCCESS 0
/* module defination */
#define MODULE_MASK 0x0FF00000
#define MODULE_KAL 0x00000000
#define MODULE_DRIVER 0x00100000
#define MODULE_PLAYER 0x00200000
#define ERR_KAL (0x80000000 | MODULE_KAL)
#define ERR_DRIVER (0x80000000 | MODULE_DRIVER)
#define ERR_AUDEO_CODEC (0x80000000 | MODULE_PLAYER)
/*--------------------------------------------------------------
KAL Error Code Defination
----------------------------------------------------------------*/
#define KAL_MODULE_MASK 0xF0000
#define KAL_TASK 0x00000
#define KAL_MEMORY 0x10000
#define KAL_SEM 0x20000
#define KAL_QUEUE 0x30000
#define KAL_MAILBOX 0x40000
#define KAL_SYSERR 0x50000
#define ERR_KAL_TASK (ERR_KAL | KAL_TASK)
#define ERR_KAL_MEMORY (ERR_KAL | KAL_MEMORY)
#define ERR_KAL_SEM (ERR_KAL | KAL_SEM)
#define ERR_KAL_QUEUE (ERR_KAL | KAL_QUEUE)
#define ERR_KAL_MAILBOX (ERR_KAL | KAL_MAILBOX)
/* Thread */
/* Interrupt */
/* Timer */
/* Dynamic Memory */
/* Mailbox */
/* Queue */
/* Semaphore */
/* Mutex */
/* System Error */
/*--------------------------------------------------------------
Driver Error Code Defination
----------------------------------------------------------------*/
#define DRIVER_MODULE_MASK 0xFFF00
#define DRIVER_NOR_FLASH 0x00000
#define DRIVER_NAND_FLASH 0x00100
#define DRIVER_SDRAM 0x00200
#define DRIVER_IIC 0x00300
#define DRIVER_SPI 0x00400
#define DRIVER_UART 0x00500
#define DRIVER_TIMER 0x00600
#define DRIVER_GPIO 0x00700
#define DRIVER_IIS 0x00800
#define DRIVER_USB 0x00900
#define DRIVER_ETHERNET 0x00A00
#ifdef __cplusplus
}
#endif
#endif /* __BASETYPE_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -