diff options
Diffstat (limited to '2.3-1/macros/Hardware/AVR')
19 files changed, 420 insertions, 0 deletions
diff --git a/2.3-1/macros/Hardware/AVR/AVRADCSetup.sci b/2.3-1/macros/Hardware/AVR/AVRADCSetup.sci index 264062bc..5299058c 100644 --- a/2.3-1/macros/Hardware/AVR/AVRADCSetup.sci +++ b/2.3-1/macros/Hardware/AVR/AVRADCSetup.sci @@ -17,6 +17,21 @@ function AVRADCSetup(prescaler,adc_ref) // Parameters // prescaler: prescaler to be used for generating ADC clock (0-7) // adc_ref : reference voltage to be used for ADC conversion +<<<<<<< HEAD +// +// Description +// This function initialises ADc of AVR with given parameters. 'prescaler' is needed for deciding ADC clock. ADC clock should be between 50KHz and 200KHz and it given as (MCU clock/2^prescaler). Select appropriate prescaler depending on MCU clock. 'adc_ref' selects one of the available reference voltage sources available. +// +// The adc_ref can take the following values- +// <itemizedlist> +// <listitem><para>0 -> Voltage on VREF pin</para></listitem> +// <listitem><para>1 -> Voltage on AVCC pin</para></listitem> +// <listitem><para>2 -> Internal 2.56 reference voltage</para></listitem> +// </itemizedlist> +// +// This is curretly dummy function. It provides no functionality but is required for providing support for generating C code for AVR. +// +======= // 0 -> Voltage on VREF pin // 1 -> Voltage on AVCC pin // 2 -> Internal 2.56 reference voltage @@ -27,16 +42,23 @@ function AVRADCSetup(prescaler,adc_ref) // and it given as (MCU clock/2^prescaler). Select appropriate prescaler depending // on MCU clock. 'adc_ref' selects one of the available reference voltage sources // available +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 // Examples // AVRADCSetup(128,0) // See also // AVRReadADC // // Authors +<<<<<<< HEAD +// Siddhesh Wani +// Ashish Kamble +// +======= // Siddhesh Wani Ashish Kamble // // This is curretly dummy function. It provides no functionality but is required // for providing support for generating C code for AVR. +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 if(prescaler>=8) disp("Error : Invalid input argument ''prescaler'' in AVRADCSetup function."); diff --git a/2.3-1/macros/Hardware/AVR/AVRDigitalIn.sci b/2.3-1/macros/Hardware/AVR/AVRDigitalIn.sci index 54eb327b..421a4f63 100644 --- a/2.3-1/macros/Hardware/AVR/AVRDigitalIn.sci +++ b/2.3-1/macros/Hardware/AVR/AVRDigitalIn.sci @@ -18,8 +18,11 @@ function state = AVRDigitalIn(port,pin) // Parameters // port : port of microcontroller to be used // pin : pin of port (mentioned above) to be used +<<<<<<< HEAD +======= // Returns // state : state of an input pin (HIGH\LOW) +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 // // Description // Each AVR microcontroller has pins which can be configured as digital @@ -27,6 +30,20 @@ function state = AVRDigitalIn(port,pin) // User has to select one of these port and which pin of that port as // digital input. // +<<<<<<< HEAD +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +// +// Examples +// pinA0 = AVRDigitalIn(1,0) //To read state on pin 0 of port A +// See also +// AVRDigitalOut AVRDigitalSetup +// +// Authors +// Siddhesh Wani +// Ashish Kamble +// +======= // Examples // pinA0 = AVRDigitalIn(1,0) //To read state on pin 0 of port A // @@ -39,6 +56,7 @@ function state = AVRDigitalIn(port,pin) // // This is curretly dummy function. It provides no functionality but is required // for providing support for generating C code for AVR. +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 if((port==0)|(port>=5)) then disp("Error : Inavalid input argument ''port'' in AVRDigitalIn function."); diff --git a/2.3-1/macros/Hardware/AVR/AVRDigitalOut.sci b/2.3-1/macros/Hardware/AVR/AVRDigitalOut.sci index a86a5aa9..a80aff0f 100644 --- a/2.3-1/macros/Hardware/AVR/AVRDigitalOut.sci +++ b/2.3-1/macros/Hardware/AVR/AVRDigitalOut.sci @@ -26,6 +26,20 @@ function AVRDigitalOut(port,pin,state) // digital output. Also, desired output state must be specified as // 'HIGH' or 'LOW'. // +<<<<<<< HEAD +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +// +// Examples +// AVRDigitalOut('A',0,HIGH) +// See also +// AVRDigitalIn +// +// Authors +// Siddhesh Wani +// Ashish Kamble +// +======= // Examples // AVRDigitalOut('A',0,HIGH) // @@ -38,6 +52,7 @@ function AVRDigitalOut(port,pin,state) // // This is curretly dummy function. It provides no functionality but is required // for providing support for generating C code for AVR. +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 if((port==0)|(port>=8)) then disp("Error : Inavalid input argument ''port'' in AVRDigitalOut function."); diff --git a/2.3-1/macros/Hardware/AVR/AVRDigitalPortSetup.sci b/2.3-1/macros/Hardware/AVR/AVRDigitalPortSetup.sci index 5f0b9671..26bec8db 100644 --- a/2.3-1/macros/Hardware/AVR/AVRDigitalPortSetup.sci +++ b/2.3-1/macros/Hardware/AVR/AVRDigitalPortSetup.sci @@ -15,7 +15,11 @@ function AVRDigitalPortSetup(port,direction) // AVRDigitalPortSetup(port,direction) // // Parameters +<<<<<<< HEAD +// port : port of microcontroller to be used(1 for PORTA, 2 for PORTB,...) +======= // port : port of microcontroller to be used(1 for PORTA, 2 for PORTB,...) +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 // direction : direction to be set for pin (0 for INPUT, 1 for OUTPUT) // // Description @@ -25,18 +29,31 @@ function AVRDigitalPortSetup(port,direction) // used as digital output/input. Also, desired direction must be specified as // 'INPUT' or 'OUTPUT'. // +<<<<<<< HEAD +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +// +======= +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 // Examples // AVRDigitalPortSetup(1,0); //This function will make PortA as input port // // See also // AVRDigitalIn AVRDigitalOut // +<<<<<<< HEAD +// Authors +// Siddhesh Wani +// Ashish Kamble +// +======= // // Authors // Siddhesh Wani Ashish Kamble // // This is curretly dummy function. It provides no functionality but is required // for providing support for generating C code for AVR. +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 if((port==0)|(port>=5)) then disp("Error : Invalid input argument ''port'' in AVRDigitalPortSetup function."); diff --git a/2.3-1/macros/Hardware/AVR/AVRDigitalSetup.sci b/2.3-1/macros/Hardware/AVR/AVRDigitalSetup.sci index e707d4fa..8e4efc7e 100644 --- a/2.3-1/macros/Hardware/AVR/AVRDigitalSetup.sci +++ b/2.3-1/macros/Hardware/AVR/AVRDigitalSetup.sci @@ -15,8 +15,13 @@ function AVRDigitalSetup(port,pin,direction) // AVRDigitalSetup(port,pin,direction) // // Parameters +<<<<<<< HEAD +// port : port of microcontroller to be used +// pin : pin of port (mentioned above) to be used +======= // port : port of microcontroller to be used // pin : pin of port (mentioned above) to be used +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 // direction : direction to be set for pin (INPUT\OUTPUT) // // Description @@ -26,18 +31,31 @@ function AVRDigitalSetup(port,pin,direction) // used as digital output/input. Also, desired direction must be specified as // 'INPUT' or 'OUTPUT'. // +<<<<<<< HEAD +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +// +======= +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 // Examples // AVRDigitalSetup('A',0,OUTPUT) // // See also // AVRDigitalIn AVRDigitalOut // +<<<<<<< HEAD +// Authors +// Siddhesh Wani +// Ashish Kamble +// +======= // // Authors // Siddhesh Wani Ashish Kamble // // This is curretly dummy function. It provides no functionality but is required // for providing support for generating C code for AVR. +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 if((port==0)|(port>=5)) then disp("Error : Invalid input argument ''port'' in AVRDigitalSetup function."); diff --git a/2.3-1/macros/Hardware/AVR/AVRGetTimerValue.sci b/2.3-1/macros/Hardware/AVR/AVRGetTimerValue.sci index afb47ac8..0b501448 100644 --- a/2.3-1/macros/Hardware/AVR/AVRGetTimerValue.sci +++ b/2.3-1/macros/Hardware/AVR/AVRGetTimerValue.sci @@ -18,20 +18,40 @@ function count = AVRGetTimerValue(timer) // 2 for timer2 // // Description +<<<<<<< HEAD +// This function returns the count value of a desired timer.By knowing the count value certain interrupt action can be taken. +// +// Timer can take the following values +// <itemizedlist> +// <listitem><para>0 -> for timer0</para></listitem> +// <listitem><para>1 -> for timer1</para></listitem> +// <listitem><para>2 -> for timer2</para></listitem> +// </itemizedlist> +// +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +// +// Examples +// AVRGetTimerValue(0); //returns present count of the TCNT0 counter +======= // This function returns the count value of a desired timer.By knowing the count value // certain interrupt action can be taken. // // Examples // AVRGetTimerValue(0); //returns present count of the TCNT0 counter // +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 // See also // AVRTimerSetup // // Authors // Ashish Kamble // +<<<<<<< HEAD +======= // This is curretly dummy function. It provides no functionality but is required // for providing support for generating C code for AVR. +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 if(timer>=3) then disp("Error : Invalid input argument ''timer'' in AVRGetTimerValue function."); diff --git a/2.3-1/macros/Hardware/AVR/AVRPWM0SetDuty.sci b/2.3-1/macros/Hardware/AVR/AVRPWM0SetDuty.sci index 604d2f40..f1faebef 100644 --- a/2.3-1/macros/Hardware/AVR/AVRPWM0SetDuty.sci +++ b/2.3-1/macros/Hardware/AVR/AVRPWM0SetDuty.sci @@ -9,6 +9,20 @@ // Email: toolbox@scilab.in function AVRPWM0SetDuty(duty) +<<<<<<< HEAD +//Function to Set Duty cycle of PWM Output generated by Timer0 at OC0 pin. +// +//Parameters +// duty : It holds an integer value from 0 to 100 which sets the percentage of time for which signal is active. +// +//Description +// Each Micro controller has PWM output pins which can generate varying voltage +// from 0V-5V.In this function by varying the duty cycle, varying voltage can be produced. +// +// This is curretly dummy function. It provides no functionality but is required for providing support for generating C code for AVR. +// +//Examples +======= //Function to Set Duty cycle of PWM Output generated by Timer0 at OC0 pin. //Parameters // duty : It holds an integer value from 0 to 100 which sets the percentage @@ -18,6 +32,7 @@ function AVRPWM0SetDuty(duty) // from 0V-5V.In this function by varying the duty cycle, varying voltage can be // produced. //Example +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 // AVRPWM0SetDuty(50); //Produces 2.5V at OC0 pin // AVRPWM0SetDuty(0); //Produces 0V at OC0 pin //See also @@ -26,8 +41,11 @@ function AVRPWM0SetDuty(duty) //Authors // Ashish Kamble // +<<<<<<< HEAD +======= // This is curretly dummy function. It provides no functionality but is required // for providing support for generating C code for AVR. +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 if(duty>100) then disp("Error : Invalid input argument ''duty'' in AVRPWM0SetDuty function."); diff --git a/2.3-1/macros/Hardware/AVR/AVRPWM0Setup.sci b/2.3-1/macros/Hardware/AVR/AVRPWM0Setup.sci index 39861c86..19d91a2a 100644 --- a/2.3-1/macros/Hardware/AVR/AVRPWM0Setup.sci +++ b/2.3-1/macros/Hardware/AVR/AVRPWM0Setup.sci @@ -10,11 +10,47 @@ function AVRPWM0Setup(waveform_mode,output_mode) //Function to Setup OC0 pin for required PWM mode +<<<<<<< HEAD +// +//Parameters +// waveform_mode: integer, from 0 to 2 +// output_mode: integer, from 0 to 1 (or 2) depending on the waveform_mode +// +======= +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 //Description // Every Micro controller has PWM pins which can generate varying voltages // from 0V-5V.This function helps to use OC0 pin to produce required // output waveform by setting the waveform mode and otput mode. // +<<<<<<< HEAD +// waveform_mode can take values- +// <itemizedlist> +// <listitem><para>0 -> for Phase correct PWM Mode</para></listitem> +// <listitem><para>1 -> for Fast PWM Mode</para></listitem> +// <listitem><para>2 -> for CTC Mode</para></listitem> +// </itemizedlist> +// +// output_mode can take values- +// <itemizedlist> +// For Phase correct PWM Mode: +// <listitem><para>0 for Clear OC0 on compare match when up-counting. Set OC0 on compare match when down-counting.</para></listitem> +// <listitem><para>1 for Set OC0 on compare match when up-counting. Clear OC0 on compare match when down-counting.</para></listitem> +// For Fast PWM Mode: +// <listitem><para>0 for non-inverted output i.e Clear OC0 on compare match, set OC0 at BOTTOM.</para></listitem> +// <listitem><para>1 for inverted output i.e Set OC0 on compare match, clear OC0 at BOTTOM.</para></listitem> +// For CTC Mode: +// <listitem><para>0 to Clear OC0 on compare match</para></listitem> +// <listitem><para>1 to Set OC0 on compare match</para></listitem> +// <listitem><para>2 to toggle OC0 on compare match</para></listitem> +// </itemizedlist> +// +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +// +//Examples +// AVRPWM0Setup(2,0); //This function will select CTC waveform mode and will clear OC0 on compare match +======= //Parameters // waveform_mode: // 0 for Phase correct PWM Mode @@ -39,14 +75,18 @@ function AVRPWM0Setup(waveform_mode,output_mode) //Example // AVRPWM0Setup(2,0); //This function will select CTC waveform mode and will clear OC0 on // compare match +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 //See also // AVRPWM0SetDuty // //Authors // Ashish Kamble // +<<<<<<< HEAD +======= //This is curretly dummy function. It provides no functionality but is required //for providing support for generating C code for AVR. +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 if(waveform_mode>=3) then disp("Error : Invalid input argument ''waveform_mode'' in AVRPWM0Setup function."); diff --git a/2.3-1/macros/Hardware/AVR/AVRPWM1SetDuty.sci b/2.3-1/macros/Hardware/AVR/AVRPWM1SetDuty.sci index 60dc0a9f..6b3e21f0 100644 --- a/2.3-1/macros/Hardware/AVR/AVRPWM1SetDuty.sci +++ b/2.3-1/macros/Hardware/AVR/AVRPWM1SetDuty.sci @@ -11,6 +11,13 @@ function AVRPWM1SetDuty(output_pin,duty,Top_Value) //Function to Set Duty cycle of PWM Output generated by Timer1 at OC1A or OC1B pin. //Parameters +<<<<<<< HEAD +// ouput_pin: integer, 0 (for OC1A) or 1 (for OC1B) +// +// duty: It holds an integer value from 0 to 100 which sets the percentage of time for which signal is active. +// +// Top_Value: It holds an integer value from 0 to 65535.This value sets the Top value of the counter TCNT1 i.e ICR.(for more info refer datasheet) +======= // ouput_pin: // 0 for selecting OC1A as output pin // 1 for selecting OC1B as output pin @@ -20,25 +27,37 @@ function AVRPWM1SetDuty(output_pin,duty,Top_Value) // // Top_Value: It holds an integer value from 0 to 65535.This value sets the Top // value of the counter TCNT1 i.e ICR.(for more info refer datasheet) +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 // //Description // Each Micro controller has PWM output pins which can generate varying voltage // from 0V-5V.This function Sets the duty cycle of output PWM signal.Also this function // decides the Top Vale of TCNT1 and the output pin to output PWM signal. // +<<<<<<< HEAD +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +// +//Example +// AVRPWM1SetDuty(0,50,40000); //This function will produce PWM signal of 50% duty cycle on OC1A pin and TCNT1 will reset at 40000 instead at 65535. +======= //Example // AVRPWM1SetDuty(0,50,40000); //This function will produce PWM signal of 50% duty // cycle on OC1A pin and TCNT1 will reset at 40000 instead // at 65535. // +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 //See also // AVRPWM1Setup // //Authors // Ashish Kamble // +<<<<<<< HEAD +======= // This is curretly dummy function. It provides no functionality but is required // for providing support for generating C code for AVR. +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 if(output_pin>=2) then disp("Error : Invalid input argument ''output_pin'' in AVRPWM1SetDuty function."); diff --git a/2.3-1/macros/Hardware/AVR/AVRPWM1Setup.sci b/2.3-1/macros/Hardware/AVR/AVRPWM1Setup.sci index 51aa25b1..feb40bd6 100644 --- a/2.3-1/macros/Hardware/AVR/AVRPWM1Setup.sci +++ b/2.3-1/macros/Hardware/AVR/AVRPWM1Setup.sci @@ -10,11 +10,45 @@ function AVRPWM1Setup(waveform_mode,output_mode,output_pin) //Function to Setup OC1A or OC1B pin for required PWM mode +<<<<<<< HEAD +// +//Parameters +// waveform_mode: integer, from 0 to 2 +// output_mode: integer, from 0 to 1 (or 2) depending on the waveform_mode +// output_pin: 0 (for OC1A) or 1 for (OC1B) +// +======= +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 //Description // Every Micro controller has PWM pins which can generate varying voltages // from 0V-5V.This function helps to use OC1A or OC1B pin to produces required // output waveform by setting the waveform mode and otput mode. // +<<<<<<< HEAD +// waveform_mode can take values- +// <itemizedlist> +// <listitem><para>0 -> for Phase correct PWM Mode</para></listitem> +// <listitem><para>1 -> for Fast PWM Mode</para></listitem> +// <listitem><para>2 -> for CTC Mode</para></listitem> +// </itemizedlist> +// +// output_mode can take values- +// <itemizedlist> +// For Phase correct PWM Mode: +// <listitem><para>0 for Clear OC1A or OC1B on compare match when up-counting. Set OC1A or OC1B on compare match when down-counting.</para></listitem> +// <listitem><para>1 for Set OC1A or OC1B on compare match when up-counting. Clear OC1A or OC1B on compare match when down-counting.</para></listitem> +// For Fast PWM Mode: +// <listitem><para>0 for non-inverted output i.e Clear OC1A or OC1B on compare match, set OC1A or OC1B at BOTTOM.</para></listitem> +// <listitem><para>1 for inverted output i.e Set OC1A or OC1B on compare match, clear OC1A or OC1B at BOTTOM.</para></listitem> +// For CTC Mode: +// <listitem><para>0 to Clear OC1A or OC1B on compare match</para></listitem> +// <listitem><para>1 to Set OC1A or OC1B on compare match</para></listitem> +// <listitem><para>2 to toggle OC1A or OC1B on compare match</para></listitem> +// </itemizedlist> +// +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +======= //Parameters // waveform_mode: // 0 for Phase correct PWM Mode @@ -42,6 +76,7 @@ function AVRPWM1Setup(waveform_mode,output_mode,output_pin) // output_pin: // 0 for selecting OC1A as output pin // 1 for selecting OC1B as output pin +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 // //Example // AVRPWM1Setup(2,0,0); //This function will select CTC mode and will clear OC1A or OC1B @@ -53,8 +88,11 @@ function AVRPWM1Setup(waveform_mode,output_mode,output_pin) //Authors // Ashish Kamble // +<<<<<<< HEAD +======= // This is curretly dummy function. It provides no functionality but is required // for providing support for generating C code for AVR. +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 if(waveform_mode>=3) then disp("Error : Invalid input argument ''waveform_mode'' in AVRPWM1Setup function."); diff --git a/2.3-1/macros/Hardware/AVR/AVRPWM2SetDuty.sci b/2.3-1/macros/Hardware/AVR/AVRPWM2SetDuty.sci index 929c1a0a..75ae8599 100644 --- a/2.3-1/macros/Hardware/AVR/AVRPWM2SetDuty.sci +++ b/2.3-1/macros/Hardware/AVR/AVRPWM2SetDuty.sci @@ -10,14 +10,26 @@ function AVRPWM2SetDuty(duty) //Function to Set Duty cycle of PWM Output generated by Timer2 at OC2 pin. +<<<<<<< HEAD +// +//Parameters +// duty : It holds an integer value from 0 to 100 which sets the percentage of time for which signal is active. +// +======= +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 //Description // Each Micro controller has PWM output pins which can generate varying voltage // from 0V-5V.In this function by varying the duty cycle, varying voltage can be // produced. // +<<<<<<< HEAD +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +======= //Parameters // duty : It holds an integer value from 0 to 100 which sets the percentage // of time for which signal is active. +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 // //Example // AVRPWM2SetDuty(50); //Produces 2.5V at OC2 pin @@ -29,8 +41,11 @@ function AVRPWM2SetDuty(duty) //Authors // Ashish Kamble // +<<<<<<< HEAD +======= // This is curretly dummy function. It provides no functionality but is required // for providing support for generating C code for AVR. +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 if(duty>100) then disp("Error : Invalid input argument ''duty'' in AVRPWM2SetDuty function."); diff --git a/2.3-1/macros/Hardware/AVR/AVRPWM2Setup.sci b/2.3-1/macros/Hardware/AVR/AVRPWM2Setup.sci index d4bc74a6..c76f3f35 100644 --- a/2.3-1/macros/Hardware/AVR/AVRPWM2Setup.sci +++ b/2.3-1/macros/Hardware/AVR/AVRPWM2Setup.sci @@ -10,11 +10,45 @@ function AVRPWM2Setup(waveform_mode,output_mode) //Function to Setup OC2 pin for required PWM mode +<<<<<<< HEAD +// +//Parameters +// waveform_mode: integer, from 0 to 2 +// output_mode: integer, from 0 to 1 (or 2) depending on the waveform_mode +// +======= +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 //Description // Every Micro controller has PWM pins which can generate varying voltages // from 0V-5V.This function helps to use OC2 pin to produces required // output waveform by setting the waveform mode and otput mode. // +<<<<<<< HEAD +// waveform_mode can take values- +// <itemizedlist> +// <listitem><para>0 -> for Phase correct PWM Mode</para></listitem> +// <listitem><para>1 -> for Fast PWM Mode</para></listitem> +// <listitem><para>2 -> for CTC Mode</para></listitem> +// </itemizedlist> +// +// output_mode can take values- +// <itemizedlist> +// For Phase correct PWM Mode: +// <listitem><para>0 for Clear OC2 on compare match when up-counting. Set OC2 on compare match when down-counting.</para></listitem> +// <listitem><para>1 for Set OC2 on compare match when up-counting. Clear OC2 on compare match when down-counting.</para></listitem> +// For Fast PWM Mode: +// <listitem><para>0 for non-inverted output i.e Clear OC2 on compare match, set OC2 at BOTTOM.</para></listitem> +// <listitem><para>1 for inverted output i.e Set OC2 on compare match, clear OC2 at BOTTOM.</para></listitem> +// For CTC Mode: +// <listitem><para>0 to Clear OC2 on compare match</para></listitem> +// <listitem><para>1 to Set OC2 on compare match</para></listitem> +// <listitem><para>2 to toggle OC2 on compare match</para></listitem> +// </itemizedlist> +// +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +// +======= //Parameters // waveform_mode: // 0 for Phase correct PWM Mode @@ -36,6 +70,7 @@ function AVRPWM2Setup(waveform_mode,output_mode) // 1 to Set OC2 on compare match // 2 to toggle OC2 on compare match // +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 //Example // AVRPWM2Setup(2,0); //This function will select CTC waveform mode and will clear OC2 on // compare match @@ -45,8 +80,11 @@ function AVRPWM2Setup(waveform_mode,output_mode) //Authors // Ashish Kamble // +<<<<<<< HEAD +======= //This is curretly dummy function. It provides no functionality but is required //for providing support for generating C code for AVR. +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 if(waveform_mode>=3) then disp("Error : Invalid input argument ''waveform_mode'' in AVRPWM2Setup function."); diff --git a/2.3-1/macros/Hardware/AVR/AVRReadADC.sci b/2.3-1/macros/Hardware/AVR/AVRReadADC.sci index 7fd3e67e..aa94c58d 100644 --- a/2.3-1/macros/Hardware/AVR/AVRReadADC.sci +++ b/2.3-1/macros/Hardware/AVR/AVRReadADC.sci @@ -15,11 +15,15 @@ function adc_result = AVRReadADC(channel) // u8AVRReadADCs(channel) // // Parameters +<<<<<<< HEAD +// channel : Select which channel is to be read. Values from 0-7 select one of the pins ADC0-ADC7. For other possible channel values refer datasheet +======= // channel : Select which channel is to be read. Values from 0-7 select one // of the pins ADC0-ADC7. For other possible channel values refer // datasheet // Returns-> // result : Digital value for the voltage present on channel selected +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 // // Description // This function returns digital value for present on adc pins. 'channel' @@ -28,6 +32,17 @@ function adc_result = AVRReadADC(channel) // voltages between some pins. For channel values for those options, please // refer datasheet. // +<<<<<<< HEAD +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +// +// Examples +// adc_result = u8AVRReadADC(0) //Read ADC0 +// Authors +// Siddhesh Wani +// Ashish Kamble +// +======= // Examples // adc_result = u8AVRReadADC(0) //Read ADC0 // @@ -36,6 +51,7 @@ function adc_result = AVRReadADC(channel) // // This is curretly dummy function. It provides no functionality but is required // for providing support for generating C code for AVR. +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 if(channel>=8) then disp("Error : Inavlid input argument ''channel'' in AVRReadADC function."); diff --git a/2.3-1/macros/Hardware/AVR/AVRSleep.sci b/2.3-1/macros/Hardware/AVR/AVRSleep.sci index a1b6add2..005fe4ed 100644 --- a/2.3-1/macros/Hardware/AVR/AVRSleep.sci +++ b/2.3-1/macros/Hardware/AVR/AVRSleep.sci @@ -1,4 +1,25 @@ function AVRSleep(delay) +<<<<<<< HEAD +// Function to pause the execution for the given time. +// +// Parameter +// delay : The time, in milliseconds, for which the execution is to be paused +// +// Description +// This function causes the execution to stop for the given amount of time. +// +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +// +//Examples +// AVRSleep(5000); +//See also +// +// Authors +// Jorawar Singh +// +======= +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 endfunction diff --git a/2.3-1/macros/Hardware/AVR/AVRTimerSetup.sci b/2.3-1/macros/Hardware/AVR/AVRTimerSetup.sci index 7c5dd1da..c4c4535e 100644 --- a/2.3-1/macros/Hardware/AVR/AVRTimerSetup.sci +++ b/2.3-1/macros/Hardware/AVR/AVRTimerSetup.sci @@ -10,11 +10,43 @@ function AVRTimerSetup(timer,prescaler,clock_source) //Function to setup Timers in ATmega16 +<<<<<<< HEAD +// +//Parameters: +// timer : integer, from 0 to 2 +// prescaler : integer. +// clock_source : integer, 0 (for internal) or 1 (for external) +// +======= +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 //Descrpition: // This function tells the micro controller which clock source you will be using. // The timer value and prescaler value passed in this function setup the timer as per // your requirement. // +<<<<<<< HEAD +// timer can take values- +// <itemizedlist> +// <listitem><para>0 -> for timer0</para></listitem> +// <listitem><para>1 -> for timer1</para></listitem> +// <listitem><para>2 -> for timer2</para></listitem> +// </itemizedlist> +// +// prescaler can take values- +// <itemizedlist> +// <listitem><para>1 for no prescaling i.e clock will run at max 16Hz frequency</para></listitem> +// <listitem><para>8 for prescaling clock by 8 i.e new clock frequency will be (clk/8)</para></listitem> +// <listitem><para>64 for prescaling clock by 64 i.e new clock frequency will be (clk/64)</para></listitem> +// <listitem><para>256 for prescaling clock by 256 i.e new clock frequency will be (clk/256)</para></listitem> +// <listitem><para>1024 for prescaling clock by 1024 i.e new clock frequency will be (clk/1024)</para></listitem> +// </itemizedlist> +// +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +// +//Example +// AVRTimerSetup(0,64,0); //This function will select timer0 with timer running as per internal clock source and prescaled by 64. +======= //Parameters: // timer : It is an integer value. // 0 to setup timer0 @@ -33,14 +65,18 @@ function AVRTimerSetup(timer,prescaler,clock_source) // AVRTimerSetup(0,64,0); //This function will select timer0 with timer running as per // internal clock source and prescaled by 64. // +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 //See also // AVRGetTimerValues // //Authors // Ashish Kamble // +<<<<<<< HEAD +======= //This is curretly dummy function. It provides no functionality but is required //for providing support for generating C code for AVR. +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 if(timer>=3) then disp("Error : Invalid input argument ''timer'' in AVRTimerSetup function."); diff --git a/2.3-1/macros/Hardware/AVR/AVRUARTReceive.sci b/2.3-1/macros/Hardware/AVR/AVRUARTReceive.sci index 790894fb..f7502e23 100644 --- a/2.3-1/macros/Hardware/AVR/AVRUARTReceive.sci +++ b/2.3-1/macros/Hardware/AVR/AVRUARTReceive.sci @@ -10,13 +10,25 @@ function received = AVRUARTReceive() // Function to Receive Char value send to ATmega16 using UART or USART. +<<<<<<< HEAD +// +======= +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 // Description // This function Receives Char as 8 bit value.This value is stored in UDR at receiving // end. // +<<<<<<< HEAD +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +// +//Examples +// state = AVRUARTReceive(); //This function will Receive char and return the entire value +======= //Examples // state = AVRUARTReceive(); //This function will Receive char and return the entire value // +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 //See also // AVRUARTSetup // AVRUARTTransmit @@ -24,7 +36,10 @@ function received = AVRUARTReceive() // Authors // Ashish Kamble // +<<<<<<< HEAD +======= // This is curretly dummy function. It provides no functionality but is required // for providing support for generating C code for AVR. +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 received = 0; // received has been initialised to avoid runtime error. endfunction diff --git a/2.3-1/macros/Hardware/AVR/AVRUARTSetup.sci b/2.3-1/macros/Hardware/AVR/AVRUARTSetup.sci index 32e5db86..896674b3 100644 --- a/2.3-1/macros/Hardware/AVR/AVRUARTSetup.sci +++ b/2.3-1/macros/Hardware/AVR/AVRUARTSetup.sci @@ -10,6 +10,36 @@ function AVRUARTSetup(mode, baudrate, stopbits, parity) // Function to Setup Serial Communication i.e UART or USART in ATmega16. +<<<<<<< HEAD +// +// Parameters +// mode : integer, from 0 to 2 +// baudrate : Enter one of the following available baudrates (2400 , 4800 , 9600 , 14400 , 19200 , 28800 , 38400 , 57600 , 768000 , 115200 , 230400 , 250000 , 1000000) +// stopbits : integer, (0 for one stopbit) or (1 for two stopbits) +// parity : integer, from 0 to 2 +// +// Description +// This function Setup the UART or USART for Serial Communicaion between ATmega16 +// and different micro controllers or between ATmega16 and Computer. +// +// mode can take values: +// <itemizedlist> +// <listitem><para>0 for Asynchronous Normal mode</para></listitem> +// <listitem><para>1 for Asynchronous Double Speed mode</para></listitem> +// <listitem><para>2 for Synchronous mode</para></listitem> +// </itemizedlist> +// +// parity can take values: +// <itemizedlist> +// <listitem><para>0 for parity disabled</para></listitem> +// <listitem><para>1 for even parity</para></listitem> +// <listitem><para>2 for odd parity</para></listitem> +// </itemizedlist> +// +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +// +======= // Description // This function Setup the UART or USART for Serial Communicaion between ATmega16 // and different micro controllers or between ATmega16 and Computer. @@ -33,6 +63,7 @@ function AVRUARTSetup(mode, baudrate, stopbits, parity) // 1 for even parity // 2 for odd parity // +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 //Examples // AVRUARTSetup(0,9600,0,0); //This function will enable UART Communication for ATmega16 // with 9600 as baudrate,one stop bit and parity disabled @@ -43,8 +74,12 @@ function AVRUARTSetup(mode, baudrate, stopbits, parity) // Authors // Ashish Kamble // +<<<<<<< HEAD + +======= // This is curretly dummy function. It provides no functionality but is required // for providing support for generating C code for AVR. +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 if(mode>=3) then disp("Error : Invalid input argument ''mode'' in AVRUARTSetup function."); end diff --git a/2.3-1/macros/Hardware/AVR/AVRUARTTransmit.sci b/2.3-1/macros/Hardware/AVR/AVRUARTTransmit.sci index eb358499..150b9fe9 100644 --- a/2.3-1/macros/Hardware/AVR/AVRUARTTransmit.sci +++ b/2.3-1/macros/Hardware/AVR/AVRUARTTransmit.sci @@ -10,6 +10,21 @@ function AVRUARTTransmit(data) // Function to Transmit data using UART or USART. +<<<<<<< HEAD +// +// Parameter +// data : The data to be transmitted can be a Char,String,Unsigned Int,Signed Int. +// +// Description +// This function Tranmits data over UART or USART.The data to be transmitted can +// be a Char , String , Unsigned Int, Signed Int. +// +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +// +//Examples +// AVRUARTTransmit("This is example"); //This function will transmit the entered string. +======= // Description // This function Tranmits data over UART or USART.The data to be transmitted can // be a Char , String , Unsigned Int, Signed Int. @@ -21,6 +36,7 @@ function AVRUARTTransmit(data) //Examples // AVRUARTTransmit("This is example"); //This function will transmit the entered string. // +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 //See also // AVRUARTSetup // AVRUARTReceive @@ -28,6 +44,9 @@ function AVRUARTTransmit(data) // Authors // Ashish Kamble // +<<<<<<< HEAD +======= // This is curretly dummy function. It provides no functionality but is required // for providing support for generating C code for AVR. +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 endfunction diff --git a/2.3-1/macros/Hardware/AVR/lib b/2.3-1/macros/Hardware/AVR/lib Binary files differindex 7631c354..a3d9e10c 100644 --- a/2.3-1/macros/Hardware/AVR/lib +++ b/2.3-1/macros/Hardware/AVR/lib |