38 #define HWCONF_PIN(name, port, bit) \
39 static CC_INLINE void name##_SELECT() {P##port##SEL &= ~(1 << bit);} \
40 static CC_INLINE void name##_SELECT_IO() {P##port##SEL &= ~(1 << bit);} \
41 static CC_INLINE void name##_SELECT_PM() {P##port##SEL |= 1 << bit;} \
42 static CC_INLINE void name##_SET() {P##port##OUT |= 1 << bit;} \
43 static CC_INLINE void name##_CLEAR() {P##port##OUT &= ~(1 << bit);} \
44 static CC_INLINE int name##_READ() {return (P##port##IN & (1 << bit));} \
45 static CC_INLINE void name##_MAKE_OUTPUT() {P##port##DIR |= 1 << bit;} \
46 static CC_INLINE void name##_MAKE_INPUT() {P##port##DIR &= ~(1 << bit);}
48 #define HWCONF_IRQ(name, port, bit) \
49 static CC_INLINE void name##_ENABLE_IRQ() {P##port##IE |= 1 << bit;} \
50 static CC_INLINE void name##_DISABLE_IRQ() {P##port##IE &= ~(1 << bit);} \
51 static CC_INLINE int name##_IRQ_ENABLED() {return P##port##IE & (1 << bit);} \
52 static CC_INLINE void name##_IRQ_EDGE_SELECTD() {P##port##IES |= 1 << bit;} \
53 static CC_INLINE void name##_IRQ_EDGE_SELECTU() {P##port##IES &= ~(1 << bit);}\
54 static CC_INLINE int name##_CHECK_IRQ() {return P##port##IFG & (1 << bit);} \
55 static CC_INLINE int name##_IRQ_PORT() {return port;}