25#if defined(LIBOPENCM3_OPAMP_H)
27#ifndef LIBOPENCM3_OPAMP_COMMON_V2_H
28#define LIBOPENCM3_OPAMP_COMMON_V2_H
36#define OPAMP_TCMR(opamp_base) MMIO32((opamp_base) + 0x18)
40#define OPAMP_CSR_CALOUT_MASK (0x1)
41#define OPAMP_CSR_CALOUT_SHIFT (30)
42#define OPAMP_CSR_CALOUT_UNSUCC (0x0)
43#define OPAMP_CSR_CALOUT_SUCC (0x1)
45#define OPAMP_CSR_PGA_GAIN_MASK (0x1f)
46#define OPAMP_CSR_PGA_GAIN_SHIFT (14)
49#define OPAMP_CSR_PGA_GAIN_2 (0x00)
50#define OPAMP_CSR_PGA_GAIN_4 (0x01)
51#define OPAMP_CSR_PGA_GAIN_8 (0x02)
52#define OPAMP_CSR_PGA_GAIN_16 (0x03)
53#define OPAMP_CSR_PGA_GAIN_32 (0x04)
54#define OPAMP_CSR_PGA_GAIN_64 (0x05)
56#define OPAMP_CSR_PGA_INV_GAIN_MINUS_1_GAIN_2_VM0 (0x08)
57#define OPAMP_CSR_PGA_INV_GAIN_MINUS_3_GAIN_4_VM0 (0x09)
58#define OPAMP_CSR_PGA_INV_GAIN_MINUS_7_GAIN_8_VM0 (0x0A)
59#define OPAMP_CSR_PGA_INV_GAIN_MINUS_15_GAIN_16_VM0 (0x0B)
60#define OPAMP_CSR_PGA_INV_GAIN_MINUS_31_GAIN_32_VM0 (0x0C)
61#define OPAMP_CSR_PGA_INV_GAIN_MINUS_63_GAIN_64_VM0 (0x0D)
63#define OPAMP_CSR_PGA_FILT_VM0_GAIN_2 (0x10)
64#define OPAMP_CSR_PGA_FILT_VM0_GAIN_4 (0x11)
65#define OPAMP_CSR_PGA_FILT_VM0_GAIN_8 (0x12)
66#define OPAMP_CSR_PGA_FILT_VM0_GAIN_16 (0x13)
67#define OPAMP_CSR_PGA_FILT_VM0_GAIN_32 (0x14)
68#define OPAMP_CSR_PGA_FILT_VM0_GAIN_64 (0x15)
71#define OPAMP_CSR_PGA_FILT_VM1_INV_GAIN_MINUS_1_GAIN_2_VM0 (0x18)
72#define OPAMP_CSR_PGA_FILT_VM1_INV_GAIN_MINUS_3_GAIN_4_VM0 (0x19)
73#define OPAMP_CSR_PGA_FILT_VM1_INV_GAIN_MINUS_7_GAIN_8_VM0 (0x1a)
74#define OPAMP_CSR_PGA_FILT_VM1_INV_GAIN_MINUS_15_GAIN_16_VM0 (0x1B)
75#define OPAMP_CSR_PGA_FILT_VM1_INV_GAIN_MINUS_31_GAIN_32_VM0 (0x1c)
76#define OPAMP_CSR_PGA_FILT_VM1_INV_GAIN_MINUS_63_GAIN_64_VM0 (0x1d)
78#define OPAMP_CSR_OPAINTOEN (0x1 << 8)
80#define OPAMP_CSR_OPAHSM (0x1 << 7)
82#define OPAMP_CSR_VM_SEL_VINM0_IN (0x0)
83#define OPAMP_CSR_VM_SEL_VINM1_IN (0x1)
84#define OPAMP_CSR_VM_SEL_PGA_MODE (0x2)
85#define OPAMP_CSR_VM_SEL_OUT_IN (0x3)
87#define OPAMP_CSR_USER_TRIM (0x1 << 4)
89#define OPAMP_CSR_VP_SEL_VINP0 (0x0)
90#define OPAMP_CSR_VP_SEL_VINP1 (0x1)
91#define OPAMP_CSR_VP_SEL_VINP2 (0x2)
109#warning "opamp_common_v2.h should not be included directly, only via opamp.h"
void opamp_output_set_internal(uint32_t base)
void opamp_output_set_external(uint32_t base)
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)