#include <avr32/io.h>
#include "intc.h"
#include "compiler.h"
#include "board.h"
#include "power_clocks_lib.h"
#include "gpio.h"
#include "tc.h"
Macros | |
TC Channel Choice | |
#define | EXAMPLE_TC (&AVR32_TC0) |
#define | EXAMPLE_TC_CHANNEL 1 |
#define | EXAMPLE_TC_IRQ_GROUP AVR32_TC0_IRQ_GROUP |
#define | EXAMPLE_TC_IRQ AVR32_TC0_IRQ1 |
#define | EXAMPLE_EVENT_PIN AVR32_PIN_PA11 |
Functions | |
static void | init_tc_input (volatile avr32_tc_t *tc, unsigned int channel) |
Initializes the timer/counter capture. More... | |
int | main (void) |
Main function: More... | |
static void | tc_irq_handler (void) |
TC interrupt handler. More... | |
Variables | |
static volatile int | chan_status = 0 |
#define EXAMPLE_EVENT_PIN AVR32_PIN_PA11 |
Referenced by main().
#define EXAMPLE_TC (&AVR32_TC0) |
Referenced by main(), and tc_irq_handler().
#define EXAMPLE_TC_CHANNEL 1 |
Referenced by main(), and tc_irq_handler().
#define EXAMPLE_TC_IRQ AVR32_TC0_IRQ1 |
Referenced by main().
#define EXAMPLE_TC_IRQ_GROUP AVR32_TC0_IRQ_GROUP |
|
static |
Initializes the timer/counter capture.
References tc_capture_opt_t::channel, TC_BURST_NOT_GATED, TC_CLOCK_RISING_EDGE, TC_CLOCK_SOURCE_TC4, TC_EXT_TRIG_SEL_TIOA, tc_init_capture(), TC_NO_TRIGGER_COMPARE_RC, TC_SEL_NO_EDGE, and TC_SEL_RISING_EDGE.
Referenced by main().
int main | ( | void | ) |
Main function:
References Disable_global_interrupt, Enable_global_interrupt, tc_interrupt_t::etrgs, EXAMPLE_EVENT_PIN, EXAMPLE_TC, EXAMPLE_TC_CHANNEL, EXAMPLE_TC_IRQ, FOSC0, gpio_configure_pin_periph_event_mode(), gpio_enable_pin_periph_event(), gpio_enable_pin_pull_up(), GPIO_FALLING_EDGE, gpio_set_gpio_pin(), init_tc_input(), LED0_GPIO, OSC0_STARTUP, pcl_configure_clocks(), PCL_OSC0, pcl_switch_to_osc(), tc_configure_interrupts(), tc_irq_handler(), and tc_start().
|
static |
TC interrupt handler.
References chan_status, EXAMPLE_TC, EXAMPLE_TC_CHANNEL, gpio_tgl_gpio_pin(), LED0_GPIO, and tc_read_sr().
Referenced by main().
|
static |
Referenced by tc_irq_handler().