⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 datatype.h

📁 LPC11C14 CAN 代码
💻 H
字号:
/****************************************Copyright (c)****************************************************
**                            Guangzhou ZHIYUAN electronics Co.,LTD.
**                                      
**                                 http://www.embedtools.com
**
**------File Info-----------------------------------------------------------------------------------------
** File name:               dataType.h
** Latest modified Date:    2008-07-24
** Latest Version:          1.0
** Descriptions:            定义常用的数据类型及函数返回值  Designed for ARM (32bit processor)
**
**--------------------------------------------------------------------------------------------------------
** Created by:              张展威
** Created date:            2008-07-24
** Version:                 1.0
** Descriptions:            
**
**--------------------------------------------------------------------------------------------------------
** Modified by:             
** Modified date:           
** Version:                 
** Descriptions:            
**
*********************************************************************************************************/


#ifndef __GENERAL_DATA_TYPE_H
#define __GENERAL_DATA_TYPE_H
/*********************************************************************************************************
** 定义与编译器无关的数据类型
*********************************************************************************************************/
#ifndef INT8U
#define INT8U    unsigned char                                          /* 无符号8位整型变量            */
#endif
#ifndef INT8S
#define INT8S    signed char                                            /* 有符号8位整型变量            */
#endif
#ifndef INT16U
#define INT16U   unsigned short                                         /* 无符号16位整型变量           */
#endif
#ifndef INT16S
#define INT16S   signed short                                           /* 有符号16位整型变量           */
#endif
#ifndef INT32U
#define INT32U   unsigned int                                           /* 无符号32位整型变量           */
#endif
#ifndef INT32S
#define INT32S   signed int                                             /* 有符号32位整型变量           */
#endif
#ifndef FP32
#define FP32     float                                                  /* 单精度浮点数(32位长度)     */
#endif
#ifndef FP64
#define FP64     double                                                 /* 双精度浮点数(64位长度)     */
#endif
#ifndef BOOLEAN
#define BOOLEAN  unsigned char                                          /* 布尔变量                     */
#endif

#ifndef boolean
#define boolean  BOOLEAN                                                /* 布尔变量                     */
#endif

#ifndef tBoolean
#define tBoolean  BOOLEAN                                                /* 布尔变量                     */
#endif

#ifndef uchar
#define uchar   unsigned char
#endif
#ifndef uint
#define uint    unsigned int 
#endif

/*********************************************************************************************************
** 定义常用返回值
*********************************************************************************************************/
#ifndef TRUE
#define TRUE  1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef true
#define true  1
#endif
#ifndef false
#define false 0
#endif

#define HWREG(x)                                                              \
        (*((volatile unsigned long *)(x)))
#define HWREGH(x)                                                             \
        (*((volatile unsigned short *)(x)))
#define HWREGB(x)                                                             \
        (*((volatile unsigned char *)(x)))
#define HWREGBITW(x, b)                                                       \
        HWREG(((unsigned long)(x) & 0xF0000000) | 0x02000000 |                \
              (((unsigned long)(x) & 0x000FFFFF) << 5) | ((b) << 2))
#define HWREGBITH(x, b)                                                       \
        HWREGH(((unsigned long)(x) & 0xF0000000) | 0x02000000 |               \
               (((unsigned long)(x) & 0x000FFFFF) << 5) | ((b) << 2))
#define HWREGBITB(x, b)                                                       \
        HWREGB(((unsigned long)(x) & 0xF0000000) | 0x02000000 |               \
               (((unsigned long)(x) & 0x000FFFFF) << 5) | ((b) << 2))


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -