ConOpSys V2970  P004.07
ANVILEX control operating system
FLASH_STM32F429.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file FLASH_STM32F429.h
3 //! @brief STM32F429 on-chip flash module 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/Targets/STM32F429/FLASH_STM32F429.h $
7 //! $Revision: 2766 $
8 //! $Date: 2021-07-04 17:26:00 +0500 (Вс, 04 июл 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 project files
44 //------------------------------------------------------------------------------
45 
46 //------------------------------------------------------------------------------
47 // Class definitions
48 //------------------------------------------------------------------------------
49 
50 //! @brief STM32F429 on-chip flash module class
52 {
53 
54  //----------------------------------------------------------------------------
55  // Public defines, methods and variables
56  //----------------------------------------------------------------------------
57 
58  public:
59 
60  //!-------------------------------------------------------------------------
61  //! @brief Flash chip initialisation method
62  //! @note None
63  //! @return None
64  //! \par Override
65  //! Not allowed
66  //! @attention None
67  //--------------------------------------------------------------------------
68 
69  virtual VOID Init();
70 
71  //!-------------------------------------------------------------------------
72  //! @brief Flash chip finalisation method
73  //! @note None
74  //! @return None
75  //! \par Override
76  //! Not allowed
77  //! @attention None
78  //--------------------------------------------------------------------------
79 
80  virtual VOID Done();
81 
82  //!-------------------------------------------------------------------------
83  //! @brief Read data from memory into buffer.
84  //! @note None
85  //! @param [in] u32_Address - Address of the data in memory
86  //! @param [in] u32_Size - Size of the data to read
87  //! @param [out] *u8_Data_Buffer - Pointer to the data buffer
88  //! @return BOOL - Data read operation status
89  //! @retval false - Read operation failed
90  //! @retval true - Read operation successed
91  //! \par Override
92  //! Not requered
93  //! @attention None
94  //--------------------------------------------------------------------------
95 
96  BOOL Read_Buffer( U32 u32_Address, U32 u32_Size, U8 *u8_Data_Buffer );
97 
98  //!-------------------------------------------------------------------------
99  //! @brief Write data from buffer into memory.
100  //! @note None
101  //! @param [in] u32_Address - Address of the data in memory
102  //! @param [in] u32_Size - Size of the data to write
103  //! @param [in] *u8_Data_Buffer - Pointer to the data buffer
104  //! @return BOOL - Data write operation status
105  //! @retval false - Write operation failed
106  //! @retval true - Write operation successed
107  //! \par Override
108  //! Not requered
109  //! @attention None
110  //--------------------------------------------------------------------------
111 
112  BOOL Write_Buffer( U32 u32_Address, U32 u32_Size, U8 *u8_Data_Buffer );
113 
114  //!-------------------------------------------------------------------------
115  //! @brief Erase block referenced by index.
116  //! @note None
117  //! @param [in] u32_Block_Index - Block index to erase
118  //! @return BOOL - Erase operation status
119  //! @retval false - Erase operation failed
120  //! @retval true - Erase operation successed
121  //! \par Override
122  //! Not requered
123  //! @attention None
124  //--------------------------------------------------------------------------
125 
126  BOOL Erase_Block_By_Index( U32 u32_Block_Index );
127 
128  //----------------------------------------------------------------------------
129  // Protected defines, methods and variables
130  //----------------------------------------------------------------------------
131 
132  protected:
133 
134  //----------------------------------------------------------------------------
135  // Private defines, methods and variables
136  //----------------------------------------------------------------------------
137 
138  private:
139 
140  //!-------------------------------------------------------------------------
141  //! @brief Flash chip unlock method
142  //! @note None
143  //! @return None
144  //! \par Override
145  //! Not allowed
146  //! @attention None
147  //--------------------------------------------------------------------------
148 
149  VOID Unlock();
150 
151  //!-------------------------------------------------------------------------
152  //! @brief Flash chip lock method
153  //! @note None
154  //! @return None
155  //! \par Override
156  //! Not allowed
157  //! @attention None
158  //--------------------------------------------------------------------------
159 
160  VOID Lock();
161 
162 
163 };
164 
165 //------------------------------------------------------------------------------
166 // End of file
167 //------------------------------------------------------------------------------
int BOOL
Boolean datatype definition.
Definition: Defines.h:124
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
STM32F429 on-chip flash module class.
Definition: FLASH_STM32F429.h:52
virtual VOID Done()
Flash chip finalisation method.
Definition: FLASH_STM32F429.cpp:103
BOOL Read_Buffer(U32 u32_Address, U32 u32_Size, U8 *u8_Data_Buffer)
Read data from memory into buffer.
Definition: FLASH_STM32F429.cpp:211
virtual VOID Init()
Flash chip initialisation method.
Definition: FLASH_STM32F429.cpp:70
VOID Unlock()
Flash chip unlock method.
Definition: FLASH_STM32F429.cpp:272
BOOL Write_Buffer(U32 u32_Address, U32 u32_Size, U8 *u8_Data_Buffer)
Write data from buffer into memory.
Definition: FLASH_STM32F429.cpp:228
VOID Lock()
Flash chip lock method.
Definition: FLASH_STM32F429.cpp:285
BOOL Erase_Block_By_Index(U32 u32_Block_Index)
Erase block referenced by index.
Definition: FLASH_STM32F429.cpp:112