ConOpSys V2970  P004.07
ANVILEX control operating system
SPI_Memory_Base.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file SPI_Memory_Base.h
3 //! @brief SPI connected memory base class header file.
4 //! @attention No special attention requered.
5 //! @copyright (C) 2015-2020 ANVILEX LLC
6 //! $HeadURL: https://192.168.3.4:8443/svn/P004_07/ConOpSys/Engine/SPI_Memory_Base.h $
7 //! $Revision: 2339 $
8 //! $Date: 2021-01-08 14:06:54 +0500 (Fr, 08 Jan 2021) $
9 //! $Author: minch $
10 //------------------------------------------------------------------------------
11 //
12 // Redistribution and use in source and binary forms, with or without
13 // modification, are permitted provided that the following conditions are met:
14 //
15 // 1. Redistributions of source code must retain the above copyright notice,
16 // this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright notice,
19 // this list of conditions and the following disclaimer in the documentation
20 // and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of ANVILEX nor the names of its contributors may be
23 // used to endorse or promote products derived from this software without
24 // specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
30 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 // POSSIBILITY OF SUCH DAMAGE.
37 //
38 //------------------------------------------------------------------------------
39 
40 #pragma once
41 
42 //------------------------------------------------------------------------------
43 // Include files
44 //------------------------------------------------------------------------------
45 
46 #include "SPI_Master_Base.h"
47 #include "Protocol_Base.h"
48 
49 //------------------------------------------------------------------------------
50 // Class definitions
51 //------------------------------------------------------------------------------
52 
53 //! @brief SPI memory base class
55 {
56 
57  //----------------------------------------------------------------------------
58  // Public defines, methods and variables
59  //----------------------------------------------------------------------------
60 
61  public:
62 
63  //--------------------------------------------------------------------------
64  // Public defines
65  //--------------------------------------------------------------------------
66 
67  //! @brief Chip descriptior structure
68  typedef struct
69  {
70 
71  //! @brief Chip capacity in bytes
73 
74  //! @brief Size of block in bytes
76 
77  //! @brief Size of page in bytes
79 
80  //! @brief Count of the blocks per chip
82 
83  //! @brief Count of the pages per block
85 
86  //! @brief Count of the pages per chip
88 
89  //! @brief Chip supported flag
91 
93 
94  //--------------------------------------------------------------------------
95  // Public methods
96  //--------------------------------------------------------------------------
97 
98  //!-------------------------------------------------------------------------
99  //! @brief Base class constructor method.
100  //! @note None
101  //! \par Override
102  //! Not allowed
103  //! @attention Don't call this method directly.
104  //--------------------------------------------------------------------------
105 
107 
108  //!-------------------------------------------------------------------------
109  //! @brief Base class constructor method.
110  //! @note None
111  //! \par Override
112  //! Not allowed
113  //! @attention Don't call this method directly.
114  //--------------------------------------------------------------------------
115 
116  virtual ~TSPI_Memory_Base();
117 
118  //!-------------------------------------------------------------------------
119  //! @brief SPI memory base object initialisation method.
120  //! @note None
121  //! @return None
122  //! \par Override
123  //! Optional
124  //! @attention None
125  //--------------------------------------------------------------------------
126 
127  VOID Init();
128 
129  //!-------------------------------------------------------------------------
130  //! @brief SPI memory base object finalisation method.
131  //! @note None
132  //! @return None
133  //! \par Override
134  //! Optional
135  //! @attention None
136  //--------------------------------------------------------------------------
137 
138  VOID Done();
139 
140  //!-------------------------------------------------------------------------
141  //! @brief Start operation of SPI memory base driver.
142  //! @note This method start operation of memory driver and underlayed SPI hardware driver.
143  //! @return None
144  //! \par Override
145  //! Optional
146  //! @attention None
147  //--------------------------------------------------------------------------
148 
149  virtual VOID Start();
150 
151  //!-------------------------------------------------------------------------
152  //! @brief Stop operation of SPI memory base driver.
153  //! @note This method stop operation of memory driver and underlayed SPI hardware driver.
154  //! @return None
155  //! \par Override
156  //! Optional
157  //! @attention None
158  //--------------------------------------------------------------------------
159 
160  virtual VOID Stop();
161 
162  //!-------------------------------------------------------------------------
163  //! @brief Assign SPI master hardware driver.
164  //! @note None
165  //! @param [in] *object_New_SPI_Master - Pointer to the SPI master hardware driver
166  //! @return None
167  //! \par Override
168  //! Not requered
169  //! @attention None
170  //--------------------------------------------------------------------------
171 
172  VOID Assign_SPI_Master( TSPI_Master_Base *object_New_SPI_Master );
173 
174  //!-------------------------------------------------------------------------
175  //! @brief Unassign SPI master hardware driver.
176  //! @note None
177  //! @return None
178  //! \par Override
179  //! Not requered
180  //! @attention None
181  //--------------------------------------------------------------------------
182 
184 
185  //!-------------------------------------------------------------------------
186  //! @brief Read data from memory into the buffer method.
187  //! @note None
188  //! @param [in] u32_Linear_Address - Linear address in memory
189  //! @param [in] u32_Size - Amount byte to read
190  //! @param [out] *u8_Data_Buffer - Pointer to the data buffer
191  //! @return BOOL - Read operation status
192  //! @retval false - Read operation failed
193  //! @retval true - Read operation succeeded
194  //! \par Override
195  //! Requered
196  //! @attention None
197  //--------------------------------------------------------------------------
198 
199  virtual BOOL Read_Buffer( U32 u32_Linear_Address, U32 u32_Size, U8 *u8_Data_Buffer ) = 0;
200 
201  //!-------------------------------------------------------------------------
202  //! @brief Write data from buffer into memory method.
203  //! @note None
204  //! @param [in] u32_Linear_Address - Linear address in memory
205  //! @param [in] u32_Size - Amount byte to write
206  //! @param [in] *u8_Data_Buffer - Pointer to the data buffer
207  //! @return BOOL - Write operation status
208  //! @retval false - Write operation failed
209  //! @retval true - Write operation succeeded
210  //! \par Override
211  //! Optional
212  //! @attention None
213  //--------------------------------------------------------------------------
214 
215  virtual BOOL Write_Buffer( U32 u32_Linear_Address, U32 u32_Size, U8 *u8_Data_Buffer ) = 0;
216 
217  //!-------------------------------------------------------------------------
218  //! @brief Verify data in memory and memory method.
219  //! @note None
220  //! @param [in] u32_Linear_Address - Linear address in memory
221  //! @param [in] u32_Size - Amount byte to verify
222  //! @param [in] *u8_Data_Buffer - Pointer to the data buffer
223  //! @return BOOL - Verification operation status
224  //! @retval false - Verification operation failed, data in buffer and memory not equal
225  //! @retval true - Verification operation succeeded, data in buffer and memory equal
226  //! \par Override
227  //! Optional
228  //! @attention None
229  //--------------------------------------------------------------------------
230 
231  virtual BOOL Verify_Buffer( U32 u32_Linear_Address, U32 u32_Size, U8 *u8_Data_Buffer );
232 
233  //!-------------------------------------------------------------------------
234  //! @brief Erase chip method.
235  //! @note This method can done full erase the memory, or erase only not damage blocks
236  //! @param [in] bool_Force_Bad_Block_Erase - Option to select an erase type
237  //! @return BOOL - Erasing status
238  //! @retval false - Erase falled
239  //! @retval true - Erase successfully done
240  //! \par Override
241  //! Optional
242  //! @attention None
243  //--------------------------------------------------------------------------
244 
245  virtual BOOL Erase_Chip( BOOL bool_Force_Bad_Block_Erase );
246 
247  //!-------------------------------------------------------------------------
248  //! @brief Get linear address of the block by specified block index.
249  //! @note None
250  //! @param [in] u16_Block_Index - Block index
251  //! @param [out] *u32_Linear_Address - Linear address of the block
252  //! @return BOOL - Operation status
253  //! @retval false - Operation failed
254  //! @retval true - Operation succeeded
255  //! \par Override
256  //! Not requered
257  //! @attention None
258  //--------------------------------------------------------------------------
259 
260  BOOL Get_Block_Address( U16 u16_Block_Index, U32 *u32_Linear_Address );
261 
262  //!-------------------------------------------------------------------------
263  //! @brief Get linear address of the page by specified block index and relative page index.
264  //! @note None
265  //! @param [in] u16_Block_Index - Block index
266  //! @param [in] u16_Relative_Page_Index - Page relative index within block
267  //! @param [out] *u32_Linear_Address - Linear address of the block
268  //! @return BOOL - Operation status
269  //! @retval false - Operation failed
270  //! @retval true - Operation succeeded
271  //! \par Override
272  //! Not requered
273  //! @attention None
274  //--------------------------------------------------------------------------
275 
276  BOOL Get_Page_Address( U16 u16_Block_Index, U16 u16_Relative_Page_Index, U32 *u32_Linear_Address );
277 
278  //!-------------------------------------------------------------------------
279  //! @brief Get capacity of attached SPI memory.
280  //! @note None
281  //! @return U32 - Capacity of attached SPI memory
282  //! \par Override
283  //! Not requered
284  //! @attention None
285  //--------------------------------------------------------------------------
286 
287  U32 Get_Capacity(); //!< DEPRICATED: Get capacity of attached SPI memory
288 
289  //!-------------------------------------------------------------------------
290  //! @brief Return SPI avaliability.
291  //! @note None
292  //! @return TRIL - SPI avaliability
293  //! \par Override
294  //! Not requered
295  //! @attention DEPRICATED: Return SPI avaliability
296  //--------------------------------------------------------------------------
297 
298  TRIL Is_Available();
299 
300  //!-------------------------------------------------------------------------
301  //! @brief Method sends default driver information over specified communication channel.
302  //! @note None
303  //! @param [in] *object_Protocol - Pointer to the connunication channel
304  //! @return None
305  //! \par Override
306  //! Not requered
307  //! @attention None
308  //--------------------------------------------------------------------------
309 
310  virtual VOID Send_Information( TProtocol_Base *object_Protocol );
311 
312  //!-------------------------------------------------------------------------
313  //! @brief Get page index from lenear address.
314  //! @note None
315  //! @param [in] u32_Linear_Address - Linear address
316  //! @param [out] *u32_Page_Index - Page index
317  //! @return BOOL - Operation status
318  //! @retval false - Operation failed
319  //! @retval true - Operation succeeded
320  //! \par Override
321  //! Not requered
322  //! @attention None
323  //--------------------------------------------------------------------------
324 
325  BOOL Get_Page_Index( U32 u32_Linear_Address, U32 *u32_Page_Index );
326 
327  //!-------------------------------------------------------------------------
328  //! @brief Get page index from block index and page relative index.
329  //! @note None
330  //! @param [in] u16_Block_Index - Block index
331  //! @param [in] u16_Page_Relative_Index - Page relative index
332  //! @param [out] *u32_Page_Index - Page index
333  //! @return BOOL - Operation status
334  //! @retval false - Operation failed
335  //! @retval true - Operation succeeded
336  //! \par Override
337  //! Not requered
338  //! @attention None
339  //--------------------------------------------------------------------------
340 
341  BOOL Get_Page_Index( U16 u16_Block_Index, U16 u16_Page_Relative_Index, U32 *u32_Page_Index );
342 
343  //!-------------------------------------------------------------------------
344  //! @brief Get block index by page index.
345  //! @note None
346  //! @param [in] u32_Page_Index - Page number of the chip
347  //! @param [out] *u16_Block_Index - Block index
348  //! @return BOOL - Operation status
349  //! @retval false - Operation failed
350  //! @retval true - Operation succeeded
351  //! \par Override
352  //! Not requered
353  //! @attention None
354  //--------------------------------------------------------------------------
355 
356  BOOL Get_Block_Index_By_Page( U32 u32_Page_Index, U16 *u16_Block_Index );
357 
358  //!-------------------------------------------------------------------------
359  //! @brief Get page index of the block.
360  //! @note None
361  //! @param [in] u16_Block_Index - Block index
362  //! @param [out] *u32_Page_Index - Page number of the chip
363  //! @return BOOL - Operation status
364  //! @retval false - Operation failed
365  //! @retval true - Operation succeeded
366  //! \par Override
367  //! Not requered
368  //! @attention None
369  //--------------------------------------------------------------------------
370 
371  BOOL Get_Page_Index( U16 u16_Block_Index, U32 *u32_Page_Index );
372 
373  //!-------------------------------------------------------------------------
374  //! @brief Return page size in bytes.
375  //! @note None
376  //! @param [out] *u16_Page_Size - Page size in bytes
377  //! @return BOOL - Operation status
378  //! @retval false - Operation failed, page size can not be retrieved
379  //! @retval true - Operation succeeded
380  //! \par Override
381  //! Not requered
382  //! @attention None
383  //--------------------------------------------------------------------------
384 
385  BOOL Get_Page_Size( U16 *u16_Page_Size );
386 
387  //!-------------------------------------------------------------------------
388  //! @brief Return pages number into block.
389  //! @note None
390  //! @param [out] *u16_Pages_Per_Block - Page into block
391  //! @return BOOL - Operation status
392  //! @retval false - Operation failed, block size can not be retrieved
393  //! @retval true - Operation succeeded
394  //! \par Override
395  //! Not requered
396  //! @attention None
397  //--------------------------------------------------------------------------
398 
399  BOOL Get_Pages_Per_Block_Count( U16 *u16_Pages_Per_Block );
400 
401  //!-------------------------------------------------------------------------
402  //! @brief Return total amount of the blocks.
403  //! @note None
404  //! @param [out] *u16_Block_Count - Total block count
405  //! @return BOOL - Operation status
406  //! @retval false - Operation failed, total block count can not be retrieved
407  //! @retval true - Operation succeeded
408  //! \par Override
409  //! Not requered
410  //! @attention None
411  //--------------------------------------------------------------------------
412 
413  BOOL Get_Block_Count( U16 *u16_Block_Count );
414 
415  //!-------------------------------------------------------------------------
416  //! @brief Return total amount of the pages.
417  //! @note None
418  //! @param [out] *u32_Pages_Per_Chip - Total pages count
419  //! @return BOOL - Operation status
420  //! @retval false - Operation failed, total block count can not be retrieved
421  //! @retval true - Operation succeeded
422  //! \par Override
423  //! Not requered
424  //! @attention None
425  //--------------------------------------------------------------------------
426 
427  BOOL Get_Pages_Per_Chip_Count( U32 *u32_Pages_Per_Chip );
428 
429  //----------------------------------------------------------------------------
430  // Protected defines, methods and variables
431  //----------------------------------------------------------------------------
432 
433  protected:
434 
435  //--------------------------------------------------------------------------
436  // Protected methods
437  //--------------------------------------------------------------------------
438 
439  //!-------------------------------------------------------------------------
440  //! @brief Return total chip capacity in bytes.
441  //! @note None
442  //! @param [out] *u32_Chip_Size - Total chip size in bytes
443  //! @return BOOL - Operation status
444  //! @retval false - Operation failed, total chip size can not be retrieved
445  //! @retval true - Operation succeeded
446  //! \par Override
447  //! Not requered
448  //! @attention None
449  //--------------------------------------------------------------------------
450 
451  BOOL Get_Chip_Size( U32 *u32_Chip_Size );
452 
453  //!-------------------------------------------------------------------------
454  //! @brief Return block size in bytes.
455  //! @note None
456  //! @param [out] *u32_Block_Size - Block size in bytes
457  //! @return BOOL - Operation status
458  //! @retval false - Operation failed, block size can not be retrieved
459  //! @retval true - Operation succeeded
460  //! \par Override
461  //! Not requered
462  //! @attention None
463  //--------------------------------------------------------------------------
464 
465  BOOL Get_Block_Size( U32 *u32_Block_Size );
466 
467  //!-------------------------------------------------------------------------
468  //! @brief Extract page relative address from lenear address.
469  //! @note None
470  //! @param [in] u32_Linear_Address - Linear address
471  //! @param [out] *u16_Relative_Address - Relative address from beggining of the page
472  //! @return BOOL - Operation status
473  //! @retval false - Operation failed
474  //! @retval true - Operation succeeded
475  //! \par Override
476  //! Not requered
477  //! @attention None
478  //--------------------------------------------------------------------------
479 
480  BOOL Extract_Page_Relative_Address( U32 u32_Linear_Address, U16 *u16_Relative_Address );
481 
482  //!-------------------------------------------------------------------------
483  //! @brief This method check that block index is valid
484  //! @note None
485  //! @param [in] u16_Block_Index - Block index
486  //! @return BOOL - Operation status
487  //! @retval false - Verification succeeded
488  //! @retval true - Operation failed, verification failed
489  //! \par Override
490  //! Requered
491  //! @attention None
492  //--------------------------------------------------------------------------
493 
494  BOOL Is_Block_Index_In_Range( U16 u16_Block_Index );
495 
496  //!-------------------------------------------------------------------------
497  //! @brief This method check that page index is valid
498  //! @note None
499  //! @param [in] u32_Page_Index - Page index
500  //! @return BOOL - Operation status
501  //! @retval false - Verification succeeded
502  //! @retval true - Operation failed, verification failed
503  //! \par Override
504  //! Requered
505  //! @attention None
506  //--------------------------------------------------------------------------
507 
508  BOOL Is_Page_Index_In_Range( U32 u32_Page_Index );
509 
510  //--------------------------------------------------------------------------
511  // Protected variables
512  //--------------------------------------------------------------------------
513 
514  //! @brief Pointer to the SPI master object
516 
517  //! @brief Pointer to the chip descriptor structure
519 
520  //! @brief Memory chip availablility status
522 
523  //! @brief Manufacturer ID availablility status
525 
526  //! @brief Device ID availablility status
528 
529  //! @brief Serial number availablility status
531 
532  //! @brief Depricated: Capacity of SPI memory in bytes
534 
535  //----------------------------------------------------------------------------
536  // Private defines, methods and variables
537  //----------------------------------------------------------------------------
538 
539  private:
540 
541  //--------------------------------------------------------------------------
542  // Private methods
543  //--------------------------------------------------------------------------
544 
545  //!-------------------------------------------------------------------------
546  //! @brief Enable write operation into memory.
547  //! @note None
548  //! @return BOOL - Operation status
549  //! @retval false - Operation succeeded
550  //! @retval true - Operation failed
551  //! \par Override
552  //! Optional
553  //! @attention Override this method if memory support enabling and disabling write protection function.
554  //--------------------------------------------------------------------------
555 
556  virtual BOOL Write_Enable();
557 
558  //!-------------------------------------------------------------------------
559  //! @brief Disable write operation into memory.
560  //! @note None
561  //! @return BOOL - Operation status
562  //! @retval false - Operation succeeded
563  //! @retval true - Operation failed
564  //! \par Override
565  //! Optional
566  //! @attention Override this method if memory support enabling and disabling write protection function.
567  //--------------------------------------------------------------------------
568 
569  virtual BOOL Write_Disable();
570 
571  //!-------------------------------------------------------------------------
572  //! @brief Read memory device status register method.
573  //! @note None
574  //! @param [out] *u8_StatusRegister - Pointer to status register value
575  //! @return BOOL - Read operation status
576  //! @retval false - Read operation succeeded
577  //! @retval true - Read operation failed
578  //! \par Override
579  //! Requered
580  //! @attention None
581  //--------------------------------------------------------------------------
582 
583  virtual BOOL Read_Status_Register( U8 *u8_StatusRegister );
584 
585  //!-------------------------------------------------------------------------
586  //! @brief Write memory device status register method.
587  //! @note None
588  //! @param [in] u8_StatusRegister - Status register value to write
589  //! @return BOOL - Write operation status
590  //! @retval false - Write operation succeeded
591  //! @retval true - Write operation failed
592  //! \par Override
593  //! Requered
594  //! @attention None
595  //--------------------------------------------------------------------------
596 
597  virtual BOOL Write_Status_Register( U8 u8_StatusRegister );
598 
599  //!-------------------------------------------------------------------------
600  //! @brief Read byte from memory.
601  //! @note None
602  //! @param [in] u32_Address - Linear address
603  //! @param [out] *u8_Data - Pointer to byte value
604  //! @return BOOL - Read operation status
605  //! @retval false - Read operation succeeded
606  //! @retval true - Read operation failed
607  //! \par Override
608  //! Requered
609  //! @attention None
610  //--------------------------------------------------------------------------
611 
612  virtual BOOL Read_Memory( U32 u32_Address, U8 *u8_Data );
613 
614  //!-------------------------------------------------------------------------
615  //! @brief Write byte into memory.
616  //! @note None
617  //! @param [in] u32_Address - Linear address
618  //! @param [in] u8_Data - Data byte value to write
619  //! @return BOOL - Write operation status
620  //! @retval false - Write operation succeeded
621  //! @retval true - Write operation failed
622  //! \par Override
623  //! Requered
624  //! @attention None
625  //--------------------------------------------------------------------------
626 
627  virtual BOOL Write_Memory( U32 u32_Address, U8 u8_Data );
628 
629  //!-------------------------------------------------------------------------
630  //! @brief Read memory device identification information pure virtual method.
631  //! @note None
632  //! @return None
633  //! \par Override
634  //! Requered
635  //! @attention None
636  //--------------------------------------------------------------------------
637 
638  virtual BOOL Read_Identification() = 0;
639 
640  //!-------------------------------------------------------------------------
641  //! @brief This method check that relative index is valid
642  //! @note None
643  //! @param [in] u16_Page_Relative_Index - Relative index
644  //! @return BOOL - Operation status
645  //! @retval false - Verification succeeded
646  //! @retval true - Operation failed, verification failed
647  //! \par Override
648  //! Requered
649  //! @attention None
650  //--------------------------------------------------------------------------
651 
652  BOOL Is_Page_Relative_Index_In_Range( U16 u16_Page_Relative_Index );
653 
654 };
655 
656 //------------------------------------------------------------------------------
657 // End of file
658 //------------------------------------------------------------------------------
int BOOL
Boolean datatype definition.
Definition: Defines.h:124
#define NULL
Definition: Defines.h:388
int TRIL
Thrilean datatype defenition.
Definition: Defines.h:143
unsigned char U8
Binary 8-Bit unsigned integer datatype defenition.
Definition: Defines.h:183
void VOID
Datatypesess datatype definition.
Definition: Defines.h:105
unsigned long U32
Binary 32-Bit unsigned integer datatype defenition.
Definition: Defines.h:203
unsigned short U16
Binary 16-Bit unsigned integer datatype defenition.
Definition: Defines.h:193
#define unset
Unset value of thrilean datatype defenition.
Definition: Defines.h:146
Communication protocol base class header file.
SPI bus master base class header file.
Definition: Protocol_Base.h:57
SPI master base class.
Definition: SPI_Master_Base.h:58
SPI memory base class.
Definition: SPI_Memory_Base.h:55
BOOL Get_Block_Size(U32 *u32_Block_Size)
Return block size in bytes.
Definition: SPI_Memory_Base.cpp:398
virtual BOOL Write_Enable()
Enable write operation into memory.
Definition: SPI_Memory_Base.cpp:231
BOOL Get_Page_Index(U32 u32_Linear_Address, U32 *u32_Page_Index)
Get page index from lenear address.
Definition: SPI_Memory_Base.cpp:566
VOID Init()
SPI memory base object initialisation method.
Definition: SPI_Memory_Base.cpp:70
virtual VOID Start()
Start operation of SPI memory base driver.
Definition: SPI_Memory_Base.cpp:99
BOOL Get_Block_Count(U16 *u16_Block_Count)
Return total amount of the blocks.
Definition: SPI_Memory_Base.cpp:356
BOOL Get_Pages_Per_Chip_Count(U32 *u32_Pages_Per_Chip)
Return total amount of the pages.
Definition: SPI_Memory_Base.cpp:482
TSPI_Master_Base * object_SPI_Master
Pointer to the SPI master object.
Definition: SPI_Memory_Base.h:515
virtual BOOL Read_Memory(U32 u32_Address, U8 *u8_Data)
Read byte from memory.
Definition: SPI_Memory_Base.cpp:279
virtual BOOL Write_Disable()
Disable write operation into memory.
Definition: SPI_Memory_Base.cpp:243
U32 Get_Capacity()
Get capacity of attached SPI memory.
Definition: SPI_Memory_Base.cpp:195
BOOL bool_Manufacturer_ID_Available
Manufacturer ID availablility status.
Definition: SPI_Memory_Base.h:524
virtual BOOL Erase_Chip(BOOL bool_Force_Bad_Block_Erase)
Erase chip method.
Definition: SPI_Memory_Base.cpp:219
virtual BOOL Write_Buffer(U32 u32_Linear_Address, U32 u32_Size, U8 *u8_Data_Buffer)=0
Write data from buffer into memory method.
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.
Definition: SPI_Memory_Base.cpp:846
U32 u32_Capacity
Depricated: Capacity of SPI memory in bytes.
Definition: SPI_Memory_Base.h:533
virtual BOOL Write_Memory(U32 u32_Address, U8 u8_Data)
Write byte into memory.
Definition: SPI_Memory_Base.cpp:291
virtual BOOL Write_Status_Register(U8 u8_StatusRegister)
Write memory device status register method.
Definition: SPI_Memory_Base.cpp:267
BOOL Get_Block_Index_By_Page(U32 u32_Page_Index, U16 *u16_Block_Index)
Get block index by page index.
Definition: SPI_Memory_Base.cpp:999
TRIL tril_Available
Memory chip availablility status.
Definition: SPI_Memory_Base.h:521
TSPI_Memory_Base()
Base class constructor method.
Definition: SPI_Memory_Base.cpp:54
VOID Done()
SPI memory base object finalisation method.
Definition: SPI_Memory_Base.cpp:91
virtual BOOL Verify_Buffer(U32 u32_Linear_Address, U32 u32_Size, U8 *u8_Data_Buffer)
Verify data in memory and memory method.
Definition: SPI_Memory_Base.cpp:207
VOID Assign_SPI_Master(TSPI_Master_Base *object_New_SPI_Master)
Assign SPI master hardware driver.
Definition: SPI_Memory_Base.cpp:159
virtual VOID Stop()
Stop operation of SPI memory base driver.
Definition: SPI_Memory_Base.cpp:129
BOOL bool_Serial_Number_Available
Serial number availablility status.
Definition: SPI_Memory_Base.h:530
BOOL Extract_Page_Relative_Address(U32 u32_Linear_Address, U16 *u16_Relative_Address)
Extract page relative address from lenear address.
Definition: SPI_Memory_Base.cpp:662
virtual BOOL Read_Identification()=0
Read memory device identification information pure virtual method.
BOOL bool_Device_ID_Available
Device ID availablility status.
Definition: SPI_Memory_Base.h:527
virtual BOOL Read_Buffer(U32 u32_Linear_Address, U32 u32_Size, U8 *u8_Data_Buffer)=0
Read data from memory into the buffer method.
VOID Unassign_SPI_Master()
Unassign SPI master hardware driver.
Definition: SPI_Memory_Base.cpp:171
BOOL Is_Page_Index_In_Range(U32 u32_Page_Index)
This method check that page index is valid.
Definition: SPI_Memory_Base.cpp:1144
virtual ~TSPI_Memory_Base()
Base class constructor method.
Definition: SPI_Memory_Base.cpp:62
TRIL Is_Available()
Return SPI avaliability.
Definition: SPI_Memory_Base.cpp:183
virtual VOID Send_Information(TProtocol_Base *object_Protocol)
Method sends default driver information over specified communication channel.
Definition: SPI_Memory_Base.cpp:303
virtual BOOL Read_Status_Register(U8 *u8_StatusRegister)
Read memory device status register method.
Definition: SPI_Memory_Base.cpp:255
TMemory_Chip_Descriptor * struct_Memory_Chip_Descriptor
Pointer to the chip descriptor structure.
Definition: SPI_Memory_Base.h:518
BOOL Is_Block_Index_In_Range(U16 u16_Block_Index)
This method check that block index is valid.
Definition: SPI_Memory_Base.cpp:1083
BOOL Is_Page_Relative_Index_In_Range(U16 u16_Page_Relative_Index)
This method check that relative index is valid.
Definition: SPI_Memory_Base.cpp:1205
BOOL Get_Pages_Per_Block_Count(U16 *u16_Pages_Per_Block)
Return pages number into block.
Definition: SPI_Memory_Base.cpp:440
BOOL Get_Block_Address(U16 u16_Block_Index, U32 *u32_Linear_Address)
Get linear address of the block by specified block index.
Definition: SPI_Memory_Base.cpp:760
BOOL Get_Chip_Size(U32 *u32_Chip_Size)
Return total chip capacity in bytes.
Definition: SPI_Memory_Base.cpp:314
BOOL Get_Page_Size(U16 *u16_Page_Size)
Return page size in bytes.
Definition: SPI_Memory_Base.cpp:524
Chip descriptior structure.
Definition: SPI_Memory_Base.h:69
U32 u32_Block_Size
Size of block in bytes.
Definition: SPI_Memory_Base.h:75
U16 u16_Blocks_Per_Chip_Count
Count of the blocks per chip.
Definition: SPI_Memory_Base.h:81
U32 u32_Pages_Per_Chip_Count
Count of the pages per chip.
Definition: SPI_Memory_Base.h:87
BOOL bool_Supported
Chip supported flag.
Definition: SPI_Memory_Base.h:90
U32 u32_Chip_Size
Chip capacity in bytes.
Definition: SPI_Memory_Base.h:72
U16 u16_Pages_Per_Block_Count
Count of the pages per block.
Definition: SPI_Memory_Base.h:84
U16 u16_Page_Size
Size of page in bytes.
Definition: SPI_Memory_Base.h:78