From b24866225a6301d3a663f874725e83c012dc25d3 Mon Sep 17 00:00:00 2001 From: Florent Duchon Date: Wed, 26 Dec 2012 17:36:00 +0100 Subject: digital/beacon: add bitcloud stack into common directory digital/zigbit --- .../MAC_PHY/MAC_HWI/include/machwiSwitchRxCtrl.h | 113 +++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 digital/zigbit/bitcloud/stack/Components/MAC_PHY/MAC_HWI/include/machwiSwitchRxCtrl.h (limited to 'digital/zigbit/bitcloud/stack/Components/MAC_PHY/MAC_HWI/include/machwiSwitchRxCtrl.h') diff --git a/digital/zigbit/bitcloud/stack/Components/MAC_PHY/MAC_HWI/include/machwiSwitchRxCtrl.h b/digital/zigbit/bitcloud/stack/Components/MAC_PHY/MAC_HWI/include/machwiSwitchRxCtrl.h new file mode 100644 index 00000000..6891b07c --- /dev/null +++ b/digital/zigbit/bitcloud/stack/Components/MAC_PHY/MAC_HWI/include/machwiSwitchRxCtrl.h @@ -0,0 +1,113 @@ +/****************************************************************************** + \file machwiSwitchRxCtrl.h + + \brief Implementation of switching receiver control. + + \author + Atmel Corporation: http://www.atmel.com \n + Support email: avr@atmel.com + + Copyright (c) 2008-2011, Atmel Corporation. All rights reserved. + Licensed under Atmel's Limited License Agreement (BitCloudTM). + + \internal + History: + 23/08/07 A. Mandychev - Created. +******************************************************************************/ + +#ifndef _MACHWISWITCHRXCTRL_H +#define _MACHWISWITCHRXCTRL_H + +/****************************************************************************** + Includes section +******************************************************************************/ +#include +#include +#include + +/****************************************************************************** + Define(s) section +******************************************************************************/ + +/****************************************************************************** + Types section +******************************************************************************/ + +/****************************************************************************** + Constants section +******************************************************************************/ + +/****************************************************************************** + External variables +******************************************************************************/ +extern bool __switchIsLocked; + +/****************************************************************************** + Prototypes section +******************************************************************************/ +/****************************************************************************** + Switches receiver to TRX OFF if RxOnWhenIdle parameter isn't set. + Parameters: + hwdReq - pointer to MACHWD request memory. + switchingCompleted - callback to indicate the end of switching receiver. + Returns: + none. +******************************************************************************/ +void machwiSwitchRxAccordToRxOnWhenIdle(MachwiHwdReqDescr_t *hwdReq, + void (*switchingCompleted)(void)); + +/****************************************************************************** + Inline static functions section +******************************************************************************/ +/****************************************************************************** + Resets switching receiver control. + Parameters: + none. + Returns: + none. +******************************************************************************/ +static inline void machwiResetSwitchingRxCtrl(void) +{ + machwiGetMem()->switchIsLocked = false; +} + +/****************************************************************************** + Locks switching receiver control. + Parameters: + none. + Returns: + none. +******************************************************************************/ +static inline void machwiLockSwitchingRx(void) +{ + machwiGetMem()->switchIsLocked = true; +} + +/****************************************************************************** + Unlocks switching receiver control. + Parameters: + none. + Returns: + none. +******************************************************************************/ +static inline void machwiUnlockSwitchingRx(void) +{ + machwiGetMem()->switchIsLocked = false; +} + +/****************************************************************************** + Tests switching receiver control state. + Parameters: + none. + Returns: + true - switching receiver is locked. + false - otherwise. +******************************************************************************/ +static inline bool machwiIsSwitchingRxLocked(void) +{ + return machwiGetMem()->switchIsLocked; +} + +#endif /* _MACHWISWITCHRXCTRL_H */ + +// eof machwiSwitchRxCtrl.h -- cgit v1.2.3