ChibiOS  21.6.0
chrfcu.h
Go to the documentation of this file.
1 /*
2  ChibiOS - Copyright (C) 2006,2007,2008,2009,2010,2011,2012,2013,2014,
3  2015,2016,2017,2018,2019,2020,2021 Giovanni Di Sirio.
4 
5  This file is part of ChibiOS.
6 
7  ChibiOS is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation version 3 of the License.
10 
11  ChibiOS is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 /**
21  * @file rt/include/chrfcu.h
22  * @brief Runtime Faults Collection Unit macros and structures.
23  *
24  * @addtogroup rfcu
25  * @{
26  */
27 
28 #ifndef CHRFCU_H
29 #define CHRFCU_H
30 
31 /*===========================================================================*/
32 /* Module constants. */
33 /*===========================================================================*/
34 
35 /**
36  * @name Predefined Faults
37  * @{
38  */
39 #define CH_RFCU_VT_INSUFFICIENT_DELTA 1U
40 #define CH_RFCU_VT_SKIPPED_DEADLINE 2U
41 /** @} */
42 
43 /**
44  * @brief Mask of all faults.
45  */
46 #define CH_RFCU_ALL_FAULTS ((rfcu_mask_t)-1)
47 
48 /*===========================================================================*/
49 /* Module pre-compile time settings. */
50 /*===========================================================================*/
51 
52 /*===========================================================================*/
53 /* Derived constants and error checks. */
54 /*===========================================================================*/
55 
56 /*===========================================================================*/
57 /* Module data structures and types. */
58 /*===========================================================================*/
59 
60 /**
61  * @brief Type of a faults mask.
62  */
63 typedef uint32_t rfcu_mask_t;
64 
65 /**
66  * @brief Type of an RFCU structure.
67  */
68 typedef struct ch_rfcu {
69  /**
70  * @brief Mask of the pending runtime faults.
71  */
73 } rfcu_t;
74 
75 /*===========================================================================*/
76 /* Module macros. */
77 /*===========================================================================*/
78 
79 /*===========================================================================*/
80 /* External declarations. */
81 /*===========================================================================*/
82 
83 #ifdef __cplusplus
84 extern "C" {
85 #endif
88 #ifdef __cplusplus
89 }
90 #endif
91 
92 /*===========================================================================*/
93 /* Module inline functions. */
94 /*===========================================================================*/
95 
96 /**
97  * @brief Runtime Faults Collection Unit initialization.
98  * @note Internal use only.
99  *
100  * @param[out] rfcup pointer to the @p rfcu_t structure
101  *
102  * @notapi
103  */
104 static inline void __rfcu_object_init(rfcu_t *rfcup) {
105 
106  rfcup->mask = (rfcu_mask_t)0;
107 }
108 
109 #endif /* CHRFCU_H */
110 
111 /** @} */
ch_rfcu::mask
rfcu_mask_t mask
Mask of the pending runtime faults.
Definition: chrfcu.h:72
ch_rfcu
Type of an RFCU structure.
Definition: chrfcu.h:68
chRFCUGetAndClearFaultsI
rfcu_mask_t chRFCUGetAndClearFaultsI(rfcu_mask_t mask)
Returns the current faults mask clearing it.
Definition: chrfcu.c:79
chRFCUCollectFaultsI
void chRFCUCollectFaultsI(rfcu_mask_t mask)
Adds fault flags to the current mask.
Definition: chrfcu.c:60
rfcu_t
struct ch_rfcu rfcu_t
Type of an RFCU structure.
rfcu_mask_t
uint32_t rfcu_mask_t
Type of a faults mask.
Definition: chrfcu.h:63
__rfcu_object_init
static void __rfcu_object_init(rfcu_t *rfcup)
Runtime Faults Collection Unit initialization.
Definition: chrfcu.h:104