]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/tda5250/HplTda5250ConfigP.nc
Merge over into the trunk.
[tinyos-2.x.git] / tos / chips / tda5250 / HplTda5250ConfigP.nc
index a0918499e38d1a8ac3c6084a2a5564de109e78a3..cb6616434a857a142230936a84159640a1786584 100644 (file)
@@ -60,6 +60,7 @@ module HplTda5250ConfigP {
     interface Tda5250ReadReg<TDA5250_REG_TYPE_STATUS>       as STATUS;
     interface Tda5250ReadReg<TDA5250_REG_TYPE_ADC>          as ADC;
 
+    interface GeneralIO as ASKNFSK;
     interface GeneralIO as TXRX;
     interface GeneralIO as PWDDD;
     interface GpioInterrupt as PWDDDInterrupt;
@@ -176,24 +177,22 @@ implementation {
   /* << tested >> */
   async command void HplTda5250Config.UseFSK(tda5250_cap_vals_t pos_shift, tda5250_cap_vals_t neg_shift) {
     currentConfig = CONFIG_ASK_NFSK_FSK(currentConfig);
-    if(currentConfig | MASK_CONFIG_CONTROL_TXRX_REGISTER) {
+    if(currentConfig & MASK_CONFIG_CONTROL_TXRX_REGISTER) {
       call CONFIG.set(currentConfig);
     }
     else {
-      // ***** For Platforms that have a connection to the FSK pin *******
-      //call FSK.set(); 
+      call ASKNFSK.clr(); 
     }
     call FSK.set(((uint16_t)((((uint16_t)pos_shift) << 8) + neg_shift)));
   }
   /* << tested >> */
   async command void HplTda5250Config.UseASK(tda5250_cap_vals_t value) {
     currentConfig = CONFIG_ASK_NFSK_ASK(currentConfig);
-    if((currentConfig | MASK_CONFIG_CONTROL_TXRX_REGISTER)) {
+    if(currentConfig & MASK_CONFIG_CONTROL_TXRX_REGISTER) {
       call CONFIG.set(currentConfig);
     } 
     else {
-      // ***** For Platforms that have a connection to the FSK pin *******
-      //call FSK.set(); 
+      call ASKNFSK.set(); 
     }
     call FSK.set((((uint16_t)value) << 8));
   }
@@ -465,7 +464,7 @@ implementation {
   async command void HplTda5250Config.SetTxMode() {
     currentConfig = CONFIG_RX_NTX_TX(currentConfig);
     currentConfig = CONFIG_ALL_PD_NORMAL(currentConfig);
-    if (currentConfig | MASK_CONFIG_CONTROL_TXRX_REGISTER) {
+    if (currentConfig & MASK_CONFIG_CONTROL_TXRX_REGISTER) {
       call CONFIG.set(currentConfig);
     }
     else {
@@ -473,12 +472,12 @@ implementation {
       call PWDDD.clr();
     }
   }
-
   /* << tested >> */
   async command void HplTda5250Config.SetRxMode() {
     currentConfig = CONFIG_RX_NTX_RX(currentConfig);
     currentConfig = CONFIG_ALL_PD_NORMAL(currentConfig);
-    if (currentConfig | MASK_CONFIG_CONTROL_TXRX_REGISTER) {
+    if (currentConfig & MASK_CONFIG_CONTROL_TXRX_REGISTER) {
       call CONFIG.set(currentConfig);
     }
     else {
@@ -490,7 +489,7 @@ implementation {
   /* << tested >> */
   async command void HplTda5250Config.SetSleepMode() {
     currentConfig = CONFIG_ALL_PD_POWER_DOWN(currentConfig);
-    if (currentConfig | MASK_CONFIG_CONTROL_TXRX_REGISTER) {
+    if (currentConfig & MASK_CONFIG_CONTROL_TXRX_REGISTER) {
       call CONFIG.set(currentConfig);
     }
     else {
@@ -498,6 +497,10 @@ implementation {
       call PWDDD.set();
     }
   }
+  
+  async command bool HplTda5250Config.IsTxRxPinControlled() {
+    return (currentConfig & MASK_CONFIG_CONTROL_TXRX_REGISTER);
+  }
 
   /****************************************************************
   Events Implemented