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/drivers/OFD/src/ofdIntFlashRead.s90 | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 digital/zigbit/bitcloud/stack/Components/HAL/drivers/OFD/src/ofdIntFlashRead.s90 (limited to 'digital/zigbit/bitcloud/stack/Components/HAL/drivers/OFD/src/ofdIntFlashRead.s90') diff --git a/digital/zigbit/bitcloud/stack/Components/HAL/drivers/OFD/src/ofdIntFlashRead.s90 b/digital/zigbit/bitcloud/stack/Components/HAL/drivers/OFD/src/ofdIntFlashRead.s90 new file mode 100644 index 00000000..9fc8e941 --- /dev/null +++ b/digital/zigbit/bitcloud/stack/Components/HAL/drivers/OFD/src/ofdIntFlashRead.s90 @@ -0,0 +1,40 @@ +/**************************************************************************//** + \file ofdIntFlashRead.s90 + + \brief Implementation of internal flash reading. + + \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: + 19/02/10 A. Khromykh - Created +*******************************************************************************/ + +/******************************************************************************* +Reads byte from internal flash +Parameters: + R19:R18:R17:R16 - Byte address into flash. +Returns: + R16 - read byte from flash. +*******************************************************************************/ +PUBLIC ofdReadInternalFlash +RSEG CODE +ofdReadInternalFlash: + push r31 ; Store Z to stack + push r30 ; Store Z to stack + in r19, 0x3B ; Save RAMPZ. + out 0x3B, r18 ; Load RAMPZ with the MSB of the address. + movw r31:r30, r17:r16 ; Move low bytes of address to ZH:ZL from R17:R16 + elpm r16, Z ; Extended load program memory from Z address + out 0x3B, r19 ; Restore RAMPZ register. + pop r30 ; Restore Z + pop r31 ; Restore Z + ret ; return from function + +; eof ofdIntFlashRead.s90 +END -- cgit v1.2.3