rfLPC
A low level library for using NXP's LPC17xx SoC. Config is given for MBED prototyping board
iap.h
Go to the documentation of this file.
1 /* This file is part of rflpc. Copyright 2010-2011 Michael Hauspie
2  *
3  * rflpc is free software: you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation, either version 3 of the License, or
6  * (at your option) any later version.
7  *
8  * rflpc is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with rflpc. If not, see <http://www.gnu.org/licenses/>.
15  */
25 /*
26  Author: Gregory Guche <gregory.guche@lifl.fr>
27  Created: 2012-03-28
28 */
29 #ifndef __RFLPC_IAP_H__
30 #define __RFLPC_IAP_H__
31 
32 
33 
34 #ifdef RFLPC_CONFIG_ENABLE_IAP
35 
41 extern int rflpc_iap_get_serial_number(unsigned long result[4]);
42 
43 
49 extern void *rflpc_iap_get_address_from_sector(int sector);
50 
56 extern int rflpc_iap_get_sector_from_address(const void *address);
57 
58 
66 extern int rflpc_iap_prepare_sectors_for_writing(int start_sector, int end_sector);
67 
71 extern int rflpc_iap_erase_sectors(int start_sector, int end_sector);
72 
80 extern int rflpc_iap_copy_ram_to_flash(const void *destination, const void *source, int length);
81 
87 extern int rflpc_iap_write_buffer_to_sector(const void *buffer, int sector_number);
88 
95 extern int rflpc_iap_write_to_sector(const void *destination, const void *buffer, int length);
96 
103 extern int rflpc_iap_write_buffer(const void *destination, const void *buffer, int length);
104 
111 extern int rflpc_iap_transfert_4ks_to_32k(const void *destination32k, const void *source4ks, int length);
112 
114 #endif /* ENABLE_IAP */
115 
116 #endif
int rflpc_iap_write_buffer(const void *destination, const void *buffer, int length)
Copy a buffer to Flash.
int rflpc_iap_write_to_sector(const void *destination, const void *buffer, int length)
Copy a buffer <= 4K to Flash.
int rflpc_iap_write_buffer_to_sector(const void *buffer, int sector_number)
Copy a 4k buffer to Flash.
int rflpc_iap_prepare_sectors_for_writing(int start_sector, int end_sector)
Prepare sectors for a writing operation (write/erase).
int rflpc_iap_get_sector_from_address(const void *address)
Flash memory address-sector mapping.
int rflpc_iap_copy_ram_to_flash(const void *destination, const void *source, int length)
Copy RAM to Flash.
int rflpc_iap_transfert_4ks_to_32k(const void *destination32k, const void *source4ks, int length)
Transfer memory from the 4k sectors to one 32k sector.
int rflpc_iap_erase_sectors(int start_sector, int end_sector)
Erase Flash sectors.
void * rflpc_iap_get_address_from_sector(int sector)
Flash memory sector-address mapping.
int rflpc_iap_get_serial_number(unsigned long result[4])
Gets the flash serial number.