libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
|
libopencm3 Defined Constants and Types for the STM32G4xx Operational Amplifier module More...
Functions | |
void | opamp_enable (uint32_t base) |
void | opamp_disable (uint32_t base) |
void | opamp_lock (uint32_t base) |
void | opamp_set_calsel (uint32_t base, uint32_t calsel) |
void | opamp_tstref_enable (uint32_t base) |
void | opamp_tstref_disable (uint32_t base) |
void | opamp_force_vp_enable (uint32_t base) |
void | opamp_force_vp_disable (uint32_t base) |
void | opamp_cal_enable (uint32_t base) |
void | opamp_cal_disable (uint32_t base) |
void | opamp_trimoffsetn_set (uint32_t base, uint32_t trim) |
void | opamp_trimoffsetp_set (uint32_t base, uint32_t trim) |
void | opamp_user_trim_enable (uint32_t base) |
void | opamp_user_trim_disable (uint32_t base) |
void | opamp_pga_gain_select (uint32_t base, uint32_t gain) |
void | opamp_vp_select (uint32_t base, uint32_t vp) |
void | opamp_vm_select (uint32_t base, uint32_t vm) |
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) |
libopencm3 Defined Constants and Types for the STM32G4xx Operational Amplifier module
LGPL License Terms libopencm3 License
LGPL License Terms libopencm3 License
#define OPAMP1 (OPAMP_BASE + 0x00) |
Definition at line 37 of file g4/opamp.h.
Definition at line 47 of file g4/opamp.h.
#define OPAMP1_CSR_VP_SEL_DAC3CH1 (0x3) |
Definition at line 62 of file g4/opamp.h.
#define OPAMP1_TCMR OPAMP_TCMR(OPAMP1) |
Definition at line 54 of file g4/opamp.h.
#define OPAMP2 (OPAMP_BASE + 0x04) |
Definition at line 38 of file g4/opamp.h.
Definition at line 48 of file g4/opamp.h.
#define OPAMP2_CSR_VP_SEL_VINP3 (0x3) |
Definition at line 63 of file g4/opamp.h.
#define OPAMP2_TCMR OPAMP_TCMR(OPAMP2) |
Definition at line 55 of file g4/opamp.h.
#define OPAMP3 (OPAMP_BASE + 0x08) |
Definition at line 39 of file g4/opamp.h.
Definition at line 49 of file g4/opamp.h.
#define OPAMP3_CSR_VP_SEL_DAC3CH2 (0x3) |
Definition at line 64 of file g4/opamp.h.
#define OPAMP3_TCMR OPAMP_TCMR(OPAMP3) |
Definition at line 56 of file g4/opamp.h.
#define OPAMP4 (OPAMP_BASE + 0x0C) |
Definition at line 40 of file g4/opamp.h.
Definition at line 50 of file g4/opamp.h.
#define OPAMP4_CSR_VP_SEL_DAC4CH1 (0x3) |
Definition at line 65 of file g4/opamp.h.
#define OPAMP4_TCMR OPAMP_TCMR(OPAMP4) |
Definition at line 57 of file g4/opamp.h.
#define OPAMP5 (OPAMP_BASE + 0x10) |
Definition at line 41 of file g4/opamp.h.
Definition at line 51 of file g4/opamp.h.
#define OPAMP5_CSR_VP_SEL_DAC4CH2 (0x3) |
Definition at line 66 of file g4/opamp.h.
#define OPAMP5_TCMR OPAMP_TCMR(OPAMP5) |
Definition at line 58 of file g4/opamp.h.
#define OPAMP6 (OPAMP_BASE + 0x14) |
Definition at line 42 of file g4/opamp.h.
Definition at line 52 of file g4/opamp.h.
#define OPAMP6_CSR_VP_SEL_DAC3CH1 (0x3) |
Definition at line 67 of file g4/opamp.h.
#define OPAMP6_TCMR OPAMP_TCMR(OPAMP6) |
Definition at line 59 of file g4/opamp.h.
#define OPAMP_CSR | ( | opamp_base | ) | MMIO32((opamp_base) + 0x00) |
Definition at line 34 of file opamp_common_all.h.
#define OPAMP_CSR_CALON (0x1 << 11) |
Definition at line 55 of file opamp_common_all.h.
#define OPAMP_CSR_CALOUT_MASK (0x1) |
Definition at line 40 of file opamp_common_v2.h.
#define OPAMP_CSR_CALOUT_SHIFT (30) |
Definition at line 41 of file opamp_common_v2.h.
#define OPAMP_CSR_CALOUT_SUCC (0x1) |
Definition at line 43 of file opamp_common_v2.h.
#define OPAMP_CSR_CALOUT_UNSUCC (0x0) |
Definition at line 42 of file opamp_common_v2.h.
#define OPAMP_CSR_CALSEL_10_PERCENT (0x1) |
Definition at line 51 of file opamp_common_all.h.
#define OPAMP_CSR_CALSEL_3P3_PERCENT (0x0) |
Definition at line 50 of file opamp_common_all.h.
#define OPAMP_CSR_CALSEL_50_PERCENT (0x2) |
Definition at line 52 of file opamp_common_all.h.
#define OPAMP_CSR_CALSEL_90_PERCENT (0x3) |
Definition at line 53 of file opamp_common_all.h.
#define OPAMP_CSR_CALSEL_MASK (0x3) |
Definition at line 48 of file opamp_common_all.h.
#define OPAMP_CSR_CALSEL_SHIFT (12) |
Definition at line 49 of file opamp_common_all.h.
#define OPAMP_CSR_EN (0x1 << 0) |
Definition at line 64 of file opamp_common_all.h.
#define OPAMP_CSR_FORCE_VP (0x1 << 1) |
Definition at line 63 of file opamp_common_all.h.
#define OPAMP_CSR_LOCK (0x1 << 31) |
Definition at line 38 of file opamp_common_all.h.
#define OPAMP_CSR_OPAHSM (0x1 << 7) |
Definition at line 80 of file opamp_common_v2.h.
#define OPAMP_CSR_OPAINTOEN (0x1 << 8) |
Definition at line 78 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_FILT_VM0_GAIN_16 (0x13) |
Definition at line 66 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_FILT_VM0_GAIN_2 (0x10) |
Definition at line 63 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_FILT_VM0_GAIN_32 (0x14) |
Definition at line 67 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_FILT_VM0_GAIN_4 (0x11) |
Definition at line 64 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_FILT_VM0_GAIN_64 (0x15) |
Definition at line 68 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_FILT_VM0_GAIN_8 (0x12) |
Definition at line 65 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_FILT_VM1_INV_GAIN_MINUS_15_GAIN_16_VM0 (0x1B) |
Definition at line 74 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_FILT_VM1_INV_GAIN_MINUS_1_GAIN_2_VM0 (0x18) |
Definition at line 71 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_FILT_VM1_INV_GAIN_MINUS_31_GAIN_32_VM0 (0x1c) |
Definition at line 75 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_FILT_VM1_INV_GAIN_MINUS_3_GAIN_4_VM0 (0x19) |
Definition at line 72 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_FILT_VM1_INV_GAIN_MINUS_63_GAIN_64_VM0 (0x1d) |
Definition at line 76 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_FILT_VM1_INV_GAIN_MINUS_7_GAIN_8_VM0 (0x1a) |
Definition at line 73 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_GAIN_16 (0x03) |
Definition at line 52 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_GAIN_2 (0x00) |
Definition at line 49 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_GAIN_32 (0x04) |
Definition at line 53 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_GAIN_4 (0x01) |
Definition at line 50 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_GAIN_64 (0x05) |
Definition at line 54 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_GAIN_8 (0x02) |
Definition at line 51 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_GAIN_MASK (0x1f) |
Definition at line 45 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_GAIN_SHIFT (14) |
Definition at line 46 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_INV_GAIN_MINUS_15_GAIN_16_VM0 (0x0B) |
Definition at line 59 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_INV_GAIN_MINUS_1_GAIN_2_VM0 (0x08) |
Definition at line 56 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_INV_GAIN_MINUS_31_GAIN_32_VM0 (0x0C) |
Definition at line 60 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_INV_GAIN_MINUS_3_GAIN_4_VM0 (0x09) |
Definition at line 57 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_INV_GAIN_MINUS_63_GAIN_64_VM0 (0x0D) |
Definition at line 61 of file opamp_common_v2.h.
#define OPAMP_CSR_PGA_INV_GAIN_MINUS_7_GAIN_8_VM0 (0x0A) |
Definition at line 58 of file opamp_common_v2.h.
#define OPAMP_CSR_TRIMOFFSETN_MASK (0x1f) |
Definition at line 42 of file opamp_common_all.h.
#define OPAMP_CSR_TRIMOFFSETN_SHIFT (24) |
Definition at line 43 of file opamp_common_all.h.
#define OPAMP_CSR_TRIMOFFSETP_MASK (0x1f) |
Definition at line 45 of file opamp_common_all.h.
#define OPAMP_CSR_TRIMOFFSETP_SHIFT (19) |
Definition at line 46 of file opamp_common_all.h.
#define OPAMP_CSR_TSTREF (0x1 << 29) |
Definition at line 40 of file opamp_common_all.h.
#define OPAMP_CSR_USER_TRIM (0x1 << 4) |
Definition at line 87 of file opamp_common_v2.h.
#define OPAMP_CSR_VM_SEL_MASK (0x3) |
Definition at line 57 of file opamp_common_all.h.
#define OPAMP_CSR_VM_SEL_OUT_IN (0x3) |
Definition at line 85 of file opamp_common_v2.h.
#define OPAMP_CSR_VM_SEL_PGA_MODE (0x2) |
Definition at line 84 of file opamp_common_v2.h.
#define OPAMP_CSR_VM_SEL_SHIFT (5) |
Definition at line 58 of file opamp_common_all.h.
#define OPAMP_CSR_VM_SEL_VINM0_IN (0x0) |
Definition at line 82 of file opamp_common_v2.h.
#define OPAMP_CSR_VM_SEL_VINM1_IN (0x1) |
Definition at line 83 of file opamp_common_v2.h.
#define OPAMP_CSR_VP_SEL_MASK (0x3) |
Definition at line 60 of file opamp_common_all.h.
#define OPAMP_CSR_VP_SEL_SHIFT (2) |
Definition at line 61 of file opamp_common_all.h.
#define OPAMP_CSR_VP_SEL_VINP0 (0x0) |
Definition at line 89 of file opamp_common_v2.h.
#define OPAMP_CSR_VP_SEL_VINP1 (0x1) |
Definition at line 90 of file opamp_common_v2.h.
#define OPAMP_CSR_VP_SEL_VINP2 (0x2) |
Definition at line 91 of file opamp_common_v2.h.
#define OPAMP_TCMR | ( | opamp_base | ) | MMIO32((opamp_base) + 0x18) |
Definition at line 36 of file opamp_common_v2.h.
void opamp_cal_disable | ( | uint32_t | base | ) |
Definition at line 62 of file opamp_common_all.c.
References OPAMP_CSR.
void opamp_cal_enable | ( | uint32_t | base | ) |
Definition at line 57 of file opamp_common_all.c.
References OPAMP_CSR, and OPAMP_CSR_CALON.
void opamp_disable | ( | uint32_t | base | ) |
Definition at line 31 of file opamp_common_all.c.
References OPAMP_CSR.
void opamp_enable | ( | uint32_t | base | ) |
Definition at line 26 of file opamp_common_all.c.
References OPAMP_CSR, and OPAMP_CSR_EN.
void opamp_force_vp_disable | ( | uint32_t | base | ) |
Definition at line 52 of file opamp_common_all.c.
References OPAMP_CSR.
void opamp_force_vp_enable | ( | uint32_t | base | ) |
Definition at line 47 of file opamp_common_all.c.
References OPAMP_CSR, and OPAMP_CSR_FORCE_VP.
void opamp_high_speed_mode_disable | ( | uint32_t | base | ) |
Definition at line 37 of file opamp_common_v2.c.
References OPAMP_CSR.
void opamp_high_speed_mode_enable | ( | uint32_t | base | ) |
Definition at line 32 of file opamp_common_v2.c.
References OPAMP_CSR, and OPAMP_CSR_OPAHSM.
void opamp_lock | ( | uint32_t | base | ) |
Definition at line 36 of file opamp_common_all.c.
References OPAMP_CSR, and OPAMP_CSR_LOCK.
void opamp_output_set_external | ( | uint32_t | base | ) |
Definition at line 47 of file opamp_common_v2.c.
References OPAMP_CSR.
void opamp_output_set_internal | ( | uint32_t | base | ) |
Definition at line 42 of file opamp_common_v2.c.
References OPAMP_CSR, and OPAMP_CSR_OPAINTOEN.
void opamp_pga_gain_select | ( | uint32_t | base, |
uint32_t | gain | ||
) |
Definition at line 91 of file opamp_common_all.c.
References OPAMP_CSR, OPAMP_CSR_PGA_GAIN_MASK, and OPAMP_CSR_PGA_GAIN_SHIFT.
bool opamp_read_calout | ( | uint32_t | base | ) |
Definition at line 26 of file opamp_common_v2.c.
References OPAMP_CSR, OPAMP_CSR_CALOUT_MASK, and OPAMP_CSR_CALOUT_SHIFT.
void opamp_set_calsel | ( | uint32_t | base, |
uint32_t | calsel | ||
) |
Definition at line 41 of file opamp_common_all.c.
References OPAMP_CSR, OPAMP_CSR_CALSEL_MASK, and OPAMP_CSR_CALSEL_SHIFT.
void opamp_trimoffsetn_set | ( | uint32_t | base, |
uint32_t | trim | ||
) |
Definition at line 67 of file opamp_common_all.c.
References OPAMP_CSR, OPAMP_CSR_TRIMOFFSETN_MASK, and OPAMP_CSR_TRIMOFFSETN_SHIFT.
void opamp_trimoffsetp_set | ( | uint32_t | base, |
uint32_t | trim | ||
) |
Definition at line 74 of file opamp_common_all.c.
References OPAMP_CSR, OPAMP_CSR_TRIMOFFSETP_MASK, and OPAMP_CSR_TRIMOFFSETP_SHIFT.
void opamp_tstref_disable | ( | uint32_t | base | ) |
void opamp_tstref_enable | ( | uint32_t | base | ) |
void opamp_user_trim_disable | ( | uint32_t | base | ) |
Definition at line 86 of file opamp_common_all.c.
References OPAMP_CSR.
void opamp_user_trim_enable | ( | uint32_t | base | ) |
Definition at line 81 of file opamp_common_all.c.
References OPAMP_CSR, and OPAMP_CSR_USER_TRIM.
void opamp_vm_select | ( | uint32_t | base, |
uint32_t | vm | ||
) |
Definition at line 105 of file opamp_common_all.c.
References OPAMP_CSR, OPAMP_CSR_VM_SEL_MASK, and OPAMP_CSR_VM_SEL_SHIFT.
void opamp_vp_select | ( | uint32_t | base, |
uint32_t | vp | ||
) |
Definition at line 98 of file opamp_common_all.c.
References OPAMP_CSR, OPAMP_CSR_VP_SEL_MASK, and OPAMP_CSR_VP_SEL_SHIFT.