SDK4.0
This document shows Ameba SDK 4.0 APIs
flash_api.h File Reference

This file provides mbed FLASH API. More...

#include "device.h"

Functions

AmebaZ Only
void flash_erase_chip (flash_t *obj)
 Erase the whole flash chip. More...
 

Ameba Common

typedef struct flash_s flash_t
 
void flash_erase_sector (flash_t *obj, uint32_t address)
 Erase flash sector. More...
 
void flash_erase_block (flash_t *obj, uint32_t address)
 Erase flash block(64KB) More...
 
int flash_read_word (flash_t *obj, uint32_t address, uint32_t *data)
 Read a word from specified address. More...
 
int flash_write_word (flash_t *obj, uint32_t address, uint32_t data)
 Write a word to specified address. More...
 
int flash_stream_read (flash_t *obj, uint32_t address, uint32_t len, uint8_t *data)
 Read a stream of data from specified address. More...
 
int flash_stream_write (flash_t *obj, uint32_t address, uint32_t len, uint8_t *data)
 Write a stream of data to specified address. More...
 
void flash_write_protect (flash_t *obj, uint32_t protect)
 Control the flash chip write protect enable/disable. More...
 
int flash_get_status (flash_t *obj)
 Get the value of status register1. More...
 
int flash_set_status (flash_t *obj, uint32_t data)
 Set Status register to enable desired operation. More...
 
void flash_reset_status (flash_t *obj)
 This function aims to reset the status register, please make sure the operation is appropriate. More...
 
int flash_burst_write (flash_t *obj, uint32_t address, uint32_t Length, uint8_t *data)
 It is the same with flash_stream_write function which is used to write a stream of data to specified address. More...
 
int flash_burst_read (flash_t *obj, uint32_t address, uint32_t Length, uint8_t *data)
 It is the same with flash_stream_read function which is used to read a stream of data from specified address. More...
 
int flash_set_extend_addr (flash_t *obj, uint32_t data)
 This function is only for Micron 128MB flash to access beyond 16MB by switching between eight 16MB-area(segment). Please refer to flash datasheet for more information about memory mapping. More...
 
int flash_get_extend_addr (flash_t *obj)
 This function is only for Micron 128MB flash to read from Extended Address Register, which shows the current segment. Please refer to flash datasheet for more information about memory mapping. More...
 
int flash_read_id (flash_t *obj, uint8_t *buf, uint8_t len)
 Get flash ID (command: 0x9F). More...
 
int flash_read_unique_id (flash_t *obj, uint8_t *buf, uint8_t len)
 This function is only for Winbond flash to get unique ID (command: 0x4B). More...
 

Detailed Description

This file provides mbed FLASH API.

mbed Microcontroller Library

Author
Version
V1.0.0
Attention

Copyright (c) 2006-2013 ARM Limited

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.