d_flash.h
Go to the documentation of this file.
1 /*
2 MIT LICENSE
3 
4 Copyright 2014-2019 Inertial Sense, Inc. - http://inertialsense.com
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
7 
8 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9 
10 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT, IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11 */
12 
13 #ifndef D_FLASH_H_
14 #define D_FLASH_H_
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 #define FLASH_GPNVM_SECURITY_BIT 0
20 #define FLASH_GPNVM_BOOTMODE_BIT 1 // clear:ROM, set:Flash
21 
22 // uINS-3 flash layout - uINS Flash Memory Map at top of bootloaderShared.h
23 
24 // write data at the given 8KB aligned flash address
25 // address the 8KB aligned flash address to write at
26 // newData is the new bytes to put in the block starting at offset - must be exactly 8K (flash block size) in size
27 // return FLASH_RC_OK if success, otherwise error code
28 uint32_t flash_update_block(uint32_t address, const void* newData, int dataSize, int noPageErase);
29 
30 // erase the flash block at the 8K aligned address
31 uint32_t flash_erase_block(uint32_t address);
32 
33 // Erase chip - Since it is a RAM function, it needs 'extern' declaration.
34 extern void flash_erase_chip(void);
35 
36 // read the user signature, size must be multiple of 4 and less than or equal to 512
37 uint32_t flash_get_user_signature(volatile void* ptr, uint32_t size);
38 
39 // write the user signature, size must be multiple of 4 and less than or equal to 512
40 uint32_t flash_set_user_signature(const volatile void* ptr, uint32_t size);
41 
42 // is a flash write in progress? 0 = no, 1 = yes
43 int flash_write_in_progress(void);
44 
45 #ifdef __cplusplus
46 }
47 #endif
48 #endif // D_FLASH_H_
uint32_t flash_erase_block(uint32_t address)
Definition: d_flash.c:106
uint32_t flash_update_block(uint32_t address, const void *newData, int dataSize, int noPageErase)
Definition: d_flash.c:23
uint32_t flash_set_user_signature(const volatile void *ptr, uint32_t size)
Definition: d_flash.c:164
uint32_t flash_get_user_signature(volatile void *ptr, uint32_t size)
Definition: d_flash.c:159
void flash_erase_chip(void)
Definition: d_flash.c:120
int flash_write_in_progress(void)
Definition: d_flash.c:184


inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:17:57