ChibiOS/RT 7.0.6
chrfcu.h
Go to the documentation of this file.
1/*
2 ChibiOS - Copyright (C) 2006-2026 Giovanni Di Sirio.
3
4 This file is part of ChibiOS.
5
6 ChibiOS is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation version 3 of the License.
9
10 ChibiOS 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
19/**
20 * @file rt/include/chrfcu.h
21 * @brief Runtime Faults Collection Unit macros and structures.
22 *
23 * @addtogroup rfcu
24 * @{
25 */
26
27#ifndef CHRFCU_H
28#define CHRFCU_H
29
30/*===========================================================================*/
31/* Module constants. */
32/*===========================================================================*/
33
34/**
35 * @name Predefined Faults
36 * @{
37 */
38#define CH_RFCU_VT_INSUFFICIENT_DELTA 1U
39#define CH_RFCU_VT_SKIPPED_DEADLINE 2U
40/** @} */
41
42/**
43 * @brief Mask of all faults.
44 */
45#define CH_RFCU_ALL_FAULTS ((rfcu_mask_t)-1)
46
47/*===========================================================================*/
48/* Module pre-compile time settings. */
49/*===========================================================================*/
50
51/*===========================================================================*/
52/* Derived constants and error checks. */
53/*===========================================================================*/
54
55/*===========================================================================*/
56/* Module data structures and types. */
57/*===========================================================================*/
58
59/**
60 * @brief Type of a faults mask.
61 */
62typedef uint32_t rfcu_mask_t;
63
64/**
65 * @brief Type of an RFCU structure.
66 */
67typedef struct ch_rfcu {
68 /**
69 * @brief Mask of the pending runtime faults.
70 */
73
74/*===========================================================================*/
75/* Module macros. */
76/*===========================================================================*/
77
78/*===========================================================================*/
79/* External declarations. */
80/*===========================================================================*/
81
82#ifdef __cplusplus
83extern "C" {
84#endif
87#ifdef __cplusplus
88}
89#endif
90
91/*===========================================================================*/
92/* Module inline functions. */
93/*===========================================================================*/
94
95/**
96 * @brief Runtime Faults Collection Unit initialization.
97 * @note Internal use only.
98 *
99 * @param[out] rfcup pointer to the @p rfcu_t structure
100 *
101 * @notapi
102 */
103static inline void __rfcu_object_init(rfcu_t *rfcup) {
104
105 rfcup->mask = (rfcu_mask_t)0;
106}
107
108#endif /* CHRFCU_H */
109
110/** @} */
void chRFCUCollectFaultsI(rfcu_mask_t mask)
Adds fault flags to the current mask.
Definition chrfcu.c:59
uint32_t rfcu_mask_t
Type of a faults mask.
Definition chrfcu.h:62
rfcu_mask_t chRFCUGetAndClearFaultsI(rfcu_mask_t mask)
Returns the current faults mask clearing it.
Definition chrfcu.c:78
static void __rfcu_object_init(rfcu_t *rfcup)
Runtime Faults Collection Unit initialization.
Definition chrfcu.h:103
struct ch_rfcu rfcu_t
Type of an RFCU structure.
Type of an RFCU structure.
Definition chrfcu.h:67
rfcu_mask_t mask
Mask of the pending runtime faults.
Definition chrfcu.h:71