summaryrefslogtreecommitdiff
path: root/src/c/hardware/rasberrypi/util
diff options
context:
space:
mode:
authorsiddhu89902016-02-01 11:05:35 +0530
committersiddhu89902016-02-01 11:05:35 +0530
commit5df6d1cb2868abdc8df66755f76c997ee36c0b49 (patch)
tree8f6eef9f83437133b0b8d7f16f3b5dd470872aee /src/c/hardware/rasberrypi/util
parent1ff7f5293444b22b46ff7bd51d52a845dc20525c (diff)
downloadScilab2C_fossee_old-5df6d1cb2868abdc8df66755f76c997ee36c0b49.tar.gz
Scilab2C_fossee_old-5df6d1cb2868abdc8df66755f76c997ee36c0b49.tar.bz2
Scilab2C_fossee_old-5df6d1cb2868abdc8df66755f76c997ee36c0b49.zip
Support for RPi gpios added
Diffstat (limited to 'src/c/hardware/rasberrypi/util')
-rw-r--r--src/c/hardware/rasberrypi/util/u16RPIDelayMicros.c29
-rw-r--r--src/c/hardware/rasberrypi/util/u16RPIDelayMillis.c30
2 files changed, 59 insertions, 0 deletions
diff --git a/src/c/hardware/rasberrypi/util/u16RPIDelayMicros.c b/src/c/hardware/rasberrypi/util/u16RPIDelayMicros.c
new file mode 100644
index 0000000..e564d88
--- /dev/null
+++ b/src/c/hardware/rasberrypi/util/u16RPIDelayMicros.c
@@ -0,0 +1,29 @@
+// Function to insert some delay in code execution.
+//
+// Calling Sequence
+// u16RPIDelayMicros(time)
+//
+// Parameters
+// time: time(microseconds) for which execution is to be delayed
+//
+// Description
+// this function can be used for insertig execution delays. 'time' should be
+// specified in microseconds.'time' should be between (1-65536).
+// Note: Delay inserted by this function is not accurate, but depedent on
+// operating system, other running tasks etc.
+//
+// Examples
+// u16RPIDelayMicros(100) //This will delay the execution of next code by 100 ms.
+//
+//
+// Authors
+// Siddhesh Wani
+//
+#include "types.h"
+#include "RPIPeripheralUtil.h"
+
+uint8 u16RPIDelayMicros(uint16 time)
+{
+ bcm2835_delayMicroseconds(time);
+}
+
diff --git a/src/c/hardware/rasberrypi/util/u16RPIDelayMillis.c b/src/c/hardware/rasberrypi/util/u16RPIDelayMillis.c
new file mode 100644
index 0000000..bc2e6dd
--- /dev/null
+++ b/src/c/hardware/rasberrypi/util/u16RPIDelayMillis.c
@@ -0,0 +1,30 @@
+// Function to insert some delay in code execution.
+//
+// Calling Sequence
+// u16RPIDelayMillis(time)
+//
+// Parameters
+// time: time(milliseconds) for which execution is to be delayed
+//
+// Description
+// this function can be used for insertig execution delays. 'time' should be
+// specified in milliseconds.'time' should be between (1-65536).
+// Note: Delay inserted by this function is not accurate, but depedent on
+// operating system, other running tasks etc.
+//
+// Examples
+// u16RPIDelayMillis(100) //This will delay the execution of next code by 100 ms.
+//
+//
+// Authors
+// Siddhesh Wani
+//
+#include "types.h"
+#include "RPIPeripheralUtil.h"
+
+uint8 u16RPIDelayMillis(uint16 time)
+{
+ bcm2835_delay(time);
+
+}
+