diff options
Diffstat (limited to '2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo')
40 files changed, 927 insertions, 0 deletions
diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/RPI_adress.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/RPI_adress.c new file mode 100644 index 00000000..3e94b925 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/RPI_adress.c @@ -0,0 +1,13 @@ +/* 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: Jorawar Singh + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "types.h"
\ No newline at end of file diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/RPI_analogRead.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/RPI_analogRead.c new file mode 100644 index 00000000..3e94b925 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/RPI_analogRead.c @@ -0,0 +1,13 @@ +/* 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: Jorawar Singh + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "types.h"
\ No newline at end of file diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/RPI_analogWrite.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/RPI_analogWrite.c new file mode 100644 index 00000000..3e94b925 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/RPI_analogWrite.c @@ -0,0 +1,13 @@ +/* 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: Jorawar Singh + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "types.h"
\ No newline at end of file diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/RPI_commande.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/RPI_commande.c new file mode 100644 index 00000000..3e94b925 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/RPI_commande.c @@ -0,0 +1,13 @@ +/* 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: Jorawar Singh + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "types.h"
\ No newline at end of file diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/RPI_i2cdetect.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/RPI_i2cdetect.c new file mode 100644 index 00000000..3e94b925 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/RPI_i2cdetect.c @@ -0,0 +1,13 @@ +/* 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: Jorawar Singh + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "types.h"
\ No newline at end of file diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/RPI_send.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/RPI_send.c new file mode 100644 index 00000000..3e94b925 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/RPI_send.c @@ -0,0 +1,13 @@ +/* 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: Jorawar Singh + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "types.h"
\ No newline at end of file diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/ISR/i16RPIPinISRs.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/ISR/i16RPIPinISRs.c new file mode 100644 index 00000000..6e398a17 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/ISR/i16RPIPinISRs.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 declare interrupt on pins and corresponding ISRs */ + +#include "types.h" +#include "RPIPeripheralPinISR.h" +#include "RPIPeripheralDigital.h" + +int16 i16RPIPinISRs(uint8 pin, uint8 edgetype, void (*ISRFunction)(void)) +{ + int status; + status = wiringPiISR((int)phy_pin[pin-1], (int) edgetype, ISRFunction); + return status; +} + diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/gpio/RPI_DigitalRead.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/gpio/RPI_DigitalRead.c new file mode 100644 index 00000000..4ab496ea --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/gpio/RPI_DigitalRead.c @@ -0,0 +1,24 @@ +/* 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 +*/ + +/* Function to read the state of the gpio pin */ + +#include "types.h" +#include "RPIPeripheralDigital.h" + +/*pin is reduced by one as array index starts from 0 and pin no starts from 1*/ +uint8 u8RPIDigitalIns(uint8 pin) +{ + uint8 state = 0; + state = digitalRead(phy_pin[pin-1]); + return (state); +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/gpio/RPI_DigitalWrite.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/gpio/RPI_DigitalWrite.c new file mode 100644 index 00000000..259bb3b6 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/gpio/RPI_DigitalWrite.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, Jorawar Singh + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/* Function to change the output state of the gpio pin */ + + +#include "types.h" +#include "RPIPeripheralDigital.h" + +/*pin is reduced by one as array index starts from 0 and pin no starts from 1*/ +void u8RPIDigitalOuts(uint8 pin, uint8 state) +{ + if (state == 0) /*low output*/ + digitalWrite(phy_pin[pin-1], LOW); + if (state == 1) /*high output*/ + digitalWrite(phy_pin[pin-1], HIGH); +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/gpio/RPI_pinMode.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/gpio/RPI_pinMode.c new file mode 100644 index 00000000..8646e8f1 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/gpio/RPI_pinMode.c @@ -0,0 +1,40 @@ +/* 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 +*/ + +/* Function to setup digital pins + direction = 2 -> PWM_output (BCM pin 18 only) + direction = 1 -> output + direction = 0 -> input +*/ + +#include "types.h" +#include "RPIPeripheralDigital.h" + + +/*This array maps pin numbers on RPi board, with pin numbers corrsponding +to WiringPi library*/ +int phy_pin[] = {17, 17, 8, 17, 9, 17, 7, 15, 17, 16, /*Pin 1 to 10*/ + 0, 1, 2, 17, 3, 4, 17, 5, 12, 17, /*Pin 11 to 20*/ + 13, 6, 14, 10, 17, 11, 30, 31, 21, 17, /*Pin 21 to 30*/ + 22, 26, 23, 17, 24, 27, 25, 28, 17, 29 }; /*Pin 31 to 40*/ + +/*pin is reduced by one as arrayiindex starts from 0 and pin no starts from 1*/ +void u8RPIDigitalSetups(uint8 pin, uint8 direction) +{ + if(direction == 1) /*Pin to be used as output*/ + pinMode(phy_pin[pin-1], OUTPUT); + else if(direction == 2) + pinMode(phy_pin[pin-1], PWM_OUTPUT); + else + pinMode(phy_pin[pin-1], INPUT); + +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/pwm/RPI_pwmClock.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/pwm/RPI_pwmClock.c new file mode 100644 index 00000000..0ad575b7 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/pwm/RPI_pwmClock.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, Jorawar Singh + 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/NotYetDone/NotToDo/backup/pwm/RPI_pwmMode.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/pwm/RPI_pwmMode.c new file mode 100644 index 00000000..7679a1ab --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/pwm/RPI_pwmMode.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, Jorawar Singh + 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/NotYetDone/NotToDo/backup/pwm/RPI_pwmRange.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/pwm/RPI_pwmRange.c new file mode 100644 index 00000000..07936b38 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/pwm/RPI_pwmRange.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, Jorawar Singh + 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/NotYetDone/NotToDo/backup/pwm/RPI_pwmWrite.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/pwm/RPI_pwmWrite.c new file mode 100644 index 00000000..a16a1d86 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/pwm/RPI_pwmWrite.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, Jorawar Singh + 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/NotYetDone/NotToDo/backup/serial/dRPISerialSendDataa.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/dRPISerialSendDataa.c new file mode 100644 index 00000000..f9902550 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/dRPISerialSendDataa.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 send double data array/matrix on specified serial port. */ + +#include "types.h" +#include "RPIPeripheralSerial.h" + +void dRPISerialSendDataa(int fd, double* data, int size) +{ + int count = 0; + + for (count = 0; count < size; count++) + { + dRPISerialSendDatas(fd, data[count]); + } + +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/dRPISerialSendDatas.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/dRPISerialSendDatas.c new file mode 100644 index 00000000..39112fc2 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/dRPISerialSendDatas.c @@ -0,0 +1,35 @@ +/* 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 send double data on specified serial port. */ + +#include "types.h" +#include "RPIPeripheralSerial.h" + +void dRPISerialSendDatas(int fd, double data) +{ + uint8 count; + + union double_bytes{ + double double_data; + unsigned char bytes[sizeof(double)]; + } in_data; + + in_data.double_data = data; + + for(count=0; count<sizeof(double); count++) + { + /*Send lsb first*/ + serialPutchar(fd, (uint8) in_data.bytes[count]); + } + +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/gRPISerialSendDatas.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/gRPISerialSendDatas.c new file mode 100644 index 00000000..f4ec8a85 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/gRPISerialSendDatas.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 send string on specified serial port. */ + +#include "types.h" +#include "RPIPeripheralSerial.h" + +void gRPISerialSendDatas(int fd, uint8* data, int size) +{ + int count = 0; + + while(data[count] != '\0') + { + serialPutchar(fd, data[count]); + } + +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/i16RPISerialDataAvails.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/i16RPISerialDataAvails.c new file mode 100644 index 00000000..b56a8196 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/i16RPISerialDataAvails.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 check for data availability at specified port. Returns no of + bytes to be read */ + +#include "types.h" +#include "RPIPeripheralSerial.h" + +int16 i16RPISerialDataAvails(int fd) +{ + int bytes = 0; + bytes = serialDataAvail(fd); + + return bytes; +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/i16RPISerialGetChars.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/i16RPISerialGetChars.c new file mode 100644 index 00000000..18ca2a7a --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/i16RPISerialGetChars.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 read character from spcified serial port (file descriptor). + This function will block execution for 10 secs if no character is available, + and will return -1 in that case*/ + +#include "types.h" +#include "RPIPeripheralSerial.h" + +int16 i16RPISerialGetChars(int fd) +{ + int data = 0; + + data = serialGetchar(fd); + + return data; +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/i16RPISerialSendDataa.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/i16RPISerialSendDataa.c new file mode 100644 index 00000000..24180f41 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/i16RPISerialSendDataa.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 send signed 16-bit data array/matrix on specified serial port. */ + +#include "types.h" +#include "RPIPeripheralSerial.h" + +void i16RPISerialSendDataa(int fd, int16* data, int size) +{ + int count = 0; + + for (count = 0; count < size; ++count) + { + i16RPISerialSendDatas(fd, data[count]); + } + +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/i16RPISerialSendDatas.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/i16RPISerialSendDatas.c new file mode 100644 index 00000000..fe6fe6f4 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/i16RPISerialSendDatas.c @@ -0,0 +1,24 @@ +/* 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 send signed 16-bit byte on specified serial port. */ + +#include "types.h" +#include "RPIPeripheralSerial.h" + +void i16RPISerialSendDatas(int fd, int16 data) +{ + /*Send lsb first*/ + serialPutchar(fd, (uint8) data); + serialPutchar(fd, (uint8) (data>>8)); + +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/i8RPISerialSendDataa.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/i8RPISerialSendDataa.c new file mode 100644 index 00000000..c4dd199c --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/i8RPISerialSendDataa.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 send signed 8-bit byte array/matrix on specified serial port. */ + +#include "types.h" +#include "RPIPeripheralSerial.h" + +void i8RPISerialSendDataa(int fd, int8* data, int size) +{ + int count = 0; + + for (count = 0; count < size; ++count) + { + i8RPISerialSendDatas(fd, data[count]); + } +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/i8RPISerialSendDatas.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/i8RPISerialSendDatas.c new file mode 100644 index 00000000..e637871f --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/i8RPISerialSendDatas.c @@ -0,0 +1,22 @@ +/* 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 send signed 8-bit byte on specified serial port. */ + +#include "types.h" +#include "RPIPeripheralSerial.h" + +void i8RPISerialSendDatas(int fd, int8 data) +{ + serialPutchar(fd, (uint8) data); + +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/sRPISerialSendDataa.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/sRPISerialSendDataa.c new file mode 100644 index 00000000..14c0bc70 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/sRPISerialSendDataa.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 send float data array/matrix on specified serial port. */ + +#include "types.h" +#include "RPIPeripheralSerial.h" + +void sRPISerialSendDataa(int fd, float* data, int size) +{ + int count = 0; + + for (count = 0; count < size; ++count) + { + sRPISerialSendDatas(fd, data[count]); + } + +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/sRPISerialSendDatas.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/sRPISerialSendDatas.c new file mode 100644 index 00000000..ff78dd1f --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/sRPISerialSendDatas.c @@ -0,0 +1,34 @@ +/* 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 send float data on specified serial port. */ + +#include "types.h" +#include "RPIPeripheralSerial.h" + +void sRPISerialSendDatas(int fd, float data) +{ + uint8 count; + + union float_bytes{ + float float_data; + unsigned char bytes[sizeof(float)]; + } in_data; + in_data.float_data = data; + + for(count=0; count<sizeof(float); count++) + { + /*Send lsb first*/ + serialPutchar(fd, (uint8) in_data.bytes[count]); + } + +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u16RPISerialSendDataa.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u16RPISerialSendDataa.c new file mode 100644 index 00000000..b444047b --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u16RPISerialSendDataa.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 send unsigned 16-bit data array/matrix on specified serial port. */ + +#include "types.h" +#include "RPIPeripheralSerial.h" + +void u16RPISerialSendDataa(int fd, uint16* data, int size) +{ + int count = 0; + + for (count = 0; count < size; ++count) + { + u16RPISerialSendDatas(fd, data[count]); + } + + +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u16RPISerialSendDatas.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u16RPISerialSendDatas.c new file mode 100644 index 00000000..b4a90c29 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u16RPISerialSendDatas.c @@ -0,0 +1,23 @@ +/* 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 send unsigned 16-bit data on specified serial port. */ + +#include "types.h" +#include "RPIPeripheralSerial.h" + +void u16RPISerialSendDatas(int fd, uint16 data) +{ + /*Send lsb first*/ + serialPutchar(fd, (uint8) data); + serialPutchar(fd, (uint8) (data>>8)); +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u16RPISerialSetups.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u16RPISerialSetups.c new file mode 100644 index 00000000..cde4cba2 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u16RPISerialSetups.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 setup port with desired baud rate. */ + +#include "types.h" +#include "RPIPeripheralSerial.h" + +int u16RPISerialSetups(char* port, int baudrate) +{ + int fd; + + fd = serialOpen (port, baudrate); + + return fd; +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u8RPISerialCloses.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u8RPISerialCloses.c new file mode 100644 index 00000000..5162d15e --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u8RPISerialCloses.c @@ -0,0 +1,21 @@ +/* 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 close serial port opened. */ + +#include "types.h" +#include "RPIPeripheralSerial.h" + +void u8RPISerialCloses(int fd) +{ + serialClose (fd); +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u8RPISerialFlushs.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u8RPISerialFlushs.c new file mode 100644 index 00000000..c80a92c5 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u8RPISerialFlushs.c @@ -0,0 +1,21 @@ +/* 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 discards data serial buffer (received as well as waiting to be sent */ + +#include "types.h" +#include "RPIPeripheralSerial.h" + +void u8RPISerialFlushs(int fd) +{ + serialFlush(fd); +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u8RPISerialSendChars.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u8RPISerialSendChars.c new file mode 100644 index 00000000..e3813514 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u8RPISerialSendChars.c @@ -0,0 +1,21 @@ +/* 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 send 8-bit char on specified serial port. */ + +#include "types.h" +#include "RPIPeripheralSerial.h" + +void u8RPISerialSendChars(int fd, uint8 data) +{ + serialPutchar(fd, data); +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u8RPISerialSendDataa.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u8RPISerialSendDataa.c new file mode 100644 index 00000000..9d097141 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u8RPISerialSendDataa.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 send unsigned 8-bit byte array/matrix on specified serial port. */ + +#include "types.h" +#include "RPIPeripheralSerial.h" + +void u8RPISerialSendDataa(int fd, uint8* data, int size) +{ + int count = 0; + + for (count = 0; count < size; ++count) + { + u8RPISerialSendDatas(fd, data[count]); + } + +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u8RPISerialSendDatas.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u8RPISerialSendDatas.c new file mode 100644 index 00000000..9edb439f --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/serial/u8RPISerialSendDatas.c @@ -0,0 +1,22 @@ +/* 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 send unsigned 8-bit byte on specified serial port. */ + +#include "types.h" +#include "RPIPeripheralSerial.h" + +void u8RPISerialSendDatas(int fd, uint8 data) +{ + serialPutchar(fd, data); + +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/threading/u16RPIThreadCreates.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/threading/u16RPIThreadCreates.c new file mode 100644 index 00000000..c05c959c --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/threading/u16RPIThreadCreates.c @@ -0,0 +1,24 @@ +/* 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 create thread for given function */ + +#include "types.h" +#include "RPIPeripheralThreading.h" + +uint16 RPIThreadCreate(void *(*threadFunction)(void*)) +{ + int status; + status = piThreadCreate (threadFunction); + return status; +} + diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/timing/RPI_delay.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/timing/RPI_delay.c new file mode 100644 index 00000000..8374c2b2 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/timing/RPI_delay.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, Jorawar Singh + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/* Function to insert some delay in code execution. */ + + + +#include "types.h" +#include "RPIPeripheralTiming.h" + +void u16RPI_delay(uint16 time) +{ + delay(time); + +} + diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/timing/RPI_delayMicro.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/timing/RPI_delayMicro.c new file mode 100644 index 00000000..df2a7a79 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/timing/RPI_delayMicro.c @@ -0,0 +1,22 @@ +/* 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 +*/ + +/* Function to insert some delay in code execution. */ + +#include "types.h" +#include "RPIPeripheralTiming.h" + +void u16RPI_delayMicro(uint16 time) +{ + delayMicroseconds(time); +} + diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/timing/RPI_micros.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/timing/RPI_micros.c new file mode 100644 index 00000000..8d06742d --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/timing/RPI_micros.c @@ -0,0 +1,21 @@ +/* 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 +*/ + +/* Function to get time in microsecond since first setup function called */ + +#include "types.h" +#include "RPIPeripheralTiming.h" + +uint32 u32RPI_micros() +{ + return(micros()); +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/timing/RPI_millis.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/timing/RPI_millis.c new file mode 100644 index 00000000..92b6e1b8 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/backup/timing/RPI_millis.c @@ -0,0 +1,21 @@ +/* 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 +*/ + +/* Function to get time in millisecond since first setup function called */ + +#include "types.h" +#include "RPIPeripheralTiming.h" + +uint32 u32RPI_millis() +{ + return(millis()); +} diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/raspi.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/raspi.c new file mode 100644 index 00000000..3e94b925 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/raspi.c @@ -0,0 +1,13 @@ +/* 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: Jorawar Singh + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "types.h"
\ No newline at end of file diff --git a/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/raspi_close.c b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/raspi_close.c new file mode 100644 index 00000000..3e94b925 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/NotYetDone/NotToDo/raspi_close.c @@ -0,0 +1,13 @@ +/* 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: Jorawar Singh + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "types.h"
\ No newline at end of file |