Sensorian  1.0
C API Reference Guide Library
Serial Flash Storage

Functions

void S25FL_Setup (void)
 Setup SPI and IOs connected to Serial FLASH. More...
 
void S25FL_WriteByte (unsigned char data, unsigned long address)
 Write a byte to the address specified (24 bit address) More...
 
unsigned char S25FL_ReadByte (unsigned long address)
 Read a byte from the specified 24 bit address. More...
 
void S25FL_WriteArray (unsigned long address, unsigned char *pData, unsigned int arrayLength)
 Write data array at the specified address , this procedure does page programming. The destination address should be provided. This function is not safe so the user has to check the arguments. More...
 
void S25FL_ReadArray (unsigned long address, unsigned char *pData, unsigned int arrayLength)
 Read an array of data from the given address. More...
 
unsigned int S25FL_ReadID (void)
 This function reads the Manufacturer ID code This procedure Reads the manufacturer's ID and device ID. More...
 
unsigned long S25FL_Jedec_ID_Read (void)
 This procedure Reads the manufacturer's ID (BFh), memory type (25h) and device ID (4Bh). It will use 9Fh as the JEDEC ID command. More...
 
void S25FL_ChipErase (void)
 Erase all chip contents. Erase is slow on flash chips. More...
 
void S25FL_SectorErase (unsigned long address)
 This function erases a 4Kb sector (it erase a page actually) More...
 
void S25FL_BlockErase (unsigned long address)
 This function erases a 64Kb block. More...
 
unsigned char S25FL_IsWriteBusy (void)
 This function reads status register and checks BUSY bit for a write in progress operation.It waits until the device is no longer busy. More...
 
unsigned char S25FL_SReg_Read (unsigned char statReg)
 Read specific Status Register depending on value of statReg. More...
 
void S25FL_SReg_Write (unsigned char statReg)
 This procedure writes a byte to the Status Register. More...
 
void S25FL_DeepSleep (void)
 Puts the flash chip into deep sleep mode. More...
 
void S25FL_WakeUp (void)
 Wakes the flash memory chip from deep sleep mode. More...
 
void S25FL_SetBlockProtection (unsigned char prot)
 Sets the block protection of the chip. More...
 

Detailed Description

These functions allow you the use the serial flash storage.

Function Documentation

void S25FL_BlockErase ( unsigned long  address)

This function erases a 64Kb block.

Parameters
addressBlock address.
Returns
none

Definition at line 230 of file S25FL204K.c.

void S25FL_ChipErase ( void  )

Erase all chip contents. Erase is slow on flash chips.

Returns
none

Definition at line 195 of file S25FL204K.c.

void S25FL_DeepSleep ( void  )

Puts the flash chip into deep sleep mode.

Returns
none

Definition at line 295 of file S25FL204K.c.

unsigned char S25FL_IsWriteBusy ( void  )

This function reads status register and checks BUSY bit for a write in progress operation.It waits until the device is no longer busy.

Returns
status Returns 1 if flash is in busy mode , 0 otherwise.

Definition at line 248 of file S25FL204K.c.

unsigned long S25FL_Jedec_ID_Read ( void  )

This procedure Reads the manufacturer's ID (BFh), memory type (25h) and device ID (4Bh). It will use 9Fh as the JEDEC ID command.

Returns
deviceID 16 bit device id

Definition at line 177 of file S25FL204K.c.

void S25FL_ReadArray ( unsigned long  address,
unsigned char *  pData,
unsigned int  arrayLength 
)

Read an array of data from the given address.

Parameters
addressDestination Address 000000H - 7FFFFFH
pDataPointer to array of data
arrayLengthLength of pointer to array of data
Returns
none

Definition at line 129 of file S25FL204K.c.

unsigned char S25FL_ReadByte ( unsigned long  address)

Read a byte from the specified 24 bit address.

Parameters
addressDestination Address 000000H - 7FFFFFH
Returns
mybyte Data located on address

Definition at line 76 of file S25FL204K.c.

unsigned int S25FL_ReadID ( void  )

This function reads the Manufacturer ID code This procedure Reads the manufacturer's ID and device ID.

Returns
deviceID 16 bit device id

Definition at line 156 of file S25FL204K.c.

void S25FL_SectorErase ( unsigned long  address)

This function erases a 4Kb sector (it erase a page actually)

Parameters
addressAddress of the sector. Should start on a even boundary.
Returns
none

Definition at line 211 of file S25FL204K.c.

void S25FL_SetBlockProtection ( unsigned char  prot)

Sets the block protection of the chip.

Parameters
protProtection settings.
Returns
none

Definition at line 318 of file S25FL204K.c.

void S25FL_Setup ( void  )

Setup SPI and IOs connected to Serial FLASH.

Returns
none

Definition at line 39 of file S25FL204K.c.

unsigned char S25FL_SReg_Read ( unsigned char  statReg)

Read specific Status Register depending on value of statReg.

Parameters
statRegAddress of one of the status registers.
Returns
StatusReg Contents of status register

Definition at line 264 of file S25FL204K.c.

void S25FL_SReg_Write ( unsigned char  statReg)

This procedure writes a byte to the Status Register.

Parameters
statRegAddress of one of the status registers.
Returns
none

Definition at line 279 of file S25FL204K.c.

void S25FL_WakeUp ( void  )

Wakes the flash memory chip from deep sleep mode.

Returns
none

Definition at line 306 of file S25FL204K.c.

void S25FL_WriteArray ( unsigned long  address,
unsigned char *  pData,
unsigned int  arrayLength 
)

Write data array at the specified address , this procedure does page programming. The destination address should be provided. This function is not safe so the user has to check the arguments.

Parameters
addressDestination Address 000000H - 7FFFFFH
pDataPointer to array of data
arrayLengthLength of pointer to array of data
Returns
none

Definition at line 97 of file S25FL204K.c.

void S25FL_WriteByte ( unsigned char  data,
unsigned long  address 
)

Write a byte to the address specified (24 bit address)

Parameters
dataByte data to be written on a specific address
address24 bit address of the flash memory
Returns
none

Definition at line 51 of file S25FL204K.c.