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 |
Referenced by main().
#define VOLT_REF (3300) |
Reference voltage for AFEC,in mv.
Referenced by main().
|
static |
AFEC interrupt callback function.
References afec_channel_get_value(), g_ul_value, and is_conversion_done.
Referenced by main().
|
static |
Configure UART console.
References uart_rs232_options::baudrate, stdio_serial_init(), and sysclk_enable_peripheral_clock().
Referenced by main().
int main | ( | void | ) |
Application entry point.
References afec_ch_get_config_defaults(), afec_ch_set_config(), afec_channel_set_analog_offset(), afec_enable(), AFEC_GAINVALUE_0, afec_get_config_defaults(), afec_init(), afec_set_callback(), afec_set_trigger(), afec_temp_sensor_end_conversion(), afec_temp_sensor_get_config_defaults(), afec_temp_sensor_set_config(), AFEC_TRIG_SW, board_init(), configure_console(), g_ul_value, afec_ch_config::gain, is_conversion_done, MAX_DIGITAL, afec_temp_sensor_config::rctc, STRING_HEADER, sysclk_init(), and VOLT_REF.
volatile uint32_t g_ul_value = 0 |
The conversion data value.
Referenced by afec_temp_sensor_end_conversion(), and main().
The conversion data is done flag.
Referenced by afec_temp_sensor_end_conversion(), and main().