/* --------------------------------------------------------------------------- * mem.h - v0.1 (c) 2007 Micro-key bv * --------------------------------------------------------------------------- * Micro-key bv * Industrieweg 28, 9804 TG Noordhorn * Postbus 92, 9800 AB Zuidhorn * The Netherlands * Tel: +31 594 503020 * Fax: +31 594 505825 * Email: support@microkey.nl * Web: www.microkey.nl * --------------------------------------------------------------------------- * Description: Non-volatile memory interface. * --------------------------------------------------------------------------- * Version(s): 0.1, 10-09-2007, Marcel Mulder. * Creation. * --------------------------------------------------------------------------- */ #ifndef __MEM_H__ #define __MEM_H__ /** \file mem.h \brief Non-volatile memory interface. */ /* --------------------------------------------------------------------------- * System include files. * --------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------- * Application include files. * --------------------------------------------------------------------------- */ #include "lpc23xx.h" #include "types.h" /* --------------------------------------------------------------------------- * Constant and macro definitions. * --------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------- * Type definitions. * --------------------------------------------------------------------------- */ typedef enum { SEEPROM, /**< Serial (SPI) EEPROM*/ SFLASH, /**< Serial (SPI) FLASH*/ IFLASH, /**< Internal FLASH*/ ISRAM /**< Internal battery backupped SRAM*/ } t_mem_devices; /* --------------------------------------------------------------------------- * Variable declarations. * --------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------- * Function declarations. * --------------------------------------------------------------------------- */ /** \brief Initialize non-volatile memory interface.*/ void memInit (void); /** \brief Read from non-volatile memory. \retval len Length of data \retval data Pointer to data \retval bool True if succesfull */ BOOLEAN memRead ( t_mem_devices memDevices, UINT32 addr, /**< Address of memory device*/ UINT16 * len, /**< Pointer to length of data*/ UINT8 * data /**< Pointer to data*/ ); /** \brief Write to non-volatile memory. \retval bool True if succesfull */ BOOLEAN memWrite ( t_mem_devices memDevices, UINT32 addr, /**< Address of memory device*/ UINT16 len, /**< Length of data*/ UINT8 * data /**< Pointer to data*/ ); #endif /* __MEM_H__ */