Defines | Functions
flash_efc.h File Reference

Embedded Flash service for SAM. More...

#include <Arduino.h>
#include "efc.h"
Include dependency graph for flash_efc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define IFLASH_ADDR   IFLASH0_ADDR
#define IFLASH_LAST_PAGE_ADDRESS   (IFLASH1_ADDR + IFLASH1_SIZE - IFLASH1_PAGE_SIZE)
#define IFLASH_PAGE_SIZE   IFLASH0_PAGE_SIZE
Flash access mode
#define FLASH_ACCESS_MODE_128   EFC_ACCESS_MODE_128
#define FLASH_ACCESS_MODE_64   EFC_ACCESS_MODE_64

Functions

uint32_t flash_clear_gpnvm (uint32_t ul_gpnvm)
 Clear the given GPNVM bit.
uint32_t flash_enable_security_bit (void)
 Set security bit.
uint32_t flash_erase_all (uint32_t ul_address)
 Erase the entire flash.
uint32_t flash_get_descriptor (uint32_t ul_address, uint32_t *pul_flash_descriptor, uint32_t ul_size)
 Get flash descriptor.
uint32_t flash_get_page_count (const uint32_t *pul_flash_descriptor)
 Get flash total page count for the specified bank.
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.
uint32_t flash_get_region_count (const uint32_t *pul_flash_descriptor)
 Get flash region (plane) count for the specified bank.
uint32_t flash_get_wait_state (uint32_t ul_address)
 Get flash wait state.
uint32_t flash_init (uint32_t ul_mode, uint32_t ul_fws)
 Initialize the flash service.
uint32_t flash_is_gpnvm_set (uint32_t ul_gpnvm)
 Check if the given GPNVM bit is set or not.
uint32_t flash_is_locked (uint32_t ul_start, uint32_t ul_end)
 Get the number of locked regions inside the given address range.
uint32_t flash_is_security_bit_enabled (void)
 Check if the security bit is set or not.
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 parameters.
uint32_t flash_read_unique_id (uint32_t *pul_data, uint32_t ul_size)
 Read the flash unique ID.
uint32_t flash_set_gpnvm (uint32_t ul_gpnvm)
 Set the given GPNVM bit.
uint32_t flash_set_wait_state (uint32_t ul_address, uint32_t ul_fws)
 Set flash wait state.
uint32_t flash_set_wait_state_adaptively (uint32_t ul_address)
 Set flash wait state.
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 output parameters.
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.

Flash driver return codes

enum  flash_rc {
  FLASH_RC_OK = 0, FLASH_RC_YES = 0, FLASH_RC_NO = 1, FLASH_RC_ERROR = 0x10,
  FLASH_RC_INVALID, FLASH_RC_NOT_SUPPORT = 0xFFFFFFFF
}
typedef enum flash_rc flash_rc_t

Flash erase page num in FARG[1:0]

Note:
The erase page commands should be cautiouly used as EPA4/EPA32 will not take effect according to errata and EPA8/EPA16 must module 8/16 page addresses.
enum  flash_farg_page_num {
  IFLASH_ERASE_PAGES_4 = 0, IFLASH_ERASE_PAGES_8, IFLASH_ERASE_PAGES_16, IFLASH_ERASE_PAGES_32,
  IFLASH_ERASE_PAGES_INVALID
}
typedef enum flash_farg_page_num flash_farg_page_num_t

Detailed Description

Embedded Flash service for SAM.

Copyright (c) 2011-2013 Atmel Corporation. All rights reserved.

Definition in file flash_efc.h.


Define Documentation

Definition at line 98 of file flash_efc.h.

Definition at line 99 of file flash_efc.h.

#define IFLASH_ADDR   IFLASH0_ADDR

Definition at line 51 of file flash_efc.h.

#define IFLASH_LAST_PAGE_ADDRESS   (IFLASH1_ADDR + IFLASH1_SIZE - IFLASH1_PAGE_SIZE)

Definition at line 56 of file flash_efc.h.

#define IFLASH_PAGE_SIZE   IFLASH0_PAGE_SIZE

Definition at line 53 of file flash_efc.h.


Typedef Documentation

typedef enum flash_rc flash_rc_t

Enumeration Type Documentation

Enumerator:
IFLASH_ERASE_PAGES_4 
IFLASH_ERASE_PAGES_8 
IFLASH_ERASE_PAGES_16 
IFLASH_ERASE_PAGES_32 
IFLASH_ERASE_PAGES_INVALID 

Definition at line 82 of file flash_efc.h.

enum flash_rc
Enumerator:
FLASH_RC_OK 

Operation OK.

FLASH_RC_YES 

Yes.

FLASH_RC_NO 

No.

FLASH_RC_ERROR 

General error.

FLASH_RC_INVALID 

Invalid argument input.

FLASH_RC_NOT_SUPPORT 

Operation is not supported.

Definition at line 68 of file flash_efc.h.



lizi_arduino
Author(s): RoboTiCan
autogenerated on Wed Aug 26 2015 12:24:23