#include <avr32/io.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_TC) |
#define | EXAMPLE_TC_OUTPUT_PIN AVR32_TC_A0_0_0_PIN |
#define | EXAMPLE_TC_OUTPUT_FUNCTION AVR32_TC_A0_0_0_FUNCTION |
#define | EXAMPLE_TC_INPUT_PIN AVR32_TC_A1_0_0_PIN |
#define | EXAMPLE_TC_INPUT_FUNCTION AVR32_TC_A1_0_0_FUNCTION |
Functions | |
static void | init_tc_input (volatile avr32_tc_t *tc, unsigned int channel) |
Initializes the timer/counter capture. More... | |
static void | init_tc_output (volatile avr32_tc_t *tc, unsigned int channel) |
Initializes the timer/counter waveform. More... | |
int | main (void) |
Main function. Execution starts here. More... | |
#define EXAMPLE_TC_INPUT_FUNCTION AVR32_TC_A1_0_0_FUNCTION |
Referenced by main().
#define EXAMPLE_TC_INPUT_PIN AVR32_TC_A1_0_0_PIN |
Referenced by main().
#define EXAMPLE_TC_OUTPUT_FUNCTION AVR32_TC_A0_0_0_FUNCTION |
Referenced by main().
#define EXAMPLE_TC_OUTPUT_PIN AVR32_TC_A0_0_0_PIN |
Referenced by main().
|
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_FALLING_EDGE, and TC_SEL_NO_EDGE.
Referenced by main().
|
static |
Initializes the timer/counter waveform.
References tc_waveform_opt_t::channel, TC_BURST_NOT_GATED, TC_CLOCK_RISING_EDGE, TC_CLOCK_SOURCE_TC3, TC_EVT_EFFECT_CLEAR, TC_EVT_EFFECT_NOOP, TC_EVT_EFFECT_SET, TC_EXT_EVENT_SEL_TIOB_INPUT, tc_init_waveform(), TC_SEL_NO_EDGE, and TC_WAVEFORM_SEL_UP_MODE.
Referenced by main().
int main | ( | void | ) |
Main function. Execution starts here.
References EXAMPLE_TC, EXAMPLE_TC_INPUT_FUNCTION, EXAMPLE_TC_INPUT_PIN, EXAMPLE_TC_OUTPUT_FUNCTION, EXAMPLE_TC_OUTPUT_PIN, FOSC0, gpio_enable_module(), init_tc_input(), init_tc_output(), OSC0_STARTUP, pcl_configure_clocks(), pcl_dfll_freq_param, PCL_OSC0, pcl_switch_to_osc(), tc_read_ra(), tc_start(), and tc_write_ra().