From dd50e95a8193fb0faa846ccaa971a115ba69e71c Mon Sep 17 00:00:00 2001 From: Sandeep Gupta Date: Wed, 5 Jul 2017 12:41:25 +0530 Subject: LinearAlgebra and MatrixOperation Update --- .../src/c/hardware/rasberrypi/pwm/gRPI_pwmModea.c | 25 ------------------- .../c/hardware/rasberrypi/pwm/u16RPI_pwmClocks.c | 23 ------------------ .../c/hardware/rasberrypi/pwm/u32RPI_pwmRanges.c | 22 ----------------- .../rasberrypi/pwm/u8RPIHardPWMSetClocks.c | 27 +++++++++++++++++++++ .../hardware/rasberrypi/pwm/u8RPIHardPWMSetModes.c | 28 ++++++++++++++++++++++ .../rasberrypi/pwm/u8RPIHardPWMSetRanges.c | 25 +++++++++++++++++++ .../c/hardware/rasberrypi/pwm/u8RPIHardPWMWrites.c | 26 ++++++++++++++++++++ .../hardware/rasberrypi/pwm/u8RPI_pwmToneWrites.c | 17 ------------- .../c/hardware/rasberrypi/pwm/u8RPI_pwmWrites.c | 19 --------------- 9 files changed, 106 insertions(+), 106 deletions(-) delete mode 100644 2.3-1/src/c/hardware/rasberrypi/pwm/gRPI_pwmModea.c delete mode 100644 2.3-1/src/c/hardware/rasberrypi/pwm/u16RPI_pwmClocks.c delete mode 100644 2.3-1/src/c/hardware/rasberrypi/pwm/u32RPI_pwmRanges.c create mode 100644 2.3-1/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetClocks.c create mode 100644 2.3-1/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetModes.c create mode 100644 2.3-1/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetRanges.c create mode 100644 2.3-1/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMWrites.c delete mode 100644 2.3-1/src/c/hardware/rasberrypi/pwm/u8RPI_pwmToneWrites.c delete mode 100644 2.3-1/src/c/hardware/rasberrypi/pwm/u8RPI_pwmWrites.c (limited to '2.3-1/src/c/hardware/rasberrypi/pwm') diff --git a/2.3-1/src/c/hardware/rasberrypi/pwm/gRPI_pwmModea.c b/2.3-1/src/c/hardware/rasberrypi/pwm/gRPI_pwmModea.c deleted file mode 100644 index da67a15c..00000000 --- a/2.3-1/src/c/hardware/rasberrypi/pwm/gRPI_pwmModea.c +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (C) 2016 - IIT Bombay - FOSSEE - - This file must be used under the terms of the CeCILL. - This source file is licensed as described in the file COPYING, which - you should have received as part of this distribution. The terms - are also available at - http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - Author: Siddhesh Wani, Jorawar Singh - Organization: FOSSEE, IIT Bombay - Email: toolbox@scilab.in -*/ - -#include "RPIPeripheralPWM.h" - -/*Function to set mode for PWM channel. Two modes are available - "bal" --> balanced mode - "ms" --> mark/space mode - */ - -void gRPI_pwmModea(char* mode,int size){ - if (mode[0] == 'm') /*mark/space mode*/ - pwmSetMode(0); - else if (mode[0] == 'b') - pwmSetMode(1); -} diff --git a/2.3-1/src/c/hardware/rasberrypi/pwm/u16RPI_pwmClocks.c b/2.3-1/src/c/hardware/rasberrypi/pwm/u16RPI_pwmClocks.c deleted file mode 100644 index 85e1fb2b..00000000 --- a/2.3-1/src/c/hardware/rasberrypi/pwm/u16RPI_pwmClocks.c +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright (C) 2016 - IIT Bombay - FOSSEE - - This file must be used under the terms of the CeCILL. - This source file is licensed as described in the file COPYING, which - you should have received as part of this distribution. The terms - are also available at - http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - Author: Siddhesh Wani, Jorawar Singh - Organization: FOSSEE, IIT Bombay - Email: toolbox@scilab.in -*/ - -#include "RPIPeripheralPWM.h" - -/*Function to set clock for pwm channel. Default clock is 19.2 MHz. 'clk_divisor' - along with range decides frequency for PWM - PWM frequency = 19.2 MHz / clk_divisor/ range - Range for clk_divisor = 1-2048 -*/ - -void u16RPI_pwmClocks(uint16 divisor){ - pwmSetClock(divisor); -} diff --git a/2.3-1/src/c/hardware/rasberrypi/pwm/u32RPI_pwmRanges.c b/2.3-1/src/c/hardware/rasberrypi/pwm/u32RPI_pwmRanges.c deleted file mode 100644 index 1fb22963..00000000 --- a/2.3-1/src/c/hardware/rasberrypi/pwm/u32RPI_pwmRanges.c +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (C) 2016 - IIT Bombay - FOSSEE - - This file must be used under the terms of the CeCILL. - This source file is licensed as described in the file COPYING, which - you should have received as part of this distribution. The terms - are also available at - http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - Author: Siddhesh Wani, Jorawar Singh - Organization: FOSSEE, IIT Bombay - Email: toolbox@scilab.in -*/ - -#include "RPIPeripheralPWM.h" - -/*Function to assign pwm duty to specified pin. PWM duty is decided by 'value' - and 'range' specified using corresponding function. - PWM duty = value/range - */ - -void u32RPI_pwmRanges(uint32 value){ - pwmSetRange(value); -} diff --git a/2.3-1/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetClocks.c b/2.3-1/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetClocks.c new file mode 100644 index 00000000..d06b135c --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetClocks.c @@ -0,0 +1,27 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/*Function to set clock for pwm channel. Default clock is 19.2 MHz. 'clk_divisor' + along with range decides frequency for PWM + PWM frequency = 19.2 MHz / clk_divisor/ range + Range for clk_divisor = 1-2048 + */ + +#include "types.h" +#include "RPIPeripheralPWM.h" + +void u8RPIHardPWMSetClocks(uint16 clk_divisor) +{ + pwmSetClock(clk_divisor); + + +} diff --git a/2.3-1/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetModes.c b/2.3-1/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetModes.c new file mode 100644 index 00000000..0cca7a70 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetModes.c @@ -0,0 +1,28 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/*Function to set mode for PWM channel. Two modes are available + 0 --> balanced mode + 1 --> mark/space mode + */ + +#include "types.h" +#include "RPIPeripheralPWM.h" + +void u8RPIHardPWMSetModes(uint8 mode) +{ + if (mode == 1) /*mark/space mode*/ + pwmSetMode(PWM_MODE_MS); + else + pwmSetMode(PWM_MODE_BAL); + +} diff --git a/2.3-1/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetRanges.c b/2.3-1/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetRanges.c new file mode 100644 index 00000000..b2489f59 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetRanges.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/*Function to assigne pwm duty to specified pin. PWM duty is decided by 'value' + and 'range' specified using corresponding function. + PWM duty = value/range + */ + +#include "types.h" +#include "RPIPeripheralPWM.h" + +void u8RPIHardPWMSetRanges(uint16 value) +{ + pwmSetRange(value); + +} diff --git a/2.3-1/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMWrites.c b/2.3-1/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMWrites.c new file mode 100644 index 00000000..ae02bf0d --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMWrites.c @@ -0,0 +1,26 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/*Function to set range for pwm channel. PWM duty is decided by 'range' + and 'value' specified using corresponding function. + PWM duty = value/range + */ + +#include "types.h" +#include "RPIPeripheralPWM.h" +#include "RPIPeripheralDigital.h" + +void u8RPIHardPWMWrites(uint8 pin, uint16 value) +{ + pwmWrite((int)phy_pin[pin-1], value); + +} diff --git a/2.3-1/src/c/hardware/rasberrypi/pwm/u8RPI_pwmToneWrites.c b/2.3-1/src/c/hardware/rasberrypi/pwm/u8RPI_pwmToneWrites.c deleted file mode 100644 index fe1b8cd2..00000000 --- a/2.3-1/src/c/hardware/rasberrypi/pwm/u8RPI_pwmToneWrites.c +++ /dev/null @@ -1,17 +0,0 @@ -/* Copyright (C) 2016 - IIT Bombay - FOSSEE - - This file must be used under the terms of the CeCILL. - This source file is licensed as described in the file COPYING, which - you should have received as part of this distribution. The terms - are also available at - http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - Author: Siddhesh Wani, Jorawar Singh - Organization: FOSSEE, IIT Bombay - Email: toolbox@scilab.in -*/ - -#include "RPIPeripheralPWM.h" - -void u8RPI_pwmToneWrites(uint8 pin, uint16 value){ - pwmToneWrite(pin, value); -} diff --git a/2.3-1/src/c/hardware/rasberrypi/pwm/u8RPI_pwmWrites.c b/2.3-1/src/c/hardware/rasberrypi/pwm/u8RPI_pwmWrites.c deleted file mode 100644 index be94e73e..00000000 --- a/2.3-1/src/c/hardware/rasberrypi/pwm/u8RPI_pwmWrites.c +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright (C) 2016 - IIT Bombay - FOSSEE - - This file must be used under the terms of the CeCILL. - This source file is licensed as described in the file COPYING, which - you should have received as part of this distribution. The terms - are also available at - http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - Author: Siddhesh Wani, Jorawar Singh - Organization: FOSSEE, IIT Bombay - Email: toolbox@scilab.in -*/ - -#include "RPIPeripheralPWM.h" - -/*Function to write the given value to the pwm pin*/ - -void u8RPI_pwmWrites(uint8 pin, uint16 value){ - pwmWrite(pin, value); -} -- cgit