From b24866225a6301d3a663f874725e83c012dc25d3 Mon Sep 17 00:00:00 2001 From: Florent Duchon Date: Wed, 26 Dec 2012 17:36:00 +0100 Subject: digital/beacon: add bitcloud stack into common directory digital/zigbit --- .../stack/Components/BSP/include/buttons.h | 96 ++++++++++++++ .../stack/Components/BSP/include/hexSwitch.h | 45 +++++++ .../stack/Components/BSP/include/joystick.h | 74 +++++++++++ .../bitcloud/stack/Components/BSP/include/lcd.h | 140 +++++++++++++++++++++ .../bitcloud/stack/Components/BSP/include/leds.h | 83 ++++++++++++ .../stack/Components/BSP/include/rs232Controller.h | 89 +++++++++++++ .../stack/Components/BSP/include/rs485Controller.h | 33 +++++ .../stack/Components/BSP/include/sensors.h | 137 ++++++++++++++++++++ .../stack/Components/BSP/include/sliders.h | 43 +++++++ .../stack/Components/BSP/include/usbController.h | 42 +++++++ 10 files changed, 782 insertions(+) create mode 100644 digital/zigbit/bitcloud/stack/Components/BSP/include/buttons.h create mode 100644 digital/zigbit/bitcloud/stack/Components/BSP/include/hexSwitch.h create mode 100644 digital/zigbit/bitcloud/stack/Components/BSP/include/joystick.h create mode 100644 digital/zigbit/bitcloud/stack/Components/BSP/include/lcd.h create mode 100644 digital/zigbit/bitcloud/stack/Components/BSP/include/leds.h create mode 100644 digital/zigbit/bitcloud/stack/Components/BSP/include/rs232Controller.h create mode 100644 digital/zigbit/bitcloud/stack/Components/BSP/include/rs485Controller.h create mode 100644 digital/zigbit/bitcloud/stack/Components/BSP/include/sensors.h create mode 100644 digital/zigbit/bitcloud/stack/Components/BSP/include/sliders.h create mode 100644 digital/zigbit/bitcloud/stack/Components/BSP/include/usbController.h (limited to 'digital/zigbit/bitcloud/stack/Components/BSP/include') 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 +// \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 diff --git a/digital/zigbit/bitcloud/stack/Components/BSP/include/hexSwitch.h b/digital/zigbit/bitcloud/stack/Components/BSP/include/hexSwitch.h new file mode 100644 index 00000000..f052fa83 --- /dev/null +++ b/digital/zigbit/bitcloud/stack/Components/BSP/include/hexSwitch.h @@ -0,0 +1,45 @@ +/**************************************************************************//** + \file hexSwitch.h + + \brief Interface of hex switch. + + \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: + 7/10/08 A. Khromykh - Created +******************************************************************************/ +#ifndef _HEXSWITCH_H +#define _HEXSWITCH_H + +/****************************************************************************** + Includes section +******************************************************************************/ +#include + +/****************************************************************************** + Define(s) section +******************************************************************************/ +#define HEX_SWITCH_FIRST 0 +#define HEX_SWITCH_SECOND 1 + +/****************************************************************************** + Prototypes section +******************************************************************************/ +/**************************************************************************//** +\brief Read the hex switch. + +\param[in] + nmSwitch - hex switch number + +\return + hex code. +******************************************************************************/ +uint8_t BSP_ReadHexSwitch(uint8_t nmSwitch); + +#endif /* _HEXSWITCH_H */ 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 +// \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 diff --git a/digital/zigbit/bitcloud/stack/Components/BSP/include/lcd.h b/digital/zigbit/bitcloud/stack/Components/BSP/include/lcd.h new file mode 100644 index 00000000..82650936 --- /dev/null +++ b/digital/zigbit/bitcloud/stack/Components/BSP/include/lcd.h @@ -0,0 +1,140 @@ +/**************************************************************************//** + \file lcd.h + + \brief The header file describes enums and functions of BSP LCD controller. + + \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: + 17/12/08 E. ALuzhetsky - Created +*******************************************************************************/ + +#ifndef _LCD_H +#define _LCD_H + +/****************************************************************************** + Includes section +******************************************************************************/ +// \cond +#include +#include +// \endcond + +/****************************************************************************** + Define(s) section +******************************************************************************/ +typedef enum +{ + // Symbols + LCD_CMD_SYMB_RAVEN_ON = 0x00, + LCD_CMD_SYMB_RAVEN_OFF = 0x01, + + LCD_CMD_SYMB_BELL_ON = 0x02, + LCD_CMD_SYMB_BELL_OFF = 0x03, + + LCD_CMD_SYMB_TONE_ON = 0x04, + LCD_CMD_SYMB_TONE_OFF = 0x05, + + LCD_CMD_SYMB_MIC_ON = 0x06, + LCD_CMD_SYMB_MIC_OFF = 0x07, + + LCD_CMD_SYMB_SPEAKER_ON = 0x08, + LCD_CMD_SYMB_SPEAKER_OFF = 0x09, + + LCD_CMD_SYMB_KEY_ON = 0x0a, + LCD_CMD_SYMB_KEY_OFF = 0x0b, + + LCD_CMD_SYMB_ATT_ON = 0x0c, + LCD_CMD_SYMB_ATT_OFF = 0x0d, + + LCD_CMD_SYMB_SPACE_SUN = 0x0e, + LCD_CMD_SYMB_SPACE_MOON = 0x0f, + LCD_CMD_SYMB_SPACE_OFF = 0x10, + + LCD_CMD_SYMB_CLOCK_AM = 0x11, + LCD_CMD_SYMB_CLOCK_PM = 0x12, + LCD_CMD_SYMB_CLOCK_OFF = 0x13, + + LCD_CMD_SYMB_TRX_RX = 0x14, + LCD_CMD_SYMB_TRX_TX = 0x15, + LCD_CMD_SYMB_TRX_OFF = 0x16, + + LCD_CMD_SYMB_IP_ON = 0x17, + LCD_CMD_SYMB_IP_OFF = 0x18, + + LCD_CMD_SYMB_PAN_ON = 0x19, + LCD_CMD_SYMB_PAN_OFF = 0x1a, + + LCD_CMD_SYMB_ZLINK_ON = 0x1b, + LCD_CMD_SYMB_ZLINK_OFF = 0x1c, + + LCD_CMD_SYMB_ZIGBEE_ON = 0x1d, + LCD_CMD_SYMB_ZIGBEE_OFF = 0x1e, + + LCD_CMD_SYMB_ANTENNA_LEVEL_0 = 0x1f, + LCD_CMD_SYMB_ANTENNA_LEVEL_1 = 0x20, + LCD_CMD_SYMB_ANTENNA_LEVEL_2 = 0x21, + LCD_CMD_SYMB_ANTENNA_OFF = 0x22, + + //LCD_CMD_SYMB_BAT // bettery symbol is controlled by ATMega3290... + + LCD_CMD_SYMB_ENV_OPEN = 0x23, + LCD_CMD_SYMB_ENV_CLOSE = 0x24, + LCD_CMD_SYMB_ENV_OFF = 0x25, + + LCD_CMD_SYMB_TEMP_CELSIUS = 0x26, + LCD_CMD_SYMB_TEMP_FAHRENHEIT = 0x27, + LCD_CMD_SYMB_TEMP_OFF = 0x28, + + LCD_CMD_SYMB_MINUS_ON = 0x29, + LCD_CMD_SYMB_MINUS_OFF = 0x2a, + + LCD_CMD_SYMB_DOT_ON = 0x2b, + LCD_CMD_SYMB_DOT_OFF = 0x2c, + + LCD_CMD_SYMB_COL_ON = 0x2d, + LCD_CMD_SYMB_COL_OFF = 0x2e, + + // Led + LCD_CMD_LED_ON = 0x2f, + LCD_CMD_LED_TOGGLE = 0x30, + LCD_CMD_LED_OFF = 0x31, +} BspLcdCmd_t ; + +/****************************************************************************** + External variables section +******************************************************************************/ +/****************************************************************************** + Function prototypes section +******************************************************************************/ +/**************************************************************************//** +\brief Initializes UART to control LCD. +******************************************************************************/ +extern void BSP_OpenLcd(void); + +/**************************************************************************//** +\brief Sends the command to the LCD. +******************************************************************************/ +extern void BSP_SendLcdCmd(BspLcdCmd_t cmdId); + +/**************************************************************************//** +\brief Sends the message to the LCD. +******************************************************************************/ +extern void BSP_SendLcdMsg(const char *str); + +/**************************************************************************//** +\brief Checks whether the LCD command transmission is finished or not. + +\param void +\return 1 in case if empty, 0 otherwise +******************************************************************************/ +extern int BSP_IsLcdOperationCompleted(void); + +#endif /* _LCD_H */ +// eof lcd.h diff --git a/digital/zigbit/bitcloud/stack/Components/BSP/include/leds.h b/digital/zigbit/bitcloud/stack/Components/BSP/include/leds.h new file mode 100644 index 00000000..a75bb28c --- /dev/null +++ b/digital/zigbit/bitcloud/stack/Components/BSP/include/leds.h @@ -0,0 +1,83 @@ +/************************************************************//** + \file leds.h + + \brief The header file describes the leds 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 _LEDS_H +#define _LEDS_H + +/**************************************************************** + Includes section +*****************************************************************/ +// \cond +#include +// \endcond + +/**************************************************************** + Define(s) section +*****************************************************************/ +#define LED_FIRST 0 +#define LED_SECOND 1 +#define LED_THIRD 2 +#define LED_FOURTH 3 +#define LED_FIFTH 4 +#define LED_SIXTH 5 +#define LED_SEVENTH 6 +#define LED_EIGHTH 7 +#define LED_RED LED_FIRST +#define LED_YELLOW LED_SECOND +#define LED_GREEN LED_THIRD +#define LED_BLUE LED_FOURTH + +/**************************************************************** + Prototypes section +*****************************************************************/ +/************************************************************//** +\brief Opens leds module to use. +\return + BC_SUCCESS - always. +****************************************************************/ +result_t BSP_OpenLeds(void); + +/************************************************************//** +\brief Closes leds module. +\return + BC_SUCCESS - always. +****************************************************************/ +result_t BSP_CloseLeds(void); + +/************************************************************//** +\brief Turns on a led. +\param[in] + id - number of the led to proceed. Must be chosen from defines. +****************************************************************/ +void BSP_OnLed(uint8_t id); + +/************************************************************//** +\brief Turns off a led. +\param[in] + id - number of the led to proceed. Must be chosen from defines. +****************************************************************/ +void BSP_OffLed(uint8_t id); + +/************************************************************//** +\brief Switches the led state to the opposite. +\param[in] + id - number of the led to proceed. Must be chosen from defines. +****************************************************************/ +void BSP_ToggleLed(uint8_t id); + +#endif /* _LEDS_H */ +// eof leds.h diff --git a/digital/zigbit/bitcloud/stack/Components/BSP/include/rs232Controller.h b/digital/zigbit/bitcloud/stack/Components/BSP/include/rs232Controller.h new file mode 100644 index 00000000..b3cf887e --- /dev/null +++ b/digital/zigbit/bitcloud/stack/Components/BSP/include/rs232Controller.h @@ -0,0 +1,89 @@ +/************************************************************//** + \file rs232Controller.h + + \brief Functions for RS232 level converter 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: + 28.09.09 A. Taradov - Created +*****************************************************************/ +#ifndef _RS232CONTROLLER_H +#define _RS232CONTROLLER_H + +/***************************************************************** + Includes section +*****************************************************************/ +#include + +/************************************************************//** +\brief Enable RS232 level converter. +****************************************************************/ +static inline void BSP_EnableRs232(void) +{ +#if BSP_ENABLE_RS232_CONTROL == 1 + #if defined(RCB_ATMEGA128RFA1) + // ~EN + GPIO_D4_make_out(); + GPIO_D4_clr(); + + // FORCEON + GPIO_D6_make_out(); + GPIO_D6_set(); + + // ~FORCEOFF + GPIO_D7_make_out(); + GPIO_D7_set(); + #elif defined(RCB230_V31) || defined(RCB230_V32) || defined(RCB230_V331) || defined(RCB231_V402) || \ + defined(RCB231_V411) || defined(RCB212_V532) + // ~EN + GPIO_13_make_out(); + GPIO_13_clr(); + + // FORCEON + GPIO_15_make_out(); + GPIO_15_set(); + + // ~FORCEOFF + GPIO_16_make_out(); + GPIO_16_set(); + #elif defined(BOARD_SAM3S_EK) + // ~EN + GPIO_PA23_make_out(); + GPIO_PA23_clr(); + #else + #error 'Unsupported board.' + #endif +#endif +}; + +/************************************************************//** +\brief Disable RS232 level converter. +****************************************************************/ +static inline void BSP_DisableRs232(void) +{ +#if BSP_ENABLE_RS232_CONTROL == 1 + #if defined(RCB_ATMEGA128RFA1) + GPIO_D4_make_in(); + GPIO_D6_make_in(); + GPIO_D7_make_in(); + #elif defined(RCB230_V31) || defined(RCB230_V32) || defined(RCB230_V331) || defined(RCB231_V402) || \ + defined(RCB231_V411) || defined(RCB212_V532) + GPIO_13_make_in(); + GPIO_15_make_in(); + GPIO_16_make_in(); + #elif defined(BOARD_SAM3S_EK) + GPIO_PA23_make_in(); + #else + #error 'Unsupported board.' + #endif +#endif +}; + +#endif /* _RS232CONTROLLER_H */ diff --git a/digital/zigbit/bitcloud/stack/Components/BSP/include/rs485Controller.h b/digital/zigbit/bitcloud/stack/Components/BSP/include/rs485Controller.h new file mode 100644 index 00000000..7323b032 --- /dev/null +++ b/digital/zigbit/bitcloud/stack/Components/BSP/include/rs485Controller.h @@ -0,0 +1,33 @@ +/************************************************************//** + \file rs485Controller.h + + \brief The header file describes functions for enabling\disabling rs485 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: + 12/11/08 A. Khromykh - Created +*****************************************************************/ +#ifndef _RS485CONTROLLER_H +#define _RS485CONTROLLER_H + +/**************************************************************** + Prototypes section +*****************************************************************/ +/************************************************************//** +\brief Enable RTS driving for RS485 driver. +****************************************************************/ +void BSP_EnableRs485(void); + +/************************************************************//** +\brief Disable RTS driving for RS485 driver. +****************************************************************/ +void BSP_DisableRs485(void); + +#endif /* _RS485CONTROLLER_H */ diff --git a/digital/zigbit/bitcloud/stack/Components/BSP/include/sensors.h b/digital/zigbit/bitcloud/stack/Components/BSP/include/sensors.h new file mode 100644 index 00000000..740c6a05 --- /dev/null +++ b/digital/zigbit/bitcloud/stack/Components/BSP/include/sensors.h @@ -0,0 +1,137 @@ +/**************************************************************************//** + \file sensors.h + + \brief The header file describes the sensors 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 _SENSORS_H +#define _SENSORS_H + +/****************************************************************************** + Includes section +******************************************************************************/ +// \cond +#include +// \endcond + +/****************************************************************************** + Define(s) section +******************************************************************************/ +// \cond +#define SENSOR_LIGHT 1 +#define SENSOR_TEMPERATURE 2 +#define SENSOR_BATTERY 3 +#define SENSOR_LED 4 +// \endcond + +typedef void (*BspTemperatureCb_t)(bool result, int16_t data); +typedef void (*BspBatteryCb_t)(int16_t data); + +/****************************************************************************** + Prototypes section +******************************************************************************/ +/***************************************************************************//** +\brief Opens temperature sensor. +\return + BC_FAIL - sensor has been already open. \n + BC_SUCCESS - otherwise. +*******************************************************************************/ +result_t BSP_OpenTemperatureSensor(void); + +/***************************************************************************//** +\brief Closes the temperature sensor. +\return + BC_FAIL - if a hardware error has occured or + there is uncompleted ReadData request. \n + BC_SUCCESS - otherwise. +*******************************************************************************/ +result_t BSP_CloseTemperatureSensor(void); + +/**************************************************************************//** +\brief Reads data from the temperature sensor. +\param[in] + f - callback. + result - the result of the requested operation. + true - operation finished successfully, false - some error has + occured. + data - sensor data. +\return + BC_FAIL - previous request was not completed. \n + BC_SUCCESS - otherwise. +******************************************************************************/ +result_t BSP_ReadTemperatureData(BspTemperatureCb_t f); + +/***************************************************************************//** +\brief Opens the light sensor. +\return + BC_FAIL - sensor has been already open. \n + BC_SUCCESS - otherwise. +*******************************************************************************/ +result_t BSP_OpenLightSensor(void); + +/***************************************************************************//** +\brief Closes the light sensor. +\return + BC_FAIL - if a hardware error has occured or + there is uncompleted ReadData request. \n + BC_SUCCESS - otherwise. +*******************************************************************************/ +result_t BSP_CloseLightSensor(void); + +/**************************************************************************//** +\brief Reads data from the light sensor. +\param[in] + f - callback. + result - the result of the requested operation. + true - operation finished successfully, false - some error has + occured. + data - sensor data. +\return + BC_FAIL - previous request was not completed. \n + BC_SUCCESS - otherwise. +******************************************************************************/ +result_t BSP_ReadLightData(void (*f)(bool result, int16_t data)); + +/***************************************************************************//** +\brief Opens the battery sensor. +\return + BC_FAIL - sensor has been already open. \n + BC_SUCCESS - otherwise. +*******************************************************************************/ +result_t BSP_OpenBatterySensor(void); + +/***************************************************************************//** +\brief Closes the battery sensor. +\return + BC_FAIL - sensor was not opened. \n + BC_SUCCESS - otherwise. +*******************************************************************************/ +result_t BSP_CloseBatterySensor(void); + +/**************************************************************************//** +\brief Reads data from battery sensor. +\param[in] + callback - callback function. + data - sensor data. + Can use (4ul * data * 125ul * 3ul) / (1024ul * 100ul) formula to count \n + battery data in Volts (for avr). +\return + BC_FAIL - previous request was not completed, or sensor was not opened. \n + BC_SUCCESS - otherwise. +******************************************************************************/ +result_t BSP_ReadBatteryData(BspBatteryCb_t cb); + +#endif/* _SENSORS_H */ +// eof sensors.h + diff --git a/digital/zigbit/bitcloud/stack/Components/BSP/include/sliders.h b/digital/zigbit/bitcloud/stack/Components/BSP/include/sliders.h new file mode 100644 index 00000000..67c19e93 --- /dev/null +++ b/digital/zigbit/bitcloud/stack/Components/BSP/include/sliders.h @@ -0,0 +1,43 @@ +/**************************************************************************//** + \file sliders.h + + \brief The header file describes the sliders 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 _SLIDERS_H +#define _SLIDERS_H + +/****************************************************************************** + Define(s) section +******************************************************************************/ +#define SLIDER0 (1 << 0) +#define SLIDER1 (1 << 1) +#define SLIDER2 (1 << 2) +#define SLIDER3 (1 << 3) + +/****************************************************************************** + Prototypes section +******************************************************************************/ +/**************************************************************************//** +\brief Reads the sliders. +\return + State of onboard DIP switches. Use the ::SLIDER0, ::SLIDER1, ::SLIDER2, + ::SLIDER3 constants to check state. Bit value 1 indicates that the + corresponding slider is on.\n + Note that the ::SLIDER3 is available on MeshBean LAN and Turbo board only. +******************************************************************************/ +uint8_t BSP_ReadSliders(void); + +#endif /* _SLIDERS_H */ +// eof sliders.h diff --git a/digital/zigbit/bitcloud/stack/Components/BSP/include/usbController.h b/digital/zigbit/bitcloud/stack/Components/BSP/include/usbController.h new file mode 100644 index 00000000..518efe42 --- /dev/null +++ b/digital/zigbit/bitcloud/stack/Components/BSP/include/usbController.h @@ -0,0 +1,42 @@ +/************************************************************//** + \file usbController.h + + \brief The header file describes functions for driving usb line. + + \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: + 12/11/08 A. Khromykh - Created +*****************************************************************/ +#ifndef _USBCONTROLLER_H +#define _USBCONTROLLER_H + +/**************************************************************** + Prototypes section +*****************************************************************/ +/************************************************************//** +\brief Turn on pull-up on D+. +****************************************************************/ +void BSP_EnableUsb(void); + +/************************************************************//** +\brief Turn off pull-up on D+. +****************************************************************/ +void BSP_DisableUsb(void); + +/************************************************************//** +\brief Read VBUS line for detection of usb cable connection. + +\return + 0 - cable is not connected. + 1 - cable is not connected. +****************************************************************/ +uint8_t BSP_ReadVBUS(void); + +#endif /* _USBCONTROLLER_H */ -- cgit v1.2.3