libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
opamp_common_v2.h File Reference
Include dependency graph for opamp_common_v2.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define OPAMP_TCMR(opamp_base)   MMIO32((opamp_base) + 0x18)
 
#define OPAMP_CSR_CALOUT_MASK   (0x1)
 
#define OPAMP_CSR_CALOUT_SHIFT   (30)
 
#define OPAMP_CSR_CALOUT_UNSUCC   (0x0)
 
#define OPAMP_CSR_CALOUT_SUCC   (0x1)
 
#define OPAMP_CSR_PGA_GAIN_MASK   (0x1f)
 
#define OPAMP_CSR_PGA_GAIN_SHIFT   (14)
 
#define OPAMP_CSR_PGA_GAIN_2   (0x00)
 
#define OPAMP_CSR_PGA_GAIN_4   (0x01)
 
#define OPAMP_CSR_PGA_GAIN_8   (0x02)
 
#define OPAMP_CSR_PGA_GAIN_16   (0x03)
 
#define OPAMP_CSR_PGA_GAIN_32   (0x04)
 
#define OPAMP_CSR_PGA_GAIN_64   (0x05)
 
#define OPAMP_CSR_PGA_INV_GAIN_MINUS_1_GAIN_2_VM0   (0x08)
 
#define OPAMP_CSR_PGA_INV_GAIN_MINUS_3_GAIN_4_VM0   (0x09)
 
#define OPAMP_CSR_PGA_INV_GAIN_MINUS_7_GAIN_8_VM0   (0x0A)
 
#define OPAMP_CSR_PGA_INV_GAIN_MINUS_15_GAIN_16_VM0   (0x0B)
 
#define OPAMP_CSR_PGA_INV_GAIN_MINUS_31_GAIN_32_VM0   (0x0C)
 
#define OPAMP_CSR_PGA_INV_GAIN_MINUS_63_GAIN_64_VM0   (0x0D)
 
#define OPAMP_CSR_PGA_FILT_VM0_GAIN_2   (0x10)
 
#define OPAMP_CSR_PGA_FILT_VM0_GAIN_4   (0x11)
 
#define OPAMP_CSR_PGA_FILT_VM0_GAIN_8   (0x12)
 
#define OPAMP_CSR_PGA_FILT_VM0_GAIN_16   (0x13)
 
#define OPAMP_CSR_PGA_FILT_VM0_GAIN_32   (0x14)
 
#define OPAMP_CSR_PGA_FILT_VM0_GAIN_64   (0x15)
 
#define OPAMP_CSR_PGA_FILT_VM1_INV_GAIN_MINUS_1_GAIN_2_VM0   (0x18)
 
#define OPAMP_CSR_PGA_FILT_VM1_INV_GAIN_MINUS_3_GAIN_4_VM0   (0x19)
 
#define OPAMP_CSR_PGA_FILT_VM1_INV_GAIN_MINUS_7_GAIN_8_VM0   (0x1a)
 
#define OPAMP_CSR_PGA_FILT_VM1_INV_GAIN_MINUS_15_GAIN_16_VM0   (0x1B)
 
#define OPAMP_CSR_PGA_FILT_VM1_INV_GAIN_MINUS_31_GAIN_32_VM0   (0x1c)
 
#define OPAMP_CSR_PGA_FILT_VM1_INV_GAIN_MINUS_63_GAIN_64_VM0   (0x1d)
 
#define OPAMP_CSR_OPAINTOEN   (0x1 << 8)
 
#define OPAMP_CSR_OPAHSM   (0x1 << 7)
 
#define OPAMP_CSR_VM_SEL_VINM0_IN   (0x0)
 
#define OPAMP_CSR_VM_SEL_VINM1_IN   (0x1)
 
#define OPAMP_CSR_VM_SEL_PGA_MODE   (0x2)
 
#define OPAMP_CSR_VM_SEL_OUT_IN   (0x3)
 
#define OPAMP_CSR_USER_TRIM   (0x1 << 4)
 
#define OPAMP_CSR_VP_SEL_VINP0   (0x0)
 
#define OPAMP_CSR_VP_SEL_VINP1   (0x1)
 
#define OPAMP_CSR_VP_SEL_VINP2   (0x2)
 

Functions

bool opamp_read_calout (uint32_t base)
 
void opamp_high_speed_mode_enable (uint32_t base)
 
void opamp_high_speed_mode_disable (uint32_t base)
 
void opamp_output_set_internal (uint32_t base)
 
void opamp_output_set_external (uint32_t base)