ConOpSys V2970  P004.07
ANVILEX control operating system
Classes | Public Member Functions | Public Attributes | Private Types | Private Member Functions | List of all members
TS25FL512 Class Reference

NAND memory hardware driver. More...

#include <S25FL512.h>

Inheritance diagram for TS25FL512:
Inheritance graph
Collaboration diagram for TS25FL512:
Collaboration graph

Classes

union  TBlock_Register
 Block lock register structure. More...
 
union  TStatus_Register
 Status register structure. More...
 

Public Member Functions

VOID Init ()
 Class constructor method. More...
 
virtual VOID Start ()
 Driver start operation method. More...
 
VOID Execute ()
 Background execute method. More...
 
virtual BOOL Read_Buffer (U32 u32_Linear_Address, U32 u32_Size, U8 *u8_Data_Buffer)
 Read data from memory into buffer. More...
 
BOOL Read_Extended_Buffer (U32 u32_Linear_Address, U32 u32_Size, U8 *u8_Data_Buffer)
 Read data from memory into buffer. More...
 
BOOL Read_Buffer_By_Page_Index (U32 u32_Page_Index, U16 u16_Offset, U32 u32_Size, U8 *u8_Data_Buffer)
 Read data from memory into buffer. More...
 
virtual BOOL Write_Buffer (U32 u32_Linear_Address, U32 u32_Size, U8 *u8_Data_Buffer)
 Write data from buffer into memory. More...
 
BOOL Write_Buffer_By_Page_Index (U32 u32_Page_Index, U16 u16_Offset, U32 u32_Size, U8 *u8_Data_Buffer)
 Write data from buffer into memory. More...
 
BOOL Erase_Block_By_Index (U16 u16_Block_Index)
 Erase block referenced by block index. More...
 
virtual BOOL Erase_Chip (BOOL bool_Force_Bad_Block_Erase)
 Erase all blocks of the chip. More...
 
BOOL Get_Bad_Block_Status (U32 u32_Block_Index, BOOL *bool_Bad_Block_Status)
 Test for specified block is bad and can not be utilised. More...
 
BOOL Is_Block_Empty (U16 u16_Block_Index)
 Test for specified block is empty and be utilised for write operation. More...
 
BOOL Is_Page_In_Cache_Empty ()
 Test for specified page is empty and be utilised for write operation. More...
 
virtual VOID Send_Information (TProtocol_Base *object_Protocol)
 Method sends actual driver information over specified communication link protocol. More...
 
TReturn_Test_Code QA_Erase_Block_Test ()
 Erase block test method. More...
 
TReturn_Test_Code QA_Write_Page_Test ()
 Write page test method. More...
 
TReturn_Test_Code QA_Read_Page_Test ()
 Read page test method. More...
 
TReturn_Test_Code QA_Single_Block_Erase_Test ()
 Single block erase test method. More...
 
TReturn_Test_Code QA_Flash_Driver_Main_Test ()
 Method for starting the main test sequence. More...
 
- Public Member Functions inherited from TSPI_Memory_Base
 TSPI_Memory_Base ()
 Base class constructor method. More...
 
virtual ~TSPI_Memory_Base ()
 Base class constructor method. More...
 
VOID Init ()
 SPI memory base object initialisation method. More...
 
VOID Done ()
 SPI memory base object finalisation method. More...
 
virtual VOID Stop ()
 Stop operation of SPI memory base driver. More...
 
VOID Assign_SPI_Master (TSPI_Master_Base *object_New_SPI_Master)
 Assign SPI master hardware driver. More...
 
VOID Unassign_SPI_Master ()
 Unassign SPI master hardware driver. More...
 
virtual BOOL Verify_Buffer (U32 u32_Linear_Address, U32 u32_Size, U8 *u8_Data_Buffer)
 Verify data in memory and memory method. More...
 
BOOL Get_Block_Address (U16 u16_Block_Index, U32 *u32_Linear_Address)
 Get linear address of the block by specified block index. More...
 
BOOL Get_Page_Address (U16 u16_Block_Index, U16 u16_Relative_Page_Index, U32 *u32_Linear_Address)
 Get linear address of the page by specified block index and relative page index. More...
 
U32 Get_Capacity ()
 Get capacity of attached SPI memory. More...
 
TRIL Is_Available ()
 Return SPI avaliability. More...
 
BOOL Get_Page_Index (U32 u32_Linear_Address, U32 *u32_Page_Index)
 Get page index from lenear address. More...
 
BOOL Get_Page_Index (U16 u16_Block_Index, U16 u16_Page_Relative_Index, U32 *u32_Page_Index)
 Get page index from block index and page relative index. More...
 
BOOL Get_Block_Index_By_Page (U32 u32_Page_Index, U16 *u16_Block_Index)
 Get block index by page index. More...
 
BOOL Get_Page_Index (U16 u16_Block_Index, U32 *u32_Page_Index)
 Get page index of the block. More...
 
BOOL Get_Page_Size (U16 *u16_Page_Size)
 Return page size in bytes. More...
 
BOOL Get_Pages_Per_Block_Count (U16 *u16_Pages_Per_Block)
 Return pages number into block. More...
 
BOOL Get_Block_Count (U16 *u16_Block_Count)
 Return total amount of the blocks. More...
 
BOOL Get_Pages_Per_Chip_Count (U32 *u32_Pages_Per_Chip)
 Return total amount of the pages. More...
 

Public Attributes

TChip_Type enum_Flash_Chip_Type = chip_type_None
 Flash chip type storage. More...
 
U8 u8_Manufacturer_ID = (U8)0xFF
 Manufacturer number storage. More...
 
U8 u8_Device_ID = (U8)0xFF
 Serial number storage. More...
 
volatile U8 u8_JEDEC_ID [3] = { (U8)0xFF, (U8)0xFF, (U8)0xFF }
 JEDEC code storage. More...
 
U32 u32_Identifier_Dummy_Byte_Counter = (U32)0
 Read identifier dummy byte counter. More...
 
U8 u8_BP1 = (U8)0x00
 BP1 bit in BL register. More...
 
U8 u8_BP2 = (U8)0x00
 BP2 bit in BL register. More...
 
U8 u8_BRWD = (U8)0x00
 BRWD bit in BL register. More...
 
U32 u32_Block_Erase_Request_Counter = (U32)0
 Block erase request counter. More...
 
U32 u32_Block_Erase_Error_Counter = (U32)0
 Block read error counter. More...
 
U32 u32_Page_Read_Request_Counter = (U32)0
 Page read request counter. More...
 
U32 u32_Page_Read_Error_Counter = (U32)0
 Page read error counter. More...
 
U32 u32_Page_Write_Request_Counter = (U32)0
 Page write request counter. More...
 
U32 u32_Page_Write_Error_Counter = (U32)0
 Page write error counter. More...
 
U16 u16_Bad_Block_Counter = (U16)0
 Bad block search counter. More...
 
U16 u16_Bad_Block_Count = (U16)0
 Bad block count. More...
 
U16 u16_Execute_Bad_Block_Count_Index = (U16)0
 Actual block index of the search bad block count process. More...
 
U8 u8_Test_Buffer [2048]
 Actual block index of the search bad block count process. More...
 

Private Types

enum  TChip_Type {
  chip_type_None = 0 , chip_type_Unknown = 1 , chip_type_IS37SML01G1 = 2 , chip_type_GD5F4GQ4UAYIG = 3 ,
  chip_type_S25FL512S = 4
}
 Define chip types. More...
 
enum  TS25FL512SCommand {
  commandRES = (U8)0xFF , commandBE = (U8)0xD8 , commandGF = (U8)0x0F , commandSF = (U8)0x1F ,
  commandWRDI = (U8)0x04 , commandWREN = (U8)0x06 , commandPP = (U8)0x02 , commandRPP = (U8)0x84 ,
  commandPE = (U8)0x10 , commandREAD = (U8)0x13 , commandRFC = (U8)0x03 , commandRDID = (U8)0x9F ,
  command2RFC = (U8)0x3B , command4RPP = (U8)0x34 , command4RFC = (U8)0x6B
}
 Define NVRAM commands. More...
 
enum  TS25FL512SAdress { address_BL = (U8)0xA0 , address_OTP = (U8)0xB0 , address_SR = (U8)0xC0 , address_OD = (U8)0xD0 }
 Feature address list. More...
 
typedef enum TS25FL512::TS25FL512SAdress TS25FL512SAdress
 Feature address list. More...
 

Private Member Functions

virtual BOOL Write_Enable ()
 Enable write operation into memory. More...
 
virtual BOOL Write_Disable ()
 Disable write operation into memory. More...
 
virtual BOOL Read_Status_Register (U8 *u8_Status_Register)
 Read memory device status register method. More...
 
BOOL Get_Feature (TS25FL512SAdress enum_Feature_Adress, U8 *u8_Data)
 Get flash memory feature method. More...
 
BOOL Set_Feature (TS25FL512SAdress enum_Feature_Adress, U8 u8_Data)
 Set flash memory feature method. More...
 
virtual BOOL Read_Identification ()
 Read memory device identification information method. More...
 
VOID Reset ()
 Software reset memory chip method. More...
 
BOOL Read_Page_From_Cache_By_Leniar_Address (U32 u32_Address, U32 u32_Length, U8 *u8_Data_Buffer)
 Read multiple byte from chip cache method. More...
 
BOOL Read_Page_From_Cache (U16 u16_Offset, U32 u32_Length, U8 *u8_Data_Buffer)
 Read multiple byte from chip cache method. More...
 
BOOL Write_Page_To_Cache_By_Leniar_Address (U32 u32_Address, U32 u32_Length, U8 *u8_Data_Buffer)
 Write multiple byte into chip cache method. More...
 
BOOL Write_Page_To_Cache (U16 u16_Offset, U32 u32_Length, U8 *u8_Data_Buffer)
 Write multiple byte into chip cache method. More...
 
BOOL Read_Page_From_Cells_To_Cache (U32 u32_Linear_Address)
 Read page from chip cells into the cache method. More...
 
BOOL Read_Page_From_Cells_To_Cache_By_Index (U32 u32_Page_Index)
 Read page from chip cells into the cache method. Page referenced by absolute page index within memory chip. More...
 
BOOL Write_Page_From_Cache_To_Cells (U32 u32_Linear_Address)
 Write page from cache into chip cells method. More...
 
BOOL Write_Page_From_Cache_To_Cells_By_Page_Index (U32 u32_Page_Index)
 Write page from cache into chip cells method. More...
 
BOOL Get_Write_Protection_Bits ()
 Get write protection bits. More...
 
BOOL Wait_For_Operation_Done (F32 f32_Timeout)
 Wait specified time for hardware controller operation done method. More...
 
BOOL Is_Operation_In_Progress ()
 Get operation status method. More...
 
BOOL Is_Read_Failure ()
 Get read operation status method. More...
 
BOOL Is_Erase_Failure ()
 Get erase operation status method. More...
 
BOOL Is_Program_Failure ()
 Get program operation status method. More...
 
VOID Increment_Block_Erase_Request_Counter ()
 Increment block erase request counter method. More...
 
VOID Increment_Block_Erase_Error_Counter ()
 Increment block erase error counter method. More...
 
VOID Increment_Page_Read_Request_Counter ()
 Increment page read request counter method. More...
 
VOID Increment_Page_Read_Error_Counter ()
 Increment page read error counter method. More...
 
VOID Increment_Page_Write_Request_Counter ()
 Increment page write request counter method. More...
 
VOID Increment_Page_Write_Error_Counter ()
 Increment page write error counter method. More...
 

Additional Inherited Members

- Protected Member Functions inherited from TSPI_Memory_Base
BOOL Get_Chip_Size (U32 *u32_Chip_Size)
 Return total chip capacity in bytes. More...
 
BOOL Get_Block_Size (U32 *u32_Block_Size)
 Return block size in bytes. More...
 
BOOL Extract_Page_Relative_Address (U32 u32_Linear_Address, U16 *u16_Relative_Address)
 Extract page relative address from lenear address. More...
 
BOOL Is_Block_Index_In_Range (U16 u16_Block_Index)
 This method check that block index is valid. More...
 
BOOL Is_Page_Index_In_Range (U32 u32_Page_Index)
 This method check that page index is valid. More...
 
- Protected Attributes inherited from TSPI_Memory_Base
TSPI_Master_Baseobject_SPI_Master = (TSPI_Master_Base*)NULL
 Pointer to the SPI master object. More...
 
TMemory_Chip_Descriptorstruct_Memory_Chip_Descriptor = (TMemory_Chip_Descriptor*)NULL
 Pointer to the chip descriptor structure. More...
 
TRIL tril_Available = (TRIL)unset
 Memory chip availablility status. More...
 
BOOL bool_Manufacturer_ID_Available = (BOOL)false
 Manufacturer ID availablility status. More...
 
BOOL bool_Device_ID_Available = (BOOL)false
 Device ID availablility status. More...
 
BOOL bool_Serial_Number_Available = (BOOL)false
 Serial number availablility status. More...
 
U32 u32_Capacity = (U32)0
 Depricated: Capacity of SPI memory in bytes. More...
 

Detailed Description

NAND memory hardware driver.

Member Typedef Documentation

◆ TS25FL512SAdress

Feature address list.

Member Enumeration Documentation

◆ TChip_Type

enum TS25FL512::TChip_Type
private

Define chip types.

Enumerator
chip_type_None 

No chip.

chip_type_Unknown 

Unknown chip.

chip_type_IS37SML01G1 

1 GBit, NAND, ISSI, IS37SML01G1

chip_type_GD5F4GQ4UAYIG 

4 GBit, NAND, GigaDevice, GD5F4GQ4UAYIG

chip_type_S25FL512S 

512 MBit, NOR, SPANSION, S25FL512S

◆ TS25FL512SAdress

Feature address list.

Enumerator
address_BL 

Block lock register address.

address_OTP 

OTP register address.

address_SR 

Status register address.

address_OD 

Output data register address.

◆ TS25FL512SCommand

Define NVRAM commands.

Enumerator
commandRES 

Reset chip command.

commandBE 

Block erase command.

commandGF 

Get feature command.

commandSF 

Set feature command.

commandWRDI 

Write disable command.

commandWREN 

Write enable command.

commandPP 

Page program command.

commandRPP 

Random page program command.

commandPE 

Program execute command.

commandREAD 

Read page command.

commandRFC 

Read from cache (or 0x0B) command.

commandRDID 

Read manufacture ID, memory type ID, capacity ID command.

command2RFC 

Read from cache x2 command.

command4RPP 

Random page program x4 command.

command4RFC 

Read from cache x4 command.

Member Function Documentation

◆ Erase_Block_By_Index()

BOOL TS25FL512::Erase_Block_By_Index ( U16  u16_Block_Index)

Erase block referenced by block index.


Note
None
Parameters
[in]u16_Block_Index- Block index to erase
Returns
BOOL - Erase operation status
Return values
false- Erase operation failed
true- Erase operation successed
Override
Not requered
Attention
None

References commandBE, TSPI_Master_Base::CS_Activate(), TSPI_Master_Base::CS_Deactivate(), Extract_U8_From_U16(), false, TSPI_Memory_Base::Get_Pages_Per_Block_Count(), Is_Erase_Failure(), NULL, TSPI_Memory_Base::object_SPI_Master, TSPI_Master_Base::Send_Byte(), Wait_For_Operation_Done(), and Write_Enable().

Referenced by Erase_Chip(), TEvent_Manager::Execute(), QA_Erase_Block_Test(), and QA_Single_Block_Erase_Test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Erase_Chip()

BOOL TS25FL512::Erase_Chip ( BOOL  bool_Force_Bad_Block_Erase)
virtual

Erase all blocks of the chip.


Note
None
Parameters
[in]bool_Force_Bad_Block_Erase- Force bad block erase
Returns
BOOL - Erase operation status
Return values
false- Erase operation failed
true- Erase operation successed
Override
Not requered
Attention
Erase operation not applied to the bad blocks.

Reimplemented from TSPI_Memory_Base.

References Erase_Block_By_Index(), false, Get_Bad_Block_Status(), TSPI_Memory_Base::Get_Block_Count(), NULL, TSPI_Memory_Base::object_SPI_Master, and true.

Referenced by TEvent_Manager::Format_Event_Storage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Execute()

VOID TS25FL512::Execute ( )

Background execute method.


Note
None.
Returns
None
Override
Not allowed
Attention
None
Todo:
Eliminate magic number as parameter in method invocation

References Get_Bad_Block_Status(), Increment_Overflowed(), Increment_Saturated(), NULL, TSPI_Memory_Base::object_SPI_Master, true, u16_Bad_Block_Count, u16_Bad_Block_Counter, and u16_Execute_Bad_Block_Count_Index.

Referenced by TEvent_Manager::Execute().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get_Bad_Block_Status()

BOOL TS25FL512::Get_Bad_Block_Status ( U32  u32_Block_Index,
BOOL bool_Bad_Block_Status 
)

Test for specified block is bad and can not be utilised.


Note
None
Parameters
[in]u32_Block_Index- Block index to erase
[out]bool_Bad_Block_Status- Bad block status value
Returns
BOOL - Operation status
Return values
false- Block is good
true- Block is bad
Override
Not requered
Attention
None

References TS25FL512::TStatus_Register::bits_ECC_Status, false, TSPI_Memory_Base::Get_Page_Address(), Read_Extended_Buffer(), Read_Status_Register(), and TS25FL512::TStatus_Register::u8_Raw_Data.

Referenced by Erase_Chip(), TEvent_Manager::Execute(), Execute(), TEvent_Manager::Get_Min_Max_Flash_Index(), TEvent_Manager::Half_Devision_Method_Searching(), QA_Erase_Block_Test(), QA_Read_Page_Test(), QA_Single_Block_Erase_Test(), and QA_Write_Page_Test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get_Feature()

BOOL TS25FL512::Get_Feature ( TS25FL512SAdress  enum_Feature_Adress,
U8 u8_Data 
)
private

Get flash memory feature method.


Note
None
Parameters
[in]enum_Feature_Adress- Chip feature address
[out]u8_Data- Chip feature value
Returns
BOOL - Get operation status
Return values
false- Get operation successed
true- Get operation failed
Override
Not allowed
Attention
None

References commandGF, TSPI_Master_Base::CS_Activate(), TSPI_Master_Base::CS_Deactivate(), TSPI_Memory_Base::object_SPI_Master, TSPI_Master_Base::Receive_Byte(), and TSPI_Master_Base::Send_Byte().

Referenced by Get_Write_Protection_Bits().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get_Write_Protection_Bits()

BOOL TS25FL512::Get_Write_Protection_Bits ( )
private

Get write protection bits.


Note
None
Returns
BOOL - Operation status
Return values
false- Operation successed
true- Operation failed
Override
Not allowed
Attention
None

References address_BL, TS25FL512::TBlock_Register::BP1, TS25FL512::TBlock_Register::BP2, TS25FL512::TBlock_Register::BRWD, Get_Feature(), u8_BP1, u8_BP2, u8_BRWD, and TS25FL512::TBlock_Register::u8_Raw_Data.

Referenced by Start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Increment_Block_Erase_Error_Counter()

VOID TS25FL512::Increment_Block_Erase_Error_Counter ( )
private

Increment block erase error counter method.


Note
None
Returns
None
Override
Not allowed
Attention
None

References Increment_Saturated(), and u32_Block_Erase_Error_Counter.

Here is the call graph for this function:

◆ Increment_Block_Erase_Request_Counter()

VOID TS25FL512::Increment_Block_Erase_Request_Counter ( )
private

Increment block erase request counter method.


Note
None
Returns
None
Override
Not allowed
Attention
None

References Increment_Saturated(), and u32_Block_Erase_Request_Counter.

Here is the call graph for this function:

◆ Increment_Page_Read_Error_Counter()

VOID TS25FL512::Increment_Page_Read_Error_Counter ( )
private

Increment page read error counter method.


Note
None
Returns
None
Override
Not allowed
Attention
None

References Increment_Saturated(), and u32_Page_Read_Error_Counter.

Referenced by Read_Page_From_Cells_To_Cache_By_Index().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Increment_Page_Read_Request_Counter()

VOID TS25FL512::Increment_Page_Read_Request_Counter ( )
private

Increment page read request counter method.


Note
None
Returns
None
Override
Not allowed
Attention
None

References Increment_Saturated(), and u32_Page_Read_Request_Counter.

Referenced by Read_Page_From_Cells_To_Cache_By_Index().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Increment_Page_Write_Error_Counter()

VOID TS25FL512::Increment_Page_Write_Error_Counter ( )
private

Increment page write error counter method.


Note
None
Returns
None
Override
Not allowed
Attention
None

References Increment_Saturated(), and u32_Page_Write_Error_Counter.

Referenced by Write_Page_From_Cache_To_Cells(), and Write_Page_From_Cache_To_Cells_By_Page_Index().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Increment_Page_Write_Request_Counter()

VOID TS25FL512::Increment_Page_Write_Request_Counter ( )
private

Increment page write request counter method.


Note
None
Returns
None
Override
Not allowed
Attention
None

References Increment_Saturated(), and u32_Page_Write_Request_Counter.

Referenced by Write_Page_From_Cache_To_Cells(), and Write_Page_From_Cache_To_Cells_By_Page_Index().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Init()

VOID TS25FL512::Init ( )

Class constructor method.


Note
None
Override
Not allowed
Attention
Don't call this method directly.

Class destructor method.

Note
None
Override
Not allowed
Attention
Don't call this method directly.

Driver initialisation method.

Note
By calling this method driver make internal initialisation and prepering for operation.
Returns
None
Override
Not allowed
Attention
None

References TSPI_Memory_Base::Init().

Here is the call graph for this function:

◆ Is_Block_Empty()

BOOL TS25FL512::Is_Block_Empty ( U16  u16_Block_Index)

Test for specified block is empty and be utilised for write operation.


Note
None
Parameters
[in]u16_Block_Index- Block index to be test
Returns
BOOL - Operation status
Return values
false- Block is not empty
true- Block is empty
Override
Not requered
Attention
None

References TSPI_Memory_Base::Get_Page_Index(), TSPI_Memory_Base::Get_Pages_Per_Block_Count(), Is_Page_In_Cache_Empty(), and Read_Page_From_Cells_To_Cache_By_Index().

Referenced by TEvent_Manager::Execute(), QA_Erase_Block_Test(), and QA_Single_Block_Erase_Test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Is_Erase_Failure()

BOOL TS25FL512::Is_Erase_Failure ( )
private

Get erase operation status method.


Note
None
Returns
BOOL - Erase operation status
Return values
false- Erase operation successed without any errors
true- Erase oparation failed
Override
Not allowed
Attention
None

References TS25FL512::TStatus_Register::bit_Erase_Fail, Read_Status_Register(), and TS25FL512::TStatus_Register::u8_Raw_Data.

Referenced by Erase_Block_By_Index().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Is_Operation_In_Progress()

BOOL TS25FL512::Is_Operation_In_Progress ( )
private

Get operation status method.


Note
None
Returns
BOOL - Operation status
Return values
false- Operation completed
true- Operation in progress
Override
Not allowed
Attention
None

References TS25FL512::TStatus_Register::bit_Operation_In_Progress, Read_Status_Register(), and TS25FL512::TStatus_Register::u8_Raw_Data.

Here is the call graph for this function:

◆ Is_Page_In_Cache_Empty()

BOOL TS25FL512::Is_Page_In_Cache_Empty ( )

Test for specified page is empty and be utilised for write operation.


Note
None
Returns
BOOL - Operation status
Return values
false- Page is not empty
true- Page is empty
Override
Not requered
Attention
None

References commandRFC, TSPI_Master_Base::CS_Activate(), TSPI_Master_Base::CS_Deactivate(), false, TSPI_Memory_Base::Get_Page_Size(), TSPI_Memory_Base::object_SPI_Master, TSPI_Master_Base::Send_Byte(), and TSPI_Master_Base::Verify_Byte().

Referenced by Is_Block_Empty().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Is_Program_Failure()

BOOL TS25FL512::Is_Program_Failure ( )
private

Get program operation status method.


Note
None
Returns
BOOL - Program operation status
Return values
false- Program operation successed without any errors
true- Program oparation failed
Override
Not allowed
Attention
None

References TS25FL512::TStatus_Register::bit_Program_Fail, Read_Status_Register(), and TS25FL512::TStatus_Register::u8_Raw_Data.

Referenced by Write_Page_From_Cache_To_Cells(), and Write_Page_From_Cache_To_Cells_By_Page_Index().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Is_Read_Failure()

BOOL TS25FL512::Is_Read_Failure ( )
private

Get read operation status method.


Note
None
Returns
BOOL - Read operation status
Return values
false- Read operation successed without any errors
true- Read oparation failed
Override
Not allowed
Attention
None

References TS25FL512::TStatus_Register::bits_ECC_Status, Read_Status_Register(), and TS25FL512::TStatus_Register::u8_Raw_Data.

Referenced by Read_Page_From_Cells_To_Cache_By_Index().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ QA_Erase_Block_Test()

TReturn_Test_Code TS25FL512::QA_Erase_Block_Test ( )

Erase block test method.


Note
None
Returns
TReturn_Test_Code - Detail test status
Override
Not allowed
Attention
None

References enum_Block_Empty_Error, enum_Block_Erase_Error, enum_Block_Index_Out_Range, enum_Get_Block_Count_Error, enum_Get_Block_Status_Error, enum_Success_Test_Code, Erase_Block_By_Index(), Get_Bad_Block_Status(), TSPI_Memory_Base::Get_Block_Count(), Is_Block_Empty(), and TSPI_Memory_Base::Is_Block_Index_In_Range().

Referenced by QA_Flash_Driver_Main_Test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ QA_Flash_Driver_Main_Test()

TReturn_Test_Code TS25FL512::QA_Flash_Driver_Main_Test ( )

Method for starting the main test sequence.


Note
None
Returns
TReturn_Test_Code - Detail test status
Override
Not allowed
Attention
None

References enum_Erase_Test_Failed, enum_Read_Test_Failed, enum_Single_Block_Erase_Test_Failed, enum_Success_Test_Code, enum_Write_Test_Failed, QA_Erase_Block_Test(), QA_Read_Page_Test(), QA_Single_Block_Erase_Test(), and QA_Write_Page_Test().

Here is the call graph for this function:

◆ QA_Read_Page_Test()

TReturn_Test_Code TS25FL512::QA_Read_Page_Test ( )

◆ QA_Single_Block_Erase_Test()

TReturn_Test_Code TS25FL512::QA_Single_Block_Erase_Test ( )

Single block erase test method.


Note
None
Returns
TReturn_Test_Code - Detail test status
Override
Not allowed
Attention
None

References enum_Block_Empty_Error, enum_Block_Erase_Error, enum_Block_Index_Out_Range, enum_Get_Block_Count_Error, enum_Get_Block_Status_Error, enum_Success_Test_Code, Erase_Block_By_Index(), Get_Bad_Block_Status(), TSPI_Memory_Base::Get_Block_Count(), Is_Block_Empty(), and TSPI_Memory_Base::Is_Block_Index_In_Range().

Referenced by QA_Flash_Driver_Main_Test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ QA_Write_Page_Test()

TReturn_Test_Code TS25FL512::QA_Write_Page_Test ( )

◆ Read_Buffer()

BOOL TS25FL512::Read_Buffer ( U32  u32_Linear_Address,
U32  u32_Size,
U8 u8_Data_Buffer 
)
virtual

Read data from memory into buffer.


Note
None
Parameters
[in]u32_Linear_Address- Linear address of the data in memory
[in]u32_Size- Size of the data to read
[out]*u8_Data_Buffer- Pointer to the data buffer
Returns
BOOL - Data read operation status
Return values
false- Read operation failed
true- Read operation successed
Override
Not requered
Attention
None

Implements TSPI_Memory_Base.

References NULL, TSPI_Memory_Base::object_SPI_Master, Read_Page_From_Cache(), and Read_Page_From_Cells_To_Cache().

Here is the call graph for this function:

◆ Read_Buffer_By_Page_Index()

BOOL TS25FL512::Read_Buffer_By_Page_Index ( U32  u32_Page_Index,
U16  u16_Offset,
U32  u32_Size,
U8 u8_Data_Buffer 
)

Read data from memory into buffer.


Note
None
Parameters
[in]u32_Page_Index- Page index
[in]u16_Offset- Offset inside page
[in]u32_Size- Size of the data to read
[out]*u8_Data_Buffer- Pointer to the data buffer
Returns
BOOL - Data read operation status
Return values
false- Read operation failed
true- Read operation successed
Override
Not requered
Attention
None

References NULL, TSPI_Memory_Base::object_SPI_Master, Read_Page_From_Cache(), and Read_Page_From_Cells_To_Cache_By_Index().

Referenced by TEvent_Manager::Get_Min_Max_Flash_Index(), TEvent_Manager::Half_Devision_Method_Searching(), and QA_Read_Page_Test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Read_Extended_Buffer()

BOOL TS25FL512::Read_Extended_Buffer ( U32  u32_Linear_Address,
U32  u32_Size,
U8 u8_Data_Buffer 
)

Read data from memory into buffer.


Note
None
Parameters
[in]u32_Linear_Address- Linear address of the data in memory
[in]u32_Size- Size of the data to read
[out]*u8_Data_Buffer- Pointer to the data buffer
Returns
BOOL - Data read operation status
Return values
false- Read operation failed
true- Read operation successed
Override
Not requered
Attention
None

References TSPI_Memory_Base::Extract_Page_Relative_Address(), NULL, TSPI_Memory_Base::object_SPI_Master, Read_Page_From_Cache(), and Read_Page_From_Cells_To_Cache().

Referenced by Get_Bad_Block_Status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Read_Identification()

BOOL TS25FL512::Read_Identification ( )
privatevirtual

◆ Read_Page_From_Cache()

BOOL TS25FL512::Read_Page_From_Cache ( U16  u16_Offset,
U32  u32_Length,
U8 u8_Data_Buffer 
)
private

Read multiple byte from chip cache method.


Note
None
Parameters
[in]u16_Offset- Address offset in cache
[in]u32_Length- Amount of the byte to read
[in]u8_Data_Buffer- Pointer to the data buffer
Returns
BOOL - Read operation status
Return values
false- Read operation successed
true- Read operation failed
Override
Not allowed
Attention
None

References commandRFC, TSPI_Master_Base::CS_Activate(), TSPI_Master_Base::CS_Deactivate(), Extract_U8_From_U16(), TSPI_Memory_Base::object_SPI_Master, TSPI_Master_Base::Receive_Byte(), and TSPI_Master_Base::Send_Byte().

Referenced by Read_Buffer(), Read_Buffer_By_Page_Index(), and Read_Extended_Buffer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Read_Page_From_Cache_By_Leniar_Address()

BOOL TS25FL512::Read_Page_From_Cache_By_Leniar_Address ( U32  u32_Address,
U32  u32_Length,
U8 u8_Data_Buffer 
)
private

Read multiple byte from chip cache method.


Note
None
Parameters
[in]u32_Address- Start address in cache
[in]u32_Length- Amount of the byte to read
[in]u8_Data_Buffer- Pointer to the data buffer
Returns
BOOL - Read operation status
Return values
false- Read operation successed
true- Read operation failed
Override
Not allowed
Attention
None

References commandRFC, TSPI_Master_Base::CS_Activate(), TSPI_Master_Base::CS_Deactivate(), TSPI_Memory_Base::Extract_Page_Relative_Address(), Extract_U8_From_U16(), TSPI_Memory_Base::object_SPI_Master, TSPI_Master_Base::Receive_Byte(), and TSPI_Master_Base::Send_Byte().

Here is the call graph for this function:

◆ Read_Page_From_Cells_To_Cache()

BOOL TS25FL512::Read_Page_From_Cells_To_Cache ( U32  u32_Linear_Address)
private

Read page from chip cells into the cache method.


Note
None
Parameters
[in]u32_Linear_Address- Linear address of the page to read
Returns
BOOL - Read operation status
Return values
false- Read operation successed
true- Read operation failed
Override
Not allowed
Attention
None

References Read_Page_From_Cells_To_Cache_By_Index().

Referenced by Read_Buffer(), and Read_Extended_Buffer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Read_Page_From_Cells_To_Cache_By_Index()

BOOL TS25FL512::Read_Page_From_Cells_To_Cache_By_Index ( U32  u32_Page_Index)
private

Read page from chip cells into the cache method. Page referenced by absolute page index within memory chip.


Note
None
Parameters
[in]u32_Page_Index- Absolute index of the page to read
Returns
BOOL - Read operation status
Return values
false- Read operation successed
true- Read operation failed
Override
Not allowed
Attention
None

References commandREAD, TSPI_Master_Base::CS_Activate(), TSPI_Master_Base::CS_Deactivate(), Extract_U8_From_U32(), Increment_Page_Read_Error_Counter(), Increment_Page_Read_Request_Counter(), Is_Read_Failure(), TSPI_Memory_Base::object_SPI_Master, TSPI_Master_Base::Send_Byte(), and Wait_For_Operation_Done().

Referenced by Is_Block_Empty(), Read_Buffer_By_Page_Index(), Read_Page_From_Cells_To_Cache(), and Write_Buffer_By_Page_Index().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Read_Status_Register()

BOOL TS25FL512::Read_Status_Register ( U8 u8_Status_Register)
privatevirtual

Read memory device status register method.


Note
None
Parameters
[out]*u8_Status_Register- Pointer to status register value
Returns
BOOL - Read operation status
Return values
false- Read operation failed
true- Read operation successed
Override
Requered
Attention
None

Reimplemented from TSPI_Memory_Base.

References address_SR, commandGF, TSPI_Master_Base::CS_Activate(), TSPI_Master_Base::CS_Deactivate(), TSPI_Memory_Base::object_SPI_Master, TSPI_Master_Base::Receive_Byte(), and TSPI_Master_Base::Send_Byte().

Referenced by Get_Bad_Block_Status(), Is_Erase_Failure(), Is_Operation_In_Progress(), Is_Program_Failure(), Is_Read_Failure(), Write_Page_To_Cache(), and Write_Page_To_Cache_By_Leniar_Address().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Reset()

VOID TS25FL512::Reset ( )
private

Software reset memory chip method.


Note
None
Returns
None
Override
Requered
Attention
None

References commandRES, TSPI_Master_Base::CS_Activate(), TSPI_Master_Base::CS_Deactivate(), THigh_Precision_Timer_Base::Delay(), object_Delay_Timer, TSPI_Memory_Base::object_SPI_Master, and TSPI_Master_Base::Send_Byte().

Referenced by Start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Send_Information()

VOID TS25FL512::Send_Information ( TProtocol_Base object_Protocol)
virtual

◆ Set_Feature()

BOOL TS25FL512::Set_Feature ( TS25FL512SAdress  enum_Feature_Adress,
U8  u8_Data 
)
private

Set flash memory feature method.


Note
None
Parameters
[in]enum_Feature_Adress- Chip feature address
[in]u8_Data- Chip feature value
Returns
BOOL - Set operation status
Return values
false- Set operation successed
true- Set operation failed
Override
Not allowed
Attention
None

References commandSF, TSPI_Master_Base::CS_Activate(), TSPI_Master_Base::CS_Deactivate(), TSPI_Memory_Base::object_SPI_Master, and TSPI_Master_Base::Send_Byte().

Referenced by Start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Start()

VOID TS25FL512::Start ( )
virtual

Driver start operation method.


Note
By calling this method driver starts opration.
Returns
None
Override
Not allowed
Attention
None

Reimplemented from TSPI_Memory_Base.

References address_BL, Get_Write_Protection_Bits(), Read_Identification(), Reset(), Set_Feature(), and TSPI_Memory_Base::Start().

Here is the call graph for this function:

◆ Wait_For_Operation_Done()

BOOL TS25FL512::Wait_For_Operation_Done ( F32  f32_Timeout)
private

Wait specified time for hardware controller operation done method.


Note
None
Parameters
[in]f32_Timeout- Timeout in seconds
Returns
BOOL - Operation status
Return values
false- Hardware controller perform operation in specified time
true- Hardware controller not perform operation in specified time
Override
Not allowed
Attention
None

References address_SR, TS25FL512::TStatus_Register::bit_Operation_In_Progress, commandGF, TSPI_Master_Base::CS_Activate(), TSPI_Master_Base::CS_Deactivate(), TTIMER2_STM32F429::Get_Actual_Time_U64(), THigh_Precision_Timer_Base::Is_Timeout(), object_Delay_Timer, TSPI_Memory_Base::object_SPI_Master, TSPI_Master_Base::Receive_Byte(), TSPI_Master_Base::Send_Byte(), and TS25FL512::TStatus_Register::u8_Raw_Data.

Referenced by Erase_Block_By_Index(), Read_Page_From_Cells_To_Cache_By_Index(), Write_Page_From_Cache_To_Cells(), and Write_Page_From_Cache_To_Cells_By_Page_Index().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Write_Buffer()

BOOL TS25FL512::Write_Buffer ( U32  u32_Linear_Address,
U32  u32_Size,
U8 u8_Data_Buffer 
)
virtual

Write data from buffer into memory.


Note
None
Parameters
[in]u32_Linear_Address- Linear address of the data in memory
[in]u32_Size- Size of the data to write
[out]*u8_Data_Buffer- Pointer to the data buffer
Returns
BOOL - Data write operation status
Return values
false- Write operation failed
true- Write operation successed
Override
Not requered
Attention
None

Implements TSPI_Memory_Base.

References TSPI_Memory_Base::Get_Chip_Size(), NULL, TSPI_Memory_Base::object_SPI_Master, Write_Page_From_Cache_To_Cells(), and Write_Page_To_Cache().

Here is the call graph for this function:

◆ Write_Buffer_By_Page_Index()

BOOL TS25FL512::Write_Buffer_By_Page_Index ( U32  u32_Page_Index,
U16  u16_Offset,
U32  u32_Size,
U8 u8_Data_Buffer 
)

Write data from buffer into memory.


Note
None
Parameters
[in]u32_Page_Index- Page index
[in]u16_Offset- Offset into page
[in]u32_Size- Size of the data to write
[out]*u8_Data_Buffer- Pointer to the data buffer
Returns
BOOL - Data write operation status
Return values
false- Write operation failed
true- Write operation successed
Override
Not requered
Attention
None

References TSPI_Memory_Base::Get_Page_Size(), TSPI_Memory_Base::Get_Pages_Per_Chip_Count(), NULL, TSPI_Memory_Base::object_SPI_Master, Read_Page_From_Cells_To_Cache_By_Index(), true, Write_Page_From_Cache_To_Cells_By_Page_Index(), and Write_Page_To_Cache().

Referenced by TEvent_Manager::Execute(), and QA_Write_Page_Test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Write_Disable()

BOOL TS25FL512::Write_Disable ( )
privatevirtual

Disable write operation into memory.


Note
None
Returns
BOOL - Operation status
Return values
false- Operation successed
true- Operation failed
Override
Not allowed
Attention
None

Reimplemented from TSPI_Memory_Base.

References commandWRDI, TSPI_Master_Base::CS_Activate(), TSPI_Master_Base::CS_Deactivate(), TSPI_Memory_Base::object_SPI_Master, and TSPI_Master_Base::Send_Byte().

Here is the call graph for this function:

◆ Write_Enable()

BOOL TS25FL512::Write_Enable ( )
privatevirtual

Enable write operation into memory.


Note
None
Returns
BOOL - Operation status
Return values
false- Operation successed
true- Operation failed
Override
Not allowed
Attention
None

Reimplemented from TSPI_Memory_Base.

References commandWREN, TSPI_Master_Base::CS_Activate(), TSPI_Master_Base::CS_Deactivate(), TSPI_Memory_Base::object_SPI_Master, and TSPI_Master_Base::Send_Byte().

Referenced by Erase_Block_By_Index(), Write_Page_To_Cache(), and Write_Page_To_Cache_By_Leniar_Address().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Write_Page_From_Cache_To_Cells()

BOOL TS25FL512::Write_Page_From_Cache_To_Cells ( U32  u32_Linear_Address)
private

Write page from cache into chip cells method.


Note
None
Parameters
[in]u32_Linear_Address- Linear address of the page to write
Returns
BOOL - Write operation status
Return values
false- Write operation successed
true- Write operation failed
Override
Not allowed
Attention
None

References commandPE, TSPI_Master_Base::CS_Activate(), TSPI_Master_Base::CS_Deactivate(), Extract_U8_From_U32(), Increment_Page_Write_Error_Counter(), Increment_Page_Write_Request_Counter(), Is_Program_Failure(), TSPI_Memory_Base::object_SPI_Master, TSPI_Master_Base::Send_Byte(), and Wait_For_Operation_Done().

Referenced by Write_Buffer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Write_Page_From_Cache_To_Cells_By_Page_Index()

BOOL TS25FL512::Write_Page_From_Cache_To_Cells_By_Page_Index ( U32  u32_Page_Index)
private

Write page from cache into chip cells method.


Note
None
Parameters
[in]u32_Page_Index- Absolute indes og the page to write
Returns
BOOL - Write operation status
Return values
false- Write operation successed
true- Write operation failed
Override
Not allowed
Attention
None

References commandPE, TSPI_Master_Base::CS_Activate(), TSPI_Master_Base::CS_Deactivate(), Extract_U8_From_U32(), Increment_Page_Write_Error_Counter(), Increment_Page_Write_Request_Counter(), Is_Program_Failure(), TSPI_Memory_Base::object_SPI_Master, TSPI_Master_Base::Send_Byte(), and Wait_For_Operation_Done().

Referenced by Write_Buffer_By_Page_Index().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Write_Page_To_Cache()

BOOL TS25FL512::Write_Page_To_Cache ( U16  u16_Offset,
U32  u32_Length,
U8 u8_Data_Buffer 
)
private

Write multiple byte into chip cache method.


Note
None
Parameters
[in]u16_Offset- Address offset in cache
[in]u32_Length- Amount of the byte to write
[in]u8_Data_Buffer- Pointer to the data buffer
Returns
BOOL - Write operation status
Return values
false- Write operation successed
true- Write operation failed
Override
Not allowed
Attention
None

References commandPP, TSPI_Master_Base::CS_Activate(), TSPI_Master_Base::CS_Deactivate(), Extract_U8_From_U16(), TSPI_Memory_Base::object_SPI_Master, Read_Status_Register(), TSPI_Master_Base::Send_Byte(), and Write_Enable().

Referenced by Write_Buffer(), and Write_Buffer_By_Page_Index().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Write_Page_To_Cache_By_Leniar_Address()

BOOL TS25FL512::Write_Page_To_Cache_By_Leniar_Address ( U32  u32_Address,
U32  u32_Length,
U8 u8_Data_Buffer 
)
private

Write multiple byte into chip cache method.


Note
None
Parameters
[in]u32_Address- Start address in cache
[in]u32_Length- Amount of the byte to write
[in]u8_Data_Buffer- Pointer to the data buffer
Returns
BOOL - Write operation status
Return values
false- Write operation successed
true- Write operation failed
Override
Not allowed
Attention
None

References commandPP, TSPI_Master_Base::CS_Activate(), TSPI_Master_Base::CS_Deactivate(), TSPI_Memory_Base::Extract_Page_Relative_Address(), Extract_U8_From_U16(), TSPI_Memory_Base::object_SPI_Master, Read_Status_Register(), TSPI_Master_Base::Send_Byte(), and Write_Enable().

Here is the call graph for this function:

Member Data Documentation

◆ enum_Flash_Chip_Type

TChip_Type TS25FL512::enum_Flash_Chip_Type = chip_type_None

Flash chip type storage.

Referenced by Read_Identification(), and Send_Information().

◆ u16_Bad_Block_Count

U16 TS25FL512::u16_Bad_Block_Count = (U16)0

Bad block count.

Referenced by Execute(), and Send_Information().

◆ u16_Bad_Block_Counter

U16 TS25FL512::u16_Bad_Block_Counter = (U16)0

Bad block search counter.

Referenced by Execute(), and Send_Information().

◆ u16_Execute_Bad_Block_Count_Index

U16 TS25FL512::u16_Execute_Bad_Block_Count_Index = (U16)0

Actual block index of the search bad block count process.

Referenced by Execute(), and Send_Information().

◆ u32_Block_Erase_Error_Counter

U32 TS25FL512::u32_Block_Erase_Error_Counter = (U32)0

Block read error counter.

Referenced by Increment_Block_Erase_Error_Counter(), and Send_Information().

◆ u32_Block_Erase_Request_Counter

U32 TS25FL512::u32_Block_Erase_Request_Counter = (U32)0

Block erase request counter.

Referenced by Increment_Block_Erase_Request_Counter(), and Send_Information().

◆ u32_Identifier_Dummy_Byte_Counter

U32 TS25FL512::u32_Identifier_Dummy_Byte_Counter = (U32)0

Read identifier dummy byte counter.

Note
ANVILEX KM: u32_Identifier_Dummy_Byte_Counter is used only for debug purpouse, and can optimised.

Referenced by Read_Identification(), and Send_Information().

◆ u32_Page_Read_Error_Counter

U32 TS25FL512::u32_Page_Read_Error_Counter = (U32)0

Page read error counter.

Referenced by Increment_Page_Read_Error_Counter(), and Send_Information().

◆ u32_Page_Read_Request_Counter

U32 TS25FL512::u32_Page_Read_Request_Counter = (U32)0

Page read request counter.

Referenced by Increment_Page_Read_Request_Counter(), and Send_Information().

◆ u32_Page_Write_Error_Counter

U32 TS25FL512::u32_Page_Write_Error_Counter = (U32)0

Page write error counter.

Referenced by Increment_Page_Write_Error_Counter(), and Send_Information().

◆ u32_Page_Write_Request_Counter

U32 TS25FL512::u32_Page_Write_Request_Counter = (U32)0

Page write request counter.

Referenced by Increment_Page_Write_Request_Counter(), and Send_Information().

◆ u8_BP1

U8 TS25FL512::u8_BP1 = (U8)0x00

BP1 bit in BL register.

Referenced by Get_Write_Protection_Bits(), and Send_Information().

◆ u8_BP2

U8 TS25FL512::u8_BP2 = (U8)0x00

BP2 bit in BL register.

Referenced by Get_Write_Protection_Bits(), and Send_Information().

◆ u8_BRWD

U8 TS25FL512::u8_BRWD = (U8)0x00

BRWD bit in BL register.

Referenced by Get_Write_Protection_Bits(), and Send_Information().

◆ u8_Device_ID

U8 TS25FL512::u8_Device_ID = (U8)0xFF

Serial number storage.

Referenced by Read_Identification(), and Send_Information().

◆ u8_JEDEC_ID

volatile U8 TS25FL512::u8_JEDEC_ID[3] = { (U8)0xFF, (U8)0xFF, (U8)0xFF }

JEDEC code storage.

Referenced by Read_Identification(), and Send_Information().

◆ u8_Manufacturer_ID

U8 TS25FL512::u8_Manufacturer_ID = (U8)0xFF

Manufacturer number storage.

Referenced by Read_Identification(), and Send_Information().

◆ u8_Test_Buffer

U8 TS25FL512::u8_Test_Buffer[2048]

Actual block index of the search bad block count process.

Todo:
ANVILEX KM: Investigate of this buffer purpoise

Referenced by QA_Read_Page_Test(), and QA_Write_Page_Test().


The documentation for this class was generated from the following files: