Atmel AVR8015
23
32185A-AVR-01/12
.bcpc = TC_EVT_EFFECT_NOOP,
/* RC compare effect on TIOB.
*/
.bcpb = TC_EVT_EFFECT_NOOP,
/* RB compare effect on TIOB.
*/
.aswtrg = TC_EVT_EFFECT_NOOP,
/* Software trigger effect on
TIOA. */
.aeevt = TC_EVT_EFFECT_NOOP,
/* External event effect on
TIOA. */
.acpc = TC_EVT_EFFECT_NOOP,
/* RC compare effect on TIOA:
toggle. */
.acpa = TC_EVT_EFFECT_NOOP,
/* RA compare effect on TIOA:
toggle (other possibilities are none, set and clear). */
.wavsel = TC_WAVEFORM_SEL_UP_MODE_RC_TRIGGER,
/* Waveform
selection: Up mode with automatic trigger(reset) on RC compare. */
.enetrg = 0u,
/* External event trigger enable. */
.eevt = 0u,
/* External event selection. */
.eevtedg = TC_SEL_NO_EDGE, /* External event edge selection. */
.cpcdis = 0u,
/* Counter disable when RC compare.
*/
.cpcstop = 0u,
/* Counter clock stopped with RC
compare. */
.burst = 0u,
/* Burst signal selection. */
.clki = 0u,
/* Clock inversion. */
.tcclks = TC_CLOCK_SOURCE_TC3
/* Internal source clock 3,
connected to fPBA / 8. */
};
static const tc_interrupt_t TC_INTERRUPT = {
.etrgs = 0u,
.ldrbs = 0u,
.ldras = 0u,
.cpcs = 1u,
.cpbs = 0u,
.cpas = 0u,
.lovrs = 0u,
.covfs = 0u
};
/* initialize the timer/counter. */
tc_init_waveform (tc, &WAVEFORM_OPT);
/* set the compare triggers. */
tc_write_rc (tc, EXAMPLE_TC_CHANNEL, EXAMPLE_RC_VALUE);
/* configure Timer interrupt. */
tc_configure_interrupts (tc, EXAMPLE_TC_CHANNEL, &TC_INTERRUPT);
/* start the timer/counter. */