#define BIT(x) (1 <
#define GET_PORT(x, bit) (PORT ## x)
#define GET_PIN( x, bit) (PIN ## x)
#define GET_BIT(x,bit) (bit)
#define PORT_OUT0(portx_bit) ( GET_PORT(portx_bit) &= ~BIT(GET_BIT(portx_bit)) )
#define PORT_OUT1(portx_bit) ( GET_PORT(portx_bit) |= BIT(GET_BIT(portx_bit)) )
#define PORT_IN(portx_bit) ( GET_PIN(portx_bit) & BIT(GET_BIT(portx_bit)) )
===================================
『本文转载自网络,版权归原作者所有,如有侵权请联系删除』