OS  v7.3.3
Documentation
Loading...
Searching...
No Matches
qedgecheck.h
1
9#ifndef QEDGECHECK_H
10 #define QEDGECHECK_H
11
12 #include "qtypes.h"
13 #include "qclock.h"
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 #ifndef Q_EDGE_CHECK_IOGROUPS
20 #define Q_EDGE_CHECK_IOGROUPS ( 1 )
21 #endif
22
30 #define QREG_8BIT _qReg_08Bits
31
33 #define QREG_16BIT _qReg_16Bits
34
36 #define QREG_32BIT _qReg_32Bits
41 typedef struct _qEdgeCheck_IONode_s { // skipcq: CXX-E2000
43 struct _qEdgeCheck_IONode_Private_s { // skipcq: CXX-E2000
44 struct _qEdgeCheck_IONode_s *next; /*< Point to the next node of the IO list. */
45 void *xPort; /*< Point to the address of the hardware PORT/IO register. */
46 qBool_t prevPinValue; /*< The previous value of "Pin". */
47 qBool_t status; /*< The status of the pin. */
48 qBool_t xPin; /*< The specific pin to read. */
49 }
50 qPrivate;
52 }
54
58 typedef qBool_t (*qCoreRegSize_t)(const void* arg1, qBool_t arg2);
59
64 typedef struct _qEdgeCheck_s { // skipcq: CXX-E2000
66 struct _qEdgeCheck_Private_s { // skipcq: CXX-E2000
67 void (*state)( struct _qEdgeCheck_s * const ec );
68 qEdgeCheck_IONode_t *head; /*< The first io-node in the list. */
69 qClock_t start, debounceTime; /*< Debounce time control*/
70 qCoreRegSize_t reader; /*< The xBits reg-reader function*/
71 }
72 qPrivate;
74 }
76
78 /*cppcheck-suppress misra-c2012-20.7 */
79 #define _QEDGECHECK_REG_FCN_DEC(NAME) /* skipcq: CXX-E2000 */\
80 qBool_t NAME( const void *addr, qBool_t pinNumber ) \
81
82 _QEDGECHECK_REG_FCN_DEC( _qReg_32Bits );
83 _QEDGECHECK_REG_FCN_DEC( _qReg_16Bits );
84 _QEDGECHECK_REG_FCN_DEC( _qReg_08Bits );
97 const qCoreRegSize_t rSize,
98 const qClock_t debounceTime );
99
110 qEdgeCheck_IONode_t * const n,
111 void *portAddress,
112 const qBool_t pinNumber );
113
121
129
137 const qBool_t pinNumber );
138
141 #ifdef __cplusplus
142 }
143 #endif
144
145#endif
qUINT32_t qClock_t
A 32-bit unsigned integer to hold ticks count. Epochs counter.
Definition qclock.h:66
qBool_t qEdgeCheck_Add_Node(qEdgeCheck_t *const ec, qEdgeCheck_IONode_t *const n, void *portAddress, const qBool_t pinNumber)
Add an input node to the Edge-Check instance.
qBool_t qEdgeCheck_Set_NodePin(qEdgeCheck_IONode_t *const n, const qBool_t pinNumber)
Set/Change the pin number for the provided node.
qBool_t qEdgeCheck_Setup(qEdgeCheck_t *const ec, const qCoreRegSize_t rSize, const qClock_t debounceTime)
Initialize a I/O Edge-Check instance.
qBool_t qEdgeCheck_Update(qEdgeCheck_t *const ec)
Update the status of all nodes inside the I/O Edge-Check instance (Non-Blocking call).
qBool_t(* qCoreRegSize_t)(const void *arg1, qBool_t arg2)
A typedef to specify the I/O register size.
Definition qedgecheck.h:58
qBool_t qEdgeCheck_Get_NodeStatus(const qEdgeCheck_IONode_t *const n)
Query the status of the specified input-node.
qUINT8_t qBool_t
A type to instantiate an OS boolean variable.
Definition qtypes.h:139
An input node object for edge checking.
Definition qedgecheck.h:41
An I/O edge check object.
Definition qedgecheck.h:64