summaryrefslogtreecommitdiff
path: root/digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include
diff options
context:
space:
mode:
authorFlorent Duchon2012-12-26 17:36:00 +0100
committerFlorent Duchon2013-02-13 21:21:12 +0100
commitb24866225a6301d3a663f874725e83c012dc25d3 (patch)
treeca527a2aab9abcdfbaf244c53ca63f0c531892b0 /digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include
parent2ba279f4eb2f23fa08a7c13465d16ae6ba5d0f96 (diff)
digital/beacon: add bitcloud stack into common directory digital/zigbit
Diffstat (limited to 'digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include')
-rw-r--r--digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/battery.h63
-rw-r--r--digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/bspDbg.h40
-rw-r--r--digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/bspLeds.h70
-rw-r--r--digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/bspTaskManager.h60
-rw-r--r--digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/lm73.h66
-rw-r--r--digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/pwrCtrl.h47
-rw-r--r--digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/tsl2550.h64
7 files changed, 410 insertions, 0 deletions
diff --git a/digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/battery.h b/digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/battery.h
new file mode 100644
index 00000000..5bdc91fe
--- /dev/null
+++ b/digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/battery.h
@@ -0,0 +1,63 @@
+/**************************************************************************//**
+\file battery.h
+
+\brief Interface to the battery sensor.
+
+\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/06/07 E. Ivanov - Created
+******************************************************************************/
+
+#ifndef _BATTERY_H
+#define _BATTERY_H
+
+/******************************************************************************
+ Includes section
+******************************************************************************/
+// \cond
+#include <types.h>
+#include <sensors.h>
+// \endcond
+
+/******************************************************************************
+ Prototypes section
+******************************************************************************/
+/**************************************************************************//**
+\brief Opens the component to use.
+\return
+ BC_SUCCESS - the component is ready to been use. \n
+ BC_FAIL - otherwise.
+******************************************************************************/
+result_t openBattery(void);
+
+/**************************************************************************//**
+\brief Closes component.
+\return
+ BC_SUCCESS - always.
+******************************************************************************/
+result_t closeBattery(void);
+
+/**************************************************************************//**
+\brief Starts ADC request on battery channel.
+\param[in]
+ callback - callback method.
+\param[in]
+ data - battery data.
+ Can use (4ul * data * 125ul * 3ul) / (1024ul * 100ul) formula to count \n
+ battery data in Volts.
+\return
+ BC_FAIL - battery component was not opened.
+ BC_SUCCESS - other case.
+******************************************************************************/
+result_t readBatteryData(BspBatteryCb_t);
+
+#endif /* _BATTERY_H */
+// eof battery.h
+
diff --git a/digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/bspDbg.h b/digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/bspDbg.h
new file mode 100644
index 00000000..b3bb6013
--- /dev/null
+++ b/digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/bspDbg.h
@@ -0,0 +1,40 @@
+/***************************************************************************//**
+ \file bspDbg.h
+
+ \brief Assert codes for BSP
+
+ \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/06/10 D. Loskutnikov - Created
+ ******************************************************************************/
+/******************************************************************************
+ * WARNING: CHANGING THIS FILE MAY AFFECT CORE FUNCTIONALITY OF THE STACK. *
+ * EXPERT USERS SHOULD PROCEED WITH CAUTION. *
+ ******************************************************************************/
+
+#ifndef _BSPDBG_H
+#define _BSPDBG_H
+
+/******************************************************************************
+ Includes section
+******************************************************************************/
+#include <dbg.h>
+
+/******************************************************************************
+ Definitions section
+******************************************************************************/
+enum
+{
+ TSL2550_UNEXPECTED_STATE = 0x9000,
+};
+
+#endif /* _BSPDBG_H */
+
+// eof bspDbg.h
diff --git a/digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/bspLeds.h b/digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/bspLeds.h
new file mode 100644
index 00000000..fc088281
--- /dev/null
+++ b/digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/bspLeds.h
@@ -0,0 +1,70 @@
+/***************************************************************************//**
+\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:
+ 29/05/07 E. Ivanov - Created
+*******************************************************************************/
+
+#ifndef _BSPLEDS_H
+#define _BSPLEDS_H
+
+/******************************************************************************
+ Includes section
+******************************************************************************/
+// \cond
+#include <gpio.h>
+#include <leds.h>
+// \endcond
+
+/******************************************************************************
+ Define(s) section
+******************************************************************************/
+
+#define halInitRedLed() GPIO_0_make_out()
+#define halUnInitRedLed() GPIO_0_make_in()
+#define halReadRedLed() GPIO_0_read()
+#define halToggleRedLed() GPIO_0_toggle()
+
+#define halInitYellowLed() GPIO_1_make_out()
+#define halUnInitYellowLed() GPIO_1_make_in()
+#define halReadYellowLed() GPIO_1_read()
+#define halToggleYellowLed() GPIO_1_toggle()
+
+#define halInitGreenLed() GPIO_2_make_out()
+#define halUnInitGreenLed() GPIO_2_make_in()
+#define halReadGreenLed() GPIO_2_read()
+#define halToggleGreenLed() GPIO_2_toggle()
+
+#if BSP_MNZB_EVB_SUPPORT == 1
+ #define halOnRedLed() GPIO_0_set()
+ #define halOffRedLed() GPIO_0_clr()
+
+ #define halOnYellowLed() GPIO_1_set()
+ #define halOffYellowLed() GPIO_1_clr()
+
+ #define halOnGreenLed() GPIO_2_set()
+ #define halOffGreenLed() GPIO_2_clr()
+#else
+ /* Atmel MeshBean boards */
+ #define halOnRedLed() GPIO_0_clr()
+ #define halOffRedLed() GPIO_0_set()
+
+ #define halOnYellowLed() GPIO_1_clr()
+ #define halOffYellowLed() GPIO_1_set()
+
+ #define halOnGreenLed() GPIO_2_clr()
+ #define halOffGreenLed() GPIO_2_set()
+#endif /* BSP_MNZB_EVB_SUPPORT */
+
+#endif /*_BSPLEDS_H*/
+// eof bspLeds.h
diff --git a/digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/bspTaskManager.h b/digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/bspTaskManager.h
new file mode 100644
index 00000000..a2198513
--- /dev/null
+++ b/digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/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:
+ 29/05/07 E. Ivanov - 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
diff --git a/digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/lm73.h b/digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/lm73.h
new file mode 100644
index 00000000..29cf29e2
--- /dev/null
+++ b/digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/lm73.h
@@ -0,0 +1,66 @@
+/**************************************************************************//**
+\file lm73.h
+
+\brief Declarations of lm73 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 _LM73_SENSOR_H
+#define _LM73_SENSOR_H
+
+/******************************************************************************
+ Includes section
+******************************************************************************/
+#include <types.h>
+
+/******************************************************************************
+ Prototypes section
+******************************************************************************/
+/**************************************************************************//**
+\brief Opens the component to use.
+
+\return
+ BC_SUCCESS - the component is ready to been use. \n
+ BC_FAIL - otherwise.
+******************************************************************************/
+result_t openLm73(void);
+
+/**************************************************************************//**
+\brief Performs the test if the component have completed request.
+
+\return
+ BC_FAIL - the previous request is not completed.
+ BC_SUCCESS - otherwise.
+******************************************************************************/
+result_t closeLm73(void);
+
+/**************************************************************************//**
+\brief Reads data from lm73 sensor.
+\param[in]
+ f - callback method.
+\param[in]
+ result - the result of the requested operation.
+ true - operation finished successfully,
+ false - some error has occured.
+\param[in]
+ data - sensor data.
+\return
+ BC_FAIL - the previous request was not completed,
+ the address of callback is 0, i2c interface is busy,
+ there is error on i2c interface.
+ BC_SUCCESS - other case.
+******************************************************************************/
+result_t readLm73Data(void (*f)(bool result, int16_t data));
+
+#endif /* _LM73_SENSOR_H */
+// eof lm73.h
diff --git a/digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/pwrCtrl.h b/digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/pwrCtrl.h
new file mode 100644
index 00000000..6a25e942
--- /dev/null
+++ b/digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/pwrCtrl.h
@@ -0,0 +1,47 @@
+/**************************************************************************//**
+\file pwrCtrl.h
+
+\brief Interface to the power control module.
+
+\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 _POWERCTRL_H
+#define _POWERCTRL_H
+
+/******************************************************************************
+ Includes section
+******************************************************************************/
+#include <types.h>
+
+/******************************************************************************
+ Prototypes section
+******************************************************************************/
+/**************************************************************************//**
+\brief Powers on periphery.
+
+\param[in]
+ id - number of periphery
+******************************************************************************/
+void bspOnPeriphery(uint8_t id);
+
+/**************************************************************************//**
+\brief Powers off periphery.
+
+\param[in]
+ id - number of periphery
+******************************************************************************/
+void bspOffPeriphery(uint8_t id);
+
+#endif /* _POWERCTRL_H */
+// eof pwrCtrl.h
+
diff --git a/digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/tsl2550.h b/digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/tsl2550.h
new file mode 100644
index 00000000..de869031
--- /dev/null
+++ b/digital/zigbit/bitcloud/stack/Components/BSP/MESHBEAN/include/tsl2550.h
@@ -0,0 +1,64 @@
+/**************************************************************************//**
+\file tsl2550.h
+
+\brief Declarations of tsl2550 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/06/07 E. Ivanov - Created
+*******************************************************************************/
+
+#ifndef _TSL2550_SENSOR_H
+#define _TSL2550_SENSOR_H
+
+/******************************************************************************
+ Includes section
+******************************************************************************/
+// \cond
+#include <types.h>
+// \endcond
+
+/******************************************************************************
+ Prototypes section
+******************************************************************************/
+/**************************************************************************//**
+\brief Opens the component to use.
+\return
+ BC_SUCCESS - the component is ready to been use. \n
+ BC_FAIL - otherwise.
+******************************************************************************/
+result_t openTsl2550(void);
+
+/**************************************************************************//**
+\brief Performs the test if the component have uncompleted request.
+\return
+ BC_FAIL - the previous request is not completed. \n
+ BC_SUCCES - otherwise.
+******************************************************************************/
+result_t closeTsl2550(void);
+
+/**************************************************************************//**
+\brief Reads data from tsl2550 sensor.
+\param[in]
+ result - the result of the requested operation.
+ true - operation finished successfully, false - some error has
+ occured.
+\param[in]
+ data - sensor data.
+\return
+ BC_FAIL - the previous request was not completed, \n
+ the address of callback is 0, i2c interface is busy, \n
+ there is error on i2c interface. \n
+ BC_SUCCESS - other case.
+******************************************************************************/
+result_t readTsl2550Data(void (*f)(bool result, int16_t data));
+
+#endif /* _TSL2550_SENSOR_H */
+// eof tsl2550.h