ConOpSys V2970  P004.07
ANVILEX control operating system
CAN1_STM32F429.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file CAN1_STM32F429.h
3 //! @brief STM32F429 on-chip CAN1 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/CAN1_STM32F429.h $
7 //! $Revision: 2819 $
8 //! $Date: 2021-07-26 17:23:01 +0500 (Mo, 26 Jul 2021) $
9 //! $Author: ggavrituhin $
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 standard libraries header files
44 //------------------------------------------------------------------------------
45 
46 //------------------------------------------------------------------------------
47 // Include thrid party header files
48 //------------------------------------------------------------------------------
49 
50 //------------------------------------------------------------------------------
51 // Include ConOpSys header files
52 //------------------------------------------------------------------------------
53 
54 #include "Communication_Link.h"
55 
56 //------------------------------------------------------------------------------
57 // Class definitions
58 //------------------------------------------------------------------------------
59 
60 //! @brief STM32F429 on-chip CAN1 hardware abstraction layer class.
62 {
63 
64  //----------------------------------------------------------------------------
65  // Public defines, methods and variables
66  //----------------------------------------------------------------------------
67 
68  public:
69 
70  //--------------------------------------------------------------------------
71  // Public methods
72  //--------------------------------------------------------------------------
73 
74  //!-------------------------------------------------------------------------
75  //! @brief Class constructor method.
76  //! @note None
77  //! \par Override
78  //! Not allowed
79  //! @attention Don't call this method directly.
80  //--------------------------------------------------------------------------
81 
83 
84  //!-------------------------------------------------------------------------
85  //! @brief Class destructor method.
86  //! @note None
87  //! \par Override
88  //! Not allowed
89  //! @attention Don't call this method directly.
90  //--------------------------------------------------------------------------
91 
93 
94  //!-------------------------------------------------------------------------
95  //! @brief Initialisation method.
96  //! @note None
97  //! @return None
98  //! \par Override
99  //! Not allowed
100  //! @attention None
101  //--------------------------------------------------------------------------
102 
103  VOID Init();
104 
105  //!-------------------------------------------------------------------------
106  //! @brief Finalisation method.
107  //! @note None
108  //! @return None
109  //! \par Override
110  //! Not allowed
111  //! @attention None
112  //--------------------------------------------------------------------------
113 
114  VOID Done();
115 
116  //!-------------------------------------------------------------------------
117  //! @brief CAN2 interrupt enable method.
118  //! @note None
119  //! @param [in] u32_Priority - Interrupt priority level
120  //! @return None
121  //! \par Override
122  //! Not allowed
123  //! @attention None
124  //--------------------------------------------------------------------------
125 
126  VOID Interrupt_Enable( U32 u32_Priority );
127 
128  //!-------------------------------------------------------------------------
129  //! @brief CAN1 interrupt disable method.
130  //! @note None
131  //! @return None
132  //! \par Override
133  //! Not allowed
134  //! @attention None
135  //--------------------------------------------------------------------------
136 
138 
139  //!-------------------------------------------------------------------------
140  //! @brief CAN1 RX interrupt processing method.
141  //! @note None
142  //! @return None
143  //! \par Override
144  //! Not allowed
145  //! @attention None
146  //--------------------------------------------------------------------------
147 
149 
150  //!-------------------------------------------------------------------------
151  //! @brief Transmit test data
152  //! @note None
153  //! @param [in] u32_ID - Identifier
154  //! @param [in] u8_ID_Type - Message type (0-Standart ID, 1-Extended ID)
155  //! @param [in] *u8_Transmit_Buffer - Pointer to the data buffer
156  //! @param [in] *u8_Transmit_Length - Data size
157  //! @return BOOL - Operation status
158  //! @retval false - Transmiting error
159  //! @retval true - Transmiting successed
160  //! \par Override
161  //! Not allowed
162  //! @attention None
163  //--------------------------------------------------------------------------
164 
165  BOOL Transmit_Data_Test( U32 u32_ID, U8 u8_ID_Type, U8 *u8_Transmit_Buffer, U8 u8_Transmit_Length );
166 
167  //----------------------------------------------------------------------------
168  // Protected defines, methods and variables
169  //----------------------------------------------------------------------------
170 
171  protected:
172 
173  //--------------------------------------------------------------------------
174  // Protected methods
175  //--------------------------------------------------------------------------
176 
177  //!-------------------------------------------------------------------------
178  //! @brief Communication data transmit method
179  //! @note None
180  //! @param [in] u32_ID - Identifier
181  //! @param [in] u8_ID_Type - Message type (0-Standart ID, 1-Extended ID)
182  //! @param [in] *u8_Transmit_Buffer - Pointer to the data buffer
183  //! @param [in] *u8_Transmit_Length - Data size
184  //! @return BOOL - Operation status
185  //! @retval false - Transmiting error
186  //! @retval true - Transmiting successed
187  //! \par Override
188  //! Not allowed
189  //! @attention None
190  //--------------------------------------------------------------------------
191 
192  virtual BOOL Transmit_Data( U32 u32_ID, U8 u8_ID_Type, U8 *u8_Transmit_Buffer, U8 u8_Transmit_Length );
193 
194  //!-------------------------------------------------------------------------
195  //! @brief CAN2 RX interrupt processing method.
196  //! @note None
197  //! @param [in] *void_Transmit_Data - Pointer to the data buffer
198  //! @return None
199  //! \par Override
200  //! Not allowed
201  //! @attention None
202  //--------------------------------------------------------------------------
203 
204  virtual VOID Communication_Block_Data_Transmit( VOID *void_Transmit_Data );
205 
206  //----------------------------------------------------------------------------
207  // Private defines, methods and variables
208  //----------------------------------------------------------------------------
209 
210  private:
211 
212  //--------------------------------------------------------------------------
213  // Private variables
214  //--------------------------------------------------------------------------
215 
216  //! @brief Initialisation error flag.
218 
219 };
220 
221 //------------------------------------------------------------------------------
222 // End of file
223 //------------------------------------------------------------------------------
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 CAN1 hardware abstraction layer class.
Definition: CAN1_STM32F429.h:62
VOID RX0_Interrupt()
CAN1 RX interrupt processing method.
Definition: CAN1_STM32F429.cpp:252
BOOL Transmit_Data_Test(U32 u32_ID, U8 u8_ID_Type, U8 *u8_Transmit_Buffer, U8 u8_Transmit_Length)
Transmit test data.
Definition: CAN1_STM32F429.cpp:446
virtual VOID Communication_Block_Data_Transmit(VOID *void_Transmit_Data)
CAN2 RX interrupt processing method.
Definition: CAN1_STM32F429.cpp:319
TCAN1_STM32F429()
Class constructor method.
Definition: CAN1_STM32F429.cpp:70
VOID Interrupt_Enable(U32 u32_Priority)
CAN2 interrupt enable method.
Definition: CAN1_STM32F429.cpp:213
VOID Init()
Initialisation method.
Definition: CAN1_STM32F429.cpp:94
BOOL bool_Initialisation_Error
Initialisation error flag.
Definition: CAN1_STM32F429.h:217
VOID Interrupt_Disable()
CAN1 interrupt disable method.
Definition: CAN1_STM32F429.cpp:234
virtual BOOL Transmit_Data(U32 u32_ID, U8 u8_ID_Type, U8 *u8_Transmit_Buffer, U8 u8_Transmit_Length)
Communication data transmit method.
Definition: CAN1_STM32F429.cpp:344
~TCAN1_STM32F429()
Class destructor method.
Definition: CAN1_STM32F429.cpp:86
VOID Done()
Finalisation method.
Definition: CAN1_STM32F429.cpp:198