TC Capture Waveform Example for SAM.
Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.
Data Structures | |
struct | waveconfig_t |
[tc_capture_selection] More... | |
Macros | |
#define | STRING_EOL "\r" |
#define | STRING_HEADER |
#define | TC_CAPTURE_TIMER_SELECTION TC_CMR_TCCLKS_TIMER_CLOCK3 |
[tc_capture_selection] More... | |
Functions | |
static void | configure_console (void) |
[tc_capture_irq_handler_end] More... | |
static void | display_menu (void) |
Display the user menu on the UART. More... | |
int | main (void) |
Application entry point for tc_capture_waveform example. More... | |
static void | tc_capture_initialize (void) |
Configure TC TC_CHANNEL_CAPTURE in capture operating mode. More... | |
void | TC_Handler (void) |
[tc_capture_init] More... | |
static void | tc_waveform_initialize (void) |
Configure TC TC_CHANNEL_WAVEFORM in waveform operating mode. More... | |
Variables | |
static const uint32_t | divisors [5] = { 2, 8, 32, 128, 0} |
const uint8_t | gc_uc_nbconfig |
Number of available wave configurations. More... | |
static struct waveconfig_t | gc_waveconfig [] |
TC waveform configurations. More... | |
static uint8_t | gs_uc_configuration = 0 |
Current wave configuration. More... | |
static uint32_t | gs_ul_captured_pulses |
Capture status. More... | |
static uint32_t | gs_ul_captured_ra |
static uint32_t | gs_ul_captured_rb |
#define STRING_EOL "\r" |
#define STRING_HEADER |
#define TC_CAPTURE_TIMER_SELECTION TC_CMR_TCCLKS_TIMER_CLOCK3 |
[tc_capture_selection]
Referenced by main().
|
static |
[tc_capture_irq_handler_end]
Configure UART console.
References uart_rs232_options::baudrate, and stdio_serial_init().
Referenced by main().
|
static |
Display the user menu on the UART.
References gc_uc_nbconfig, TC_CHANNEL_CAPTURE, TC_PERIPHERAL, waveconfig_t::us_dutycycle, and waveconfig_t::us_frequency.
Referenced by main().
int main | ( | void | ) |
Application entry point for tc_capture_waveform example.
[tc_waveform_gpio]
Configure PIO Pins for TC
Disable I/O to enable peripheral mode)
[tc_waveform_gpio]
[tc_capture_gpio]
Configure PIO Pins for TC
Disable I/O to enable peripheral mode)
[tc_capture_gpio]
[tc_waveform_init_call]
[tc_waveform_init_call]
[tc_capture_init_call]
[tc_capture_init_call]
[tc_capture_init_irq]
Configure TC interrupts for TC TC_CHANNEL_CAPTURE only
[tc_capture_init_irq]
[tc_capture_init_module_irq]
[tc_capture_init_module_irq]
[tc_capture_start_now]
[tc_capture_start_now]
References board_init(), BOARD_NAME, configure_console(), display_menu(), gs_ul_captured_ra, ioport_disable_pin(), ioport_set_pin_mode(), PIN_TC_CAPTURE, PIN_TC_CAPTURE_MUX, PIN_TC_WAVEFORM, PIN_TC_WAVEFORM_MUX, sysclk_get_peripheral_bus_hz(), sysclk_init(), TC, tc_capture_initialize(), TC_CAPTURE_TIMER_SELECTION, TC_CHANNEL_CAPTURE, TC_CHANNEL_WAVEFORM, tc_disable_interrupt(), tc_enable_interrupt(), TC_IRQn, TC_PERIPHERAL, tc_start(), and tc_waveform_initialize().
|
static |
void TC_Handler | ( | void | ) |
[tc_capture_init]
Interrupt handler for the TC TC_CHANNEL_CAPTURE[tc_capture_irq_handler_start]
[tc_capture_irq_handler_start] [tc_capture_irq_handler_status]
[tc_capture_irq_handler_status]
[tc_capture_irq_handler_read_ra]
[tc_capture_irq_handler_read_ra] [tc_capture_irq_handler_read_rb]
[tc_capture_irq_handler_read_rb]
[tc_capture_irq_handler_end]
|
static |
Configure TC TC_CHANNEL_WAVEFORM in waveform operating mode.
References gs_uc_configuration, ID_TC_WAVEFORM, sysclk_enable_peripheral_clock(), sysclk_get_peripheral_bus_hz(), TC, TC_CHANNEL_WAVEFORM, tc_init(), tc_start(), tc_write_ra(), tc_write_rc(), waveconfig_t::ul_intclock, waveconfig_t::us_dutycycle, and waveconfig_t::us_frequency.
Referenced by main().
|
static |
Referenced by tc_find_mck_divisor().
const uint8_t gc_uc_nbconfig |
Number of available wave configurations.
Referenced by display_menu().
|
static |
TC waveform configurations.
|
static |
Current wave configuration.
Referenced by tc_waveform_initialize().
|
static |
Capture status.
|
static |
Referenced by main().
|
static |