dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pios_flash.h
Go to the documentation of this file.
1 
11 /*
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful, but
18  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20  * for more details.
21  *
22  * You should have received a copy of the GNU General Public License along
23  * with this program; if not, see <http://www.gnu.org/licenses/>
24  */
25 
26 #ifndef PIOS_FLASH_H_
27 #define PIOS_FLASH_H_
28 
29 #include <stdint.h>
30 
39 
40  FLASH_PARTITION_NUM_LABELS, /* Must be last */
41 };
42 
43 extern int32_t PIOS_FLASH_find_partition_id(enum pios_flash_partition_labels label, uintptr_t *partition_id);
44 extern uint16_t PIOS_FLASH_get_num_partitions(void);
45 extern int32_t PIOS_FLASH_get_partition_size(uintptr_t partition_id, uint32_t *partition_size);
46 
47 extern int32_t PIOS_FLASH_start_transaction(uintptr_t partition_id);
48 extern int32_t PIOS_FLASH_end_transaction(uintptr_t partition_id);
49 extern int32_t PIOS_FLASH_erase_partition(uintptr_t partition_id);
50 extern int32_t PIOS_FLASH_erase_range(uintptr_t partition_id, uint32_t start_offset, uint32_t size);
51 extern int32_t PIOS_FLASH_write_data(uintptr_t partition_id, uint32_t offset, const uint8_t *data, uint16_t len);
52 extern int32_t PIOS_FLASH_read_data(uintptr_t partition_id, uint32_t offset, uint8_t *data, uint16_t len);
53 
54 extern void *PIOS_FLASH_get_address(uintptr_t partition_id, uint32_t *partition_size);
55 
56 #endif /* PIOS_FLASH_H_ */
int32_t PIOS_FLASH_find_partition_id(enum pios_flash_partition_labels label, uintptr_t *partition_id)
int32_t PIOS_FLASH_erase_partition(uintptr_t partition_id)
enum dfu_partition_label label
Definition: bl_messages.h:121
uint16_t PIOS_FLASH_get_num_partitions(void)
int32_t PIOS_FLASH_get_partition_size(uintptr_t partition_id, uint32_t *partition_size)
void * PIOS_FLASH_get_address(uintptr_t partition_id, uint32_t *partition_size)
uint8_t data[XFER_BYTES_PER_PACKET]
Definition: bl_messages.h:129
int32_t PIOS_FLASH_write_data(uintptr_t partition_id, uint32_t offset, const uint8_t *data, uint16_t len)
int32_t PIOS_FLASH_end_transaction(uintptr_t partition_id)
int32_t PIOS_FLASH_erase_range(uintptr_t partition_id, uint32_t start_offset, uint32_t size)
uint32_t offset
Definition: uavtalk_priv.h:51
pios_flash_partition_labels
Definition: pios_flash.h:31
int32_t PIOS_FLASH_read_data(uintptr_t partition_id, uint32_t offset, uint8_t *data, uint16_t len)
int32_t PIOS_FLASH_start_transaction(uintptr_t partition_id)