libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
|
#include <libopencm3/sam/adcife.h>
Go to the source code of this file.
Functions | |
void | adcife_enable_sync (void) |
Enable ADC interface. More... | |
void | adcife_configure (enum adcife_refsel ref, enum adcife_speed speed, enum adcife_clk clk, enum adcife_prescal prescal) |
void | adcife_select_channel (enum adcife_channel ad) |
void | adcife_set_resolution (enum adcife_resolution res) |
void | adcife_select_trigger (enum adcife_trigger trig) |
void | adcife_set_gain (enum adcife_gain gain) |
void | adcife_set_bipolar (bool enable) |
void | adcife_set_left_adjust (bool enable) |
void | adcife_start_conversion (void) |
void | adcife_wait_conversion (void) |
struct adcife_lcv | adcife_get_lcv (void) |
void | adcife_enable_interrupts (uint32_t imask) |
void | adcife_disable_interrupts (uint32_t imask) |
void | adcife_timer_start (void) |
void | adcife_timer_stop (void) |
void | adcife_timer_set_timeout (uint16_t timeout) |
void adcife_configure | ( | enum adcife_refsel | ref, |
enum adcife_speed | speed, | ||
enum adcife_clk | clk, | ||
enum adcife_prescal | prescal | ||
) |
Definition at line 24 of file adcife.c.
References ADCIFE_CFG, ADCIFE_CFG_PRESCAL_MASKED, ADCIFE_CFG_REFSEL_MASKED, and ADCIFE_CFG_SPEED_MASKED.
void adcife_disable_interrupts | ( | uint32_t | imask | ) |
Definition at line 103 of file adcife.c.
References ADCIFE_IDR.
void adcife_enable_interrupts | ( | uint32_t | imask | ) |
Definition at line 98 of file adcife.c.
References ADCIFE_IER.
void adcife_enable_sync | ( | void | ) |
Enable ADC interface.
Must be done before any other configuration.
This function does it synchronously and returns only when the interface is actually enabled.
Definition at line 18 of file adcife.c.
References ADCIFE_CR, ADCIFE_CR_EN, ADCIFE_SR, and ADCIFE_SR_EN.
struct adcife_lcv adcife_get_lcv | ( | void | ) |
Definition at line 91 of file adcife.c.
References adcife_lcv::_lc_u, ADCIFE_LCV, and adcife_lcv::lcv.
void adcife_select_channel | ( | enum adcife_channel | ad | ) |
Definition at line 36 of file adcife.c.
References ADCIFE_SEQCFG, and ADCIFE_SEQCFG_MUXPOS_MASKED.
void adcife_select_trigger | ( | enum adcife_trigger | trig | ) |
Definition at line 50 of file adcife.c.
References ADCIFE_SEQCFG, and ADCIFE_SEQCFG_TRGSEL_MASKED.
void adcife_set_bipolar | ( | bool | enable | ) |
Definition at line 62 of file adcife.c.
References ADCIFE_SEQCFG, and ADCIFE_SEQCFG_BIPOLAR.
void adcife_set_gain | ( | enum adcife_gain | gain | ) |
Definition at line 56 of file adcife.c.
References ADCIFE_SEQCFG, and ADCIFE_SEQCFG_GAIN_MASKED.
void adcife_set_left_adjust | ( | bool | enable | ) |
Definition at line 71 of file adcife.c.
References ADCIFE_SEQCFG, and ADCIFE_SEQCFG_HWLA.
void adcife_set_resolution | ( | enum adcife_resolution | res | ) |
Definition at line 41 of file adcife.c.
References ADCIFE_RESOLUTION_12BITS, ADCIFE_SEQCFG, and ADCIFE_SEQCFG_RES.
void adcife_start_conversion | ( | void | ) |
Definition at line 80 of file adcife.c.
References ADCIFE_CR, and ADCIFE_CR_STRIG.
void adcife_timer_set_timeout | ( | uint16_t | timeout | ) |
Definition at line 118 of file adcife.c.
References ADCIFE_TIM.
void adcife_timer_start | ( | void | ) |
Definition at line 108 of file adcife.c.
References ADCIFE_CR, and ADCIFE_CR_TSTART.
void adcife_timer_stop | ( | void | ) |
Definition at line 113 of file adcife.c.
References ADCIFE_CR, and ADCIFE_CR_TSTOP.
void adcife_wait_conversion | ( | void | ) |
Definition at line 85 of file adcife.c.
References ADCIFE_SCR, ADCIFE_SR, and ADCIFE_SR_SEOC.