Microchip® Advanced Software Framework

afec_example1.c File Reference

AFEC temperature sensor example for SAM.

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

#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "asf.h"

Macros

#define MAX_DIGITAL   (4095UL)
 The maximal digital value. More...
 
#define STRING_EOL   "\r"
 
#define STRING_HEADER
 
#define VOLT_REF   (3300)
 Reference voltage for AFEC,in mv. More...
 

Functions

static void afec_temp_sensor_end_conversion (void)
 AFEC interrupt callback function. More...
 
static void configure_console (void)
 Configure UART console. More...
 
int main (void)
 Application entry point. More...
 

Variables

volatile uint32_t g_ul_value = 0
 The conversion data value. More...
 
volatile bool is_conversion_done = false
 The conversion data is done flag. More...
 

#define MAX_DIGITAL   (4095UL)

The maximal digital value.

Referenced by main().

#define STRING_EOL   "\r"
#define STRING_HEADER
Value:
"-- AFEC Temperature Sensor Example --\r\n" \
"-- "BOARD_NAME" --\r\n" \
"-- Compiled: "__DATE__" "__TIME__" --"STRING_EOL
#define BOARD_NAME
Definition: fatfs_access_example.c:112
#define STRING_EOL
Definition: afec_example1.c:95

Referenced by main().

#define VOLT_REF   (3300)

Reference voltage for AFEC,in mv.

Referenced by main().

static void afec_temp_sensor_end_conversion ( void  )
static

AFEC interrupt callback function.

References afec_channel_get_value(), g_ul_value, and is_conversion_done.

Referenced by main().

static void configure_console ( void  )
static

Configure UART console.

References uart_rs232_options::baudrate, stdio_serial_init(), and sysclk_enable_peripheral_clock().

Referenced by main().

volatile uint32_t g_ul_value = 0

The conversion data value.

Referenced by afec_temp_sensor_end_conversion(), and main().

volatile bool is_conversion_done = false

The conversion data is done flag.

Referenced by afec_temp_sensor_end_conversion(), and main().