From a54ad9edce697133a024aff096e50f7e4f389d5b Mon Sep 17 00:00:00 2001 From: Florent Duchon Date: Sun, 18 Mar 2012 12:22:02 +0100 Subject: digital/beacon: import Zigbit stack (bitcloud) & avr sources --- .../include/private/pdsMemAbstract.h | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 digital/beacon/src/Bitcloud_stack/Components/PersistDataServer/include/private/pdsMemAbstract.h (limited to 'digital/beacon/src/Bitcloud_stack/Components/PersistDataServer/include/private/pdsMemAbstract.h') diff --git a/digital/beacon/src/Bitcloud_stack/Components/PersistDataServer/include/private/pdsMemAbstract.h b/digital/beacon/src/Bitcloud_stack/Components/PersistDataServer/include/private/pdsMemAbstract.h new file mode 100644 index 00000000..ca95f064 --- /dev/null +++ b/digital/beacon/src/Bitcloud_stack/Components/PersistDataServer/include/private/pdsMemAbstract.h @@ -0,0 +1,70 @@ +/***************************************************************************//** + \file pdsMemAbstract.h + + \brief Memory abstract header + + \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: + 6/11/08 A. Khromykh - Created +*****************************************************************************/ +#ifndef _PDSMEMABSTRACT_H +#define _PDSMEMABSTRACT_H + +/* Type of usage memory */ +#define USE_EEPROM + +/* This header file performs persistence memory API redefinition. + * The goal is to achieve memory type independence for persist data server (PDS). + * + * + * MEMORY_DESCRIPTOR - persistence memory descriptor. It is a structure type, which + * includes the following variables: + * uint16_t address - internal persistence memory address to be accessed. + * uint8_t *data - pointer to the variable in RAM to be stored (or to be filled + * by read value from persistence). + * uint16_t length - "data" variable length (bytes). Equal to the number of bytes + * to be exchanged between persistence memory and RAM. + * + * + * WRITE_MEMORY, READ_MEMORY - persistence memory access functions. These functions + * should have the following form: + * int write/read(MEMORY_DESCRIPTOR *memoryDescr, void (*callback)(void)); + * Parameters: + * memoryDescr - pointer to memory descriptor + * callback - pointer to callback function. Callback function will be called + * after read or write persistence memory operation is completed. + * Returns: + * 0 - successful access; + * -1 - the number of bytes to read (write) is too large. + * Persistence memory access functions should perform memory arbitration also, i.e. + * memory busy return status is illegal. + * + * + * IS_MEMORY_BUSY - persistence memory access function, should have the following form: + * bool isMemoryBusy(void); + * Parameters: + * none. + * Returns: + * true - memory is busy + * false - memory is free; +*/ + +#if defined(USE_EEPROM) + +#include + +#define WRITE_MEMORY HAL_WriteEeprom +#define READ_MEMORY HAL_ReadEeprom +#define IS_MEMORY_BUSY HAL_IsEepromBusy +#define MEMORY_DESCRIPTOR HAL_EepromParams_t + +#endif + +#endif /* _PDSMEMABSTRACT_H */ -- cgit v1.2.3