summaryrefslogtreecommitdiff
path: root/digital/zigbit/bitcloud/stack/Components/SystemEnvironment/include/sysTimer.h
diff options
context:
space:
mode:
Diffstat (limited to 'digital/zigbit/bitcloud/stack/Components/SystemEnvironment/include/sysTimer.h')
-rw-r--r--digital/zigbit/bitcloud/stack/Components/SystemEnvironment/include/sysTimer.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/digital/zigbit/bitcloud/stack/Components/SystemEnvironment/include/sysTimer.h b/digital/zigbit/bitcloud/stack/Components/SystemEnvironment/include/sysTimer.h
new file mode 100644
index 00000000..4420725d
--- /dev/null
+++ b/digital/zigbit/bitcloud/stack/Components/SystemEnvironment/include/sysTimer.h
@@ -0,0 +1,79 @@
+/**************************************************************************//**
+ \file sysTimer.h
+
+ \brief Simple interface of HAL application timer.
+
+ \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:
+ 2010-10-18 Max Gekk - Created.
+ Last change:
+ $Id: sysTimer.h 17448 2011-06-09 13:53:59Z ataradov $
+ ******************************************************************************/
+#if !defined _SYS_TIMER_H
+#define _SYS_TIMER_H
+
+/******************************************************************************
+ Includes section
+ ******************************************************************************/
+#include <appTimer.h>
+
+/******************************************************************************
+ Types section
+ ******************************************************************************/
+/* Internal states of system timer. */
+typedef enum _SYS_TimerState_t
+{
+ SYS_TIMER_STOPPED = 0x00,
+ SYS_TIMER_STARTED = 0x01
+} SYS_TimerState_t;
+
+/* Type of the system timer. */
+typedef struct _SYS_Timer_t
+{
+ SYS_TimerState_t state;
+ HAL_AppTimer_t timer;
+} SYS_Timer_t;
+
+
+/******************************************************************************
+ Prototypes section
+ ******************************************************************************/
+/******************************************************************************
+ \brief Initialize the System Timer.
+
+ \param[in] sysTimer - timer pointer will be initialized.
+ \param[in] mode - timer mode: TIMER_ONE_SHOT_MODE or TIMER_REPEAT_MODE.
+ \param[in] interval - timer interval (milliseconds).
+ \param[in] handler - timer handler function pointer.
+
+ \return None.
+ *****************************************************************************/
+void SYS_InitTimer(SYS_Timer_t *const sysTimer, const TimerMode_t mode,
+ const uint32_t interval, void (*handler)(void));
+
+/******************************************************************************
+ \brief Start the HAL Application Timer.
+
+ \param[in] appTimer - timer pointer will be started.
+ \return None.
+ ******************************************************************************/
+void SYS_StartTimer(SYS_Timer_t *const sysTimer);
+
+/******************************************************************************
+ \brief Stop the HAL Application Timer.
+
+ \param[in] appTimer - timer pointer will be stopped.
+
+ \return None.
+ *****************************************************************************/
+void SYS_StopTimer(SYS_Timer_t *const sysTimer);
+
+#endif /* _SYS_TIMER_H */
+/** eof sysTimer.h */