diff options
author | siddhu8990 | 2016-08-18 15:47:18 +0530 |
---|---|---|
committer | siddhu8990 | 2016-08-18 15:47:18 +0530 |
commit | c8fd6991786ccddb44547b619178bb391f3f9b96 (patch) | |
tree | cd1cacd7796d85875e8b2bb15780902c55f42db1 /macros/Hardware/RasberryPi | |
parent | 24fbba33153e7758df4a990cb4c21ae8e53e6f3e (diff) | |
download | Scilab2C_fossee_old-c8fd6991786ccddb44547b619178bb391f3f9b96.tar.gz Scilab2C_fossee_old-c8fd6991786ccddb44547b619178bb391f3f9b96.tar.bz2 Scilab2C_fossee_old-c8fd6991786ccddb44547b619178bb391f3f9b96.zip |
RPi-PWM and basic imaage processing
Diffstat (limited to 'macros/Hardware/RasberryPi')
16 files changed, 120 insertions, 2 deletions
diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin Binary files differindex 960068e..0c64927 100644 --- a/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin +++ b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci b/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci index fe4edb1..a791f1e 100644 --- a/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci +++ b/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/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin b/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin Binary files differindex 1de4e22..1f20deb 100644 --- a/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin +++ b/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin diff --git a/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci b/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci index aede0b7..460a417 100644 --- a/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci +++ b/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/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin Binary files differnew file mode 100644 index 0000000..1efe080 --- /dev/null +++ b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci new file mode 100644 index 0000000..3c05030 --- /dev/null +++ b/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/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin Binary files differnew file mode 100644 index 0000000..075d6e6 --- /dev/null +++ b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci new file mode 100644 index 0000000..2ab697b --- /dev/null +++ b/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/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin Binary files differnew file mode 100644 index 0000000..8ded270 --- /dev/null +++ b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci new file mode 100644 index 0000000..cb7dd67 --- /dev/null +++ b/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/macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin Binary files differnew file mode 100644 index 0000000..9957f3a --- /dev/null +++ b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci new file mode 100644 index 0000000..9f9f797 --- /dev/null +++ b/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/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin b/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin Binary files differindex 9e6dd09..928f28a 100644 --- a/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin +++ b/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin diff --git a/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci b/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci index ce17ea8..0271449 100644 --- a/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci +++ b/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/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib Binary files differindex 40a6b04..d25d944 100644 --- a/macros/Hardware/RasberryPi/lib +++ b/macros/Hardware/RasberryPi/lib diff --git a/macros/Hardware/RasberryPi/names b/macros/Hardware/RasberryPi/names index a97a189..fa64776 100644 --- a/macros/Hardware/RasberryPi/names +++ b/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 |