diff options
Diffstat (limited to 'src')
30 files changed, 486 insertions, 7 deletions
diff --git a/src/c/elementaryFunctions/includes/sec.h b/src/c/elementaryFunctions/includes/sec.h index 9606158..a04c5f7 100644 --- a/src/c/elementaryFunctions/includes/sec.h +++ b/src/c/elementaryFunctions/includes/sec.h @@ -14,7 +14,7 @@ #include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" -#include <complex.h> +//#include <complex.h> #include "types.h" #ifdef __cplusplus diff --git a/src/c/scilab-arduino/cmd_analog_in_volt/u8cmd_analog_in_volts.c b/src/c/scilab-arduino/cmd_analog_in_volt/u8cmd_analog_in_volts.c new file mode 100644 index 0000000..7018df2 --- /dev/null +++ b/src/c/scilab-arduino/cmd_analog_in_volt/u8cmd_analog_in_volts.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2017 - 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: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "cmd_analog_in_volt.h" +#include "Arduino.h" + +float u8cmd_analog_in_volts(uint8 board_no, uint8 pin) +{ + float a; + a = ((5*(float)analogRead(pin))/1023); + return(a); +} + diff --git a/src/c/scilab-arduino/cmd_analog_out_volt/u8cmd_analog_out_volts.c b/src/c/scilab-arduino/cmd_analog_out_volt/u8cmd_analog_out_volts.c new file mode 100644 index 0000000..2dd82e4 --- /dev/null +++ b/src/c/scilab-arduino/cmd_analog_out_volt/u8cmd_analog_out_volts.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2017 - 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: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "cmd_analog_out_volt.h" +#include "Arduino.h" + +void u8cmd_analog_out_volts(uint8 board_no, uint8 pin, float value) +{ + int a; + a = ((value*255)/5); + analogWrite(pin,a); + +} diff --git a/src/c/scilab-arduino/cmd_dcmotor_release/u8cmd_dcmotor_releases.c b/src/c/scilab-arduino/cmd_dcmotor_release/u8cmd_dcmotor_releases.c new file mode 100644 index 0000000..349bcb1 --- /dev/null +++ b/src/c/scilab-arduino/cmd_dcmotor_release/u8cmd_dcmotor_releases.c @@ -0,0 +1,29 @@ +/* Copyright (C) 2017 - 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: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "cmd_dcmotor_release.h" +#include "Arduino.h" + +void u8cmd_dcmotor_releases(uint8 board_no, uint8 motor_no) +{ + if (dcm_mode[motor_no] == 3) + { + analogWrite(dcm_pin_1[motor_no],0); + analogWrite(dcm_pin_2[motor_no],0); + } + + else + { + digitalWrite(dcm_pin_1[motor_no],LOW); + digitalWrite(dcm_pin_2[motor_no],LOW); + } +} diff --git a/src/c/scilab-arduino/cmd_dcmotor_run/u8cmd_dcmotor_runs.c b/src/c/scilab-arduino/cmd_dcmotor_run/u8cmd_dcmotor_runs.c index 6e1c2ca..e8fa8b3 100644 --- a/src/c/scilab-arduino/cmd_dcmotor_run/u8cmd_dcmotor_runs.c +++ b/src/c/scilab-arduino/cmd_dcmotor_run/u8cmd_dcmotor_runs.c @@ -6,6 +6,7 @@ are also available at http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt Author: Siddhesh Wani + Revised by: Yash Pratap Singh Tomar Organization: FOSSEE, IIT Bombay Email: toolbox@scilab.in */ diff --git a/src/c/scilab-arduino/cmd_dcmotor_setup/u8cmd_dcmotor_setups.c b/src/c/scilab-arduino/cmd_dcmotor_setup/u8cmd_dcmotor_setups.c index 389f911..0d04e74 100644 --- a/src/c/scilab-arduino/cmd_dcmotor_setup/u8cmd_dcmotor_setups.c +++ b/src/c/scilab-arduino/cmd_dcmotor_setup/u8cmd_dcmotor_setups.c @@ -6,6 +6,7 @@ are also available at http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt Author: Siddhesh Wani + Revised by: Yash Pratap Singh Tomar Organization: FOSSEE, IIT Bombay Email: toolbox@scilab.in */ diff --git a/src/c/scilab-arduino/cmd_i2c_dev/u8cmd_i2c_devs.cpp b/src/c/scilab-arduino/cmd_i2c_dev/u8cmd_i2c_devs.cpp new file mode 100644 index 0000000..adc1a6e --- /dev/null +++ b/src/c/scilab-arduino/cmd_i2c_dev/u8cmd_i2c_devs.cpp @@ -0,0 +1,10 @@ +#include "cmd_i2c_dev.h" +#include "Arduino.h" +#include "Wire.h" + + +uint8 u8cmd_i2c_devs(uint8 address) +{ + Wire.begin(); + return((uint8)address); +} diff --git a/src/c/scilab-arduino/cmd_i2c_read/u8cmd_i2c_reads.cpp b/src/c/scilab-arduino/cmd_i2c_read/u8cmd_i2c_reads.cpp new file mode 100644 index 0000000..8f02a87 --- /dev/null +++ b/src/c/scilab-arduino/cmd_i2c_read/u8cmd_i2c_reads.cpp @@ -0,0 +1,18 @@ +#include "cmd_i2c_read.h" +#include "Arduino.h" +#include "Wire.h" + +float u8cmd_i2c_reads(uint8 address, uint8 bytes) +{ + + float c; //variable declaration to save received data + + // request reading from sensor + Wire.requestFrom(address, bytes); // request no. of bytes(given) from slave device with address + + // receive reading from sensor + while (Wire.available()) //If data is received + c = Wire.read(); //Save received data in variable + return(c); + +} diff --git a/src/c/scilab-arduino/cmd_i2c_read_register/u8cmd_i2c_read_registers.cpp b/src/c/scilab-arduino/cmd_i2c_read_register/u8cmd_i2c_read_registers.cpp new file mode 100644 index 0000000..0a2ec2e --- /dev/null +++ b/src/c/scilab-arduino/cmd_i2c_read_register/u8cmd_i2c_read_registers.cpp @@ -0,0 +1,26 @@ +#include "cmd_i2c_read_register.h" +#include "Arduino.h" +#include "Wire.h" + +uint16 u8cmd_i2c_read_registers(uint8 address, uint8 reg_adrs) +{ + long int reading; + + Wire.beginTransmission(address); // transmit to device address + Wire.write(reg_adrs); // sets register pointer to reg_adrs position + Wire.endTransmission(); // stop transmitting + + // request reading from sensor + Wire.requestFrom(address, 2); // request 2 bytes from slave device with address + + // receive reading from sensor + if (2 <= Wire.available()) // if two bytes were received + { + reading = Wire.read(); // receive high byte (overwrites previous reading) + reading = reading << 8; // shift high byte to be high 8 bits + reading |= Wire.read(); // receive low byte as lower 8 bits + } + + return(reading); + +} diff --git a/src/c/scilab-arduino/cmd_i2c_write/u8cmd_i2c_writes.cpp b/src/c/scilab-arduino/cmd_i2c_write/u8cmd_i2c_writes.cpp new file mode 100644 index 0000000..0239097 --- /dev/null +++ b/src/c/scilab-arduino/cmd_i2c_write/u8cmd_i2c_writes.cpp @@ -0,0 +1,13 @@ +#include "cmd_i2c_write.h" +#include "Arduino.h" +#include "Wire.h" + +void u8cmd_i2c_writes(uint8 address, uint8 data) +{ + + Wire.beginTransmission(address); //Begins transmission to the device connected to given address + Wire.write(data); //sends data to slave device + Wire.endTransmission(); //Transmission ends + +} + diff --git a/src/c/scilab-arduino/cmd_i2c_write_register/u8cmd_i2c_write_registers.cpp b/src/c/scilab-arduino/cmd_i2c_write_register/u8cmd_i2c_write_registers.cpp new file mode 100644 index 0000000..63cc7c7 --- /dev/null +++ b/src/c/scilab-arduino/cmd_i2c_write_register/u8cmd_i2c_write_registers.cpp @@ -0,0 +1,16 @@ +#include "cmd_i2c_write_register.h" +#include "Arduino.h" +#include "Wire.h" + +void u8cmd_i2c_write_registers(uint8 address, uint8 reg_adrs, uint8 data) +{ + + + Wire.beginTransmission(address); //Begins transmission to the device connected to given address + Wire.write(reg_adrs); //sets register pointer to reg_adrs position + Wire.write(data); //writes given data on reg_adrs position + Wire.endTransmission(); //Transmission ends + + +} + diff --git a/src/c/scilab-arduino/includes/cmd_analog_in_volt.h b/src/c/scilab-arduino/includes/cmd_analog_in_volt.h new file mode 100644 index 0000000..ec47142 --- /dev/null +++ b/src/c/scilab-arduino/includes/cmd_analog_in_volt.h @@ -0,0 +1,28 @@ +/* Copyright (C) 2017 - 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: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __CMD_ANALOG_IN_VOLT_H__ +#define __CMD_ANALOG_IN_VOLT_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +float u8cmd_analog_in_volts(uint8 board_no, uint8 pin); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CMD_ANALOG_IN_VOLT_H__ */ diff --git a/src/c/scilab-arduino/includes/cmd_analog_out_volt.h b/src/c/scilab-arduino/includes/cmd_analog_out_volt.h new file mode 100644 index 0000000..51580fb --- /dev/null +++ b/src/c/scilab-arduino/includes/cmd_analog_out_volt.h @@ -0,0 +1,27 @@ +/* Copyright (C) 2017 - 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: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __CMD_ANALOG_OUT_VOLT_H__ +#define __CMD_ANALOG_OUT_VOLT_H__ + +#include "types.h" +#ifdef __cplusplus +extern "C" { +#endif + +void u8cmd_analog_out_volts(uint8 board_no, uint8 pin, float value); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CMD_ANALOG_OUT_VOLT_H__ */ diff --git a/src/c/scilab-arduino/includes/cmd_dcmotor_release.h b/src/c/scilab-arduino/includes/cmd_dcmotor_release.h new file mode 100644 index 0000000..d185fb5 --- /dev/null +++ b/src/c/scilab-arduino/includes/cmd_dcmotor_release.h @@ -0,0 +1,30 @@ +/* Copyright (C) 2017 - 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: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __CMD_DCMOTOR_RELEASE_H__ +#define __CMD_DCMOTOR_RELEASE_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +extern uint8 dcm_pin_1[4], dcm_pin_2[4], dcm_mode[4]; + +void u8cmd_dcmotor_releases(uint8 board_no, uint8 motor_no); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CMD_DCMOTOR_RELEASE_H__ */ diff --git a/src/c/scilab-arduino/includes/cmd_dcmotor_run.h b/src/c/scilab-arduino/includes/cmd_dcmotor_run.h index 2b69c99..1b5d41c 100644 --- a/src/c/scilab-arduino/includes/cmd_dcmotor_run.h +++ b/src/c/scilab-arduino/includes/cmd_dcmotor_run.h @@ -22,7 +22,7 @@ extern "C" { extern uint8 dcm_pin_1[4], dcm_pin_2[4], dcm_mode[4]; -void u8cmd_dc_motor_runs(uint8 board_no, uint8 motor_no, int16 duty); +void u8cmd_dcmotor_runs(uint8 board_no, uint8 motor_no, int16 duty); #ifdef __cplusplus } /* extern "C" */ diff --git a/src/c/scilab-arduino/includes/cmd_dcmotor_setup.h b/src/c/scilab-arduino/includes/cmd_dcmotor_setup.h index cecd465..45854ff 100644 --- a/src/c/scilab-arduino/includes/cmd_dcmotor_setup.h +++ b/src/c/scilab-arduino/includes/cmd_dcmotor_setup.h @@ -22,7 +22,7 @@ extern "C" { extern uint8 dcm_pin_1[4], dcm_pin_2[4], dcm_mode[4]; -void u8cmd_dc_motor_setups(uint8 board_no, uint8 driver_type, uint8 motor_no,\ +void u8cmd_dcmotor_setups(uint8 board_no, uint8 driver_type, uint8 motor_no,\ uint8 pin_1, uint8 pin_2); #ifdef __cplusplus diff --git a/src/c/scilab-arduino/includes/cmd_i2c_dev.h b/src/c/scilab-arduino/includes/cmd_i2c_dev.h new file mode 100644 index 0000000..861a8e7 --- /dev/null +++ b/src/c/scilab-arduino/includes/cmd_i2c_dev.h @@ -0,0 +1,16 @@ +#ifndef __CMD_I2C_DEV_H__ +#define __CMD_I2C_DEV_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +uint8 u8cmd_i2c_devs(uint8 address); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CMD_I2C_DEV_H__ */ diff --git a/src/c/scilab-arduino/includes/cmd_i2c_read.h b/src/c/scilab-arduino/includes/cmd_i2c_read.h new file mode 100644 index 0000000..791bdd3 --- /dev/null +++ b/src/c/scilab-arduino/includes/cmd_i2c_read.h @@ -0,0 +1,16 @@ +#ifndef __CMD_I2C_READ_H__ +#define __CMD_I2C_READ_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +float u8cmd_i2c_reads(uint8 address, uint8 bytes); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CMD_I2C_READ_H__ */ diff --git a/src/c/scilab-arduino/includes/cmd_i2c_read_register.h b/src/c/scilab-arduino/includes/cmd_i2c_read_register.h new file mode 100644 index 0000000..ea203ad --- /dev/null +++ b/src/c/scilab-arduino/includes/cmd_i2c_read_register.h @@ -0,0 +1,16 @@ +#ifndef __CMD_I2C_READ_REGISTER_H__ +#define __CMD_I2C_READ_REGISTER_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +uint16 u8cmd_i2c_read_registers(uint8 address, uint8 reg_adrs); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CMD_I2C_READ_REGISTER_H__ */ diff --git a/src/c/scilab-arduino/includes/cmd_i2c_write.h b/src/c/scilab-arduino/includes/cmd_i2c_write.h new file mode 100644 index 0000000..6a57222 --- /dev/null +++ b/src/c/scilab-arduino/includes/cmd_i2c_write.h @@ -0,0 +1,16 @@ +#ifndef __CMD_I2C_WRITE_H__ +#define __CMD_I2C_WRITE_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void u8cmd_i2c_writes(uint8 address, uint8 data); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CMD_I2C_WRITE_H__ */ diff --git a/src/c/scilab-arduino/includes/cmd_i2c_write_register.h b/src/c/scilab-arduino/includes/cmd_i2c_write_register.h new file mode 100644 index 0000000..ff1b9ec --- /dev/null +++ b/src/c/scilab-arduino/includes/cmd_i2c_write_register.h @@ -0,0 +1,16 @@ +#ifndef __CMD_I2C_WRITE_REGISTER_H__ +#define __CMD_I2C_WRITE_REGISTER_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void u8cmd_i2c_write_registers(uint8 address, uint8 reg_adrs, uint8 data); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CMD_I2C_WRITE_REGISTER_H__ */ diff --git a/src/c/scilab-arduino/interfaces/int_cmd_analog_in_volt.h b/src/c/scilab-arduino/interfaces/int_cmd_analog_in_volt.h new file mode 100644 index 0000000..e8fe65d --- /dev/null +++ b/src/c/scilab-arduino/interfaces/int_cmd_analog_in_volt.h @@ -0,0 +1,30 @@ +/* Copyright (C) 2017 - 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: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#ifndef __INT_CMD_ANALOG_IN_VOLT_H__ +#define __INT_CMD_ANALOG_IN_VOLT_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define d0d0cmd_analog_in_volts0(in1,in2) u8cmd_analog_in_volts((uint8)in1,(uint8)in2) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __INT_CMD_ANALOG_IN_VOLT_H__ */ diff --git a/src/c/scilab-arduino/interfaces/int_cmd_analog_out_volt.h b/src/c/scilab-arduino/interfaces/int_cmd_analog_out_volt.h new file mode 100644 index 0000000..283f8fa --- /dev/null +++ b/src/c/scilab-arduino/interfaces/int_cmd_analog_out_volt.h @@ -0,0 +1,30 @@ +/* Copyright (C) 2017 - 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: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __INT_CMD_ANALOG_OUT_VOLT_H__ +#define __INT_CMD_ANALOG_OUT_VOLT_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define d0d0d0cmd_analog_out_volt(in1,in2,in3) u8cmd_analog_out_volts((uint8)in1,(uint8)in2,(float)in3) + +#define d0d0s0cmd_analog_out_volt(in1,in2,in3) u8cmd_analog_out_volts((uint8)in1,(uint8)in2,(float)in3) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __INT_CMD_ANALOG_OUT_VOLT_H__ */ diff --git a/src/c/scilab-arduino/interfaces/int_cmd_dcmotor.h b/src/c/scilab-arduino/interfaces/int_cmd_dcmotor.h index 61e0d2e..d465ff6 100644 --- a/src/c/scilab-arduino/interfaces/int_cmd_dcmotor.h +++ b/src/c/scilab-arduino/interfaces/int_cmd_dcmotor.h @@ -6,6 +6,7 @@ are also available at http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt Author: Siddhesh Wani + Revised by: Yash Pratap Singh Tomar Organization: FOSSEE, IIT Bombay Email: toolbox@scilab.in */ @@ -20,16 +21,16 @@ extern "C" { #endif -#define d0d0d0d0d0cmd_dcmotor_setup(in1,in2,in3,in4,in5)\ - u8cmd_dcmotor_setups((uint8)in1,(uint8)in2,(uint8)in3,\ - (uint8)in4,(uint8)in5) +#define d0d0d0d0d0cmd_dcmotor_setup(in1,in2,in3,in4,in5) u8cmd_dcmotor_setups((uint8)in1,(uint8)in2,(uint8)in3,(uint8)in4,(uint8)in5) #define d0d0d0cmd_dcmotor_run(in1,in2,in3) u8cmd_dcmotor_runs((uint8)in1,\ (uint8)in2, (int16)in3); #define d0d0u160cmd_dcmotor_run(in1,in2,in3) u8cmd_dcmotor_runs((uint8)in1,\ - (uint8)in2, (int16)in3); + (uint8)in2, (int16)in3); + +#define d0d0cmd_dcmotor_release(in1,in2) u8cmd_dcmotor_releases((uint8)in1,(uint8)in2) #ifdef __cplusplus diff --git a/src/c/scilab-arduino/interfaces/int_cmd_i2c_dev.h b/src/c/scilab-arduino/interfaces/int_cmd_i2c_dev.h new file mode 100644 index 0000000..c4d93d7 --- /dev/null +++ b/src/c/scilab-arduino/interfaces/int_cmd_i2c_dev.h @@ -0,0 +1,17 @@ +#ifndef __INT_CMD_I2C_DEV_H__ +#define __INT_CMD_I2C_DEV_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define d0cmd_i2c_devu80(in1) u8cmd_i2c_devs((uint8)in1) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __INT_CMD_I2C_DEV_H__ */ diff --git a/src/c/scilab-arduino/interfaces/int_cmd_i2c_read.h b/src/c/scilab-arduino/interfaces/int_cmd_i2c_read.h new file mode 100644 index 0000000..b0633a0 --- /dev/null +++ b/src/c/scilab-arduino/interfaces/int_cmd_i2c_read.h @@ -0,0 +1,19 @@ +#ifndef __INT_CMD_I2C_READ_H__ +#define __INT_CMD_I2C_READ_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define d0d0cmd_i2c_reads0(in1, in2) u8cmd_i2c_reads((uint8)in1, (uint8)in2) + +#define u80d0cmd_i2c_reads0(in1, in2) u8cmd_i2c_reads((uint8)in1, (uint8)in2) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __INT_CMD_I2C_READ_H__ */ diff --git a/src/c/scilab-arduino/interfaces/int_cmd_i2c_read_register.h b/src/c/scilab-arduino/interfaces/int_cmd_i2c_read_register.h new file mode 100644 index 0000000..5f4c529 --- /dev/null +++ b/src/c/scilab-arduino/interfaces/int_cmd_i2c_read_register.h @@ -0,0 +1,18 @@ +#ifndef __INT_CMD_I2C_READ_REGISTER_H__ +#define __INT_CMD_I2C_READ_REGISTER_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define d0d0cmd_i2c_read_registeru160(in1, in2) u8cmd_i2c_read_registers((uint8)in1, (uint8)in2) + +#define u80d0cmd_i2c_read_registeru160(in1, in2) u8cmd_i2c_read_registers((uint8)in1, (uint8)in2) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __INT_CMD_I2C_READ_REGISTER_H__ */ diff --git a/src/c/scilab-arduino/interfaces/int_cmd_i2c_write.h b/src/c/scilab-arduino/interfaces/int_cmd_i2c_write.h new file mode 100644 index 0000000..a7705a8 --- /dev/null +++ b/src/c/scilab-arduino/interfaces/int_cmd_i2c_write.h @@ -0,0 +1,20 @@ +#ifndef __INT_CMD_I2C_WRITE_H__ +#define __INT_CMD_I2C_WRITE_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define d0d0cmd_i2c_write(in1, in2) u8cmd_i2c_writes((uint8)in1, (uint8)in2) + +#define u80d0cmd_i2c_write(in1, in2) u8cmd_i2c_writes((uint8)in1, (uint8)in2) + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __INT_CMD_I2C_WRITE_H__ */ diff --git a/src/c/scilab-arduino/interfaces/int_cmd_i2c_write_register.h b/src/c/scilab-arduino/interfaces/int_cmd_i2c_write_register.h new file mode 100644 index 0000000..35c0527 --- /dev/null +++ b/src/c/scilab-arduino/interfaces/int_cmd_i2c_write_register.h @@ -0,0 +1,19 @@ +#ifndef __INT_CMD_I2C_WRITE_REGISTER_H__ +#define __INT_CMD_I2C_WRITE_REGISTER_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define d0d0d0cmd_i2c_write_register(in1, in2, in3) u8cmd_i2c_write_registers((uint8)in1, (uint8)in2, (uint8)in3) + +#define u80d0d0cmd_i2c_write_register(in1, in2, in3) u8cmd_i2c_write_registers((uint8)in1, (uint8)in2, (uint8)in3) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __INT_CMD_I2C_WRITE_REGISTER_H__ */ diff --git a/src/c/scilab-arduino/sleep/u16sleeps.c b/src/c/scilab-arduino/sleep/u16sleeps.c index 88f8a66..3045978 100644 --- a/src/c/scilab-arduino/sleep/u16sleeps.c +++ b/src/c/scilab-arduino/sleep/u16sleeps.c @@ -6,11 +6,13 @@ are also available at http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt Author: Siddhesh Wani + Revised by: Yash Pratap Singh Tomar Organization: FOSSEE, IIT Bombay Email: toolbox@scilab.in */ #include "sleep.h" +#include "Arduino.h" void u16sleeps(uint16 delay_ms) { |