|
enum | afec_cmp_mode { AFEC_CMP_MODE_0 = AFEC_EMR_CMPMODE_LOW,
AFEC_CMP_MODE_1 = AFEC_EMR_CMPMODE_HIGH,
AFEC_CMP_MODE_2 = AFEC_EMR_CMPMODE_IN,
AFEC_CMP_MODE_3 = AFEC_EMR_CMPMODE_OUT
} |
|
enum | afec_gainvalue { AFEC_GAINVALUE_0 = 0,
AFEC_GAINVALUE_1 = 1,
AFEC_GAINVALUE_2 = 2,
AFEC_GAINVALUE_3 = 3
} |
|
enum | afec_power_mode { AFEC_POWER_MODE_0 = 0,
AFEC_POWER_MODE_1,
AFEC_POWER_MODE_2
} |
|
enum | afec_resolution {
AFEC_10_BITS = AFEC_EMR_RES_LOW_RES,
AFEC_12_BITS = AFEC_EMR_RES_NO_AVERAGE,
AFEC_13_BITS = AFEC_EMR_RES_OSR4,
AFEC_14_BITS = AFEC_EMR_RES_OSR16,
AFEC_15_BITS = AFEC_EMR_RES_OSR64,
AFEC_16_BITS = AFEC_EMR_RES_OSR256
} |
|
enum | afec_startup_time {
AFEC_STARTUP_TIME_0 = AFEC_MR_STARTUP_SUT0,
AFEC_STARTUP_TIME_1 = AFEC_MR_STARTUP_SUT8,
AFEC_STARTUP_TIME_2 = AFEC_MR_STARTUP_SUT16,
AFEC_STARTUP_TIME_3 = AFEC_MR_STARTUP_SUT24,
AFEC_STARTUP_TIME_4 = AFEC_MR_STARTUP_SUT64,
AFEC_STARTUP_TIME_5 = AFEC_MR_STARTUP_SUT80,
AFEC_STARTUP_TIME_6 = AFEC_MR_STARTUP_SUT96,
AFEC_STARTUP_TIME_7 = AFEC_MR_STARTUP_SUT112,
AFEC_STARTUP_TIME_8 = AFEC_MR_STARTUP_SUT512,
AFEC_STARTUP_TIME_9 = AFEC_MR_STARTUP_SUT576,
AFEC_STARTUP_TIME_10 = AFEC_MR_STARTUP_SUT640,
AFEC_STARTUP_TIME_11 = AFEC_MR_STARTUP_SUT704,
AFEC_STARTUP_TIME_12 = AFEC_MR_STARTUP_SUT768,
AFEC_STARTUP_TIME_13 = AFEC_MR_STARTUP_SUT832,
AFEC_STARTUP_TIME_14 = AFEC_MR_STARTUP_SUT896,
AFEC_STARTUP_TIME_15 = AFEC_MR_STARTUP_SUT960
} |
|
enum | afec_temp_cmp_mode { AFEC_TEMP_CMP_MODE_0 = AFEC_TEMPMR_TEMPCMPMOD_LOW,
AFEC_TEMP_CMP_MODE_1 = AFEC_TEMPMR_TEMPCMPMOD_HIGH,
AFEC_TEMP_CMP_MODE_2 = AFEC_TEMPMR_TEMPCMPMOD_IN,
AFEC_TEMP_CMP_MODE_3 = AFEC_TEMPMR_TEMPCMPMOD_OUT
} |
|
enum | afec_trigger {
AFEC_TRIG_SW = AFEC_MR_TRGEN_DIS,
AFEC_TRIG_EXT = AFEC_MR_TRGSEL_AFEC_TRIG0 | AFEC_MR_TRGEN,
AFEC_TRIG_TIO_CH_0 = AFEC_MR_TRGSEL_AFEC_TRIG1 | AFEC_MR_TRGEN,
AFEC_TRIG_TIO_CH_1 = AFEC_MR_TRGSEL_AFEC_TRIG2 | AFEC_MR_TRGEN,
AFEC_TRIG_TIO_CH_2 = AFEC_MR_TRGSEL_AFEC_TRIG3 | AFEC_MR_TRGEN,
AFEC_TRIG_PWM_EVENT_LINE_0 = AFEC_MR_TRGSEL_AFEC_TRIG4 | AFEC_MR_TRGEN,
AFEC_TRIG_PWM_EVENT_LINE_1 = AFEC_MR_TRGSEL_AFEC_TRIG5 | AFEC_MR_TRGEN,
AFEC_TRIG_FREERUN = 0xFF
} |
|
|
void | afec_ch_get_config_defaults (struct afec_ch_config *const cfg) |
| Get the AFEC channel default configurations. More...
|
|
static void | afec_ch_sanity_check (Afec *const afec, const enum afec_channel_num channel) |
|
void | afec_ch_set_config (Afec *const afec, const enum afec_channel_num channel, struct afec_ch_config *config) |
| Configure the AFEC channel. More...
|
|
static void | afec_channel_disable (Afec *const afec, const enum afec_channel_num afec_ch) |
| Disable the specified AFEC channel. More...
|
|
static void | afec_channel_enable (Afec *const afec, const enum afec_channel_num afec_ch) |
| Enable the specified AFEC channel. More...
|
|
static uint32_t | afec_channel_get_status (Afec *const afec, const enum afec_channel_num afec_ch) |
| Get the AFEC channel status. More...
|
|
static uint32_t | afec_channel_get_value (Afec *const afec, enum afec_channel_num afec_ch) |
| Read the Converted Data of the selected channel. More...
|
|
static void | afec_channel_set_analog_offset (Afec *const afec, enum afec_channel_num afec_ch, uint16_t aoffset) |
| Set analog offset to be used for channel CSEL. More...
|
|
void | afec_configure_sequence (Afec *const afec, const enum afec_channel_num ch_list[], const uint8_t uc_num) |
| Configure conversion sequence. More...
|
|
void | afec_disable (Afec *const afec) |
| Disable AFEC Module. More...
|
|
void | afec_disable_interrupt (Afec *const afec, enum afec_interrupt_source interrupt_source) |
| Disable AFEC interrupts. More...
|
|
void | afec_enable (Afec *const afec) |
| Enable AFEC Module. More...
|
|
void | afec_enable_interrupt (Afec *const afec, enum afec_interrupt_source interrupt_source) |
| Enable AFEC interrupts. More...
|
|
static enum afec_cmp_mode | afec_get_comparison_mode (Afec *const afec) |
| Get comparison mode. More...
|
|
void | afec_get_config_defaults (struct afec_config *const cfg) |
| Get the AFEC default configurations. More...
|
|
static uint32_t | afec_get_interrupt_mask (Afec *const afec) |
| Get AFEC interrupt mask. More...
|
|
static uint32_t | afec_get_interrupt_status (Afec *const afec) |
| Get AFEC interrupt status. More...
|
|
static uint32_t | afec_get_latest_chan_num (Afec *const afec) |
| Get the Last Converted Channel Number. More...
|
|
static uint32_t | afec_get_latest_value (Afec *const afec) |
| Get the Last Data Converted. More...
|
|
static uint32_t | afec_get_overrun_status (Afec *const afec) |
| Get AFEC overrun error status. More...
|
|
static uint32_t | afec_get_writeprotect_status (Afec *const afec) |
| Indicate write protect status. More...
|
|
enum status_code | afec_init (Afec *const afec, struct afec_config *const config) |
| Initialize the AFEC Module. More...
|
|
void | afec_set_callback (Afec *const afec, enum afec_interrupt_source source, afec_callback_t callback, uint8_t irq_level) |
| Set callback for AFEC. More...
|
|
void | afec_set_comparison_mode (Afec *const afec, const enum afec_cmp_mode mode, const enum afec_channel_num channel, uint8_t cmp_filter) |
| Configure comparison mode. More...
|
|
static void | afec_set_comparison_window (Afec *const afec, const uint16_t us_low_threshold, const uint16_t us_high_threshold) |
| Configure AFEC compare window. More...
|
|
void | afec_set_power_mode (Afec *const afec, const enum afec_power_mode mode) |
| Configure AFEC power mode. More...
|
|
static void | afec_set_resolution (Afec *const afec, const enum afec_resolution res) |
| Configure conversion resolution. More...
|
|
static void | afec_set_trigger (Afec *const afec, const enum afec_trigger trigger) |
| Configure conversion trigger and free run mode. More...
|
|
static void | afec_set_writeprotect (Afec *const afec, const bool is_enable) |
| Enable or disable write protection of AFEC registers. More...
|
|
static void | afec_start_software_conversion (Afec *const afec) |
| Start analog-to-digital conversion. More...
|
|
void | afec_temp_sensor_get_config_defaults (struct afec_temp_sensor_config *const cfg) |
| Get the AFEC Temperature Sensor default configurations. More...
|
|
void | afec_temp_sensor_set_config (Afec *const afec, struct afec_temp_sensor_config *config) |
| Configure the AFEC temperature sensor. More...
|
|
Analog-Front-End Controller driver for SAM.
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
Definition in file drivers/afec/afec.h.