📄 types.h
字号:
#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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -