ConOpSys V2970  P004.07
ANVILEX control operating system
UART1_STM32F429.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file UART1_STM32F429.h
3 //! @brief STM32F429 on-chip UART1 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/UART1_STM32F429.h $
7 //! $Revision: 2766 $
8 //! $Date: 2021-07-04 17:26:00 +0500 (So, 04 Jul 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 // System includes
44 //------------------------------------------------------------------------------
45 
46 #include "Communication_Link.h"
47 
48 //------------------------------------------------------------------------------
49 // Global defines
50 //------------------------------------------------------------------------------
51 
52 //! @brief Definition of UART1 transmit buffer size
53 //! @note Don't use this define outside of this file.
54 #define UART1_TX_BUFFER_SIZE 256
55 
56 //------------------------------------------------------------------------------
57 // Class definitions
58 //------------------------------------------------------------------------------
59 
60 //! @brief STM32F429 on-chip UART1 hardware abstraction layer class.
62 {
63 
64  //----------------------------------------------------------------------------
65  // Public defines, methods and variables
66  //----------------------------------------------------------------------------
67 
68  public:
69 
70  //!-------------------------------------------------------------------------
71  //! @brief Object initialisation method.
72  //! @note None
73  //! @return None
74  //! \par Override
75  //! Not allowed
76  //! @attention None
77  //--------------------------------------------------------------------------
78 
79  VOID Init();
80 
81  //!-------------------------------------------------------------------------
82  //! @brief Object finalisation method.
83  //! @note None
84  //! @return None
85  //! \par Override
86  //! Not allowed
87  //! @attention None
88  //--------------------------------------------------------------------------
89 
90  VOID Done();
91 
92  //!-------------------------------------------------------------------------
93  //! @brief Start RX operation.
94  //! @note Calling this method enables RX operation of the UART.
95  //! @return None
96  //! \par Override
97  //! Not allowed
98  //! @attention None
99  //--------------------------------------------------------------------------
100 
102 
103  //!-------------------------------------------------------------------------
104  //! @brief Stop RX operation.
105  //! @note Calling this method enables RX operation of the UART.
106  //! @return None
107  //! \par Override
108  //! Not allowed
109  //! @attention None
110  //--------------------------------------------------------------------------
111 
113 
114  //!-------------------------------------------------------------------------
115  //! @brief Start TX operation.
116  //! @note Calling this method enables RX operation of the UART.
117  //! @return None
118  //! \par Override
119  //! Not allowed
120  //! @attention None
121  //--------------------------------------------------------------------------
122 
124 
125  //!-------------------------------------------------------------------------
126  //! @brief Stop TX operation.
127  //! @note Calling this method enables RX operation of the UART.
128  //! @return None
129  //! \par Override
130  //! Not allowed
131  //! @attention None
132  //--------------------------------------------------------------------------
133 
135 
136  //!-------------------------------------------------------------------------
137  //! @brief Enable interrupt method.
138  //! @note None
139  //! @param [in] u32_Priority - Interrupt priority
140  //! @return None
141  //! \par Override
142  //! Not allowed / Requered / Optional
143  //! @attention None
144  //--------------------------------------------------------------------------
145 
146  VOID Interrupt_Enable( U32 u32_Priority );
147 
148  //!-------------------------------------------------------------------------
149  //! @brief Disable interrupt method.
150  //! @note None
151  //! @return None
152  //! \par Override
153  //! Not allowed / Requered / Optional
154  //! @attention None
155  //--------------------------------------------------------------------------
156 
158 
159  //!-------------------------------------------------------------------------
160  //! @brief Interrupt service method.
161  //! @note None
162  //! @return None
163  //! \par Override
164  //! Not allowed / Requered / Optional
165  //! @attention None
166  //--------------------------------------------------------------------------
167 
168  VOID Interrupt();
169 
170  //----------------------------------------------------------------------------
171  // Protected defines, methods and variables
172  //----------------------------------------------------------------------------
173 
174  protected:
175 
176  //!-------------------------------------------------------------------------
177  //! @brief Transmit data method.
178  //! @note This method adds data to the internal queue.
179  //! @param [in] u8_Transmit_Value - Value for transmitting
180  //! @return None
181  //! \par Override
182  //! Not allowed
183  //! @attention None
184  //--------------------------------------------------------------------------
185 
186  virtual VOID Communication_Data_Transmit( U8 u8_Transmit_Value );
187 
188  //----------------------------------------------------------------------------
189  // Private methods, variables and definitions
190  //----------------------------------------------------------------------------
191 
192  private:
193 
194  //--------------------------------------------------------------------------
195  // Private type definitions
196  //--------------------------------------------------------------------------
197 
198  //! @brief Send buffer structure datatype definition
199  typedef struct
200  {
201 
202  //! @brief Data section
204 
205  //! @brief Displaying readiness for recording
207 
208  } TSend_Buffer;
209 
210  //--------------------------------------------------------------------------
211  // Private variables
212  //--------------------------------------------------------------------------
213 
214  //! @brief RX operation enabled status flag
216 
217  //! @brief TX operation enabled status flag
219 
220  //! @brief Transmiting active status flag
222 
223  //! @brief Buffer for data transmitting
225 
226  //! @brief Count for struct_Send_Buffer
228 
229  //! @brief Count data index for transmiting
231 
232 };
233 
234 //------------------------------------------------------------------------------
235 // End of file
236 //------------------------------------------------------------------------------
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
unsigned short U16
Binary 16-Bit unsigned integer datatype defenition.
Definition: Defines.h:193
#define UART1_TX_BUFFER_SIZE
Definition of UART1 transmit buffer size.
Definition: UART1_STM32F429.h:54
STM32F429 on-chip UART1 hardware abstraction layer class.
Definition: UART1_STM32F429.h:62
VOID Stop_TX_Operation()
Stop TX operation.
Definition: UART1_STM32F429.cpp:317
VOID Done()
Object finalisation method.
Definition: UART1_STM32F429.cpp:234
volatile TSend_Buffer struct_Send_Buffer[UART1_TX_BUFFER_SIZE]
Buffer for data transmitting.
Definition: UART1_STM32F429.h:224
volatile U16 u16_Buffer_Count
Count for struct_Send_Buffer.
Definition: UART1_STM32F429.h:227
BOOL bool_RX_Operation_Enabled
RX operation enabled status flag.
Definition: UART1_STM32F429.h:215
BOOL bool_TX_Operation_Enabled
TX operation enabled status flag.
Definition: UART1_STM32F429.h:218
VOID Interrupt()
Interrupt service method.
Definition: UART1_STM32F429.cpp:385
volatile U16 u16_Transmission_Data_Index
Count data index for transmiting.
Definition: UART1_STM32F429.h:230
VOID Start_TX_Operation()
Start TX operation.
Definition: UART1_STM32F429.cpp:302
VOID Stop_RX_Operation()
Stop RX operation.
Definition: UART1_STM32F429.cpp:267
VOID Init()
Object initialisation method.
Definition: UART1_STM32F429.cpp:88
virtual VOID Communication_Data_Transmit(U8 u8_Transmit_Value)
Transmit data method.
Definition: UART1_STM32F429.cpp:574
VOID Start_RX_Operation()
Start RX operation.
Definition: UART1_STM32F429.cpp:252
VOID Interrupt_Disable()
Disable interrupt method.
Definition: UART1_STM32F429.cpp:370
volatile BOOL bool_Transmiting_Active
Transmiting active status flag.
Definition: UART1_STM32F429.h:221
VOID Interrupt_Enable(U32 u32_Priority)
Enable interrupt method.
Definition: UART1_STM32F429.cpp:352
Send buffer structure datatype definition.
Definition: UART1_STM32F429.h:200
U8 u8_Data
Data section.
Definition: UART1_STM32F429.h:203
BOOL bool_Data_Status
Displaying readiness for recording.
Definition: UART1_STM32F429.h:206