flash_efc.h
Go to the documentation of this file.
1 
43 /*
44  * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
45  */
46 
47 #ifndef FLASH_H_INCLUDED
48 #define FLASH_H_INCLUDED
49 
50 #include "compiler.h"
51 #include "efc.h"
52 
54 
55 #ifdef __cplusplus
56  extern "C" {
57 #endif
58 
59 
62 typedef enum flash_rc {
67  FLASH_RC_ERROR = 0x10,
69  FLASH_RC_NOT_SUPPORT = 0xFFFFFFFF
70 } flash_rc_t;
72 
76 typedef enum flash_farg_page_num {
78  /* 4 of pages to be erased with EPA command*/
80  /* 8 of pages to be erased with EPA command*/
82  /* 16 of pages to be erased with EPA command*/
84  /* 32 of pages to be erased with EPA command*/
86  /* Parameter is not support */
90 
92 #define FLASH_ACCESS_MODE_128 EFC_ACCESS_MODE_128
94 #define FLASH_ACCESS_MODE_64 EFC_ACCESS_MODE_64
95 
97 uint32_t flash_init(uint32_t ul_mode, uint32_t ul_fws);
98 uint32_t flash_set_wait_state(uint32_t ul_address, uint32_t ul_fws);
99 uint32_t flash_set_wait_state_adaptively(uint32_t ul_address);
100 uint32_t flash_get_wait_state(uint32_t ul_address);
101 uint32_t flash_get_descriptor(uint32_t ul_address,
102  uint32_t *pul_flash_descriptor, uint32_t ul_size);
103 uint32_t flash_get_page_count(const uint32_t *pul_flash_descriptor);
104 uint32_t flash_get_page_count_per_region(const uint32_t *pul_flash_descriptor);
105 uint32_t flash_get_region_count(const uint32_t *pul_flash_descriptor);
106 uint32_t flash_erase_all(uint32_t ul_address);
107 
108 #if (SAM3S8 || SAM3SD8)
109 uint32_t flash_erase_plane(uint32_t ul_address);
110 #endif
111 
112 #if (SAM4S || SAM4E || SAM4N || SAM4C || SAMG || SAM4CP || SAM4CM || \
113  SAMV71 || SAMV70 || SAMS70 || SAME70)
114 uint32_t flash_erase_page(uint32_t ul_address, uint8_t uc_page_num);
115 uint32_t flash_erase_sector(uint32_t ul_address);
116 #endif
117 
118 uint32_t flash_write(uint32_t ul_address, const void *p_buffer,
119  uint32_t ul_size, uint32_t ul_erase_flag);
120 uint32_t flash_lock(uint32_t ul_start, uint32_t ul_end,
121  uint32_t *pul_actual_start, uint32_t *pul_actual_end);
122 uint32_t flash_unlock(uint32_t ul_start, uint32_t ul_end,
123  uint32_t *pul_actual_start, uint32_t *pul_actual_end);
124 uint32_t flash_is_locked(uint32_t ul_start, uint32_t ul_end);
125 uint32_t flash_set_gpnvm(uint32_t ul_gpnvm);
126 uint32_t flash_clear_gpnvm(uint32_t ul_gpnvm);
127 uint32_t flash_is_gpnvm_set(uint32_t ul_gpnvm);
128 uint32_t flash_enable_security_bit(void);
129 uint32_t flash_is_security_bit_enabled(void);
130 uint32_t flash_read_unique_id(uint32_t *pul_data, uint32_t ul_size);
131 
132 #if (SAM4S || SAM4E || SAM4N || SAM4C || SAMG || SAM4CP || SAM4CM || \
133  SAMV71 || SAMV70 || SAMS70 || SAME70)
134 uint32_t flash_read_user_signature(uint32_t *p_data, uint32_t ul_size);
135 uint32_t flash_write_user_signature(const void *p_buffer, uint32_t ul_size);
136 uint32_t flash_erase_user_signature(void);
137 #endif
138 
140 
141 #ifdef __cplusplus
142 }
143 #endif
144 
145 
147 #endif /* FLASH_H_INCLUDED */
Operation OK.
Definition: flash_efc.h:64
uint32_t flash_enable_security_bit(void)
Set security bit.
Definition: flash_efc.c:948
flash_farg_page_num
Definition: flash_efc.h:77
uint32_t flash_init(uint32_t ul_mode, uint32_t ul_fws)
Initialize the flash service.
Definition: flash_efc.c:313
uint32_t flash_get_page_count(const uint32_t *pul_flash_descriptor)
Get flash total page count for the specified bank.
Definition: flash_efc.c:449
uint32_t flash_lock(uint32_t ul_start, uint32_t ul_end, uint32_t *pul_actual_start, uint32_t *pul_actual_end)
Lock all the regions in the given address range. The actual lock range is reported through two output...
Definition: flash_efc.c:703
uint32_t flash_clear_gpnvm(uint32_t ul_gpnvm)
Clear the given GPNVM bit.
Definition: flash_efc.c:897
uint32_t flash_is_locked(uint32_t ul_start, uint32_t ul_end)
Get the number of locked regions inside the given address range.
Definition: flash_efc.c:796
uint32_t flash_erase_all(uint32_t ul_address)
Erase the entire flash.
Definition: flash_efc.c:495
Commonly used includes, types and macros.
Operation is not supported.
Definition: flash_efc.h:69
enum flash_farg_page_num flash_farg_page_num_t
uint32_t flash_set_wait_state_adaptively(uint32_t ul_address)
Set flash wait state.
Definition: flash_efc.c:350
General error.
Definition: flash_efc.h:67
Invalid argument input.
Definition: flash_efc.h:68
uint32_t flash_get_page_count_per_region(const uint32_t *pul_flash_descriptor)
Get flash page count per region (plane) for the specified bank.
Definition: flash_efc.c:464
uint32_t flash_write(uint32_t ul_address, const void *p_buffer, uint32_t ul_size, uint32_t ul_erase_flag)
Write a data buffer on flash.
Definition: flash_efc.c:607
uint32_t flash_is_gpnvm_set(uint32_t ul_gpnvm)
Check if the given GPNVM bit is set or not.
Definition: flash_efc.c:923
uint32_t flash_get_descriptor(uint32_t ul_address, uint32_t *pul_flash_descriptor, uint32_t ul_size)
Get flash descriptor.
Definition: flash_efc.c:412
uint32_t flash_get_wait_state(uint32_t ul_address)
Get flash wait state.
Definition: flash_efc.c:395
uint32_t flash_is_security_bit_enabled(void)
Check if the security bit is set or not.
Definition: flash_efc.c:960
uint32_t flash_set_gpnvm(uint32_t ul_gpnvm)
Set the given GPNVM bit.
Definition: flash_efc.c:873
uint32_t flash_set_wait_state(uint32_t ul_address, uint32_t ul_fws)
Set flash wait state.
Definition: flash_efc.c:332
enum flash_rc flash_rc_t
uint32_t flash_get_region_count(const uint32_t *pul_flash_descriptor)
Get flash region (plane) count for the specified bank.
Definition: flash_efc.c:479
uint32_t flash_unlock(uint32_t ul_start, uint32_t ul_end, uint32_t *pul_actual_start, uint32_t *pul_actual_end)
Unlock all the regions in the given address range. The actual unlock range is reported through two ou...
Definition: flash_efc.c:752
flash_rc
Definition: flash_efc.h:63
uint32_t flash_read_unique_id(uint32_t *pul_data, uint32_t ul_size)
Read the flash unique ID.
Definition: flash_efc.c:973


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