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 --- .../HAL/avr/atmega1281/common/src/halInit.c | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 digital/zigbit/bitcloud/stack/Components/HAL/avr/atmega1281/common/src/halInit.c (limited to 'digital/zigbit/bitcloud/stack/Components/HAL/avr/atmega1281/common/src/halInit.c') diff --git a/digital/zigbit/bitcloud/stack/Components/HAL/avr/atmega1281/common/src/halInit.c b/digital/zigbit/bitcloud/stack/Components/HAL/avr/atmega1281/common/src/halInit.c new file mode 100644 index 00000000..593e6257 --- /dev/null +++ b/digital/zigbit/bitcloud/stack/Components/HAL/avr/atmega1281/common/src/halInit.c @@ -0,0 +1,71 @@ +/**************************************************************************//** + \file halInit.c + + \brief HAL start up 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/06/07 E. Ivanov - Created + ******************************************************************************/ +/****************************************************************************** + * WARNING: CHANGING THIS FILE MAY AFFECT CORE FUNCTIONALITY OF THE STACK. * + * EXPERT USERS SHOULD PROCEED WITH CAUTION. * + ******************************************************************************/ + +/****************************************************************************** + Includes section +******************************************************************************/ +#include +#include +#include +#include +#include + +/****************************************************************************** + Prototypes section +******************************************************************************/ +/****************************************************************************** + Reads uid from external devices. +******************************************************************************/ +void halReadUid(void); + +/****************************************************************************** + Implementations section +******************************************************************************/ +/****************************************************************************** +Performs start up HAL initialization. +Parameters: + none. +Returns: + none. +******************************************************************************/ +void HAL_Init(void) +{ + /* Init first diagnostic timer */ +#ifdef MEASURE + TCCR5B = (1 << CS50); +#endif + + HAL_InitRfSpi(); + /* start sleep time */ + halStartSleepTimerClock(); + /* initialization work frequency & + * start calibration */ + halInitFreq(); + /* Reads unique ID */ + halReadUid(); + /* initialization and start application timer */ + halInitAppClock(); + /* initialization dtr interrupt */ + halSetIrqConfig(IRQ_4, IRQ_LOW_LEVEL); + /* global enable interrupt*/ + HAL_EnableInterrupts(); +} +// eof halInit.c -- cgit v1.2.3