summaryrefslogtreecommitdiffhomepage
path: root/digital/zigbit/bitcloud/stack/Components/BSP/include/joystick.h
blob: d2c8581e062fd6f7ba55d12b6e023f1dc2e9c551 (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
70
71
72
73
74
/***************************************************************************//**
  \file  joystick.h

  \brief The header file describes the joystick 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:
    10/09/07 A. Khromykh - Created
*******************************************************************************/

#ifndef _BSPJOYSTICK_H
#define _BSPJOYSTICK_H

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

/******************************************************************************
                   Types section
******************************************************************************/
/*! \brief joystick states */
typedef enum
{
  JOYSTICK_LEFT,
  JOYSTICK_RIGHT,
  JOYSTICK_UP,
  JOYSTICK_DOWN,
  JOYSTICK_PUSH
} BSP_JoystickState_t;

/******************************************************************************
                   Prototypes section
******************************************************************************/
/**************************************************************************//**
\brief Opens component and registers�handler�for�joystick�events.
\param[in]
    generalHandler�- the joystick handler
\param[in]
    state�- joystick state�
\return
  BC_FAIL -�joystick module is busy, \n
  BC_SUCCESS - joystick module is free.
******************************************************************************/
result_t BSP_OpenJoystick(void (*generalHandler)(BSP_JoystickState_t state));

/**************************************************************************//**
\brief closes joystick component.

\return
  BC_FAIL -�joystick module was not opened, \n
  BC_SUCCESS - joystick module was closed.
******************************************************************************/
result_t BSP_CloseJoystick(void);

/**************************************************************************//**
\brief Reads state of joystick.

\return
 �  Joystick�state.
******************************************************************************/
BSP_JoystickState_t BSP_ReadJoystickState(void);

#endif /* _BSPJOYSTICK_H */
//eof joystick.h