X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Fchips%2Ftda5250%2FHplTda5250ConfigP.nc;h=cb6616434a857a142230936a84159640a1786584;hb=1a329382c4f4556fd52d85f4e3f4a67e54911682;hp=a0918499e38d1a8ac3c6084a2a5564de109e78a3;hpb=1ba974b83d19fc41bf80acd52726f36f7f1df297;p=tinyos-2.x.git diff --git a/tos/chips/tda5250/HplTda5250ConfigP.nc b/tos/chips/tda5250/HplTda5250ConfigP.nc index a0918499..cb661643 100644 --- a/tos/chips/tda5250/HplTda5250ConfigP.nc +++ b/tos/chips/tda5250/HplTda5250ConfigP.nc @@ -60,6 +60,7 @@ module HplTda5250ConfigP { interface Tda5250ReadReg as STATUS; interface Tda5250ReadReg 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