Microchip® Advanced Software Framework

acifc_example.c File Reference

SAM4L Analog Comparator Interfacer (ACIFC) example.

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

#include <asf.h>
#include <stdio_serial.h>
#include <conf_board.h>
#include <conf_clock.h>

Macros

#define EXAMPLE_AC_CHANNEL   0
 [acifc_define_channel] More...
 
#define STRING_EOL   "\r"
 [acifc_define_channel] More...
 
#define STRING_HEADER
 

Functions

static void compare_result_output (void)
 Callback for channel 0 comparison done. More...
 
static void configure_console (void)
 Configure UART console. More...
 
int main (void)
 ACIFC example application entry point. More...
 

Variables

struct ac_dev_inst ac_device
 [acifc_struct_declaration] More...
 
volatile bool state = false
 [acifc_struct_declaration] More...
 

#define EXAMPLE_AC_CHANNEL   0

[acifc_define_channel]

Analog comparator channel number

Referenced by main().

#define STRING_EOL   "\r"

[acifc_define_channel]

#define STRING_HEADER
Value:
"-- ACIFC IRQ Example --\r\n" \
"-- "BOARD_NAME" --\r\n" \
"-- Compiled: "__DATE__" "__TIME__" --"STRING_EOL
#define BOARD_NAME
Definition: inc/app_init.h:140
#define STRING_EOL
[acifc_define_channel]
Definition: acifc_example.c:47

Referenced by main().

static void compare_result_output ( void  )
static

Callback for channel 0 comparison done.

References ac_clear_interrupt_status(), ac_device, ac_get_status(), and state.

Referenced by main().

static void configure_console ( void  )
static

Configure UART console.

References uart_rs232_options::baudrate, and stdio_serial_init().

Referenced by main().

int main ( void  )

ACIFC example application entry point.

Returns
Unused (ANSI-C compatibility).

[acifc_init_and_configure]

AC instance configuration

[acifc_init_and_configure_1]

[acifc_init_and_configure_1]

AC channel configuration

[acifc_init_and_configure_2]

[acifc_init_and_configure_2] [acifc_init_and_configure]

References ac_ch_get_config_defaults(), ac_ch_set_config(), ac_device, ac_enable(), ac_get_config_defaults(), ac_init(), AC_INTERRUPT_CONVERSION_COMPLETED_0, ac_set_callback(), ac_user_trigger_single_comparison(), ac_ch_config::always_on, board_init(), compare_result_output(), configure_console(), delay_ms, EXAMPLE_AC_CHANNEL, ac_ch_config::fast_mode, state, STRING_HEADER, and sysclk_init().

struct ac_dev_inst ac_device

[acifc_struct_declaration]

Referenced by compare_result_output(), main(), run_ac_test(), and set_int_flag().