summaryrefslogtreecommitdiffhomepage
path: root/digital/zigbit/bitcloud/stack/Components/BSP/RCB/include
diff options
context:
space:
mode:
Diffstat (limited to 'digital/zigbit/bitcloud/stack/Components/BSP/RCB/include')
-rw-r--r--digital/zigbit/bitcloud/stack/Components/BSP/RCB/include/bspLeds.h68
-rw-r--r--digital/zigbit/bitcloud/stack/Components/BSP/RCB/include/bspTaskManager.h60
2 files changed, 128 insertions, 0 deletions
diff --git a/digital/zigbit/bitcloud/stack/Components/BSP/RCB/include/bspLeds.h b/digital/zigbit/bitcloud/stack/Components/BSP/RCB/include/bspLeds.h
new file mode 100644
index 00000000..8bfb459f
--- /dev/null
+++ b/digital/zigbit/bitcloud/stack/Components/BSP/RCB/include/bspLeds.h
@@ -0,0 +1,68 @@
+/***************************************************************************//**
+\file bspLeds.h
+
+\brief Declaration of leds defines.
+
+\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:
+ 26.08.09 A. Taradov - Created
+*******************************************************************************/
+
+#ifndef _BSPLEDS_H
+#define _BSPLEDS_H
+
+/******************************************************************************
+ Includes section
+******************************************************************************/
+// \cond
+#include <gpio.h>
+#include <leds.h>
+// \endcond
+
+/******************************************************************************
+ Define(s) section
+******************************************************************************/
+
+#define halInitFirstLed() GPIO_E2_make_out()
+#define halUnInitFirstLed() GPIO_E2_make_in()
+#define halOnFirstLed() GPIO_E2_clr()
+#define halOffFirstLed() GPIO_E2_set()
+#define halReadFirstLed() GPIO_E2_read()
+#define halToggleFirstLed() GPIO_E2_toggle()
+
+#define halInitSecondLed() GPIO_E3_make_out()
+#define halUnInitSecondLed() GPIO_E3_make_in()
+#define halOnSecondLed() GPIO_E3_clr()
+#define halOffSecondLed() GPIO_E3_set()
+#define halReadSecondLed() GPIO_E3_read()
+#define halToggleSecondLed() GPIO_E3_toggle()
+
+#if (APP_USART_CHANNEL == USART_CHANNEL_USBFIFO) && defined(ATMEGA128RFA1)
+
+#define halInitThirdLed()
+#define halUnInitThirdLed()
+#define halOnThirdLed()
+#define halOffThirdLed()
+#define halReadThirdLed()
+#define halToggleThirdLed()
+
+#else
+
+#define halInitThirdLed() GPIO_E4_make_out()
+#define halUnInitThirdLed() GPIO_E4_make_in()
+#define halOnThirdLed() GPIO_E4_clr()
+#define halOffThirdLed() GPIO_E4_set()
+#define halReadThirdLed() GPIO_E4_read()
+#define halToggleThirdLed() GPIO_E4_toggle()
+
+#endif // APP_USART_CHANNEL == USART_CHANNEL_USBFIFO
+
+#endif /*_BSPLEDS_H*/
+// eof bspLeds.h
diff --git a/digital/zigbit/bitcloud/stack/Components/BSP/RCB/include/bspTaskManager.h b/digital/zigbit/bitcloud/stack/Components/BSP/RCB/include/bspTaskManager.h
new file mode 100644
index 00000000..2bd88abb
--- /dev/null
+++ b/digital/zigbit/bitcloud/stack/Components/BSP/RCB/include/bspTaskManager.h
@@ -0,0 +1,60 @@
+/**************************************************************************//**
+\file bspTaslManager.h
+
+\brief Declarations of enums and functions of BSP task manager.
+
+\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:
+ 26.08.09 A. Taradov - Created
+*******************************************************************************/
+
+#ifndef _BSPTASKHANDLER_H
+#define _BSPTASKHANDLER_H
+
+/******************************************************************************
+ Includes section
+******************************************************************************/
+// \cond
+#include <types.h>
+#include <taskManager.h>
+// \endcond
+
+/******************************************************************************
+ Define(s) section
+******************************************************************************/
+enum
+{
+ BSP_BUTTONS = (uint8_t)1 << 0,
+ BSP_TEMPERATURE = (uint8_t)1 << 1,
+ BSP_LIGHT = (uint8_t)1 << 2,
+ BSP_BATTERY = (uint8_t)1 << 3,
+};
+
+/******************************************************************************
+ External variables section
+******************************************************************************/
+extern volatile uint8_t bspTaskFlags;
+
+/******************************************************************************
+ Inline static functions section
+******************************************************************************/
+/***************************************************************************//**
+\brief posting bsp task for task manager.
+\param[in]
+ flag - task number
+*******************************************************************************/
+INLINE void bspPostTask(uint8_t flag)
+{
+ bspTaskFlags |= flag;
+ SYS_PostTask(BSP_TASK_ID);
+}
+
+#endif /* _BSPTASKHANDLER_H */
+// eof bspTaskManager.h