summaryrefslogtreecommitdiff
path: root/src/c/hardware/avr/interfaces
diff options
context:
space:
mode:
authorsiddhu89902017-04-19 14:28:34 +0530
committersiddhu89902017-04-19 14:28:34 +0530
commit9e506f48291533cba7b4c555b0d2e98f234bfbe3 (patch)
tree6ffe38eefea51cdb767493850b2ada0c098fe416 /src/c/hardware/avr/interfaces
parent453598b49cb3d4a62b1797dbc90f0e3dd4521329 (diff)
downloadScilab2C_fossee_old-9e506f48291533cba7b4c555b0d2e98f234bfbe3.tar.gz
Scilab2C_fossee_old-9e506f48291533cba7b4c555b0d2e98f234bfbe3.tar.bz2
Scilab2C_fossee_old-9e506f48291533cba7b4c555b0d2e98f234bfbe3.zip
Merged Ashish's work
Diffstat (limited to 'src/c/hardware/avr/interfaces')
-rw-r--r--src/c/hardware/avr/interfaces/int_AVRPeripheralADC.h14
-rw-r--r--src/c/hardware/avr/interfaces/int_AVRPeripheralGPIO.h19
-rw-r--r--src/c/hardware/avr/interfaces/int_AVRPeripheralPWM.h27
-rw-r--r--src/c/hardware/avr/interfaces/int_AVRPeripheralTimer.h18
-rw-r--r--src/c/hardware/avr/interfaces/int_AVRPeripheralUART.h57
-rw-r--r--src/c/hardware/avr/interfaces/int_AVRUtil.h19
6 files changed, 128 insertions, 26 deletions
diff --git a/src/c/hardware/avr/interfaces/int_AVRPeripheralADC.h b/src/c/hardware/avr/interfaces/int_AVRPeripheralADC.h
index 425b03f..5d3a48e 100644
--- a/src/c/hardware/avr/interfaces/int_AVRPeripheralADC.h
+++ b/src/c/hardware/avr/interfaces/int_AVRPeripheralADC.h
@@ -1,8 +1,14 @@
-//This file defines constants corresponding to gpios.
-//
-// Authors
-// Siddhesh Wani
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Aithor: Ashish Kamble
+// Email: toolbox@scilab.in
+
#ifndef __INT_AVRPERIPHERALADC_H__
#define __INT_AVRPERIPHERALADC_H__
diff --git a/src/c/hardware/avr/interfaces/int_AVRPeripheralGPIO.h b/src/c/hardware/avr/interfaces/int_AVRPeripheralGPIO.h
index c034718..3fcbb8f 100644
--- a/src/c/hardware/avr/interfaces/int_AVRPeripheralGPIO.h
+++ b/src/c/hardware/avr/interfaces/int_AVRPeripheralGPIO.h
@@ -1,8 +1,15 @@
-//This file defines constants corresponding to gpios.
-//
-// Authors
-// Siddhesh Wani
+
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Author: Siddhesh Wani, Ashish Kamble
+// Email: toolbox@scilab.in
+
#ifndef __INT_AVRPERIPHERALGPIO_H__
#define __INT_AVRPERIPHERALGPIO_H__
@@ -22,6 +29,10 @@ extern "C" {
#define AVRDigitalOut(in1,in2,in3) u8AVRDigitalOuts((uint8) in1,\
(uint8) in2, (uint8) in3);
+#define AVRDigitalPortSetup(in1,in2) u8AVRDigitalPortSetups((uint8) in1,\
+ (uint8) in2);
+
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/src/c/hardware/avr/interfaces/int_AVRPeripheralPWM.h b/src/c/hardware/avr/interfaces/int_AVRPeripheralPWM.h
index 2d5e5cb..5c5950b 100644
--- a/src/c/hardware/avr/interfaces/int_AVRPeripheralPWM.h
+++ b/src/c/hardware/avr/interfaces/int_AVRPeripheralPWM.h
@@ -1,8 +1,14 @@
-//This file defines constants corresponding to gpios.
-//
-// Authors
-// Siddhesh Wani
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Author: Ashish Kamble
+// Email: toolbox@scilab.in
+
#ifndef __INT_AVRPERIPHERALPWM_H__
#define __INT_AVRPERIPHERALPWM_H__
@@ -14,10 +20,17 @@
extern "C" {
#endif
-#define AVRPWMSetup(in1,in2,in3,in4) u8AVRPWMSetups((uint8) in1,\
- (uint8) in2, (uint8) in3, (uint8) in4);
+#define AVRPWM0Setup(in1,in2) u8AVRPWM0Setups((uint8) in1, (uint8) in2);
+
+#define AVRPWM2Setup(in1,in2) u8AVRPWM2Setups((uint8) in1, (uint8) in2);
+
+#define AVRPWM1Setup(in1,in2,in3) u8AVRPWM1Setups((uint8) in1, (uint8) in2, (uint8) in3);
+
+#define AVRPWM0SetDuty(in1) u8AVRPWM0SetDutys((uint8) in1);
+
+#define AVRPWM2SetDuty(in1) u8AVRPWM2SetDutys((uint8) in1);
-#define AVRPWMSetDuty(in1,in2) u8AVRPWMSetDutys((uint8) in1, (uint8) in2);
+#define AVRPWM1SetDuty(in1,in2,in3) u8AVRPWM1SetDutys((uint8) in1,(uint16) in2,(uint16) in3);
#ifdef __cplusplus
} /* extern "C" */
diff --git a/src/c/hardware/avr/interfaces/int_AVRPeripheralTimer.h b/src/c/hardware/avr/interfaces/int_AVRPeripheralTimer.h
index b4b66ba..3ec6a7e 100644
--- a/src/c/hardware/avr/interfaces/int_AVRPeripheralTimer.h
+++ b/src/c/hardware/avr/interfaces/int_AVRPeripheralTimer.h
@@ -1,8 +1,14 @@
-//This file defines constants corresponding to gpios.
-//
-// Authors
-// Siddhesh Wani
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Author: Siddhesh Wani, Ashish Kamble
+// Email: toolbox@scilab.in
+
#ifndef __INT_AVRPERIPHERALTIMER_H__
#define __INT_AVRPERIPHERALTIMER_H__
@@ -14,9 +20,9 @@
extern "C" {
#endif
-#define AVRTimerSetup(in1,in2) u8AVRTimerSetups((uint8) in1, (uint8) in2);
+#define AVRGetTimerValue(in1) u8AVRGetTimerValues((uint16) in1);
-#define AVRGetTimerValue(in1) u8AVRGetTimerValues((uint8) in1);
+#define AVRTimerSetup(in1,in2,in3) u8AVRTimerSetups((uint8) in1, (uint16) in2, (uint8) in3);
#ifdef __cplusplus
} /* extern "C" */
diff --git a/src/c/hardware/avr/interfaces/int_AVRPeripheralUART.h b/src/c/hardware/avr/interfaces/int_AVRPeripheralUART.h
new file mode 100644
index 0000000..81b4af6
--- /dev/null
+++ b/src/c/hardware/avr/interfaces/int_AVRPeripheralUART.h
@@ -0,0 +1,57 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Authors: Siddhesh Wani, Ashish Kamble
+// Email: toolbox@scilab.in
+
+
+#ifndef __INT_AVRPERIPHERALUART_H__
+#define __INT_AVRPERIPHERALUART_H__
+
+#include <avr/io.h>
+#include "AVRPeripheralUART.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define AVRUARTSetup(in1,in2,in3,in4) u8AVRUARTSetups((uint8) in1,(uint32) in2,(uint8) in3,(uint8) in4);
+
+#define u80AVRUARTTransmitu80(in1) u8AVRUARTTransmits((uint8) in1);
+
+#define g2AVRUARTTransmitu80(in1,in2) gAVRUARTTransmits((char*) in1,in2[0]*in2[1]);
+
+#define u160AVRUARTTransmitu80(in1) u16AVRUARTTransmits((uint16) in1);
+
+#define i160AVRUARTTransmitu80(in1) i16AVRUARTTransmits((int16) in1);
+
+#define i80AVRUARTTransmitu80(in1) i8AVRUARTTransmits((int8) in1);
+
+#define u82AVRUARTTransmitu80(in1,in2) u8AVRUARTTransmita((uint8) in1,in2[0]*in2[1]);
+
+#define d0AVRUARTTransmitu80(in1) dAVRUARTTransmits((double) in1);
+
+//#define g2AVRUARTTransmitu80(in1,in2) gAVRUARTTransmita((char*) in1,in2[0]*in2[1]);
+
+#define u162AVRUARTTransmitu80(in1,in2) u16AVRUARTTransmita((uint16) in1,in2[0]*in2[1]);
+
+#define i162AVRUARTTransmitu80(in1,in2) i16AVRUARTTransmita((int16) in1,in2[0]*in2[1]);
+
+#define i82AVRUARTTransmitu80(in1,in2) i8AVRUARTTransmita((int8) in1,in2[0]*in2[1]);
+
+#define u80AVRUSARTReceiveCharu80() u8AVRUSARTReceiveCharu8();
+
+//#define s0AVRUARTTransmitu80(in1) sAVRUARTTransmits((float) in1);
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* !__AVRPERIPHERALUART_H__ */
diff --git a/src/c/hardware/avr/interfaces/int_AVRUtil.h b/src/c/hardware/avr/interfaces/int_AVRUtil.h
index 2d6bbef..51cbce5 100644
--- a/src/c/hardware/avr/interfaces/int_AVRUtil.h
+++ b/src/c/hardware/avr/interfaces/int_AVRUtil.h
@@ -1,8 +1,14 @@
-//This file defines interfaces corresponding to uitl function.
-//
-// Authors
-// Siddhesh Wani
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Author: Siddhesh Wani
+// Email: toolbox@scilab.in
+
#ifndef __INT_AVRUTIL_H__
#define __INT_AVRUTIL_H__
@@ -14,7 +20,10 @@
extern "C" {
#endif
-#define d0sleepu80(in1) u16AVRSleeps ((uint16) in1);
+//#define d0sleepu80(in1) u16AVRSleeps ((uint16) in1);
+
+#define AVRSleep(in1) u16AVRSleeps ((uint16) in1);
+
#ifdef __cplusplus
} /* extern "C" */