summaryrefslogtreecommitdiff
path: root/2.3-1/macros/Hardware
diff options
context:
space:
mode:
authorsiddhu89902016-08-18 15:47:18 +0530
committersiddhu89902016-08-18 15:47:18 +0530
commit1552675d4ac3be8d265bcf089fbc1ac5be1547f9 (patch)
tree4162a70fa63681584c6d5485b08b516e64015569 /2.3-1/macros/Hardware
parent21ab4886b202a52189b398bd9d3137e2a567d62a (diff)
downloadScilab2C-1552675d4ac3be8d265bcf089fbc1ac5be1547f9.tar.gz
Scilab2C-1552675d4ac3be8d265bcf089fbc1ac5be1547f9.tar.bz2
Scilab2C-1552675d4ac3be8d265bcf089fbc1ac5be1547f9.zip
RPi-PWM and basic imaage processing
Diffstat (limited to '2.3-1/macros/Hardware')
-rw-r--r--2.3-1/macros/Hardware/RasberryPi/GetRPISupportFunctions.binbin2784 -> 3184 bytes
-rw-r--r--2.3-1/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci4
-rw-r--r--2.3-1/macros/Hardware/RasberryPi/RPI_DigitalSetup.binbin4884 -> 4964 bytes
-rw-r--r--2.3-1/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci3
-rw-r--r--2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.binbin0 -> 3488 bytes
-rw-r--r--2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci27
-rw-r--r--2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.binbin0 -> 2448 bytes
-rw-r--r--2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci24
-rw-r--r--2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.binbin0 -> 3340 bytes
-rw-r--r--2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci27
-rw-r--r--2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMWrite.binbin0 -> 4628 bytes
-rw-r--r--2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci31
-rw-r--r--2.3-1/macros/Hardware/RasberryPi/RPI_SerialGetChar.binbin3400 -> 3404 bytes
-rw-r--r--2.3-1/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci2
-rw-r--r--2.3-1/macros/Hardware/RasberryPi/libbin1056 -> 1152 bytes
-rw-r--r--2.3-1/macros/Hardware/RasberryPi/names4
16 files changed, 120 insertions, 2 deletions
diff --git a/2.3-1/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin b/2.3-1/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin
index 960068e0..0c64927f 100644
--- a/2.3-1/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin
+++ b/2.3-1/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin
Binary files differ
diff --git a/2.3-1/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci b/2.3-1/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
index fe4edb1c..a791f1e7 100644
--- a/2.3-1/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
+++ b/2.3-1/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
@@ -26,6 +26,10 @@ RPiSupportFunctions = [
"RPI_SerialGetChar"
"RPI_ThreadCreate"
"RPI_PinISR"
+ "RPI_HardPWMWrite"
+ "RPI_HardPWMSetRange"
+ "RPI_HardPWMSetClock"
+ "RPI_HardPWMSetMode"
];
//Note: "RPI_SerialSendData" is removed since distinction between input data
diff --git a/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin b/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin
index 1de4e224..1f20deb2 100644
--- a/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin
+++ b/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin
Binary files differ
diff --git a/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci b/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
index aede0b7a..460a4174 100644
--- a/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
+++ b/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
@@ -6,7 +6,8 @@ function RPI_DigitalSetup(pin, direction)
//
// Parameters
// pin : pin of RPi to be used
-// direction : direction to be set for pin (0 -> INPUT, 1 -> OUTPUT)
+// direction : direction to be set for pin
+// 0 -> INPUT, 1 -> OUTPUT, 2->PWM Output
//
// Description
// There are few pins available on RPi as Gpio or digital io. These pins can be used as digital output or input. Pin name must be provided from list provided. Please refer '' for complete list of pins. Direction can be 0 or 1 depending upon desired function (Input/output)
diff --git a/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin b/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin
new file mode 100644
index 00000000..1efe0803
--- /dev/null
+++ b/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin
Binary files differ
diff --git a/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci b/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci
new file mode 100644
index 00000000..3c050306
--- /dev/null
+++ b/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci
@@ -0,0 +1,27 @@
+function RPI_HardPWMSetClock(clock_divisor)
+// Function to set PWM clock. PWM clock frequency is 19.2MHz, which can be reduced
+// using suitable clock_divisor (1 to 2048, powers of 2)
+//
+// Calling Sequence
+// RPI_HardPWMSetClock(clock_divisor)
+//
+// Parameters
+// clock_divisor: Value can be from 1 to 2048, powers of 2.
+// Description
+// This function decides pwm clock.
+// PWM frequency = (PWM Clock frequency/Clock divisor/range)
+// PWM clock frequency = 19.2 MHz
+// clock divisor is setup using RPI_HardPWMSetClock
+// range is setup using RPI_HardPWMSetRange
+// Examples
+//
+// See also
+// RPI_HardPWMSetWrite RPI_HardPWMSetRange
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+endfunction
diff --git a/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin b/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin
new file mode 100644
index 00000000..075d6e60
--- /dev/null
+++ b/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin
Binary files differ
diff --git a/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci b/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci
new file mode 100644
index 00000000..2ab697bc
--- /dev/null
+++ b/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci
@@ -0,0 +1,24 @@
+function RPI_HardPWMSetMode(pwm_mode)
+// Function to set PWM mode. Two modes are available - balanced and mark/space
+//
+// Calling Sequence
+// RPI_HardPWMSetMode(pwm_mode)
+//
+// Parameters
+// pwm_mode: decides pwm mode
+// 0 -> balanced
+// 1 -> mark/space
+// Description
+// This function decides pwm mode
+// Examples
+//
+// See also
+// RPI_HardPWMSetWrite RPI_HardPWMSetRange
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+endfunction
diff --git a/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin b/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin
new file mode 100644
index 00000000..8ded2709
--- /dev/null
+++ b/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin
Binary files differ
diff --git a/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci b/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci
new file mode 100644
index 00000000..cb7dd67d
--- /dev/null
+++ b/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci
@@ -0,0 +1,27 @@
+function RPI_HardPWMSetRange(range_val)
+// Function to set range value for PWM. Range value along with clock divisor
+// decides pwm frequency. Range value must be less than 1024
+//
+// Calling Sequence
+// RPI_HardPWMSetRange(range_val)
+//
+// Parameters
+// range_val: range for pwm
+// Description
+// This function decides range for pwm.
+// PWM frequency = (PWM Clock frequency/Clock divisor/range)
+// PWM clock frequency = 19.2 MHz
+// clock divisor is setup using RPI_HardPWMSetClock
+// range is setup using RPI_HardPWMSetRange
+// Examples
+//
+// See also
+// RPI_HardPWMSetClock RPI_HardPWMWrite
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+endfunction
diff --git a/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin b/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin
new file mode 100644
index 00000000..9957f3a4
--- /dev/null
+++ b/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin
Binary files differ
diff --git a/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci b/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci
new file mode 100644
index 00000000..9f9f7977
--- /dev/null
+++ b/2.3-1/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci
@@ -0,0 +1,31 @@
+function RPI_HardPWMWrite(pin,value)
+// Function to change pwm duty on specified pin. Hardware PWM is available
+// only on pin 12. So, only '12' should be provided as pin
+//
+// Calling Sequence
+// RPI_HardPWMWrite(12,512) //Value must be smaller than the range set
+// using RPI_HARDPWMSetRange
+//
+// Parameters
+// pin: pin no on which pwm value is to be changed. Currently only 12 is allowed
+// value: pwm value for given pin. This must be less than range value set
+// Description
+// This function changes pwm duty on specified pin. As for RPi, only one pin
+// (pin 12) is available for hardware PWM.
+// PWM frequency = (PWM Clock frequency/Clock divisor/range)
+// PWM clock frequency = 19.2 MHz
+// clock divisor is setup using RPI_HardPWMSetClock
+// range is setup using RPI_HardPWMSetRange
+// Actual PWM duty = value/range
+// Examples
+//
+// See also
+// RPI_HardPWMSetClock RPI_HardPWMSetRange
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+endfunction
diff --git a/2.3-1/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin b/2.3-1/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin
index 9e6dd09a..928f28a3 100644
--- a/2.3-1/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin
+++ b/2.3-1/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin
Binary files differ
diff --git a/2.3-1/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci b/2.3-1/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci
index ce17ea89..0271449d 100644
--- a/2.3-1/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci
+++ b/2.3-1/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci
@@ -2,7 +2,7 @@ function data = RPI_SerialGetChar(fd)
// Function to read data from specified serial port
//
// Calling Sequence
-// RPI_SerialGetCharfd)
+// RPI_SerialGetChar(fd)
//
// Parameters
// fd: file descriptor returned when serial port was opened
diff --git a/2.3-1/macros/Hardware/RasberryPi/lib b/2.3-1/macros/Hardware/RasberryPi/lib
index 40a6b049..d25d9440 100644
--- a/2.3-1/macros/Hardware/RasberryPi/lib
+++ b/2.3-1/macros/Hardware/RasberryPi/lib
Binary files differ
diff --git a/2.3-1/macros/Hardware/RasberryPi/names b/2.3-1/macros/Hardware/RasberryPi/names
index a97a189a..fa647761 100644
--- a/2.3-1/macros/Hardware/RasberryPi/names
+++ b/2.3-1/macros/Hardware/RasberryPi/names
@@ -7,6 +7,10 @@ RPI_DigitalOut
RPI_DigitalSetup
RPI_GetMicros
RPI_GetMillis
+RPI_HardPWMSetClock
+RPI_HardPWMSetMode
+RPI_HardPWMSetRange
+RPI_HardPWMWrite
RPI_PinISR
RPI_SerialClose
RPI_SerialFlush