SAMV71 Xplained Ultra Software Package 1.5

s25fl1.c File Reference

#include <board.h>
#include <assert.h>
#include "stdlib.h"
#include "string.h"

Go to the source code of this file.

Defines

#define READ_DEV   0
#define WRITE_DEV   1
#define PAGE_SIZE   256

Functions

void XDMAC_Handler (void)
 XDMA handler.
void S25FL1D_InitFlashInterface (uint8_t Mode)
uint32_t S25FL1D_ReadJedecId (void)
 Reads and returns the serial flash device ID.
void S25FL1D_QuadMode (uint8_t Enable)
 Enables critical writes operation on a serial flash device, such as sector protection, status register, etc.
void S25FL1D_EnableWrap (uint8_t ByetAlign)
 Enables critical writes operation on a serial flash device, such as sector protection, status register, etc.
void S25FL1D_SetReadLatencyControl (uint8_t Latency)
 Enables critical writes operation on a serial flash device, such as sector protection, status register, etc.
void S25FL1D_SoftReset (void)
void S25FL1D_ContReadModeReset (void)
 Issue 'CContinuous Read Mode' command, the device can return to normal SPI command mode, in which all commands can be accepts.
unsigned char S25FL1D_Unprotect (void)
 Unprotected the contents of the serial flash device.
unsigned char S25FL1D_Protect (uint32_t StartAddr, uint32_t Size)
 Unprotected the contents of the serial flash device.
unsigned char S25FL1D_EraseChip (void)
 Erases all the content of the memory chip.
unsigned char S25FL1D_EraseSector (unsigned int address)
 Erases the specified block of the serial firmware dataflash.
unsigned char S25FL1D_Erase64KBlock (unsigned int address)
 Erases the specified 64KB block of the serial firmware dataflash.
unsigned char S25FL1D_Write (uint32_t *pData, uint32_t size, uint32_t address, uint8_t Secure)
 Writes data at the specified address on the serial firmware dataflash. The page(s) to program must have been erased prior to writing. This function handles page boundary crossing automatically.
unsigned char S25FL1D_Read (uint32_t *pData, uint32_t size, uint32_t address)
 Reads data from the specified address on the serial flash.
unsigned char S25FL1D_ReadDual (uint32_t *pData, uint32_t size, uint32_t address)
 Reads data from the specified address on the serial flash.
unsigned char S25FL1D_ReadQuad (uint32_t *pData, uint32_t size, uint32_t address)
 Reads data from the specified address on the serial flash.
unsigned char S25FL1D_ReadDualIO (uint32_t *pData, uint32_t size, uint32_t address, uint8_t ContMode, uint8_t Secure)
 Reads data from the specified address on the serial flash.
unsigned char S25FL1D_ReadQuadIO (uint32_t *pData, uint32_t size, uint32_t address, uint8_t ContMode, uint8_t Secure)
 Reads data from the specified address on the serial flash.

Detailed Description

Implementation for the S25FL1 Serialflash driver.

Definition in file s25fl1.c.


Function Documentation

void S25FL1D_EnableWrap ( uint8_t  ByetAlign  ) 

Enables critical writes operation on a serial flash device, such as sector protection, status register, etc.

pS25fl1 Pointer to an S25FL1 driver instance.

Definition at line 589 of file s25fl1.c.

Here is the call graph for this function:

unsigned char S25FL1D_Erase64KBlock ( unsigned int  address  ) 

Erases the specified 64KB block of the serial firmware dataflash.

Parameters:
pS25fl1 Pointer to an S25FL1 driver instance.
address Address of the block to erase.
Returns:
0 if successful; otherwise returns ERROR_PROTECTED if the device is protected or ERROR_BUSY if it is busy executing a command.

Definition at line 828 of file s25fl1.c.

Here is the call graph for this function:

unsigned char S25FL1D_EraseChip ( void   ) 

Erases all the content of the memory chip.

Parameters:
pS25fl1 Pointer to an S25FL1 driver instance.
Returns:
0 if the device has been unprotected; otherwise returns ERROR_PROTECTED.

Definition at line 744 of file s25fl1.c.

Here is the call graph for this function:

unsigned char S25FL1D_EraseSector ( unsigned int  address  ) 

Erases the specified block of the serial firmware dataflash.

Parameters:
pS25fl1 Pointer to an S25FL1 driver instance.
address Address of the block to erase.
Returns:
0 if successful; otherwise returns ERROR_PROTECTED if the device is protected or ERROR_BUSY if it is busy executing a command.

Definition at line 783 of file s25fl1.c.

unsigned char S25FL1D_Protect ( uint32_t  StartAddr,
uint32_t  Size 
)

Unprotected the contents of the serial flash device.

Parameters:
pS25fl1 Pointer to an S25FL1 driver instance.
Returns:
0 if the device has been unprotected; otherwise returns S25FL1D_ERROR_PROTECTED.

Definition at line 702 of file s25fl1.c.

void S25FL1D_QuadMode ( uint8_t  Enable  ) 

Enables critical writes operation on a serial flash device, such as sector protection, status register, etc.

pS25fl1 Pointer to an S25FL1 driver instance.

Definition at line 556 of file s25fl1.c.

Here is the call graph for this function:

unsigned char S25FL1D_Read ( uint32_t *  pData,
uint32_t  size,
uint32_t  address 
)

Reads data from the specified address on the serial flash.

Parameters:
pS25fl1 Pointer to an S25FL1 driver instance.
pData Data buffer.
size Number of bytes to read.
address Read address.
Returns:
0 if successful; otherwise, fail.

Definition at line 953 of file s25fl1.c.

Here is the call graph for this function:

unsigned char S25FL1D_ReadDual ( uint32_t *  pData,
uint32_t  size,
uint32_t  address 
)

Reads data from the specified address on the serial flash.

Parameters:
pS25fl1 Pointer to an S25FL1 driver instance.
pData Data buffer.
size Number of bytes to read.
address Read address.
Returns:
0 if successful; otherwise, fail.

Definition at line 997 of file s25fl1.c.

Here is the call graph for this function:

unsigned char S25FL1D_ReadDualIO ( uint32_t *  pData,
uint32_t  size,
uint32_t  address,
uint8_t  ContMode,
uint8_t  Secure 
)

Reads data from the specified address on the serial flash.

Parameters:
pS25fl1 Pointer to an S25FL1 driver instance.
pData Data buffer.
size Number of bytes to read.
address Read address.
Returns:
0 if successful; otherwise, fail.

Definition at line 1091 of file s25fl1.c.

Here is the call graph for this function:

uint32_t S25FL1D_ReadJedecId ( void   ) 

Reads and returns the serial flash device ID.

Parameters:
pS25fl1 Pointer to an S25FL1 driver instance.

Definition at line 542 of file s25fl1.c.

unsigned char S25FL1D_ReadQuad ( uint32_t *  pData,
uint32_t  size,
uint32_t  address 
)

Reads data from the specified address on the serial flash.

Parameters:
pS25fl1 Pointer to an S25FL1 driver instance.
pData Data buffer.
size Number of bytes to read.
address Read address.
Returns:
0 if successful; otherwise, fail.

Definition at line 1045 of file s25fl1.c.

Here is the call graph for this function:

unsigned char S25FL1D_ReadQuadIO ( uint32_t *  pData,
uint32_t  size,
uint32_t  address,
uint8_t  ContMode,
uint8_t  Secure 
)

Reads data from the specified address on the serial flash.

Parameters:
pS25fl1 Pointer to an S25FL1 driver instance.
pData Data buffer.
size Number of bytes to read.
address Read address.
Returns:
0 if successful; otherwise, fail.

Definition at line 1148 of file s25fl1.c.

Here is the call graph for this function:

void S25FL1D_SetReadLatencyControl ( uint8_t  Latency  ) 

Enables critical writes operation on a serial flash device, such as sector protection, status register, etc.

pS25fl1 Pointer to an S25FL1 driver instance.

Definition at line 615 of file s25fl1.c.

Here is the call graph for this function:

unsigned char S25FL1D_Unprotect ( void   ) 

Unprotected the contents of the serial flash device.

Parameters:
pS25fl1 Pointer to an S25FL1 driver instance.
Returns:
0 if the device has been unprotected; otherwise returns S25FL1D_ERROR_PROTECTED.

Definition at line 659 of file s25fl1.c.

unsigned char S25FL1D_Write ( uint32_t *  pData,
uint32_t  size,
uint32_t  address,
uint8_t  Secure 
)

Writes data at the specified address on the serial firmware dataflash. The page(s) to program must have been erased prior to writing. This function handles page boundary crossing automatically.

Parameters:
pS25fl1 Pointer to an S25FL1 driver instance.
pData Data buffer.
size Number of bytes in buffer.
address Write address.
Returns:
0 if successful; otherwise, returns ERROR_PROGRAM is there has been an error during the data programming.

Definition at line 883 of file s25fl1.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines