comparison include/Utilities.h @ 310:02c4ca0e3718 prerelease

Renamed pinModeFrame -> pinMode
author andrewm
date Fri, 27 May 2016 18:29:20 +0100
parents 1feb9c23ac57
children 5c8f46fcd4d0
comparison
equal deleted inserted replaced
309:6b717992c8d2 310:02c4ca0e3718
223 * \param channel Which digital output to write. 16 pins across the P8 and P9 headers of the 223 * \param channel Which digital output to write. 16 pins across the P8 and P9 headers of the
224 * BeagleBone Black are available. See the constants P8_xx and P9_xx defined in 224 * BeagleBone Black are available. See the constants P8_xx and P9_xx defined in
225 * digital_gpio_mapping.h. 225 * digital_gpio_mapping.h.
226 * \param value Direction of the pin (\c INPUT or \c OUTPUT). 226 * \param value Direction of the pin (\c INPUT or \c OUTPUT).
227 */ 227 */
228 static inline void pinModeFrame(BelaContext *context, int frame, int channel, int mode); 228 static inline void pinMode(BelaContext *context, int frame, int channel, int mode);
229 229
230 /** 230 /**
231 * \brief Set the direction of a digital pin to input or output. 231 * \brief Set the direction of a digital pin to input or output.
232 * 232 *
233 * This function sets the direction of a digital pin, at the time indicated by \c frame. 233 * This function sets the direction of a digital pin, at the time indicated by \c frame.
241 * \param channel Which digital output to write. 16 pins across the P8 and P9 headers of the 241 * \param channel Which digital output to write. 16 pins across the P8 and P9 headers of the
242 * BeagleBone Black are available. See the constants P8_xx and P9_xx defined in 242 * BeagleBone Black are available. See the constants P8_xx and P9_xx defined in
243 * digital_gpio_mapping.h. 243 * digital_gpio_mapping.h.
244 * \param value Direction of the pin (\c INPUT or \c OUTPUT). 244 * \param value Direction of the pin (\c INPUT or \c OUTPUT).
245 */ 245 */
246 static inline void pinModeFrameOnce(BelaContext *context, int frame, int channel, int mode); 246 static inline void pinModeOnce(BelaContext *context, int frame, int channel, int mode);
247 247
248 /** @} */ 248 /** @} */
249 249
250 /** 250 /**
251 * \defgroup wiring Wiring language support 251 * \defgroup wiring Wiring language support
363 context->digital[frame] |= 1 << (channel + 16); 363 context->digital[frame] |= 1 << (channel + 16);
364 else 364 else
365 context->digital[frame] &= ~(1 << (channel + 16)); 365 context->digital[frame] &= ~(1 << (channel + 16));
366 } 366 }
367 367
368 // pinModeFrame() 368 // pinMode()
369 // 369 //
370 // Sets the direction of a digital pin for the current frame and all subsequent frames 370 // Sets the direction of a digital pin for the current frame and all subsequent frames
371 static inline void pinModeFrame(BelaContext *context, int frame, int channel, int mode) { 371 static inline void pinMode(BelaContext *context, int frame, int channel, int mode) {
372 for(unsigned int f = frame; f < context->digitalFrames; f++) { 372 for(unsigned int f = frame; f < context->digitalFrames; f++) {
373 if(mode == INPUT) 373 if(mode == INPUT)
374 context->digital[f] |= (1 << channel); 374 context->digital[f] |= (1 << channel);
375 else 375 else
376 context->digital[f] &= ~(1 << channel); 376 context->digital[f] &= ~(1 << channel);
377 } 377 }
378 } 378 }
379 379
380 // pinModeFrameOnce() 380 // pinModeOnce()
381 // 381 //
382 // Sets the direction of a digital pin for the current frame only 382 // Sets the direction of a digital pin for the current frame only
383 static inline void pinModeFrameOnce(BelaContext *context, int frame, int channel, int mode) { 383 static inline void pinModeOnce(BelaContext *context, int frame, int channel, int mode) {
384 if(mode == INPUT) 384 if(mode == INPUT)
385 context->digital[frame] |= (1 << channel); 385 context->digital[frame] |= (1 << channel);
386 else 386 else
387 context->digital[frame] &= ~(1 << channel); 387 context->digital[frame] &= ~(1 << channel);
388 } 388 }