SAMV71 Xplained Ultra Software Package 1.0

s25fl1_qspi.c File Reference

#include <board.h>
#include <assert.h>

Go to the source code of this file.

Functions

void S25FL1_Configure (S25fl1 *pS25fl1, Qspid *pQspid, uint8_t polling)
 Initializes an S25FL1 driver instance with the given SPI driver and chip select value.
uint8_t S25FL1_IsBusy (S25fl1 *pS25fl1)
 Is serial flash driver busy.
uint8_t S25FL1_SendCommand (uint8_t Instr, uint8_t ReadWrite)
 Sends a command to the serial flash through the SPI. The command is made up of two parts: the first is used to transmit the command byte and optionally, address and dummy bytes. The second part is the data to send or receive. This function does not block: it returns as soon as the transfer has been started. An optional callback can be invoked to notify the end of transfer.
const S25fl1DescS25FL1_FindDevice (S25fl1 *pS25fl1, uint32_t jedecId)
 Tries to detect a serial firmware flash device given its JEDEC identifier. The JEDEC id can be retrieved by sending the correct command to the device.

Detailed Description

Implementation for the S25FL1 SPI driver.

Definition in file s25fl1_qspi.c.


Function Documentation

void S25FL1_Configure ( S25fl1 pS25fl1,
Qspid pQspid,
uint8_t  polling 
)

Initializes an S25FL1 driver instance with the given SPI driver and chip select value.

Parameters:
pS25fl1 Pointer to an S25FL1 driver instance.
pSpid Pointer to an SPI driver instance.
cs Chip select value to communicate with the serial flash.
polling Uses polling mode instead of IRQ trigger.

Definition at line 100 of file s25fl1_qspi.c.

const S25fl1Desc* S25FL1_FindDevice ( S25fl1 pS25fl1,
uint32_t  jedecId 
)

Tries to detect a serial firmware flash device given its JEDEC identifier. The JEDEC id can be retrieved by sending the correct command to the device.

Parameters:
pS25fl1 Pointer to an S25FL1 driver instance.
jedecId JEDEC identifier of device.
Returns:
the corresponding S25FL1 descriptor if found; otherwise returns 0.

Definition at line 174 of file s25fl1_qspi.c.

uint8_t S25FL1_IsBusy ( S25fl1 pS25fl1  ) 

Is serial flash driver busy.

Parameters:
pS25fl1 Pointer to an S25fl1 driver instance.
Returns:
1 if the serial flash driver is currently busy executing a command; otherwise returns 0.

Definition at line 128 of file s25fl1_qspi.c.

Here is the call graph for this function:

uint8_t S25FL1_SendCommand ( uint8_t  Instr,
uint8_t  ReadWrite 
)

Sends a command to the serial flash through the SPI. The command is made up of two parts: the first is used to transmit the command byte and optionally, address and dummy bytes. The second part is the data to send or receive. This function does not block: it returns as soon as the transfer has been started. An optional callback can be invoked to notify the end of transfer.

Parameters:
pS25fl1 Pointer to an S25fl1 driver instance.
cmd Command byte.
cmdSize Size of command (command byte + address bytes + dummy bytes).
pData Data buffer.
dataSize Number of bytes to send/receive.
address Address to transmit.
callback Optional user-provided callback to invoke at end of transfer.
pArgument Optional argument to the callback function.
Returns:
0 if successful; otherwise, returns S25FL1_ERROR_BUSY if the S25FL1 driver is currently executing a command, or S25FL1_ERROR_SPI if the command cannot be sent because of a SPI error.

Definition at line 158 of file s25fl1_qspi.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines