diff options
Diffstat (limited to '2.3-1/src/c/hardware/avr/includes')
-rw-r--r-- | 2.3-1/src/c/hardware/avr/includes/AVRPeripheralADC.h | 27 | ||||
-rw-r--r-- | 2.3-1/src/c/hardware/avr/includes/AVRPeripheralGPIO.h | 54 | ||||
-rw-r--r-- | 2.3-1/src/c/hardware/avr/includes/AVRPeripheralPWM.h | 34 | ||||
-rw-r--r-- | 2.3-1/src/c/hardware/avr/includes/AVRPeripheralTimer.h | 32 | ||||
-rw-r--r-- | 2.3-1/src/c/hardware/avr/includes/AVRPeripheralUART.h | 59 | ||||
-rw-r--r-- | 2.3-1/src/c/hardware/avr/includes/AVRUtil.h | 31 |
6 files changed, 237 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..2a27e37d --- /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 prescaler, uint8 adc_ref); + +uint8 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..9a8d2d65 --- /dev/null +++ b/2.3-1/src/c/hardware/avr/includes/AVRPeripheralGPIO.h @@ -0,0 +1,54 @@ +// 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 __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 +void u8AVRDigitalSetups(uint8 port,uint8 pin,uint8 direction); + +uint8 u8AVRDigitalIns(uint8 port,uint8 pin); + +void u8AVRDigitalOuts(uint8 port,uint8 pin,uint8 state); + +uint8 u8AVRDigitalPortSetups(uint8 port,uint8 direction); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* !__AVRPERIPHERALGPIO_H__ */ diff --git a/2.3-1/src/c/hardware/avr/includes/AVRPeripheralPWM.h b/2.3-1/src/c/hardware/avr/includes/AVRPeripheralPWM.h new file mode 100644 index 00000000..2107a5a4 --- /dev/null +++ b/2.3-1/src/c/hardware/avr/includes/AVRPeripheralPWM.h @@ -0,0 +1,34 @@ +//This file defines functions prototypes related to PWM. +// +// Authors +// Ashish Kamble +// + +#ifndef __AVRPERIPHERALPWM_H__ +#define __AVRPERIPHERALPWM_H__ + +#include <avr/io.h> +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +//Function prototypes +uint8 u8AVRPWM0Setups(uint8 waveform_mode, uint8 output_mode); + +uint8 u8AVRPWM2Setups(uint8 waveform_mode, uint8 output_mode); + +uint8 u8AVRPWM1Setups(uint8 waveform_mode, uint8 output_mode, uint8 output_pin); + +uint8 u8AVRPWM0SetDutys(uint8 duty); + +uint8 u8AVRPWM2SetDutys(uint8 duty); + +uint8 u8AVRPWM1SetDutys(uint8 output_pin, uint16 duty, uint16 Top_Value); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* !__AVRPERIPHERALPWM_H__ */ diff --git a/2.3-1/src/c/hardware/avr/includes/AVRPeripheralTimer.h b/2.3-1/src/c/hardware/avr/includes/AVRPeripheralTimer.h new file mode 100644 index 00000000..ab087692 --- /dev/null +++ b/2.3-1/src/c/hardware/avr/includes/AVRPeripheralTimer.h @@ -0,0 +1,32 @@ +// 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 __AVRPERIPHERALTIMER_H__ +#define __AVRPERIPHERALTIMER_H__ + +#include <avr/io.h> +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +//Function prototypes + +uint16 u8AVRGetTimerValues(uint16 timer); + +uint8 u8AVRTimerSetups(uint8 timer, uint16 prescaler,uint8 clock_source); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* !__AVRPERIPHERALTIMER_H__ */ diff --git a/2.3-1/src/c/hardware/avr/includes/AVRPeripheralUART.h b/2.3-1/src/c/hardware/avr/includes/AVRPeripheralUART.h new file mode 100644 index 00000000..09db3b03 --- /dev/null +++ b/2.3-1/src/c/hardware/avr/includes/AVRPeripheralUART.h @@ -0,0 +1,59 @@ +// 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 __AVRPERIPHERALUART_H__ +#define __AVRPERIPHERALUART_H__ + +#include <avr/io.h> +#include "types.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +//Function prototypes +uint8 u8AVRUARTSetups(uint8 mode, uint32 baudrate, uint8 stopbits, uint8 parity); + +uint8 u8AVRUARTTransmits(uint8 data); + +uint8 gAVRUARTTransmits(char* msg,int size); + +uint8 u16AVRUARTTransmits(uint16 data); + +uint8 i16AVRUARTTransmits(int16 data); + +uint8 i8AVRUARTTransmits(int8 data); + +//uint8 sAVRUARTTransmits(float data); + +uint8 u8AVRUARTTransmita(uint8 *x,int size); + +//uint8 gAVRUARTTransmita(uint8 *x,int size); + +uint8 u16AVRUARTTransmita(uint16 *x,int size); + +uint8 i16AVRUARTTransmita(int16 *x,int size); + +uint8 i8AVRUARTTransmita(int8 *x,int size); + +uint8 u8AVRUSARTReceiveCharu8(); + +uint8 dAVRUARTTransmits(double data); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* !__AVRUART_H__ */ + + diff --git a/2.3-1/src/c/hardware/avr/includes/AVRUtil.h b/2.3-1/src/c/hardware/avr/includes/AVRUtil.h new file mode 100644 index 00000000..55789bef --- /dev/null +++ b/2.3-1/src/c/hardware/avr/includes/AVRUtil.h @@ -0,0 +1,31 @@ +// 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 __AVRUTIL_H__ +#define __AVRUTIL_H__ + +#include <avr/io.h> + + +#ifdef __cplusplus +extern "C" { +#endif + +#include "types.h" +#include "util/delay.h" + +uint8 u16AVRSleeps (uint16 delay); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* !__AVRUTIL_H__ */ |