summaryrefslogtreecommitdiff
path: root/src/c/hardware/avr
diff options
context:
space:
mode:
authorsiddhu89902015-12-08 11:43:14 +0530
committersiddhu89902015-12-08 11:43:14 +0530
commit56d929da6683ca38ab07870173dba5aadb451403 (patch)
tree481583d1acbde742f975ea7b140f005d4ac08216 /src/c/hardware/avr
parent28917732a0c500c5db111ed49dbd7755758f5f72 (diff)
downloadScilab2C_fossee_old-56d929da6683ca38ab07870173dba5aadb451403.tar.gz
Scilab2C_fossee_old-56d929da6683ca38ab07870173dba5aadb451403.tar.bz2
Scilab2C_fossee_old-56d929da6683ca38ab07870173dba5aadb451403.zip
Modified so that code for all three output formats can be generated
Diffstat (limited to 'src/c/hardware/avr')
-rw-r--r--src/c/hardware/avr/includes/AVRUtil.h25
-rw-r--r--src/c/hardware/avr/interfaces/int_AVRPeripheralADC.h4
-rw-r--r--src/c/hardware/avr/interfaces/int_AVRPeripheralGPIO.h2
-rw-r--r--src/c/hardware/avr/interfaces/int_AVRUtil.h23
-rw-r--r--src/c/hardware/avr/util/U16AVRSleeps.c14
5 files changed, 65 insertions, 3 deletions
diff --git a/src/c/hardware/avr/includes/AVRUtil.h b/src/c/hardware/avr/includes/AVRUtil.h
new file mode 100644
index 0000000..2e6d9ae
--- /dev/null
+++ b/src/c/hardware/avr/includes/AVRUtil.h
@@ -0,0 +1,25 @@
+//This file defines functions corresponding to delay functions
+//
+// Authors
+// Siddhesh Wani
+//
+#ifndef __AVRUTIL_H__
+#define __AVRUTIL_H__
+
+#include <avr/io.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "Types.h"
+#include "avr/util.h"
+
+uint8 U16AVRSleeps (uint16 delay);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* !__AVRUTIL_H__ */
diff --git a/src/c/hardware/avr/interfaces/int_AVRPeripheralADC.h b/src/c/hardware/avr/interfaces/int_AVRPeripheralADC.h
index 073f8a0..0aafb8c 100644
--- a/src/c/hardware/avr/interfaces/int_AVRPeripheralADC.h
+++ b/src/c/hardware/avr/interfaces/int_AVRPeripheralADC.h
@@ -14,10 +14,10 @@
extern "C" {
#endif
-#define d0d0AVRDigitalSetupu80(in1,in2) u8AVRADCSetups((uint8) in1,\
+#define d0d0AVRADCSetupu80(in1,in2) u8AVRADCSetups((uint8) in1,\
(uint8) in2);
-#define d0AVRDigitalOutu160(in1) u8AVRReadADC((uint8) in1);
+#define d0AVRReadADCu160(in1) u8AVRReadADCs((uint8) in1);
#ifdef __cplusplus
} /* extern "C" */
diff --git a/src/c/hardware/avr/interfaces/int_AVRPeripheralGPIO.h b/src/c/hardware/avr/interfaces/int_AVRPeripheralGPIO.h
index 88e4c63..a4f9b91 100644
--- a/src/c/hardware/avr/interfaces/int_AVRPeripheralGPIO.h
+++ b/src/c/hardware/avr/interfaces/int_AVRPeripheralGPIO.h
@@ -17,7 +17,7 @@ extern "C" {
#define d0d0d0AVRDigitalSetupu80(in1,in2,in3) u8AVRDigitalSetups((uint8) in1,\
(uint8) in2, (uint8) in3);
-#define d0d0AVRDigitalOutu80(in1,in2) u8AVRDigitalIns((uint8) in1,\
+#define d0d0AVRDigitalInu80(in1,in2) u8AVRDigitalIns((uint8) in1,\
(uint8) in2);
#define d0d0d0AVRDigitalOutu80(in1,in2,in3) u8AVRDigitalOuts((uint8) in1,\
diff --git a/src/c/hardware/avr/interfaces/int_AVRUtil.h b/src/c/hardware/avr/interfaces/int_AVRUtil.h
new file mode 100644
index 0000000..ce96951
--- /dev/null
+++ b/src/c/hardware/avr/interfaces/int_AVRUtil.h
@@ -0,0 +1,23 @@
+//This file defines interfaces corresponding to uitl function.
+//
+// Authors
+// Siddhesh Wani
+//
+
+#ifndef __INT_AVRUTIL_H__
+#define __INT_AVRUTIL_H__
+
+#include <avr/io.h>
+#include "AVRUtil.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define d0sleepu80(in1) U16AVRSleeps ((uint16) in1);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* !__AVRPERIPHERALGPIO_H__ */
diff --git a/src/c/hardware/avr/util/U16AVRSleeps.c b/src/c/hardware/avr/util/U16AVRSleeps.c
new file mode 100644
index 0000000..f214471
--- /dev/null
+++ b/src/c/hardware/avr/util/U16AVRSleeps.c
@@ -0,0 +1,14 @@
+//Function to introduce specific delay in milliseconds
+//
+//Authors
+// Siddhesh Wani
+//
+
+#include "AVRUtil.h"
+
+uint8 U16AVRSleeps (uint16 delay)
+{
+ _delay_ms(delay);
+
+ retrun 0;
+}