Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:software:homelab:library:timer [2010/03/25 18:21] mikk.leinien:software:homelab:library:timer [2020/07/20 09:00] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Timers ====== ====== Timers ======
  
-This library covers large part of the functionality of ATmega128 timers. There are data types and functions which make usage of timers easier. Unfortunately, because of the complexity of AVR timers, there are no common functions to use different timers. Each of the timer has functions which starts with the prefix of "timer" and its index.+This library covers large part of the functionality of ATmega128 timers. There are data types and functions which make usage of timers easier. Unfortunately, because of the complexity of AVR timers, there are no common functions to use different timers. Each of the timers has functions which start with the prefix of "timer" and its index.
  
 ===== Data types ===== ===== Data types =====
Line 56: Line 56:
  
   * **//void timer0_init_normal(timer0_prescale prescale)//** \\   * **//void timer0_init_normal(timer0_prescale prescale)//** \\
-    Initializes timer 0 in normal mode. In this mode timer counts from 0 to 255 (including). Only possible event is timer overflow. Parameters:+    Initializes timer 0 in normal mode. In this mode the timer counts from 0 to 255 (including). Overflow interrupt can be used. Parameters:
     * //prescale// - Prescaler.     * //prescale// - Prescaler.
  
   * **//void timer2_init_normal(timer2_prescale prescale)//** \\   * **//void timer2_init_normal(timer2_prescale prescale)//** \\
-    Initializes timer 2 in normal mode. In this mode timer counts from 0 to 255 (including). Only possible event is timer overflow. Parameters:+    Initializes timer 2 in normal mode. In this mode timer counts from 0 to 255 (including). Overflow interrupt can be used. Parameters:
     * //prescale// - Prescaler.     * //prescale// - Prescaler.
  
Line 79: Line 79:
   * **//void timer0_overflow_interrupt_enable(bool enable)//**   * **//void timer0_overflow_interrupt_enable(bool enable)//**
   * **//void timer2_overflow_interrupt_enable(bool enable)//** \\   * **//void timer2_overflow_interrupt_enable(bool enable)//** \\
-    Enables or disables timer 0/2 overflow interrupt. Interrupt vector name is "TIMERn_OVF_vect" where "n" represents 0 or 2. Parameters:+    Enables or disables timer 0/2 overflow interrupt. The name of the interrupt vector is "TIMERn_OVF_vect" where "n" represents 0 or 2. Parameters:
     * //enable// - //true// to enable interrupt, //false// to disable.     * //enable// - //true// to enable interrupt, //false// to disable.
  
Line 93: Line 93:
   * **//void timer1_init_normal(timer1_prescale prescale)//**   * **//void timer1_init_normal(timer1_prescale prescale)//**
   * **//void timer3_init_normal(timer3_prescale prescale)//** \\   * **//void timer3_init_normal(timer3_prescale prescale)//** \\
-    Initializes timer 1/3 in normal mode. In this mode timer counts from 0 to 65535 (including). Only possible event is timer overflow. Parameters:+    Initializes timer 1/3 in normal mode. In this mode timer counts from 0 to 65535 (including). Overflow interrupt can be used. Parameters:
     * //prescale// - Prescaler.     * //prescale// - Prescaler.
  
   * **//void timer1_init_ctc(timer1_prescale prescale, timer1_ctc_top top)//**   * **//void timer1_init_ctc(timer1_prescale prescale, timer1_ctc_top top)//**
-  * **//void timer3_init_ctc(timer3_prescale prescale, timer3_ctc_top top)//** \\ Taimer 1/3 CTC (inglise keeles //Clear Timer on Compare Match//režiimi seadistamineSelles režiimis taimer ei loenda mitte 65535-ni, vaid valitud registri väärtuseni ja tekitab soovi korral sinnani jõudes katkestuseParameetrid+  * **//void timer3_init_ctc(timer3_prescale prescale, timer3_ctc_top top)//** \\ 
-    * //prescale//Taktijaguri tegur+    Initializes timer 1/3 in CTC (//Clear Timer on Compare Match//modeIn this mode timer counts to specified top value. Overflow interrupt can be usedParameters
-    * //top// - Taimeri maksimaalse väärtuse registri valikValida saab kahe registri vahel, mille mõlema muutmiseks on omaette funktsioonid. Mõlemad registrid võib loenduri tippu jõudes katkestust tekitama seadistada.+    * //prescale//Prescaler
 +    * //top// - Timer top value selectionActual value must be specified with register selected as a top value holder.
  
   * **//void timer1_init_fast_pwm(timer1_prescale prescale, timer1_fast_pwm_top top, timer1_fast_pwm_output_mode output_a, timer1_fast_pwm_output_mode output_b, timer1_fast_pwm_output_mode output_c)//**   * **//void timer1_init_fast_pwm(timer1_prescale prescale, timer1_fast_pwm_top top, timer1_fast_pwm_output_mode output_a, timer1_fast_pwm_output_mode output_b, timer1_fast_pwm_output_mode output_c)//**
-  * **//void timer3_init_fast_pwm(timer3_prescale prescale, timer3_fast_pwm_top top, timer3_fast_pwm_output_mode output_a, timer3_fast_pwm_output_mode output_b, timer3_fast_pwm_output_mode output_c)//** \\ Taimer 1/3 kiire PWM tekitamise režiimi seadistamineSelles režiimis on valitav väärtusmilleni taimer loendab, ehk PWM signaali perioodTaimeril on PWM signaali genereerimise üksust (A, B ja C), millel kõigil on seadistatav väljund. Parameters: +  * **//void timer3_init_fast_pwm(timer3_prescale prescale, timer3_fast_pwm_top top, timer3_fast_pwm_output_mode output_a, timer3_fast_pwm_output_mode output_b, timer3_fast_pwm_output_mode output_c)//** \\ 
-    * //prescale//Taktijaguri tegur+    Initializises timer 1/3 in fast PWM modeIn this mode timer counts to a specified valuewhich also determines the period of the PWM signalTimer 1/has three 3 output compare units (A, B and C) to generate PWM signals. Overflow and compare match interrupts can be used. Parameters: 
-    * //top// - Taimeri maksimaalse väärtuse valikValida saab konstantide ja kahe registri vahel. Mõlemad registrid võib loenduri tippu jõudes katkestust tekitama seadistada+    * //prescale//Prescaler
-    * //output_a//Väljundviigu seadistus+    * //top// - Timer top value selectionActual value must be specified with register selected as a top value holder
-    * //output_b//Väljundviigu seadistus+    * //output_a//Output compare unit pin configuration
-    * //output_c//Väljundviigu seadistus.+    * //output_b//Output compare unit pin configuration
 +    * //output_c//Output compare unit pin configuration.
  
   * **//void timer1_stop()//**   * **//void timer1_stop()//**
-  * **//void timer3_stop()//** \\ Taimeri 1/3 peatamine.+  * **//void timer3_stop()//** \\ 
 +    Stops timer 1/3.
  
   * **//unsigned char timer1_get_value(void)//**   * **//unsigned char timer1_get_value(void)//**
-  * **//unsigned char timer3_get_value(void)//** \\ Taimeri 1/3 loenduri hetkeväärtuse tagastamine. Parameters: +  * **//unsigned char timer3_get_value(void)//** \\ 
-    * Tagastab 16-bitise loenduri hetkeväärtuse.+    Returns timer 1/3 current value. Parameters: 
 +    * Returns 16-bit timer value.
  
   * **//void timer1_set_value(unsigned char value)//**   * **//void timer1_set_value(unsigned char value)//**
-  * **//void timer3_set_value(unsigned char value)//** \\ Taimeri 1/3 loenduri uue väärtuse määramine. Parameters: +  * **//void timer3_set_value(unsigned char value)//** \\ 
-    * //value// - Uus 16-bitine loenduri väärtus.+    Sets timer 0/2 value. Parameters: 
 +    * //value// - New 16-bit timer value.
  
   * **//unsigned short timer1_get_compare_match_unitA_value(void)//**   * **//unsigned short timer1_get_compare_match_unitA_value(void)//**
Line 125: Line 130:
   * **//unsigned short timer3_get_compare_match_unitA_value(void)//**   * **//unsigned short timer3_get_compare_match_unitA_value(void)//**
   * **//unsigned short timer3_get_compare_match_unitB_value(void)//**   * **//unsigned short timer3_get_compare_match_unitB_value(void)//**
-  * **//unsigned short timer3_get_compare_match_unitC_value(void)//** \\ Taimeri 1/3 signaali genereerimise üksuse A/B/C võrdlusväärtuse tagastamine. Parameters: +  * **//unsigned short timer3_get_compare_match_unitC_value(void)//** \\ 
-    * Tagastab 16-bitise üksuse võrdlusregistri väärtuse.+   Returns timer 1/3 output compare unit A/B/C compare match register value. Parameters: 
 +    * Returns 16-bit compare match register value.
  
   * **//void timer1_set_compare_match_unitA_value(unsigned short value)//**   * **//void timer1_set_compare_match_unitA_value(unsigned short value)//**
Line 133: Line 139:
   * **//void timer3_set_compare_match_unitA_value(unsigned short value)//**   * **//void timer3_set_compare_match_unitA_value(unsigned short value)//**
   * **//void timer3_set_compare_match_unitB_value(unsigned short value)//**   * **//void timer3_set_compare_match_unitB_value(unsigned short value)//**
-  * **//void timer3_set_compare_match_unitC_value(unsigned short value)//** \\ Taimeri 1/3 signaali genereerimise üksuse A/B/C võrdlusväärtuse määramineParameetrid+  * **//void timer3_set_compare_match_unitC_value(unsigned short value)//** \\ 
-    * //value// - Uus 16-bitine võrdlusväärtus.+    Sets timer 1/3 output compare unit A/B/C compare match register valueParameters
 +    * //value// - New 16-bit compare match register value.
  
   * **//unsigned short timer1_get_input_capture_value(void)//**   * **//unsigned short timer1_get_input_capture_value(void)//**
-  * **//unsigned short timer3_get_input_capture_value(void)//** \\ Taimer 1/3 sündmuste loenduri väärtuse tagastamine. Parameters: +  * **//unsigned short timer3_get_input_capture_value(void)//** \\ 
-    * Tagastab 16-bitise sündmuste loenduri registri väärtuse.+    Returns timer 1/3 input capture register value. Parameters: 
 +    * Returns 16-bit input capture register value.
  
   * **//void timer1_set_input_capture_value(unsigned short value)//**   * **//void timer1_set_input_capture_value(unsigned short value)//**
-  * **//void timer3_set_input_capture_value(unsigned short value)//** \\ Taimer 1/3 sündmuste loenduri registri väärtuse määramine. Parameters: +  * **//void timer3_set_input_capture_value(unsigned short value)//** \\ 
-    * //value// - Uus 16-bitine sündmuste loenduri väärtus.+    Sets timer 1/3 input capture register value. Parameters: 
 +    * //value// - New 16-bit input capture register value.
  
   * **//void timer1_overflow_interrupt_enable(bool enable)//**   * **//void timer1_overflow_interrupt_enable(bool enable)//**
-  * **//void timer3_overflow_interrupt_enable(bool enable)//** \\ Taimer 1/3 ületäitumise katkestuse lubamine või keelamineKatkestuse vektor on TIMERn_OVF_vect, kus "n" on 1 või 3. Parameters:+  * **//void timer3_overflow_interrupt_enable(bool enable)//** \\ 
 +    Enables or disables timer 1/3 overflow interruptThe name of the interrupt vector is "TIMERn_OVF_vect" where "n" represents 1 või 3. Parameters:
     * //enable// - //true// to enable interrupt, //false// to disable.     * //enable// - //true// to enable interrupt, //false// to disable.
  
Line 153: Line 163:
   * **//void timer3_compare_match_unitA_interrupt_enable(bool enable)//**   * **//void timer3_compare_match_unitA_interrupt_enable(bool enable)//**
   * **//void timer3_compare_match_unitB_interrupt_enable(bool enable)//**   * **//void timer3_compare_match_unitB_interrupt_enable(bool enable)//**
-  * **//void timer3_compare_match_unitC_interrupt_enable(bool enable)//** \\ Taimer 1/3 signaali genereerimise üksuse A/B/C võrdluse sündmuse katkestuse lubamine või keelamineKatkestuse vektor on TIMERn_COMPx_vect, kus on "n" on või ja "x" on A, B või C. Parameters:+  * **//void timer3_compare_match_unitC_interrupt_enable(bool enable)//** \\ 
 +   Enables or disables timer 1/3 output compare unit A/B/C compare match interruptThe name of the interrupt vector is "TIMERn_COMPx_vect" where "n" represents or and "x" represents A, B or C. Parameters:
     * //enable// - //true// to enable interrupt, //false// to disable.     * //enable// - //true// to enable interrupt, //false// to disable.
  
   * **//void timer1_input_capture_interrupt_enable(bool enable)//**   * **//void timer1_input_capture_interrupt_enable(bool enable)//**
   * **//void timer3_input_capture_interrupt_enable(bool enable)//** \\   * **//void timer3_input_capture_interrupt_enable(bool enable)//** \\
-    Enables or disables timer 1/3 input capture interrupt. Interrupt vector name is "TIMERn_CAPT_vect", where "n" represents 1 or 3. Parameters:+    Enables or disables timer 1/3 input capture interrupt. The name of the interrupt vector is "TIMERn_CAPT_vect", where "n" represents 1 or 3. Parameters:
     * //enable// - //true// to enable interrupt, //false// to disable.     * //enable// - //true// to enable interrupt, //false// to disable.
  
en/software/homelab/library/timer.1269541277.txt.gz · Last modified: 2020/07/20 09:00 (external edit)
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0