summaryrefslogtreecommitdiff
path: root/2.3-1/src/c/hardware/avr/includes
diff options
context:
space:
mode:
authorsiddhu89902015-11-28 11:01:40 +0530
committersiddhu89902015-11-28 11:01:40 +0530
commit128638e88ce6d8414c9e1061faa96008be9bcda5 (patch)
treec38d4dbbed3ee4f3e71f263693d408e8bee519bc /2.3-1/src/c/hardware/avr/includes
parent3bcc8ce62560f36eaaab0e064b169b0118f354f3 (diff)
downloadScilab2C-128638e88ce6d8414c9e1061faa96008be9bcda5.tar.gz
Scilab2C-128638e88ce6d8414c9e1061faa96008be9bcda5.tar.bz2
Scilab2C-128638e88ce6d8414c9e1061faa96008be9bcda5.zip
Intermediate commit aith support added for AVR (GPIO,ADC). Does not support other targets.
Diffstat (limited to '2.3-1/src/c/hardware/avr/includes')
-rw-r--r--2.3-1/src/c/hardware/avr/includes/AVRPeripheralADC.h27
-rw-r--r--2.3-1/src/c/hardware/avr/includes/AVRPeripheralGPIO.h45
2 files changed, 72 insertions, 0 deletions
diff --git a/2.3-1/src/c/hardware/avr/includes/AVRPeripheralADC.h b/2.3-1/src/c/hardware/avr/includes/AVRPeripheralADC.h
new file mode 100644
index 00000000..e343de63
--- /dev/null
+++ b/2.3-1/src/c/hardware/avr/includes/AVRPeripheralADC.h
@@ -0,0 +1,27 @@
+//This file defines constants corresponding to gpios and digital input functions.
+//
+// Authors
+// Siddhesh Wani
+//
+
+#ifndef __AVRPERIPHERALADC_H__
+#define __AVRPERIPHERALADC_H__
+
+#include <avr/io.h>
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//Function prototypes
+uint8 u8AVRADCSetups(uint8 prescalar, uint8 adc_ref);
+
+uint16 u8AVRReadADCs(uint8 channel);
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* !__AVRPERIPHERALGPIO_H__ */
diff --git a/2.3-1/src/c/hardware/avr/includes/AVRPeripheralGPIO.h b/2.3-1/src/c/hardware/avr/includes/AVRPeripheralGPIO.h
new file mode 100644
index 00000000..ddbeb2d8
--- /dev/null
+++ b/2.3-1/src/c/hardware/avr/includes/AVRPeripheralGPIO.h
@@ -0,0 +1,45 @@
+//This file defines constants corresponding to gpios and digital input functions.
+//
+// Authors
+// Siddhesh Wani
+//
+
+#ifndef __AVRPERIPHERALGPIO_H__
+#define __AVRPERIPHERALGPIO_H__
+
+#include <avr/io.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include <avr/io.h>
+#include "types.h"
+
+//Port definitions
+#define PORT_A 1
+#define PORT_B 2
+#define PORT_C 3
+#define PORT_D 4
+
+//Direction definitions
+#define INPUT 0
+#define OUTPUT 1
+
+//Pin state definitions
+#define LOW 0
+#define HIGH 1
+
+//Function prototypes
+uint8 u8AVRDigitalSetups(uint8 port,uint8 pin,uint8 direction);
+
+uint8 u8AVRDigitalIns(uint8 port,uint8 pin);
+
+uint8 u8AVRDigitalOuts(uint8 port,uint8 pin,uint8 state);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* !__AVRPERIPHERALGPIO_H__ */