使用I/O口组件:
components HplMsp430GeneralIOC;
MyC.LED1 -> HplMsp430GeneralIOC.Port54; // 用LED1表示P5.4
uses interface HplMsp430GeneralIO as LED1;
将I/O口设置为输入/输出:
call LED1.makeInput();
call LED1.makeOutput();
输入: call LED1.get();
输出0/1:
call LED1.clr();
call LED1.set();
call LED1.toggle(); // 反转高低电平