Yuta Togashi / eeprom
Committer:
YutaTogashi
Date:
Mon Mar 09 15:59:19 2020 +0000
Revision:
2:233b73889b39
Parent:
1:724b44e46ecf
20200310 make library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
YutaTogashi 2:233b73889b39 1 #ifndef eeprom_h
YutaTogashi 2:233b73889b39 2 #define eeprom_h
YutaTogashi 2:233b73889b39 3
okini3939 1:724b44e46ecf 4 // OKANO's IAP code from
okini3939 1:724b44e46ecf 5 // http://mbed.org/users/okano/notebook/iap-in-application-programming-internal-flash-eras/
okini3939 0:c32514e75196 6 /**
okini3939 0:c32514e75196 7 * @file
okini3939 0:c32514e75196 8 */
okini3939 0:c32514e75196 9
okini3939 0:c32514e75196 10 #define EEPROM_ADDRESS 64
YutaTogashi 2:233b73889b39 11 #include "mbed.h"
okini3939 0:c32514e75196 12
okini3939 0:c32514e75196 13 /** Copy RAM to EEPROM (LPC11U24)
okini3939 0:c32514e75196 14 *
okini3939 0:c32514e75196 15 * @param source_addr Source RAM address from which data bytes are to be read.
okini3939 0:c32514e75196 16 * @param target_addr Destination EEPROM address where data bytes are to be written.
okini3939 0:c32514e75196 17 * @param size Number of bytes to be written.
okini3939 0:c32514e75196 18 * @return error code: CMD_SUCCESS | SRC_ADDR_NOT_MAPPED | DST_ADDR_NOT_MAPPED
okini3939 0:c32514e75196 19 * Remark: The top 64 bytes of the EEPROM memory are reserved and cannot be written to.
okini3939 0:c32514e75196 20 */
okini3939 0:c32514e75196 21 int write_eeprom( char *source_addr, char *target_addr, int size );
okini3939 0:c32514e75196 22
okini3939 0:c32514e75196 23 /** Copy EEPROM to RAM (LPC11U24)
okini3939 0:c32514e75196 24 *
okini3939 0:c32514e75196 25 * @param source_addr Source EEPROM address from which data bytes are to be read.
okini3939 0:c32514e75196 26 * @param target_addr Destination RAM address where data bytes are to be written.
okini3939 0:c32514e75196 27 * @param size Number of bytes to be written.
okini3939 0:c32514e75196 28 * @return error code: CMD_SUCCESS | SRC_ADDR_NOT_MAPPED | DST_ADDR_NOT_MAPPED
okini3939 0:c32514e75196 29 * Remark: The top 64 bytes of the EEPROM memory are reserved and cannot be written to.
okini3939 0:c32514e75196 30 */
okini3939 0:c32514e75196 31 int read_eeprom( char *source_addr, char *target_addr, int size );
okini3939 0:c32514e75196 32
YutaTogashi 2:233b73889b39 33 #endif