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

📄 bitops.h

📁 博创科技arm3000开发板(arm7 44b0) 大量实验源代码 bootloader实验 ucos的移植 ucos的开发柜架 音频实验 电机控制 绘图的API函数 UDP通讯实
💻 H
字号:
/*These are the standard ANSI bit operation macros.  They are used by */
/*microcontrollers that don't have special bit operation instructions.*/

#define BIT(x)  (1 << (x))                  /*used by bit op macros   */

#define BIT0 0x01                           /*used by bit op macros   */
#define BIT1 0x02
#define BIT2 0x04
#define BIT3 0x08
#define BIT4 0x10
#define BIT5 0x20
#define BIT6 0x40
#define BIT7 0x80

/* this macro sets a bit in the specified register or memory location */
#define SETBIT(reg,bit) reg|=bit

/* this macro clrs a bit in the specified register or memory location */
#define CLRBIT(reg,bit) reg&=(~bit)

/* this macro toggles a bit in the spec'd register or memory location */
#define TGLBIT(reg,bit) reg^=bit

/* this macro tests a bit, returning a non-zero val if bit is set *****/
#define TSTBIT(reg,bit) (reg&bit)

⌨️ 快捷键说明

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