types.h
来自「This is full set of procedures used to c」· C头文件 代码 · 共 44 行
H
44 行
#ifndef __TYPES_H__
#define __TYPES_H__
/*
* FILE:
* types.h (rev. 1.0 - 10.04.2006)
*
* PROJECT:
* GSM Communication Module
*
* DESCRIPTION:
* Data types for easy porting on others platforms
*
*/
#include <inavr.h>
#include <iom162.h>
// User-defined types
typedef char U8;
typedef unsigned int U16;
#define _bitset(bits)\
((byte)(\
(bits%010)|\
(bits/010%010)<<1|\
(bits/0100%010)<<2|\
(bits/01000%010)<<3|\
(bits/010000%010)<<4|\
(bits/0100000%010)<<5|\
(bits/01000000%010)<<6|\
(bits/010000000%010)<<7))
#define BIN(bits) _bitset(0##bits)
// Set of macros for bit manipulations
#define BIT_SET(X,Y) ((X)|=(Y)) // Set specified bit in specified byte
#define BIT_CLR(X,Y) ((X)&=~(Y)) // Clear specified bit in specified byte
#define BIT(X,Y) (((X)&(Y))==Y) // Get state of bit
#define B(bit) (1<<(bit)) // Set to 1 by bit name
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?