summaryrefslogtreecommitdiffhomepage
path: root/digital/zigbit/bitcloud/stack/Components/HAL/include/sleepTimer.h
blob: 87c2963200a5e895991ff70399221377dcf0bf53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/**************************************************************************//**
  \file  sleepTimer.h

  \brief The header file describes the sleepTimer interface.

  \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:
    29/05/07 E. Ivanov - Created
 ******************************************************************************/
/******************************************************************************
 *   WARNING: CHANGING THIS FILE MAY AFFECT CORE FUNCTIONALITY OF THE STACK.  *
 *   EXPERT USERS SHOULD PROCEED WITH CAUTION.                                *
 ******************************************************************************/

#ifndef _SLEEPTIMER_H
#define _SLEEPTIMER_H

// \cond
/******************************************************************************
                   Includes section
******************************************************************************/
#include <bcTimer.h>
// \endcond

/******************************************************************************
                   Types section
******************************************************************************/
/** \brief fields of structure \n
    \brief uint32_t interval - timer firing interval (set by user) \n
    \brief TimerMode_t mode - timer work mode (set by user). Must be chosen from: \n
           TIMER_REPEAT_MODE \n
           TIMER_ONE_SHOT_MODE \n
    \brief void (*callback)() - pointer to the timer callback function (set by user) \n */
typedef Timer_t HAL_SleepTimer_t;

/******************************************************************************
                   Prototypes section
******************************************************************************/
/**************************************************************************//**
\brief Starts sleep timer. Interval must be greater one time of sleep timer tick.
\param[in]
    sleepTimer - pointer to sleep timer structure.
\return
  -1 - NULL pointer, \n
  -2 - interval can not be counted out, \n
  -3 - sleep timer has already started, \n
   0 - otherwise.
******************************************************************************/
int HAL_StartSleepTimer(HAL_SleepTimer_t *sleepTimer);

/**************************************************************************//**
\brief Removes timer.
\param[in]
  sleepTimer - address of the timer to be removed from the list
\return
  -1 - there is no active sleep timer, \n
   0 - otherwise.
******************************************************************************/
int HAL_StopSleepTimer(HAL_SleepTimer_t *sleepTimer);

#endif /* _SLEEPTIMER_H */
// eof sleepTimer.h