X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Fchips%2Fmsp430%2Fusci%2FHplMsp430UsciRegP.nc;h=d67123ceb6accf512e4a74b558e9b55630b87e70;hb=76eb4bee32f633c7046716c39fe046f5174aa859;hp=73c9be612073131d9c52fc681d8e27c2e4957f5a;hpb=2ba7058c1f5127b488ea4994a454b02d37f7de2e;p=tinyos-2.x.git diff --git a/tos/chips/msp430/usci/HplMsp430UsciRegP.nc b/tos/chips/msp430/usci/HplMsp430UsciRegP.nc index 73c9be61..d67123ce 100644 --- a/tos/chips/msp430/usci/HplMsp430UsciRegP.nc +++ b/tos/chips/msp430/usci/HplMsp430UsciRegP.nc @@ -55,7 +55,9 @@ generic module HplMsp430UsciRegP( uint8_t I2Coa_addr, /* B devices only */ uint8_t I2Csa_addr, /* B devices only */ uint8_t Ie_addr, - uint8_t Ifg_addr + uint8_t Ifg_addr, + uint8_t UCAxRXIFG, /* We rely on xIE and xIFG at same bit positions */ + uint8_t UCAxTXIFG, ) @safe() { provides interface HplMsp430UsciReg as Registers; } @@ -170,9 +172,9 @@ implementation command bool Registers.setMode(msp430_usci_mode_t mode) { if (mode == UCSYNC_UART && IS_USCI_Bx) - return false; + return FALSE; if (mode == UCI2C && IS_USCI_Ax) - return false; + return FALSE; SET_FLAG(UCxxCtl0, UCSYNC) } @@ -184,6 +186,7 @@ implementation RENDER_B(I2Cie); RENDER(Stat); + /* RENDER(Rxbuf); */ command uint8_t* Registers.ptrRxbuf() { return UCxxRXBuf; @@ -194,6 +197,7 @@ implementation return UCxxRXBuf; } + /* RENDER(Txbuf); */ command uint8_t* Registers.ptrTxbuf() { return UCxxTXBuf; @@ -214,6 +218,67 @@ implementation RENDER_A(Irrctl); RENDER_B(I2Coa); RENDER_B(I2Csa); - RENDER(Ie); - RENDER(Ifg); + + /* RENDER(Ie); */ + command bool getIeRx() + { + return READ_FLAG(UCxxIe, UCAxRXIFG); + } + + command void setIeRx() + { + return SET_FLAG(UCxxIe, UCAxRXIFG); + } + + command void clrIeRx() + { + return CLR_FLAG(UCxxIe, UCAxRXIFG); + } + + command bool getIeTx() + { + return READ_FLAG(UCxxIe, UCAxTXIFG); + } + + command void setIeTx() + { + return SET_FLAG(UCxxIe, UCAxTXIFG); + } + + command void clrIeTx() + { + return CLR_FLAG(UCxxIe, UCAxTXIFG); + } + + /* RENDER(Ifg); */ + command bool getIeRx() + { + return READ_FLAG(UCxxIfg, UCAxRXIFG); + } + + command void setIfgRx() + { + return SET_FLAG(UCxxIfg, UCAxRXIFG); + } + + command void clrIfgRx() + { + return CLR_FLAG(UCxxIfg, UCAxRXIFG); + } + + command bool getIfgTx() + { + return READ_FLAG(UCxxIfg, UCAxTXIFG); + } + + command void setIfgTx() + { + return SET_FLAG(UCxxIfg, UCAxTXIFG); + } + + command void clrIfgTx() + { + return CLR_FLAG(UCxxIfg, UCAxTXIFG); + } + }