summaryrefslogtreecommitdiff
path: root/digital/zigbit/bitcloud/stack/Components/BSP/include/joystick.h
diff options
context:
space:
mode:
Diffstat (limited to 'digital/zigbit/bitcloud/stack/Components/BSP/include/joystick.h')
-rw-r--r--digital/zigbit/bitcloud/stack/Components/BSP/include/joystick.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/digital/zigbit/bitcloud/stack/Components/BSP/include/joystick.h b/digital/zigbit/bitcloud/stack/Components/BSP/include/joystick.h
new file mode 100644
index 00000000..d2c8581e
--- /dev/null
+++ b/digital/zigbit/bitcloud/stack/Components/BSP/include/joystick.h
@@ -0,0 +1,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