stm32_eval_spi_flash.h File Reference

This file contains all the functions prototypes for the stm32_eval_spi_flash firmware driver. More...

#include "stm32_eval.h"

Go to the source code of this file.

Defines

#define sFLASH_CMD_BE   0xC7
#define sFLASH_CMD_RDID   0x9F
#define sFLASH_CMD_RDSR   0x05
#define sFLASH_CMD_READ   0x03
#define sFLASH_CMD_SE   0xD8
#define sFLASH_CMD_WREN   0x06
#define sFLASH_CMD_WRITE   0x02
 M25P SPI Flash supported commands.
#define sFLASH_CMD_WRSR   0x01
#define sFLASH_CS_HIGH()   GPIO_SetBits(sFLASH_CS_GPIO_PORT, sFLASH_CS_PIN)
 Deselect sFLASH: Chip Select pin high.
#define sFLASH_CS_LOW()   GPIO_ResetBits(sFLASH_CS_GPIO_PORT, sFLASH_CS_PIN)
 Select sFLASH: Chip Select pin low.
#define sFLASH_DUMMY_BYTE   0xA5
#define sFLASH_M25P128_ID   0x202018
#define sFLASH_M25P64_ID   0x202017
#define sFLASH_SPI_PAGESIZE   0x100
#define sFLASH_WIP_FLAG   0x01

Functions

void sFLASH_DeInit (void)
 High layer functions.
void sFLASH_EraseBulk (void)
 Erases the entire FLASH.
void sFLASH_EraseSector (uint32_t SectorAddr)
 Erases the specified FLASH sector.
void sFLASH_Init (void)
 Initializes the peripherals used by the SPI FLASH driver.
void sFLASH_ReadBuffer (uint8_t *pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead)
 Reads a block of data from the FLASH.
uint8_t sFLASH_ReadByte (void)
 Low layer functions.
uint32_t sFLASH_ReadID (void)
 Reads FLASH identification.
uint8_t sFLASH_SendByte (uint8_t byte)
 Sends a byte through the SPI interface and return the byte received from the SPI bus.
uint16_t sFLASH_SendHalfWord (uint16_t HalfWord)
 Sends a Half Word through the SPI interface and return the Half Word received from the SPI bus.
void sFLASH_StartReadSequence (uint32_t ReadAddr)
 Initiates a read data byte (READ) sequence from the Flash.
void sFLASH_WaitForWriteEnd (void)
 Polls the status of the Write In Progress (WIP) flag in the FLASH's status register and loop until write opertaion has completed.
void sFLASH_WriteBuffer (uint8_t *pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite)
 Writes block of data to the FLASH.
void sFLASH_WriteEnable (void)
 Enables the write access to the FLASH.
void sFLASH_WritePage (uint8_t *pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite)
 Writes more than one byte to the FLASH with a single WRITE cycle (Page WRITE sequence).

Detailed Description

This file contains all the functions prototypes for the stm32_eval_spi_flash firmware driver.

Author:
MCD Application Team
Version:
V4.3.0
Date:
10/15/2010

THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.

© COPYRIGHT 2010 STMicroelectronics

Definition in file stm32_eval_spi_flash.h.

STM32F10x Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM32(CORTEX M3) 32-bit Microcontrollers platform visit  www.st.com/STM32