47 #ifndef EFC_H_INCLUDED 48 #define EFC_H_INCLUDED 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 83 #if (SAM4S || SAM4E || SAM4N || SAM4C || SAMG || SAM4CP || SAM4CM || \ 84 SAMV71 || SAMV70 || SAMS70 || SAME70) 85 #define EFC_FCMD_EPA 0x07 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 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 109 #define CHIP_FLASH_IAP_ADDRESS (IROM_ADDR + 8) 112 #define EFC_ACCESS_MODE_128 0 114 #define EFC_ACCESS_MODE_64 EEFC_FMR_FAM 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);
125 #if (SAMV71 || SAMV70 || SAMS70 || SAME70) 126 void efc_enable_write_protection(
Efc *p_efc);
127 void efc_disable_write_protection(
Efc *p_efc);
135 uint32_t ul_argument);
139 uint32_t ul_cmd_st, uint32_t ul_cmd_sp,
140 uint32_t *p_ul_buf, uint32_t ul_size);
uint32_t efc_init(Efc *p_efc, uint32_t ul_access_mode, uint32_t ul_fws)
Initialize the EFC controller.
uint32_t efc_get_wait_state(Efc *p_efc)
Get flash wait state.
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).
uint32_t efc_get_status(Efc *p_efc)
Get the current status of the EEFC.
void efc_set_flash_access_mode(Efc *p_efc, uint32_t ul_mode)
Set flash access mode.
void efc_set_wait_state(Efc *p_efc, uint32_t ul_fws)
Set flash wait state.
void efc_disable_frdy_interrupt(Efc *p_efc)
Disable the flash ready interrupt.
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.
Commonly used includes, types and macros.
uint32_t efc_get_flash_access_mode(Efc *p_efc)
Get flash access mode.
uint32_t efc_get_result(Efc *p_efc)
Get the result of the last executed command.
Operation is not supported.
void efc_enable_frdy_interrupt(Efc *p_efc)
Enable the flash ready interrupt.