diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/c/hardware/avr/includes/AVRUtil.h | 25 | ||||
-rw-r--r-- | src/c/hardware/avr/interfaces/int_AVRPeripheralADC.h | 4 | ||||
-rw-r--r-- | src/c/hardware/avr/interfaces/int_AVRPeripheralGPIO.h | 2 | ||||
-rw-r--r-- | src/c/hardware/avr/interfaces/int_AVRUtil.h | 23 | ||||
-rw-r--r-- | src/c/hardware/avr/util/U16AVRSleeps.c | 14 |
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; +} |