tools.h
来自「AVR USB 下载线, 全套的开发资料,想做板子的可以参考下/」· C头文件 代码 · 共 39 行
H
39 行
#ifndef __TOOLS_H
#define __TOOLS_H
#define TRUE 1
#define FALSE 0
#define CHIP_CLOCK 8000000
//F黵s Bit setzen und l鰏chen
#define BIT0_POS (1<<0)
#define BIT1_POS (1<<1)
#define BIT2_POS (1<<2)
#define BIT3_POS (1<<3)
#define BIT4_POS (1<<4)
#define BIT5_POS (1<<5)
#define BIT6_POS (1<<6)
#define BIT7_POS (1<<7)
#define BIT0_NEG ((unsigned char)(~(1<<0)))
#define BIT1_NEG ((unsigned char)(~(1<<1)))
#define BIT2_NEG ((unsigned char)(~(1<<2)))
#define BIT3_NEG ((unsigned char)(~(1<<3)))
#define BIT4_NEG ((unsigned char)(~(1<<4)))
#define BIT5_NEG ((unsigned char)(~(1<<5)))
#define BIT6_NEG ((unsigned char)(~(1<<6)))
#define BIT7_NEG ((unsigned char)(~(1<<7)))
//Hardware-Interface
//LED an PORTC 0
#define LED_GN_OFF PORTB&=BIT0_NEG
#define LED_GN_ON PORTB|=BIT0_POS
#define LED_GN_TOG PORTB^=BIT0_POS
//LED an PORTC 1
#define LED_RT_OFF PORTB&=BIT1_NEG
#define LED_RT_ON PORTB|=BIT1_POS
#define LED_RT_TOG PORTB^=BIT1_POS
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?