@@ -78,9 +78,25 @@ class InterruptIn {
78
78
* The function object created for 'fptr'
79
79
*/
80
80
pFunctionPointer_t rise (void (*fptr)(void ));
81
+
82
+ /* * Add a function to be called when a rising edge occurs at the end of the call chain
83
+ *
84
+ * @param fptr the function to add
85
+ *
86
+ * @returns
87
+ * The function object created for 'fptr'
88
+ */
81
89
pFunctionPointer_t rise_add (void (*fptr)(void )) {
82
90
return rise_add_common (fptr);
83
91
}
92
+
93
+ /* * Add a function to be called when a rising edge occurs at the beginning of the call chain
94
+ *
95
+ * @param fptr the function to add
96
+ *
97
+ * @returns
98
+ * The function object created for 'fptr'
99
+ */
84
100
pFunctionPointer_t rise_add_front (void (*fptr)(void )) {
85
101
return rise_add_common (fptr, true );
86
102
}
@@ -101,26 +117,68 @@ class InterruptIn {
101
117
return pf;
102
118
}
103
119
120
+ /* * Add a function to be called when a rising edge occurs at the end of the call chain
121
+ *
122
+ * @param tptr pointer to the object to call the member function on
123
+ * @param mptr pointer to the member function to be called
124
+ *
125
+ * @returns
126
+ * The function object created for 'tptr' and 'mptr'
127
+ */
104
128
template <typename T>
105
129
pFunctionPointer_t rise_add (T* tptr, void (T::*mptr)(void )) {
106
130
return rise_add_common (tptr, mptr);
107
131
}
108
132
133
+ /* * Add a function to be called when a rising edge occurs at the beginning of the call chain
134
+ *
135
+ * @param tptr pointer to the object to call the member function on
136
+ * @param mptr pointer to the member function to be called
137
+ *
138
+ * @returns
139
+ * The function object created for 'tptr' and 'mptr'
140
+ */
109
141
template <typename T>
110
142
pFunctionPointer_t rise_add_front (T* tptr, void (T::*mptr)(void )) {
111
143
return rise_add_common (tptr, mptr, true );
112
144
}
113
145
146
+ /* * Remove a function from the list of functions to be called when a rising edge occurs
147
+ *
148
+ * @param pf the function object to remove
149
+ *
150
+ * @returns
151
+ * true if the function was found and removed, false otherwise
152
+ */
114
153
bool rise_remove (pFunctionPointer_t pf);
115
154
116
155
/* * Attach a function to call when a falling edge occurs on the input
117
156
*
118
157
* @param fptr A pointer to a void function, or 0 to set as none
158
+ *
159
+ * @returns
160
+ * The function object created for 'fptr'
119
161
*/
120
162
pFunctionPointer_t fall (void (*fptr)(void ));
163
+
164
+ /* * Add a function to be called when a falling edge occurs at the end of the call chain
165
+ *
166
+ * @param fptr the function to add
167
+ *
168
+ * @returns
169
+ * The function object created for 'fptr'
170
+ */
121
171
pFunctionPointer_t fall_add (void (*fptr)(void )) {
122
172
return fall_add_common (fptr);
123
173
}
174
+
175
+ /* * Add a function to be called when a falling edge occurs at the beginning of the call chain
176
+ *
177
+ * @param fptr the function to add
178
+ *
179
+ * @returns
180
+ * The function object created for 'fptr'
181
+ */
124
182
pFunctionPointer_t fall_add_front (void (*fptr)(void )) {
125
183
return fall_add_common (fptr, true );
126
184
}
@@ -129,6 +187,9 @@ class InterruptIn {
129
187
*
130
188
* @param tptr pointer to the object to call the member function on
131
189
* @param mptr pointer to the member function to be called
190
+ *
191
+ * @returns
192
+ * The function object created for 'tptr' and 'mptr'
132
193
*/
133
194
template <typename T>
134
195
pFunctionPointer_t fall (T* tptr, void (T::*mptr)(void )) {
@@ -137,15 +198,40 @@ class InterruptIn {
137
198
gpio_irq_set (&gpio_irq, IRQ_FALL, 1 );
138
199
return pf;
139
200
}
201
+
202
+ /* * Add a function to be called when a falling edge occurs at the end of the call chain
203
+ *
204
+ * @param tptr pointer to the object to call the member function on
205
+ * @param mptr pointer to the member function to be called
206
+ *
207
+ * @returns
208
+ * The function object created for 'tptr' and 'mptr'
209
+ */
140
210
template <typename T>
141
211
pFunctionPointer_t fall_add (T* tptr, void (T::*mptr)(void )) {
142
212
return fall_add_common (tptr, mptr);
143
213
}
214
+
215
+ /* * Add a function to be called when a falling edge occurs at the beginning of the call chain
216
+ *
217
+ * @param tptr pointer to the object to call the member function on
218
+ * @param mptr pointer to the member function to be called
219
+ *
220
+ * @returns
221
+ * The function object created for 'tptr' and 'mptr'
222
+ */
144
223
template <typename T>
145
224
pFunctionPointer_t fall_add_front (T* tptr, void (T::*mptr)(void )) {
146
225
return fall_add_common (tptr, mptr, true );
147
226
}
148
227
228
+ /* * Remove a function from the list of functions to be called when a falling edge occurs
229
+ *
230
+ * @param pf the function object to remove
231
+ *
232
+ * @returns
233
+ * true if the function was found and removed, false otherwise
234
+ */
149
235
bool fall_remove (pFunctionPointer_t pf);
150
236
151
237
/* * Set the input pin mode
0 commit comments