📄 port.h
字号:
#ifndef _PORT_H_
#define _PORT_H_
//PB
#define _MD0 0
#define _MD1 1
#define _PWM 2
#define _SPU_EN 6
#define _SPU 7
//PC
#define _HI_CHECK 0
#define _SENSOR 1
#define _VR 2
#define _SAFETY 3
#define _NC1 4
#define _NC2 5
//PD
#define _RXD 0
#define _TXD 1
#define _RS485DE 2
#define _UNLOCK 3
#define _NC3 4
#define _LED 5
#define _UP_DOWN 6
#define _RAMP_CTRL 7
//some macros.h
#define UART_RECEIVE_ENABLE() CLEARBIT(PORTD, _RS485DE);
#define UART_SEND_ENABLE() SETBIT(PORTD, _RS485DE);
#define SPEED_MOTOR_ENABLE() CLEARBIT(PORTB,_MD0);\
SETBIT(PORTB,_MD1);\
CLEARBIT(PORTB,_SPU_EN)
#define SPEED_MOTOR_DISABLE() SETBIT(PORTB,_MD0);\
CLEARBIT(PORTB,_MD1);\
SETBIT(PORTB,_SPU_EN)
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -