summaryrefslogtreecommitdiff
path: root/digital/zigbit/bitcloud/stack/Components/BSP/include/buttons.h
diff options
context:
space:
mode:
Diffstat (limited to 'digital/zigbit/bitcloud/stack/Components/BSP/include/buttons.h')
-rw-r--r--digital/zigbit/bitcloud/stack/Components/BSP/include/buttons.h96
1 files changed, 96 insertions, 0 deletions
diff --git a/digital/zigbit/bitcloud/stack/Components/BSP/include/buttons.h b/digital/zigbit/bitcloud/stack/Components/BSP/include/buttons.h
new file mode 100644
index 00000000..316c80d9
--- /dev/null
+++ b/digital/zigbit/bitcloud/stack/Components/BSP/include/buttons.h
@@ -0,0 +1,96 @@
+/***************************************************************************//**
+ \file buttons.h
+
+ \brief The header file describes the buttons 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
+*******************************************************************************/
+
+#ifndef _BSPBUTTONS_H
+#define _BSPBUTTONS_H
+
+/******************************************************************************
+ Includes section
+******************************************************************************/
+// \cond
+#include <types.h>
+// \endcond
+
+/******************************************************************************
+ Define(s) section
+******************************************************************************/
+// \cond
+#define BSP_KEY0 ((uint8_t)1 << 0)
+#define BSP_KEY1 ((uint8_t)1 << 1)
+#define BSP_KEY2 ((uint8_t)1 << 2)
+#define BSP_KEY3 ((uint8_t)1 << 3)
+#define BSP_KEY4 ((uint8_t)1 << 4)
+#define BSP_KEY5 ((uint8_t)1 << 5)
+#define BSP_KEY6 ((uint8_t)1 << 6)
+#define BSP_KEY7 ((uint8_t)1 << 7)
+// for avr32_evk1105
+#define BSP_UP 0
+#define BSP_DOWN 1
+#define BSP_RIGHT 2
+#define BSP_LEFT 3
+#define BSP_ENTER 4
+// \endcond
+
+/******************************************************************************
+ Types section
+******************************************************************************/
+
+// \cond
+typedef void (*BSP_ButtonsEventFunc_t)(uint8_t);
+// \endcond
+
+/******************************************************************************
+ Prototypes section
+******************************************************************************/
+/**************************************************************************//**
+\brief Registers handlers for button events.
+\param[in]
+ pressed - the handler to process pressing of the button \n
+ bn - button number.
+\param[in]
+ released - the handler to process releasing of the button \n
+ bn - button number.
+\return
+ BC_FAIL - buttons module is busy, \n
+ BC_SUCCESS - otherwise.
+******************************************************************************/
+result_t BSP_OpenButtons(void (*pressed)(uint8_t bn), void (*released)(uint8_t bn));
+
+/**************************************************************************//**
+\brief Cancel buttons handlers.
+\return
+ BC_FAIL - buttons module was not opened, \n
+ BC_SUCCESS - otherwise.
+******************************************************************************/
+result_t BSP_CloseButtons(void);
+
+/**************************************************************************//**
+\brief Reads state of the buttons.
+\return
+ Current buttons state in a binary way. \n
+ Bit 0 defines the state of button 1, \n
+ bit 1 defines the state of button 2 (for meshbean). \n
+ Bit 0 defines the state of up, \n
+ bit 1 defines the state of down, \n
+ bit 2 defines the state of right, \n
+ bit 3 defines the state of left, \n
+ bit 4 defines the state of enter(for avr32_evk1105).
+******************************************************************************/
+uint8_t BSP_ReadButtonsState(void);
+
+#endif /* _BSPBUTTONS_H */
+//eof buttons.h