drivers/efc/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 EFC_H_INCLUDED
48 #define EFC_H_INCLUDED
49 
50 #include "compiler.h"
51 
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 
61 typedef enum efc_rc {
63  EFC_RC_OK = 0,
64  EFC_RC_YES = 0,
65  EFC_RC_NO = 1,
68  EFC_RC_NOT_SUPPORT = 0xFFFFFFFF
69 } efc_rc_t;
71 
73 #define EFC_FCMD_GETD 0x00
75 #define EFC_FCMD_WP 0x01
76 #define EFC_FCMD_WPL 0x02
77 #define EFC_FCMD_EWP 0x03
78 #define EFC_FCMD_EWPL 0x04
79 #define EFC_FCMD_EA 0x05
80 #if (SAM3S8 || SAM3SD8)
81 #define EFC_FCMD_EPL 0x06
82 #endif
83 #if (SAM4S || SAM4E || SAM4N || SAM4C || SAMG || SAM4CP || SAM4CM || \
84  SAMV71 || SAMV70 || SAMS70 || SAME70)
85 #define EFC_FCMD_EPA 0x07
86 #endif
87 #define EFC_FCMD_SLB 0x08
88 #define EFC_FCMD_CLB 0x09
89 #define EFC_FCMD_GLB 0x0A
90 #define EFC_FCMD_SGPB 0x0B
91 #define EFC_FCMD_CGPB 0x0C
92 #define EFC_FCMD_GGPB 0x0D
93 #define EFC_FCMD_STUI 0x0E
94 #define EFC_FCMD_SPUI 0x0F
95 #if (!SAM3U && !SAM3SD8 && !SAM3S8)
96 #define EFC_FCMD_GCALB 0x10
97 #endif
98 #if (SAM4S || SAM4E || SAM4N || SAM4C || SAMG || SAM4CP || SAM4CM || \
99  SAMV71 || SAMV70 || SAMS70 || SAME70)
100 #define EFC_FCMD_ES 0x11
101 #define EFC_FCMD_WUS 0x12
102 #define EFC_FCMD_EUS 0x13
103 #define EFC_FCMD_STUS 0x14
104 #define EFC_FCMD_SPUS 0x15
105 #endif
106 
109 #define CHIP_FLASH_IAP_ADDRESS (IROM_ADDR + 8)
110 
112 #define EFC_ACCESS_MODE_128 0
114 #define EFC_ACCESS_MODE_64 EEFC_FMR_FAM
115 
117 uint32_t efc_init(Efc *p_efc, uint32_t ul_access_mode, uint32_t ul_fws);
118 #if (SAM4S || SAM4E || SAM4N || SAM4C || SAMG || SAM4CP || SAM4CM || \
119  SAMV71 || SAMV70 || SAMS70 || SAME70)
120 void efc_enable_cloe(Efc *p_efc);
121 void efc_disable_cloe(Efc *p_efc);
122 #endif
123 void efc_enable_frdy_interrupt(Efc *p_efc);
124 void efc_disable_frdy_interrupt(Efc *p_efc);
125 #if (SAMV71 || SAMV70 || SAMS70 || SAME70)
126 void efc_enable_write_protection(Efc *p_efc);
127 void efc_disable_write_protection(Efc *p_efc);
128 #else
129 void efc_set_flash_access_mode(Efc *p_efc, uint32_t ul_mode);
130 uint32_t efc_get_flash_access_mode(Efc *p_efc);
131 #endif
132 void efc_set_wait_state(Efc *p_efc, uint32_t ul_fws);
133 uint32_t efc_get_wait_state(Efc *p_efc);
134 uint32_t efc_perform_command(Efc *p_efc, uint32_t ul_command,
135  uint32_t ul_argument);
136 uint32_t efc_get_status(Efc *p_efc);
137 uint32_t efc_get_result(Efc *p_efc);
138 uint32_t efc_perform_read_sequence(Efc *p_efc,
139  uint32_t ul_cmd_st, uint32_t ul_cmd_sp,
140  uint32_t *p_ul_buf, uint32_t ul_size);
141 
143 
144 #ifdef __cplusplus
145 }
146 #endif
147 
148 
150 #endif /* EFC_H_INCLUDED */
Invalid argument input.
uint32_t efc_init(Efc *p_efc, uint32_t ul_access_mode, uint32_t ul_fws)
Initialize the EFC controller.
Definition: efc.c:119
uint32_t efc_get_wait_state(Efc *p_efc)
Get flash wait state.
Definition: efc.c:248
efc_rc
uint32_t efc_perform_command(Efc *p_efc, uint32_t ul_command, uint32_t ul_argument)
Perform the given command and wait until its completion (or an error).
Definition: efc.c:266
uint32_t efc_get_status(Efc *p_efc)
Get the current status of the EEFC.
Definition: efc.c:295
void efc_set_flash_access_mode(Efc *p_efc, uint32_t ul_mode)
Set flash access mode.
Definition: efc.c:208
Operation OK.
void efc_set_wait_state(Efc *p_efc, uint32_t ul_fws)
Set flash wait state.
Definition: efc.c:234
void efc_disable_frdy_interrupt(Efc *p_efc)
Disable the flash ready interrupt.
Definition: efc.c:174
Efc hardware registers.
uint32_t efc_perform_read_sequence(Efc *p_efc, uint32_t ul_cmd_st, uint32_t ul_cmd_sp, uint32_t *p_ul_buf, uint32_t ul_size)
Perform read sequence. Supported sequences are read Unique ID and read User Signature.
Definition: efc.c:326
Commonly used includes, types and macros.
uint32_t efc_get_flash_access_mode(Efc *p_efc)
Get flash access mode.
Definition: efc.c:222
uint32_t efc_get_result(Efc *p_efc)
Get the result of the last executed command.
Definition: efc.c:307
enum efc_rc efc_rc_t
Operation is not supported.
General error.
void efc_enable_frdy_interrupt(Efc *p_efc)
Enable the flash ready interrupt.
Definition: efc.c:162


inertial_sense_ros
Author(s):
autogenerated on Sat Sep 19 2020 03:19:04