ConOpSys V2970
P004.07
ANVILEX control operating system
|
SPI memory base class. More...
#include <SPI_Memory_Base.h>
Classes | |
struct | TMemory_Chip_Descriptor |
Chip descriptior structure. More... | |
Public Member Functions | |
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 | Start () |
Start operation of SPI memory base driver. 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 | Read_Buffer (U32 u32_Linear_Address, U32 u32_Size, U8 *u8_Data_Buffer)=0 |
Read data from memory into the buffer method. More... | |
virtual BOOL | Write_Buffer (U32 u32_Linear_Address, U32 u32_Size, U8 *u8_Data_Buffer)=0 |
Write data from buffer into memory method. More... | |
virtual BOOL | Verify_Buffer (U32 u32_Linear_Address, U32 u32_Size, U8 *u8_Data_Buffer) |
Verify data in memory and memory method. More... | |
virtual BOOL | Erase_Chip (BOOL bool_Force_Bad_Block_Erase) |
Erase chip 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... | |
virtual VOID | Send_Information (TProtocol_Base *object_Protocol) |
Method sends default driver information over specified communication channel. 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... | |
Protected Member Functions | |
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 | |
TSPI_Master_Base * | object_SPI_Master = (TSPI_Master_Base*)NULL |
Pointer to the SPI master object. More... | |
TMemory_Chip_Descriptor * | struct_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... | |
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_StatusRegister) |
Read memory device status register method. More... | |
virtual BOOL | Write_Status_Register (U8 u8_StatusRegister) |
Write memory device status register method. More... | |
virtual BOOL | Read_Memory (U32 u32_Address, U8 *u8_Data) |
Read byte from memory. More... | |
virtual BOOL | Write_Memory (U32 u32_Address, U8 u8_Data) |
Write byte into memory. More... | |
virtual BOOL | Read_Identification ()=0 |
Read memory device identification information pure virtual method. More... | |
BOOL | Is_Page_Relative_Index_In_Range (U16 u16_Page_Relative_Index) |
This method check that relative index is valid. More... | |
SPI memory base class.
TSPI_Memory_Base::TSPI_Memory_Base | ( | ) |
Base class constructor method.
|
virtual |
Base class constructor method.
VOID TSPI_Memory_Base::Assign_SPI_Master | ( | TSPI_Master_Base * | object_New_SPI_Master | ) |
Assign SPI master hardware driver.
[in] | *object_New_SPI_Master | - Pointer to the SPI master hardware driver |
References object_SPI_Master.
Referenced by TApplication_Base::Init(), and TBootloader_Base::Init().
VOID TSPI_Memory_Base::Done | ( | ) |
SPI memory base object finalisation method.
Erase chip method.
[in] | bool_Force_Bad_Block_Erase | - Option to select an erase type |
false | - Erase falled |
true | - Erase successfully done |
Reimplemented in TS25FL512.
|
protected |
Extract page relative address from lenear address.
[in] | u32_Linear_Address | - Linear address |
[out] | *u16_Relative_Address | - Relative address from beggining of the page |
false | - Operation failed |
true | - Operation succeeded |
References Get_Page_Size(), and Get_Pages_Per_Block_Count().
Referenced by TS25FL512::Read_Extended_Buffer(), TS25FL512::Read_Page_From_Cache_By_Leniar_Address(), and TS25FL512::Write_Page_To_Cache_By_Leniar_Address().
Get linear address of the block by specified block index.
[in] | u16_Block_Index | - Block index |
[out] | *u32_Linear_Address | - Linear address of the block |
false | - Operation failed |
true | - Operation succeeded |
References Get_Block_Count(), and Get_Block_Size().
Return total amount of the blocks.
[out] | *u16_Block_Count | - Total block count |
false | - Operation failed, total block count can not be retrieved |
true | - Operation succeeded |
References NULL, struct_Memory_Chip_Descriptor, and TSPI_Memory_Base::TMemory_Chip_Descriptor::u16_Blocks_Per_Chip_Count.
Referenced by TS25FL512::Erase_Chip(), TEvent_Manager::Execute(), Get_Block_Address(), TEvent_Manager::Get_Min_Max_Flash_Index(), Get_Page_Index(), Is_Block_Index_In_Range(), TS25FL512::QA_Erase_Block_Test(), and TS25FL512::QA_Single_Block_Erase_Test().
Get block index by page index.
[in] | u32_Page_Index | - Page number of the chip |
[out] | *u16_Block_Index | - Block index |
false | - Operation failed |
true | - Operation succeeded |
References Get_Pages_Per_Block_Count(), and Get_Pages_Per_Chip_Count().
Referenced by TEvent_Manager::Half_Devision_Method_Searching(), TS25FL512::QA_Read_Page_Test(), and TS25FL512::QA_Write_Page_Test().
Return block size in bytes.
[out] | *u32_Block_Size | - Block size in bytes |
false | - Operation failed, block size can not be retrieved |
true | - Operation succeeded |
References NULL, struct_Memory_Chip_Descriptor, and TSPI_Memory_Base::TMemory_Chip_Descriptor::u32_Block_Size.
Referenced by Get_Block_Address(), and Get_Page_Address().
U32 TSPI_Memory_Base::Get_Capacity | ( | ) |
Get capacity of attached SPI memory.
References u32_Capacity.
Referenced by TParameter_Manager::Assign_Media(), and TParameter_Manager::Show_Boot_Information().
Return total chip capacity in bytes.
[out] | *u32_Chip_Size | - Total chip size in bytes |
false | - Operation failed, total chip size can not be retrieved |
true | - Operation succeeded |
References NULL, struct_Memory_Chip_Descriptor, and TSPI_Memory_Base::TMemory_Chip_Descriptor::u32_Chip_Size.
Referenced by TS25FL512::Write_Buffer().
BOOL TSPI_Memory_Base::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.
[in] | u16_Block_Index | - Block index |
[in] | u16_Relative_Page_Index | - Page relative index within block |
[out] | *u32_Linear_Address | - Linear address of the block |
false | - Operation failed |
true | - Operation succeeded |
References Get_Block_Size(), and Get_Page_Size().
Referenced by TEvent_Manager::Execute(), and TS25FL512::Get_Bad_Block_Status().
BOOL TSPI_Memory_Base::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.
[in] | u16_Block_Index | - Block index |
[in] | u16_Page_Relative_Index | - Page relative index |
[out] | *u32_Page_Index | - Page index |
false | - Operation failed |
true | - Operation succeeded |
Get page index of the block.
[in] | u16_Block_Index | - Block index |
[out] | *u32_Page_Index | - Page number of the chip |
false | - Operation failed |
true | - Operation succeeded |
References Get_Block_Count(), and Get_Pages_Per_Block_Count().
Get page index from lenear address.
[in] | u32_Linear_Address | - Linear address |
[out] | *u32_Page_Index | - Page index |
false | - Operation failed |
true | - Operation succeeded |
References Get_Page_Size().
Referenced by TEvent_Manager::Get_Min_Max_Flash_Index(), and TS25FL512::Is_Block_Empty().
Return page size in bytes.
[out] | *u16_Page_Size | - Page size in bytes |
false | - Operation failed, page size can not be retrieved |
true | - Operation succeeded |
References NULL, struct_Memory_Chip_Descriptor, and TSPI_Memory_Base::TMemory_Chip_Descriptor::u16_Page_Size.
Referenced by TEvent_Manager::Execute(), Extract_Page_Relative_Address(), TEvent_Manager::Get_Min_Max_Flash_Index(), Get_Page_Address(), Get_Page_Index(), TS25FL512::Is_Page_In_Cache_Empty(), TS25FL512::QA_Read_Page_Test(), TS25FL512::QA_Write_Page_Test(), and TS25FL512::Write_Buffer_By_Page_Index().
Return pages number into block.
[out] | *u16_Pages_Per_Block | - Page into block |
false | - Operation failed, block size can not be retrieved |
true | - Operation succeeded |
References NULL, struct_Memory_Chip_Descriptor, and TSPI_Memory_Base::TMemory_Chip_Descriptor::u16_Pages_Per_Block_Count.
Referenced by TS25FL512::Erase_Block_By_Index(), TEvent_Manager::Execute(), Extract_Page_Relative_Address(), Get_Block_Index_By_Page(), TEvent_Manager::Get_Min_Max_Flash_Index(), Get_Page_Index(), TS25FL512::Is_Block_Empty(), Is_Page_Relative_Index_In_Range(), TS25FL512::QA_Read_Page_Test(), and TS25FL512::QA_Write_Page_Test().
Return total amount of the pages.
[out] | *u32_Pages_Per_Chip | - Total pages count |
false | - Operation failed, total block count can not be retrieved |
true | - Operation succeeded |
References NULL, struct_Memory_Chip_Descriptor, and TSPI_Memory_Base::TMemory_Chip_Descriptor::u32_Pages_Per_Chip_Count.
Referenced by TEvent_Manager::Execute(), Get_Block_Index_By_Page(), Is_Page_Index_In_Range(), TS25FL512::QA_Read_Page_Test(), TS25FL512::QA_Write_Page_Test(), and TS25FL512::Write_Buffer_By_Page_Index().
VOID TSPI_Memory_Base::Init | ( | ) |
SPI memory base object initialisation method.
References bool_Serial_Number_Available, NULL, object_SPI_Master, tril_Available, u32_Capacity, and unset.
Referenced by TFM25V02::Init(), and TS25FL512::Init().
TRIL TSPI_Memory_Base::Is_Available | ( | ) |
Return SPI avaliability.
References tril_Available.
Referenced by TParameter_Manager::Assign_Media(), TCommand_INFO::Execute(), TCommand_NVRAM_STATUS::Execute(), and TParameter_Manager::Is_Media_Database_Available().
This method check that block index is valid.
[in] | u16_Block_Index | - Block index |
false | - Verification succeeded |
true | - Operation failed, verification failed |
References Get_Block_Count().
Referenced by TS25FL512::QA_Erase_Block_Test(), and TS25FL512::QA_Single_Block_Erase_Test().
This method check that page index is valid.
[in] | u32_Page_Index | - Page index |
false | - Verification succeeded |
true | - Operation failed, verification failed |
References Get_Pages_Per_Chip_Count().
Referenced by TS25FL512::QA_Read_Page_Test(), and TS25FL512::QA_Write_Page_Test().
This method check that relative index is valid.
[in] | u16_Page_Relative_Index | - Relative index |
false | - Verification succeeded |
true | - Operation failed, verification failed |
References Get_Pages_Per_Block_Count().
|
pure virtual |
Read data from memory into the buffer method.
[in] | u32_Linear_Address | - Linear address in memory |
[in] | u32_Size | - Amount byte to read |
[out] | *u8_Data_Buffer | - Pointer to the data buffer |
false | - Read operation failed |
true | - Read operation succeeded |
Implemented in TS25FL512, and TFM25V02.
Referenced by TParameter_Manager::Allocate_Parameter_Media_Storege_Index(), TParameter_Manager::Media_Database_Read_Record(), and TParameter_Manager::Update_Empty_Block_Address().
|
privatepure virtual |
Read byte from memory.
[in] | u32_Address | - Linear address |
[out] | *u8_Data | - Pointer to byte value |
false | - Read operation succeeded |
true | - Read operation failed |
Reimplemented in TFM25V02.
Read memory device status register method.
[out] | *u8_StatusRegister | - Pointer to status register value |
false | - Read operation succeeded |
true | - Read operation failed |
|
virtual |
Method sends default driver information over specified communication channel.
[in] | *object_Protocol | - Pointer to the connunication channel |
Reimplemented in TS25FL512.
|
virtual |
Start operation of SPI memory base driver.
Reimplemented in TS25FL512, and TFM25V02.
References NULL, object_SPI_Master, and TSPI_Master_Base::Start().
Referenced by TS25FL512::Start().
|
virtual |
Stop operation of SPI memory base driver.
References NULL, object_SPI_Master, and TSPI_Master_Base::Stop().
VOID TSPI_Memory_Base::Unassign_SPI_Master | ( | ) |
Unassign SPI master hardware driver.
References NULL, and object_SPI_Master.
|
virtual |
Verify data in memory and memory method.
[in] | u32_Linear_Address | - Linear address in memory |
[in] | u32_Size | - Amount byte to verify |
[in] | *u8_Data_Buffer | - Pointer to the data buffer |
false | - Verification operation failed, data in buffer and memory not equal |
true | - Verification operation succeeded, data in buffer and memory equal |
Reimplemented in TFM25V02.
|
pure virtual |
Write data from buffer into memory method.
[in] | u32_Linear_Address | - Linear address in memory |
[in] | u32_Size | - Amount byte to write |
[in] | *u8_Data_Buffer | - Pointer to the data buffer |
false | - Write operation failed |
true | - Write operation succeeded |
Implemented in TS25FL512, and TFM25V02.
Referenced by TParameter_Manager::Media_Database_Invalidate_Record(), and TParameter_Manager::Media_Database_Write_Record().
|
privatevirtual |
Disable write operation into memory.
false | - Operation succeeded |
true | - Operation failed |
Reimplemented in TS25FL512.
|
privatevirtual |
Enable write operation into memory.
false | - Operation succeeded |
true | - Operation failed |
Reimplemented in TS25FL512.
Write byte into memory.
[in] | u32_Address | - Linear address |
[in] | u8_Data | - Data byte value to write |
false | - Write operation succeeded |
true | - Write operation failed |
Reimplemented in TFM25V02.
Write memory device status register method.
[in] | u8_StatusRegister | - Status register value to write |
false | - Write operation succeeded |
true | - Write operation failed |
Reimplemented in TFM25V02.
Device ID availablility status.
Referenced by TFM25V02::Read_Device_ID(), and TS25FL512::Read_Identification().
Manufacturer ID availablility status.
Referenced by TS25FL512::Read_Identification().
Serial number availablility status.
Referenced by Init(), and TFM25V02::Read_Serial_Number().
|
protected |
Pointer to the SPI master object.
Referenced by Assign_SPI_Master(), TS25FL512::Erase_Block_By_Index(), TS25FL512::Erase_Chip(), TS25FL512::Execute(), TFM25V02::Exit_Sleep_Mode(), TS25FL512::Get_Feature(), Init(), TS25FL512::Is_Page_In_Cache_Empty(), TFM25V02::Read_Buffer(), TS25FL512::Read_Buffer(), TS25FL512::Read_Buffer_By_Page_Index(), TFM25V02::Read_Device_ID(), TS25FL512::Read_Extended_Buffer(), TS25FL512::Read_Identification(), TFM25V02::Read_Memory(), TS25FL512::Read_Page_From_Cache(), TS25FL512::Read_Page_From_Cache_By_Leniar_Address(), TS25FL512::Read_Page_From_Cells_To_Cache_By_Index(), TFM25V02::Read_Serial_Number(), TFM25V02::Read_Status_Register(), TS25FL512::Read_Status_Register(), TS25FL512::Reset(), TS25FL512::Set_Feature(), Start(), TFM25V02::Start(), Stop(), Unassign_SPI_Master(), TFM25V02::Verify_Buffer(), TS25FL512::Wait_For_Operation_Done(), TFM25V02::Write_Buffer(), TS25FL512::Write_Buffer(), TS25FL512::Write_Buffer_By_Page_Index(), TS25FL512::Write_Disable(), TS25FL512::Write_Enable(), TFM25V02::Write_Memory(), TS25FL512::Write_Page_From_Cache_To_Cells(), TS25FL512::Write_Page_From_Cache_To_Cells_By_Page_Index(), TS25FL512::Write_Page_To_Cache(), TS25FL512::Write_Page_To_Cache_By_Leniar_Address(), and TFM25V02::Write_Status_Register().
|
protected |
Pointer to the chip descriptor structure.
Referenced by Get_Block_Count(), Get_Block_Size(), Get_Chip_Size(), Get_Page_Size(), Get_Pages_Per_Block_Count(), Get_Pages_Per_Chip_Count(), and TS25FL512::Read_Identification().
Memory chip availablility status.
Referenced by Init(), Is_Available(), TS25FL512::Read_Identification(), and TFM25V02::Start().
Depricated: Capacity of SPI memory in bytes.
Referenced by Get_Capacity(), Init(), and TFM25V02::Start().