changeset 310:02c4ca0e3718 prerelease

Renamed pinModeFrame -> pinMode
author andrewm
date Fri, 27 May 2016 18:29:20 +0100
parents 6b717992c8d2
children 493a07f6ec09
files core/PulseIn.cpp examples/7segment/render.cpp examples/analogDigitalDemo/render.cpp examples/basic_blink/render.cpp examples/basic_button/render.cpp examples/basic_pulseIn/render.cpp examples/gpioAnalogLoopbackTest/render.cpp examples/level_meter/render.cpp examples/stepper/render.cpp include/Utilities.h
diffstat 10 files changed, 23 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/core/PulseIn.cpp	Fri May 27 18:26:45 2016 +0100
+++ b/core/PulseIn.cpp	Fri May 27 18:29:20 2016 +0100
@@ -13,7 +13,7 @@
 	_pulseOnState = direction == 1 ? 1 : 0;
 	_array.resize(context->digitalFrames);
 	_lastContext = (uint64_t)-1;
-	pinModeFrame(context, 0, digitalInput, INPUT); //context is used to allocate the number of elements in the array
+	pinMode(context, 0, digitalInput, INPUT); //context is used to allocate the number of elements in the array
 }
 
 void PulseIn::check(BelaContext* context){
--- a/examples/7segment/render.cpp	Fri May 27 18:26:45 2016 +0100
+++ b/examples/7segment/render.cpp	Fri May 27 18:29:20 2016 +0100
@@ -58,7 +58,7 @@
 	}
 	
 	for(int i = 0; i < NUM_PINS; i++) {
-		pinModeFrame(context, 0, kPins[i], OUTPUT);
+		pinMode(context, 0, kPins[i], OUTPUT);
 	}
 
 	return true;
--- a/examples/analogDigitalDemo/render.cpp	Fri May 27 18:26:45 2016 +0100
+++ b/examples/analogDigitalDemo/render.cpp	Fri May 27 18:29:20 2016 +0100
@@ -56,7 +56,7 @@
         digitalWrite(context, 2, P8_08, GPIO_LOW);
         digitalWrite(context, 4, P8_08, GPIO_HIGH);
         digitalWrite(context, 5, P8_08, GPIO_LOW);
-        pinModeFrame(context, 0, P9_16, GPIO_INPUT); // set channel 10 to input
+        pinMode(context, 0, P9_16, GPIO_INPUT); // set channel 10 to input
         // in this buffer the frames of channel 1 will look like this: 1 1 0 0 1 0 0 0 .... 0
         // in the next buffer each frame of channel 1 will be initialized to 0 (the last value of this buffer)
 	}
@@ -70,7 +70,7 @@
         context->digital[n]=context->digital[n] | ( ((context->audioSampleCount&0b1111111)<<(16+2)) ) ;  // set the bits in the higher word to the desired output value, keeping the lower word unchanged
         digitalWrite(context, n, P8_29, digitalRead(context, n, P8_30)); // echo the input from from channel 15 to channel 14
         digitalWrite(context, n, P8_28, digitalRead(context, n, P9_16)); // echo the input from from channel 10 to channel 13
-        pinModeFrame(context, 0, P8_30, 0); //set channel 15 to input
+        pinMode(context, 0, P8_30, 0); //set channel 15 to input
 	}
 
 	for(unsigned int n=0; n<context->analogFrames; n++){
--- a/examples/basic_blink/render.cpp	Fri May 27 18:26:45 2016 +0100
+++ b/examples/basic_blink/render.cpp	Fri May 27 18:29:20 2016 +0100
@@ -14,7 +14,7 @@
 
 bool setup(BelaContext *context, void *userData)
 {
-    pinModeFrame(context, 0, P8_07, OUTPUT);
+    pinMode(context, 0, P8_07, OUTPUT);
 	return true;
 }
 
--- a/examples/basic_button/render.cpp	Fri May 27 18:26:45 2016 +0100
+++ b/examples/basic_button/render.cpp	Fri May 27 18:29:20 2016 +0100
@@ -21,8 +21,8 @@
 
 bool setup(BelaContext *context, void *userData)
 {
-	pinModeFrame(context, 0, P8_08, INPUT);
-	pinModeFrame(context, 0, P8_07, OUTPUT);
+	pinMode(context, 0, P8_08, INPUT);
+	pinMode(context, 0, P8_07, OUTPUT);
 	return true;
 }
 
--- a/examples/basic_pulseIn/render.cpp	Fri May 27 18:26:45 2016 +0100
+++ b/examples/basic_pulseIn/render.cpp	Fri May 27 18:29:20 2016 +0100
@@ -28,7 +28,7 @@
 
 bool setup(BelaContext *context, void *userData)
 {
-	pinModeFrame(context, 0, gDigitalOutPin, OUTPUT);
+	pinMode(context, 0, gDigitalOutPin, OUTPUT);
 	pulseIn.init(context, gPulseInPin, 1); //third parameter is direction
 	return true;
 }
--- a/examples/gpioAnalogLoopbackTest/render.cpp	Fri May 27 18:26:45 2016 +0100
+++ b/examples/gpioAnalogLoopbackTest/render.cpp	Fri May 27 18:29:20 2016 +0100
@@ -34,9 +34,9 @@
 			context->analogChannels, context->audioFrames);
 
 	for(unsigned int n = 0; n < context->digitalFrames; n++){
-		pinModeFrame(context, n, gDigitalInACh, INPUT);
-		pinModeFrame(context, n, gDigitalInDCh, INPUT);
-		pinModeFrame(context, n, gDigitalOutCh, OUTPUT);
+		pinMode(context, n, gDigitalInACh, INPUT);
+		pinMode(context, n, gDigitalInDCh, INPUT);
+		pinMode(context, n, gDigitalOutCh, OUTPUT);
 	}
 	switch (context->analogChannels){
 		case 2:
--- a/examples/level_meter/render.cpp	Fri May 27 18:26:45 2016 +0100
+++ b/examples/level_meter/render.cpp	Fri May 27 18:29:20 2016 +0100
@@ -60,7 +60,7 @@
 	
 	for(int i = 0; i < NUMBER_OF_SEGMENTS; i++) {
 		gSamplesToLight[i] = 0;
-		pinModeFrame(context, 0, i, OUTPUT);
+		pinMode(context, 0, i, OUTPUT);
 	}
 
 	return true;
--- a/examples/stepper/render.cpp	Fri May 27 18:26:45 2016 +0100
+++ b/examples/stepper/render.cpp	Fri May 27 18:29:20 2016 +0100
@@ -58,11 +58,11 @@
 		return false;
 	}
 	
-	pinModeFrame(context, 0, gPinA1, OUTPUT);
-	pinModeFrame(context, 0, gPinA2, OUTPUT);
-	pinModeFrame(context, 0, gPinB1, OUTPUT);
-	pinModeFrame(context, 0, gPinB2, OUTPUT);
-	pinModeFrame(context, 0, gPinServo, OUTPUT);
+	pinMode(context, 0, gPinA1, OUTPUT);
+	pinMode(context, 0, gPinA2, OUTPUT);
+	pinMode(context, 0, gPinB1, OUTPUT);
+	pinMode(context, 0, gPinB2, OUTPUT);
+	pinMode(context, 0, gPinServo, OUTPUT);
 		
 	return true;
 }
--- a/include/Utilities.h	Fri May 27 18:26:45 2016 +0100
+++ b/include/Utilities.h	Fri May 27 18:29:20 2016 +0100
@@ -225,7 +225,7 @@
  * digital_gpio_mapping.h.
  * \param value Direction of the pin (\c INPUT or \c OUTPUT).
  */
-static inline void pinModeFrame(BelaContext *context, int frame, int channel, int mode);
+static inline void pinMode(BelaContext *context, int frame, int channel, int mode);
 
 /**
  * \brief Set the direction of a digital pin to input or output.
@@ -243,7 +243,7 @@
  * digital_gpio_mapping.h.
  * \param value Direction of the pin (\c INPUT or \c OUTPUT).
  */
-static inline void pinModeFrameOnce(BelaContext *context, int frame, int channel, int mode);
+static inline void pinModeOnce(BelaContext *context, int frame, int channel, int mode);
 
 /** @} */
 
@@ -365,10 +365,10 @@
 		context->digital[frame] &= ~(1 << (channel + 16));
 }
 
-// pinModeFrame()
+// pinMode()
 //
 // Sets the direction of a digital pin for the current frame and all subsequent frames
-static inline void pinModeFrame(BelaContext *context, int frame, int channel, int mode) {
+static inline void pinMode(BelaContext *context, int frame, int channel, int mode) {
 	for(unsigned int f = frame; f < context->digitalFrames; f++) {
 		if(mode == INPUT)
 			context->digital[f] |= (1 << channel);
@@ -377,10 +377,10 @@
 	}
 }
 
-// pinModeFrameOnce()
+// pinModeOnce()
 //
 // Sets the direction of a digital pin for the current frame only
-static inline void pinModeFrameOnce(BelaContext *context, int frame, int channel, int mode) {
+static inline void pinModeOnce(BelaContext *context, int frame, int channel, int mode) {
 	if(mode == INPUT)
 		context->digital[frame] |= (1 << channel);
 	else