From 22abd06132445a55a1a0266897920f26634825c1 Mon Sep 17 00:00:00 2001 From: Florent Duchon Date: Wed, 26 Dec 2012 17:38:10 +0100 Subject: digital/beacon: remove obsolete bitcloud stack --- .../Components/BSP/RCB/include/bspLeds.h | 68 ---- .../Components/BSP/RCB/include/bspTaskManager.h | 60 ---- .../Components/BSP/RCB/src/bspTaskManager.c | 86 ----- .../Components/BSP/RCB/src/buttons.c | 187 ----------- .../Components/BSP/RCB/src/fakeBSP.c | 356 --------------------- .../Bitcloud_stack/Components/BSP/RCB/src/leds.c | 124 ------- 6 files changed, 881 deletions(-) delete mode 100644 digital/beacon/src/Bitcloud_stack/Components/BSP/RCB/include/bspLeds.h delete mode 100644 digital/beacon/src/Bitcloud_stack/Components/BSP/RCB/include/bspTaskManager.h delete mode 100644 digital/beacon/src/Bitcloud_stack/Components/BSP/RCB/src/bspTaskManager.c delete mode 100644 digital/beacon/src/Bitcloud_stack/Components/BSP/RCB/src/buttons.c delete mode 100644 digital/beacon/src/Bitcloud_stack/Components/BSP/RCB/src/fakeBSP.c delete mode 100644 digital/beacon/src/Bitcloud_stack/Components/BSP/RCB/src/leds.c (limited to 'digital/beacon/src/Bitcloud_stack/Components/BSP/RCB') diff --git a/digital/beacon/src/Bitcloud_stack/Components/BSP/RCB/include/bspLeds.h b/digital/beacon/src/Bitcloud_stack/Components/BSP/RCB/include/bspLeds.h deleted file mode 100644 index 8bfb459f..00000000 --- a/digital/beacon/src/Bitcloud_stack/Components/BSP/RCB/include/bspLeds.h +++ /dev/null @@ -1,68 +0,0 @@ -/***************************************************************************//** -\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 -#include -// \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/beacon/src/Bitcloud_stack/Components/BSP/RCB/include/bspTaskManager.h b/digital/beacon/src/Bitcloud_stack/Components/BSP/RCB/include/bspTaskManager.h deleted file mode 100644 index 2bd88abb..00000000 --- a/digital/beacon/src/Bitcloud_stack/Components/BSP/RCB/include/bspTaskManager.h +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************//** -\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 -#include -// \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/beacon/src/Bitcloud_stack/Components/BSP/RCB/src/bspTaskManager.c b/digital/beacon/src/Bitcloud_stack/Components/BSP/RCB/src/bspTaskManager.c deleted file mode 100644 index 65c80e55..00000000 --- a/digital/beacon/src/Bitcloud_stack/Components/BSP/RCB/src/bspTaskManager.c +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************//** -\file bspTaskManager.c - -\brief Implemenattion 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 -******************************************************************************/ - -/****************************************************************************** - Includes section -******************************************************************************/ -#include -#include - -/****************************************************************************** - Prototypes section -******************************************************************************/ -/**************************************************************************//** -\brief BSP button handler. -******************************************************************************/ -void bspButtonsHandler(void); - -/**************************************************************************//** -\brief BSP temperature sensor handler. -******************************************************************************/ -void bspTemperatureSensorHandler(void); - -/**************************************************************************//** -\brief BSP light sensor handler. -******************************************************************************/ -void bspLightSensorHandler(void); - -/**************************************************************************//** -\brief BSP battery handler. -******************************************************************************/ -void bspEmptyBatteryHandler(void); - -/****************************************************************************** - Global variables section -******************************************************************************/ -volatile uint8_t bspTaskFlags = 0; - -/****************************************************************************** - Implementations section -******************************************************************************/ -/**************************************************************************//** -\brief BSP task handler. -******************************************************************************/ -void BSP_TaskHandler(void) -{ -#if APP_DISABLE_BSP != 1 - if (bspTaskFlags & BSP_BUTTONS) - { - bspTaskFlags &= ~BSP_BUTTONS; - bspButtonsHandler(); - } -#endif //APP_DISABLE_BSP != 1 - if (bspTaskFlags & BSP_TEMPERATURE) - { - bspTaskFlags &= (~BSP_TEMPERATURE); - bspTemperatureSensorHandler(); - } - if (bspTaskFlags & BSP_LIGHT) - { - bspTaskFlags &= (~BSP_LIGHT); - bspLightSensorHandler(); - } - if (bspTaskFlags & BSP_BATTERY) - { - bspTaskFlags &= (~BSP_BATTERY); - bspEmptyBatteryHandler(); - } - if (bspTaskFlags) - SYS_PostTask(BSP_TASK_ID); -} - -// eof bspTaskManager.c diff --git a/digital/beacon/src/Bitcloud_stack/Components/BSP/RCB/src/buttons.c b/digital/beacon/src/Bitcloud_stack/Components/BSP/RCB/src/buttons.c deleted file mode 100644 index 8139394a..00000000 --- a/digital/beacon/src/Bitcloud_stack/Components/BSP/RCB/src/buttons.c +++ /dev/null @@ -1,187 +0,0 @@ -/**************************************************************************//** -\file buttons.c - -\brief Implementation of 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: - 21.08.09 A. Taradov - Created -*******************************************************************************/ -#if APP_DISABLE_BSP != 1 - -/****************************************************************************** - Includes section -******************************************************************************/ -#include -#include -#include -#include -#include -#include - -/****************************************************************************** - Define(s) section -******************************************************************************/ -#define BSP_readKEY0() GPIO_E5_read() -#define PRESSED 1 -#define RELEASED 0 -#define BSP_BUTTONS_IDLE 0 -#define BSP_BUTTONS_BUSY 1 - -/****************************************************************************** - Types section -******************************************************************************/ -typedef struct -{ - uint8_t currentState0 : 1; - uint8_t wasPressed0 : 1; - uint8_t waitReleased0 : 1; -} BSP_buttonsAction_t; - -/****************************************************************************** - Prototypes section -******************************************************************************/ -/**************************************************************************//** -\brief HAL's event handlers about KEY 0 has changed state. -******************************************************************************/ -void bspKey0InterruptHandler(void); - -/****************************************************************************** - Global variables section -******************************************************************************/ -static uint8_t state = BSP_BUTTONS_IDLE; -static volatile BSP_buttonsAction_t buttonsAction; -static BSP_ButtonsEventFunc_t bspButtonPressHandle; // callback -static BSP_ButtonsEventFunc_t bspButtonReleaseHandle; // callback - -/****************************************************************************** - Implementations section -******************************************************************************/ -/**************************************************************************//** -\brief Initializes buttons module. -******************************************************************************/ -static void bspInitButtons(void) -{ - GPIO_E5_make_in(); - GPIO_E5_make_pullup(); - - HAL_RegisterIrq(IRQ_5, IRQ_LOW_LEVEL, bspKey0InterruptHandler); - - if (BSP_readKEY0()) - buttonsAction.currentState0 = RELEASED; - else - buttonsAction.currentState0 = PRESSED; - - HAL_EnableIrq(IRQ_5); -} - -/**************************************************************************//** -\brief Registers handlers for button events. - -\param[in] - pressed - the handler to process pressing the button -\param[in] - released - the handler to process releasing the button -\param[in] - bn - button number. -\return - BC_FAIL - buttons module is busy, \n - BC_SUCCESS in other case. -******************************************************************************/ -result_t BSP_OpenButtons(void (*pressed)(uint8_t bn), void (*released)(uint8_t bn)) -{ - if (state != BSP_BUTTONS_IDLE) - return BC_FAIL; - state = BSP_BUTTONS_BUSY; - bspButtonPressHandle = pressed; - bspButtonReleaseHandle = released; - bspInitButtons(); - return BC_SUCCESS; -}; - -/**************************************************************************//** -\brief Cancel buttons handlers. -\return - BC_FAIL - buttons module was not opened, \n - BC_SUCCESS in other case. -******************************************************************************/ -result_t BSP_CloseButtons(void) -{ - if (state != BSP_BUTTONS_BUSY) - return BC_FAIL; - HAL_UnregisterIrq(IRQ_5); - bspButtonPressHandle = NULL; - bspButtonReleaseHandle = NULL; - state = BSP_BUTTONS_IDLE; - return BC_SUCCESS; -}; - -/**************************************************************************//** -\brief Reads state of buttons. - -\return - Current buttons state in a binary way. \n - Bit 0 defines state of the button 1, \n - bit 1 defines state of the button 2. -******************************************************************************/ -uint8_t BSP_ReadButtonsState(void) -{ - uint8_t state = 0; - - if (buttonsAction.currentState0) - state = 0x01; - - return state; -} - -/**************************************************************************//** -\brief HAL's event about KEY has changed state. -******************************************************************************/ -void bspKey0InterruptHandler(void) -{ - HAL_DisableIrq(IRQ_5); - buttonsAction.currentState0 = PRESSED; - buttonsAction.wasPressed0 = 1; - bspPostTask(BSP_BUTTONS); -} - -/**************************************************************************//** -\brief BSP's event about KEY has changed state. -******************************************************************************/ -void bspButtonsHandler(void) -{ - if (buttonsAction.wasPressed0) - { - buttonsAction.wasPressed0 = 0; - buttonsAction.waitReleased0 = 1; - if (NULL != bspButtonPressHandle) - bspButtonPressHandle(BSP_KEY0); - } - - if (buttonsAction.waitReleased0) - { - if (BSP_readKEY0()) - { - buttonsAction.waitReleased0 = 0; - buttonsAction.currentState0 = RELEASED; - if (NULL != bspButtonReleaseHandle) - bspButtonReleaseHandle(BSP_KEY0); - HAL_EnableIrq(IRQ_5); - } - else - { - bspPostTask(BSP_BUTTONS); - } - } -} - -#endif // APP_DISABLE_BSP != 1 - -// end of buttons.c diff --git a/digital/beacon/src/Bitcloud_stack/Components/BSP/RCB/src/fakeBSP.c b/digital/beacon/src/Bitcloud_stack/Components/BSP/RCB/src/fakeBSP.c deleted file mode 100644 index b7454d82..00000000 --- a/digital/beacon/src/Bitcloud_stack/Components/BSP/RCB/src/fakeBSP.c +++ /dev/null @@ -1,356 +0,0 @@ -/***************************************************************************//** -\file fakeBSP.c - -\brief Implementation of fake board-specific periphery. - -\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: - 05/05/11 A. Malkin - Created -*******************************************************************************/ - -/****************************************************************************** - Includes section -******************************************************************************/ -#include -#include -#include - -/****************************************************************************** - Global variables section -******************************************************************************/ -void(* readTemperatureDataCallback)(bool error, int16_t data); -void(* readLightDataCallback)(bool error, int16_t data); -void(* readBatteryDataCallback)(int16_t data); - -#if APP_DISABLE_BSP == 1 - -/****************************************************************************** - Implementations section -******************************************************************************/ -/****************************************************************************** - Leds -******************************************************************************/ -/**************************************************************************//** -\brief Opens leds module to use. - -\return - operation state -******************************************************************************/ -result_t BSP_OpenLeds(void) -{ - return BC_SUCCESS; -} - -/**************************************************************************//** -\brief Closes leds module. - -\return - operation state -******************************************************************************/ -result_t BSP_CloseLeds(void) -{ - return BC_SUCCESS; -} - -/**************************************************************************//** -\brief Turns on the LED. - -\param[in] - id - number of led -******************************************************************************/ -void BSP_OnLed(uint8_t id) -{ - (void)id; -} - -/**************************************************************************//** -\brief Turns off the LED. - -\param[in] - id - number of led -******************************************************************************/ -void BSP_OffLed(uint8_t id) -{ - (void)id; -} - -/**************************************************************************//** -\brief Changes the LED state to opposite. - -\param[in] - id - number of led -******************************************************************************/ -void BSP_ToggleLed(uint8_t id) -{ - (void)id; -} - -/****************************************************************************** - Buttons -******************************************************************************/ -/**************************************************************************//** -\brief Registers handlers for button events. - -\param[in] - pressed - the handler to process pressing the button -\param[in] - released - the handler to process releasing the button -\param[in] - bn - button number. - -\return - BC_SUCCESS - always. -******************************************************************************/ -result_t BSP_OpenButtons(void (*pressed)(uint8_t bn), void (*released)(uint8_t bn)) -{ - (void)pressed; - (void)released; - - return BC_SUCCESS; -} - -/**************************************************************************//** -\brief Cancel buttons handlers. - -\return - BC_SUCCESS - always. -******************************************************************************/ -result_t BSP_CloseButtons(void) -{ - return BC_SUCCESS; -} - -/**************************************************************************//** -\brief Reads state of buttons. - -\return - Current buttons state in a binary way. \n - Bit 0 defines state of the button 1, \n - bit 1 defines state of the button 2. -******************************************************************************/ -uint8_t BSP_ReadButtonsState(void) -{ - return 0; -} - -#endif // APP_DISABLE_BSP == 1 - -/****************************************************************************** - Sensors -******************************************************************************/ -/***************************************************************************//** -\brief Opens temperature sensor. - -\return - BC_SUCCESS - always. -*******************************************************************************/ -result_t BSP_OpenTemperatureSensor(void) -{ - return BC_SUCCESS; -} - -/***************************************************************************//** -\brief Closes the temperature sensor. - -\return - BC_SUCCESS - always. -*******************************************************************************/ -result_t BSP_CloseTemperatureSensor(void) -{ - return BC_SUCCESS; -} - -/**************************************************************************//** -\brief Reads data from the temperature 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_SUCCESS - always. -******************************************************************************/ -result_t BSP_ReadTemperatureData(void (*f)(bool result, int16_t data)) -{ - readTemperatureDataCallback = f; - - bspPostTask(BSP_TEMPERATURE); - - return BC_SUCCESS; -} - -/**************************************************************************//** -\brief BSP task handler for temperature sensor. -******************************************************************************/ -void bspTemperatureSensorHandler(void) -{ - readTemperatureDataCallback(true, 0); -} - -/***************************************************************************//** -\brief Opens the light sensor. - -\return - BC_SUCCESS - always. -*******************************************************************************/ -result_t BSP_OpenLightSensor(void) -{ - return BC_SUCCESS; -} - -/***************************************************************************//** -\brief Closes the light sensor. - -\return - BC_SUCCESS - always. -*******************************************************************************/ -result_t BSP_CloseLightSensor(void) -{ - return BC_SUCCESS; -} - -/**************************************************************************//** -\brief Reads data from the light 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_SUCCESS - always. -******************************************************************************/ -result_t BSP_ReadLightData(void (*f)(bool result, int16_t data)) -{ - readLightDataCallback = f; - - bspPostTask(BSP_LIGHT); - - return BC_SUCCESS; -} - -/**************************************************************************//** -\brief BSP task handler for light sensor. -******************************************************************************/ -void bspLightSensorHandler(void) -{ - readLightDataCallback(true, 0); -} - -/***************************************************************************//** -\brief Opens the battery sensor. - -\return - BC_SUCCESS - always. -*******************************************************************************/ -result_t BSP_OpenBatterySensor(void) -{ - return BC_SUCCESS; -} - -/***************************************************************************//** -\brief Closes the battery sensor. - -\return - BC_SUCCESS - always. -*******************************************************************************/ -result_t BSP_CloseBatterySensor(void) -{ - return BC_SUCCESS; -} - -/**************************************************************************//** -\brief Reads data from battery sensor. - -\param[in] - data - sensor data. - -\return - BC_SUCCESS - always. -******************************************************************************/ -result_t BSP_ReadBatteryData(void (*f)(int16_t data)) -{ - readBatteryDataCallback = f; - - bspPostTask(BSP_BATTERY); - - return BC_SUCCESS; -} - -/**************************************************************************//** -\brief BSP task handler for battery sensor. -******************************************************************************/ -void bspEmptyBatteryHandler(void) -{ - readBatteryDataCallback(0); -} - -/****************************************************************************** - Sliders -******************************************************************************/ -/**************************************************************************//** -\brief Reads the sliders. - -\return - state of 3 on-board DIP-switches.User can uses SLIDER0, SLIDER1, SLIDER2 - defines to test state. Value 1 indicates that slider is on. -******************************************************************************/ -uint8_t BSP_ReadSliders(void) -{ - return 0; -} - -/****************************************************************************** - Joystick -******************************************************************************/ -/****************************************************************************** -\brief Registers handler for joystick events. - -\param[in] - state - joystick state. - -\return - BC_FAIL - joystick module is busy, - BC_SUCCESS in other cases. -******************************************************************************/ -result_t BSP_OpenJoystick(void (*generalHandler)(BSP_JoystickState_t state)) -{ - (void)generalHandler; - - return BC_SUCCESS; -} - -/****************************************************************************** -\brief Cancel joystick handlers. - -\return - BC_FAIL - joystick module was not opened, - BC_SUCCESS in other cases. -******************************************************************************/ -result_t BSP_CloseJoystick(void) -{ - return BC_SUCCESS; -} - -/****************************************************************************** -\brief Reads state of joystick. - -\return - Current joystick state. -******************************************************************************/ -BSP_JoystickState_t BSP_ReadJoystickState(void) -{ - return 0; -} - -// eof fakeBSP.c diff --git a/digital/beacon/src/Bitcloud_stack/Components/BSP/RCB/src/leds.c b/digital/beacon/src/Bitcloud_stack/Components/BSP/RCB/src/leds.c deleted file mode 100644 index 48a26fd3..00000000 --- a/digital/beacon/src/Bitcloud_stack/Components/BSP/RCB/src/leds.c +++ /dev/null @@ -1,124 +0,0 @@ -/***************************************************************************//** -\file leds.c - -\brief The module to access to the leds. - -\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: - 05.08.09 A. Taradov - Created -*******************************************************************************/ -#if APP_DISABLE_BSP != 1 - -/****************************************************************************** - Includes section -******************************************************************************/ -#include - -/****************************************************************************** - Implementations section -******************************************************************************/ - -/**************************************************************************//** -\brief Opens leds module to use. - -\return - operation state -******************************************************************************/ -result_t BSP_OpenLeds(void) -{ - halInitFirstLed(); - halInitSecondLed(); - halInitThirdLed(); - return BC_SUCCESS; -} - -/**************************************************************************//** -\brief Closes leds module. - -\return - operation state -******************************************************************************/ -result_t BSP_CloseLeds(void) -{ - halUnInitFirstLed(); - halUnInitSecondLed(); - halUnInitThirdLed(); - return BC_SUCCESS; -} - -/**************************************************************************//** -\brief Turns the LED on. - -\param[in] - id - number of led -******************************************************************************/ -void BSP_OnLed(uint8_t id) -{ - switch (id) - { - case LED_FIRST: - halOnFirstLed(); - break; - case LED_SECOND: - halOnSecondLed(); - break; - case LED_THIRD: - halOnThirdLed(); - break; - } -} - -/**************************************************************************//** -\brief Turns the LED off. - -\param[in] - id - number of led -******************************************************************************/ -void BSP_OffLed(uint8_t id) -{ - switch (id) - { - case LED_FIRST: - halOffFirstLed(); - break; - case LED_SECOND: - halOffSecondLed(); - break; - case LED_THIRD: - halOffThirdLed(); - break; - } -} - -/**************************************************************************//** -\brief Toggles LED state. - -\param[in] - id - number of led -******************************************************************************/ -void BSP_ToggleLed(uint8_t id) -{ - switch (id) - { - case LED_FIRST: - halToggleFirstLed(); - break; - case LED_SECOND: - halToggleSecondLed(); - break; - case LED_THIRD: - halToggleThirdLed(); - break; - } -} - -#endif // APP_DISABLE_BSP != 1 - -// eof leds.c -- cgit v1.2.3