Merge pull request #2 from ronan22/master
[apps/agl-service-unicens.git] / ucs2-lib / inc / ucs_base.h
1 /*------------------------------------------------------------------------------------------------*/
2 /* UNICENS V2.1.0-3491                                                                            */
3 /* Copyright (c) 2017 Microchip Technology Germany II GmbH & Co. KG.                              */
4 /*                                                                                                */
5 /* This program is free software: you can redistribute it and/or modify                           */
6 /* it under the terms of the GNU General Public License as published by                           */
7 /* the Free Software Foundation, either version 2 of the License, or                              */
8 /* (at your option) any later version.                                                            */
9 /*                                                                                                */
10 /* This program is distributed in the hope that it will be useful,                                */
11 /* but WITHOUT ANY WARRANTY; without even the implied warranty of                                 */
12 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                  */
13 /* GNU General Public License for more details.                                                   */
14 /*                                                                                                */
15 /* You should have received a copy of the GNU General Public License                              */
16 /* along with this program.  If not, see <http://www.gnu.org/licenses/>.                          */
17 /*                                                                                                */
18 /* You may also obtain this software under a propriety license from Microchip.                    */
19 /* Please contact Microchip for further information.                                              */
20 /*------------------------------------------------------------------------------------------------*/
21
22 /*!
23  * \file
24  * \brief Internal header file of the Base class.
25  *
26  * \cond UCS_INTERNAL_DOC
27  * \addtogroup G_BASE
28  * @{
29  */
30
31 #ifndef UCS_BASE_H
32 #define UCS_BASE_H
33
34 /*------------------------------------------------------------------------------------------------*/
35 /* Includes                                                                                       */
36 /*------------------------------------------------------------------------------------------------*/
37 #include "ucs_rules.h"
38 #include "ucs_timer.h"
39 #include "ucs_scheduler.h"
40 #include "ucs_trace.h"
41 #include "ucs_eh.h"
42 #include "ucs_alm.h"
43
44 #ifdef __cplusplus
45 extern "C"
46 {
47 #endif
48
49 /*------------------------------------------------------------------------------------------------*/
50 /* Structures                                                                                     */
51 /*------------------------------------------------------------------------------------------------*/
52 /*! \brief  Initialization structure of the Base class. */
53 typedef struct Base_InitData_
54 {
55     void *ucs_user_ptr;             /*!< \brief User reference for API callback functions */
56     uint8_t ucs_inst_id;            /*!< \brief UNICENS instance ID */
57     Scd_InitData_t scd;             /*!< \brief Initialization data of the scheduler */
58     Tm_InitData_t tm;               /*!< \brief Initialization data of the timer management */
59
60 } Base_InitData_t;
61
62 /*! \brief   Class structure of the Base class. */
63 typedef struct CBase_
64 {
65     CScheduler scd;                 /*!< \brief Scheduler instance */
66     CTimerManagement tm;            /*!< \brief Timer management instance */
67     CEventHandler eh;               /*!< \brief Event handler instance */
68     CApiLockingManager alm;         /*!< \brief API locking manager instance */
69     uint8_t ucs_inst_id;            /*!< \brief UNICENS instance ID */
70     void *ucs_user_ptr;             /*!< \brief User reference for API callback functions */
71
72 } CBase;
73
74 /*------------------------------------------------------------------------------------------------*/
75 /* Prototypes                                                                                     */
76 /*------------------------------------------------------------------------------------------------*/
77 void Base_Ctor(CBase *self, Base_InitData_t *init_ptr);
78
79 #ifdef __cplusplus
80 }   /* extern "C" */
81 #endif
82
83 #endif  /* #ifndef UCS_BASE_H */
84
85 /*!
86  * @}
87  * \endcond
88  */
89
90 /*------------------------------------------------------------------------------------------------*/
91 /* End of file                                                                                    */
92 /*------------------------------------------------------------------------------------------------*/
93