From 586db6343e7b472d8dc3e63a82f4c73f99cdcbd7 Mon Sep 17 00:00:00 2001 From: siddhu8990 Date: Wed, 19 Apr 2017 14:28:34 +0530 Subject: Merged Ashish's work --- .../src/c/hardware/avr/includes/AVRPeripheralADC.h | 4 +- .../c/hardware/avr/includes/AVRPeripheralGPIO.h | 17 +++++-- .../src/c/hardware/avr/includes/AVRPeripheralPWM.h | 13 +++-- .../c/hardware/avr/includes/AVRPeripheralTimer.h | 17 ++++--- .../c/hardware/avr/includes/AVRPeripheralUART.h | 59 ++++++++++++++++++++++ 2.3-1/src/c/hardware/avr/includes/AVRUtil.h | 14 +++-- 6 files changed, 105 insertions(+), 19 deletions(-) create mode 100644 2.3-1/src/c/hardware/avr/includes/AVRPeripheralUART.h (limited to '2.3-1/src/c/hardware/avr/includes') diff --git a/2.3-1/src/c/hardware/avr/includes/AVRPeripheralADC.h b/2.3-1/src/c/hardware/avr/includes/AVRPeripheralADC.h index 736c3406..2a27e37d 100644 --- a/2.3-1/src/c/hardware/avr/includes/AVRPeripheralADC.h +++ b/2.3-1/src/c/hardware/avr/includes/AVRPeripheralADC.h @@ -15,9 +15,9 @@ extern "C" { #endif //Function prototypes -void u8AVRADCSetups(uint8 prescalar, uint8 adc_ref); +uint8 u8AVRADCSetups(uint8 prescaler, uint8 adc_ref); -uint16 u8AVRReadADCs(uint8 channel); +uint8 u8AVRReadADCs(uint8 channel); #ifdef __cplusplus diff --git a/2.3-1/src/c/hardware/avr/includes/AVRPeripheralGPIO.h b/2.3-1/src/c/hardware/avr/includes/AVRPeripheralGPIO.h index 37f2377e..9a8d2d65 100644 --- a/2.3-1/src/c/hardware/avr/includes/AVRPeripheralGPIO.h +++ b/2.3-1/src/c/hardware/avr/includes/AVRPeripheralGPIO.h @@ -1,8 +1,14 @@ -//This file defines constants corresponding to gpios and digital input functions. -// -// 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 __AVRPERIPHERALGPIO_H__ #define __AVRPERIPHERALGPIO_H__ @@ -38,6 +44,9 @@ 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 diff --git a/2.3-1/src/c/hardware/avr/includes/AVRPeripheralPWM.h b/2.3-1/src/c/hardware/avr/includes/AVRPeripheralPWM.h index 2e41db6e..2107a5a4 100644 --- a/2.3-1/src/c/hardware/avr/includes/AVRPeripheralPWM.h +++ b/2.3-1/src/c/hardware/avr/includes/AVRPeripheralPWM.h @@ -1,7 +1,7 @@ //This file defines functions prototypes related to PWM. // // Authors -// Siddhesh Wani +// Ashish Kamble // #ifndef __AVRPERIPHERALPWM_H__ @@ -15,10 +15,17 @@ extern "C" { #endif //Function prototypes -void u8AVRPWMSetups(uint8 timer, uint8 prescalar, uint8 waveform_mode, uint8 output_mode); +uint8 u8AVRPWM0Setups(uint8 waveform_mode, uint8 output_mode); -void u8AVRPWMSetDutys(uint8 timer, uint8 duty); +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" */ diff --git a/2.3-1/src/c/hardware/avr/includes/AVRPeripheralTimer.h b/2.3-1/src/c/hardware/avr/includes/AVRPeripheralTimer.h index 78b04aae..ab087692 100644 --- a/2.3-1/src/c/hardware/avr/includes/AVRPeripheralTimer.h +++ b/2.3-1/src/c/hardware/avr/includes/AVRPeripheralTimer.h @@ -1,8 +1,13 @@ -//This file defines functions prototypes related to Timer. -// -// 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 __AVRPERIPHERALTIMER_H__ #define __AVRPERIPHERALTIMER_H__ @@ -15,10 +20,10 @@ extern "C" { #endif //Function prototypes -uint8 u8AVRTimerSetups(uint8 timer, uint8 prescalar); -uint8 u8AVRGetTimerValue(uint8 timer); +uint16 u8AVRGetTimerValues(uint16 timer); +uint8 u8AVRTimerSetups(uint8 timer, uint16 prescaler,uint8 clock_source); #ifdef __cplusplus } /* extern "C" */ 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 +#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 index 0aa1923f..55789bef 100644 --- a/2.3-1/src/c/hardware/avr/includes/AVRUtil.h +++ b/2.3-1/src/c/hardware/avr/includes/AVRUtil.h @@ -1,8 +1,14 @@ -//This file defines functions corresponding to delay functions -// -// 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 __AVRUTIL_H__ #define __AVRUTIL_H__ -- cgit