PDL for FM0+  Version1.0
Peripheral Driverl Library for FM0+
C:/pdl_v10/library/utility/s25fl127s/csio_int_s25fl127s.h File Reference
#include "pdl_user.h"
#include "mfs\mfs.h"
#include "gpio\gpio.h"
Include dependency graph for csio_int_s25fl127s.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define InitCsioIo(void)   {SetPinFunc_SIN1_1(); SetPinFunc_SOT1_1();SetPinFunc_SCK1_1();SetPinFunc_SCS10_1();}
 < CSIO function initialization
#define FLASH_CSIO_CH   &CSIO1
 Flash default page size.
#define S25FL127S_DEFAULT_PAGE_SIZE   (256u)

Functions

en_result_t S25fl127s_Init (void)
 Initialize S25FL127S.
en_result_t S25fl127s_ReadId (uint8_t *pManufactureId, uint8_t *pDeviceId)
 Read ID from S25FL127S.
en_result_t S25fl127s_BulkErase (void)
 Chip erase the whole Flash memory.
en_result_t S25fl127s_4kSectorErase (uint32_t u32Addr)
 Sector erase 4KB sector.
en_result_t S25fl127s_SectorErase (uint32_t u32Addr)
 Sector erase 64kB or 256kB sector.
en_result_t S25fl127s_PageProgram (uint32_t u32Addr, uint8_t *pu8Data, uint16_t u16Size)
 Page program S25FL127S.
en_result_t S25fl127s_Read (uint32_t u32Addr, uint8_t *pu8Data, uint32_t u32Size)
 Read data from S25FL127S.

Detailed Description

S25FL127S driver header file

The S25fl127S is tested in the example, make following pin connection first.

--------------------------------------------------------- | MCU S25fl127S | |--------------------------------------------------------- | Pin Name Pin Count Pin Name | | SCS10_1 1 CS# (pull-up) | | SIN1_1 2 SO/IO1 (pull-up) | | - 3 WP#/IO2 (pull-up) | | GND 4 GND | | SOT1_1 5 SI/IO0 (pull-up) | | SCK1_1 6 CLK (pull-up) | | - 7 HOLD#/IO3/RESET# (pull-up)| | VCC 8 VCC | ---------------------------------------------------------

This driver provides basic operation APIs to access to S25FL127S, based on default memory map as following: -------- 0x00FFFFFF | ... | -------- | 64k | -------- 0x00010000 | ... | -------- | 4k | -------- 0x00000000

The memory map can be configured to other types, which is not implemented and considered in this driver file.

History:

  • 2014-03-10 1.0 Edison Zhang First release version.

Definition in file csio_int_s25fl127s.h.


Define Documentation

< CSIO function initialization

CSIO channel used for S25FL127S

Definition at line 133 of file csio_int_s25fl127s.h.

Referenced by S25fl127s_Init().

#define S25FL127S_DEFAULT_PAGE_SIZE   (256u)

Definition at line 141 of file csio_int_s25fl127s.h.

Referenced by S25fl127s_PageProgram().


Function Documentation

en_result_t S25fl127s_4kSectorErase ( uint32_t  u32Addr)

Sector erase 4KB sector.

Parameters:
u32AddrThe address within the 4k area
Return values:
OkSector Erase ok
ErrorSector erase error occurs

Definition at line 755 of file csio_int_s25fl127s.c.

References Cmd4kSectorErase, CmdReadStatusReg1, CmdWriteDisable, CmdWriteEnable, CsioRxReg(), CsioTxCmd(), CsioTxCmdAddr(), Error, FALSE, Ok, and TRUE.

Here is the call graph for this function:

Chip erase the whole Flash memory.

Return values:
OkChip Erase ok
ErrorChip erase error occurs

Definition at line 711 of file csio_int_s25fl127s.c.

References CmdBulkErase, CmdReadStatusReg1, CmdWriteDisable, CmdWriteEnable, CsioRxReg(), CsioTxCmd(), Error, FALSE, Ok, and TRUE.

Here is the call graph for this function:

en_result_t S25fl127s_PageProgram ( uint32_t  u32Addr,
uint8_t *  pu8Data,
uint16_t  u16Size 
)

Page program S25FL127S.

The default page size is 256Byte, 256bytes or less can be progammed with this function. The page buffer size can also be set to 512Byte via status register 2, but it is not considered here.

Parameters:
u32AddrAddress
pu8DataPointer to data address
u16SizeData size
Return values:
OkPage program OK
ErrorInvalidParameteru16Size > S25FL127S_DEFAULT_PAGE_SIZE pu8Data == NULL
ErrorPage program error

Definition at line 851 of file csio_int_s25fl127s.c.

References CmdPagePgm, CmdReadStatusReg1, CmdWriteDisable, CmdWriteEnable, CsioRxReg(), CsioTxCmd(), CsioTxData(), Error, ErrorInvalidParameter, FALSE, Ok, S25FL127S_DEFAULT_PAGE_SIZE, and TRUE.

Here is the call graph for this function:

en_result_t S25fl127s_Read ( uint32_t  u32Addr,
uint8_t *  pu8Data,
uint32_t  u32Size 
)

Read data from S25FL127S.

Parameters:
u32AddrAddress
pu8DataPointer to data address
u32SizeData size
Return values:
OkPage program OK
ErrorInvalidParameterpu8Data == NULL

Definition at line 902 of file csio_int_s25fl127s.c.

References CmdRead, CsioRxData(), ErrorInvalidParameter, and Ok.

Here is the call graph for this function:

en_result_t S25fl127s_ReadId ( uint8_t *  pManufactureId,
uint8_t *  pDeviceId 
)

Read ID from S25FL127S.

Parameters:
pManufactureIdPointer to manufacture ID
pDeviceIdPointer to device ID
Return values:
OkID are read normally

Definition at line 692 of file csio_int_s25fl127s.c.

References CmdReadId, CsioRxData(), and Ok.

Here is the call graph for this function:

en_result_t S25fl127s_SectorErase ( uint32_t  u32Addr)

Sector erase 64kB or 256kB sector.

Parameters:
u32AddrThe address within the 64kB or 256kB area
Return values:
OkSector Erase ok
ErrorSector erase error occurs

Definition at line 799 of file csio_int_s25fl127s.c.

References CmdReadStatusReg1, CmdSectorErase, CmdWriteDisable, CmdWriteEnable, CsioRxReg(), CsioTxCmd(), CsioTxCmdAddr(), Error, FALSE, Ok, and TRUE.

Here is the call graph for this function: