Microchip® Advanced Software Framework

tc_megarf.c File Reference

AVR MEGA TC Driver.

Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.

#include <stdint.h>
#include "interrupt.h"
#include "compiler.h"
#include "parts.h"
#include "tc_megarf.h"
#include "sysclk.h"
#include "status_codes.h"

Functions

 ISR (TIMER1_OVF_vect)
 Interrupt handler for Timer Counter overflow. More...
 
 ISR (TIMER1_COMPA_vect)
 Interrupt handler for Timer Counter Compare Match in Channel A. More...
 
 ISR (TIMER1_COMPB_vect)
 Interrupt handler for Timer Counter Compare Match in Channel B. More...
 
 ISR (TIMER1_COMPC_vect)
 Interrupt handler for Timer Counter Compare Match in Channel C. More...
 
 ISR (TIMER3_OVF_vect)
 
 ISR (TIMER3_COMPA_vect)
 
 ISR (TIMER3_COMPB_vect)
 
 ISR (TIMER3_COMPC_vect)
 
 ISR (TIMER4_OVF_vect)
 
 ISR (TIMER4_COMPA_vect)
 
 ISR (TIMER4_COMPB_vect)
 
 ISR (TIMER4_COMPC_vect)
 
 ISR (TIMER5_OVF_vect)
 
 ISR (TIMER5_COMPA_vect)
 
 ISR (TIMER5_COMPB_vect)
 
 ISR (TIMER5_COMPC_vect)
 
void tc_disable (volatile void *tc)
 Disable Timer. More...
 
void tc_enable (volatile void *tc)
 Enable Timer. More...
 
void tc_set_compa_interrupt_callback (volatile void *tc, tc_callback_t callback)
 Register a Compare interrupt callback. More...
 
void tc_set_compb_interrupt_callback (volatile void *tc, tc_callback_t callback)
 Register a Compare interrupt callback. More...
 
void tc_set_compc_interrupt_callback (volatile void *tc, tc_callback_t callback)
 Register a Compare interrupt callback. More...
 
void tc_set_overflow_interrupt_callback (volatile void *tc, tc_callback_t callback)
 Register a Overflow interrupt callback. More...
 

Variables

static tc_callback_t tc_tccr1_compa_callback
 
static tc_callback_t tc_tccr1_compb_callback
 
static tc_callback_t tc_tccr1_compc_callback
 
static tc_callback_t tc_tccr1_ovf_callback
 
static tc_callback_t tc_tccr3_compa_callback
 
static tc_callback_t tc_tccr3_compb_callback
 
static tc_callback_t tc_tccr3_compc_callback
 
static tc_callback_t tc_tccr3_ovf_callback
 
static tc_callback_t tc_tccr4_compa_callback
 
static tc_callback_t tc_tccr4_compb_callback
 
static tc_callback_t tc_tccr4_compc_callback
 
static tc_callback_t tc_tccr4_ovf_callback
 
static tc_callback_t tc_tccr5_compa_callback
 
static tc_callback_t tc_tccr5_compb_callback
 
static tc_callback_t tc_tccr5_compc_callback
 
static tc_callback_t tc_tccr5_ovf_callback
 

ISR ( TIMER1_OVF_vect  )

Interrupt handler for Timer Counter overflow.

References tc_tccr1_ovf_callback.

ISR ( TIMER1_COMPA_vect  )

Interrupt handler for Timer Counter Compare Match in Channel A.

References tc_tccr1_compa_callback.

ISR ( TIMER1_COMPB_vect  )

Interrupt handler for Timer Counter Compare Match in Channel B.

References tc_tccr1_compb_callback.

ISR ( TIMER1_COMPC_vect  )

Interrupt handler for Timer Counter Compare Match in Channel C.

References tc_tccr1_compc_callback.

ISR ( TIMER3_OVF_vect  )

References tc_tccr3_ovf_callback.

ISR ( TIMER3_COMPA_vect  )
ISR ( TIMER3_COMPB_vect  )
ISR ( TIMER3_COMPC_vect  )
ISR ( TIMER4_OVF_vect  )

References tc_tccr4_ovf_callback.

ISR ( TIMER4_COMPA_vect  )
ISR ( TIMER4_COMPB_vect  )
ISR ( TIMER4_COMPC_vect  )
ISR ( TIMER5_OVF_vect  )

References tc_tccr5_ovf_callback.

ISR ( TIMER5_COMPA_vect  )
ISR ( TIMER5_COMPB_vect  )
ISR ( TIMER5_COMPC_vect  )
void tc_disable ( volatile void *  tc)

Disable Timer.

Parameters
tcTimer Address

References cpu_irq_restore(), cpu_irq_save(), and sysclk_disable_peripheral_clock().

Referenced by tc_stop(), and tmr_stop().

void tc_enable ( volatile void *  tc)

Enable Timer.

Parameters
tcTimer Address

References cpu_irq_restore(), cpu_irq_save(), and sysclk_enable_peripheral_clock().

Referenced by init_timer_isr(), and tmr_init().

void tc_set_compa_interrupt_callback ( volatile void *  tc,
tc_callback_t  callback 
)

Register a Compare interrupt callback.

Parameters
tcTimer Address
callbackCallback called once Compare interrupt occurs in channel A

References tc_tccr1_compa_callback, tc_tccr3_compa_callback, tc_tccr4_compa_callback, and tc_tccr5_compa_callback.

Referenced by configure_tc_callback(), and initialize_EPD_timer().

void tc_set_compb_interrupt_callback ( volatile void *  tc,
tc_callback_t  callback 
)

Register a Compare interrupt callback.

Parameters
tcTimer Address
callbackCallback called once Compare interrupt occurs in channel B

References tc_tccr1_compb_callback, tc_tccr3_compb_callback, tc_tccr4_compb_callback, and tc_tccr5_compb_callback.

Referenced by configure_tc_callback().

void tc_set_compc_interrupt_callback ( volatile void *  tc,
tc_callback_t  callback 
)

Register a Compare interrupt callback.

Parameters
tcTimer Address
callbackCallback called once Compare interrupt occurs in channel C

References tc_tccr1_compc_callback, tc_tccr3_compc_callback, tc_tccr4_compc_callback, and tc_tccr5_compc_callback.

Referenced by configure_tc_callback().

void tc_set_overflow_interrupt_callback ( volatile void *  tc,
tc_callback_t  callback 
)

Register a Overflow interrupt callback.

Parameters
tcTimer Address
callbackCallback called once Overflow interrupt occurs

References tc_tccr1_ovf_callback, tc_tccr3_ovf_callback, tc_tccr4_ovf_callback, and tc_tccr5_ovf_callback.

Referenced by tmr_init().

tc_callback_t tc_tccr1_compa_callback
static
tc_callback_t tc_tccr1_compb_callback
static
tc_callback_t tc_tccr1_compc_callback
static
tc_callback_t tc_tccr1_ovf_callback
static
tc_callback_t tc_tccr3_compa_callback
static
tc_callback_t tc_tccr3_compb_callback
static
tc_callback_t tc_tccr3_compc_callback
static
tc_callback_t tc_tccr3_ovf_callback
static
tc_callback_t tc_tccr4_compa_callback
static
tc_callback_t tc_tccr4_compb_callback
static
tc_callback_t tc_tccr4_compc_callback
static
tc_callback_t tc_tccr4_ovf_callback
static
tc_callback_t tc_tccr5_compa_callback
static
tc_callback_t tc_tccr5_compb_callback
static
tc_callback_t tc_tccr5_compc_callback
static
tc_callback_t tc_tccr5_ovf_callback
static