libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
adcife.c File Reference
Include dependency graph for adcife.c:

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)
 

Function Documentation

◆ adcife_configure()

void adcife_configure ( enum adcife_refsel  ref,
enum adcife_speed  speed,
enum adcife_clk  clk,
enum adcife_prescal  prescal 
)

◆ adcife_disable_interrupts()

void adcife_disable_interrupts ( uint32_t  imask)

Definition at line 103 of file adcife.c.

References ADCIFE_IDR.

◆ adcife_enable_interrupts()

void adcife_enable_interrupts ( uint32_t  imask)

Definition at line 98 of file adcife.c.

References ADCIFE_IER.

◆ adcife_enable_sync()

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.

◆ adcife_get_lcv()

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.

◆ adcife_select_channel()

void adcife_select_channel ( enum adcife_channel  ad)

Definition at line 36 of file adcife.c.

References ADCIFE_SEQCFG, and ADCIFE_SEQCFG_MUXPOS_MASKED.

◆ adcife_select_trigger()

void adcife_select_trigger ( enum adcife_trigger  trig)

Definition at line 50 of file adcife.c.

References ADCIFE_SEQCFG, and ADCIFE_SEQCFG_TRGSEL_MASKED.

◆ adcife_set_bipolar()

void adcife_set_bipolar ( bool  enable)

Definition at line 62 of file adcife.c.

References ADCIFE_SEQCFG, and ADCIFE_SEQCFG_BIPOLAR.

◆ adcife_set_gain()

void adcife_set_gain ( enum adcife_gain  gain)

Definition at line 56 of file adcife.c.

References ADCIFE_SEQCFG, and ADCIFE_SEQCFG_GAIN_MASKED.

◆ adcife_set_left_adjust()

void adcife_set_left_adjust ( bool  enable)

Definition at line 71 of file adcife.c.

References ADCIFE_SEQCFG, and ADCIFE_SEQCFG_HWLA.

◆ adcife_set_resolution()

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.

◆ adcife_start_conversion()

void adcife_start_conversion ( void  )

Definition at line 80 of file adcife.c.

References ADCIFE_CR, and ADCIFE_CR_STRIG.

◆ adcife_timer_set_timeout()

void adcife_timer_set_timeout ( uint16_t  timeout)

Definition at line 118 of file adcife.c.

References ADCIFE_TIM.

◆ adcife_timer_start()

void adcife_timer_start ( void  )

Definition at line 108 of file adcife.c.

References ADCIFE_CR, and ADCIFE_CR_TSTART.

◆ adcife_timer_stop()

void adcife_timer_stop ( void  )

Definition at line 113 of file adcife.c.

References ADCIFE_CR, and ADCIFE_CR_TSTOP.

◆ adcife_wait_conversion()

void adcife_wait_conversion ( void  )

Definition at line 85 of file adcife.c.

References ADCIFE_SCR, ADCIFE_SR, and ADCIFE_SR_SEOC.