]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/msp430/usci/HplMsp430UsciRegP.nc
More work on USCI peripheral support.
[tinyos-2.x.git] / tos / chips / msp430 / usci / HplMsp430UsciRegP.nc
index 73c9be612073131d9c52fc681d8e27c2e4957f5a..d67123ceb6accf512e4a74b558e9b55630b87e70 100644 (file)
@@ -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);
+  }
+
 }