Zephyr Project API 4.3.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Interfaces for operational amplifiers (OPAMP). More...

Files

file  opamp.h
 Main header file for OPAMP (Operational Amplifier) driver API.

Data Structures

struct  opamp_driver_api
 @driver_ops{OPAMP} More...

Enumerations

enum  opamp_gain {
  OPAMP_GAIN_1_7 = 0 , OPAMP_GAIN_1_3 , OPAMP_GAIN_1 , OPAMP_GAIN_5_3 ,
  OPAMP_GAIN_2 , OPAMP_GAIN_11_5 , OPAMP_GAIN_3 , OPAMP_GAIN_4 ,
  OPAMP_GAIN_13_3 , OPAMP_GAIN_7 , OPAMP_GAIN_8 , OPAMP_GAIN_15 ,
  OPAMP_GAIN_16 , OPAMP_GAIN_31 , OPAMP_GAIN_32 , OPAMP_GAIN_33 ,
  OPAMP_GAIN_63 , OPAMP_GAIN_64
}
 OPAMP gain factors. More...

Functions

int opamp_set_gain (const struct device *dev, enum opamp_gain gain)
 Set opamp gain.
enum  opamp_functional_mode {
  OPAMP_FUNCTIONAL_MODE_DIFFERENTIAL = 0 , OPAMP_FUNCTIONAL_MODE_INVERTING , OPAMP_FUNCTIONAL_MODE_NON_INVERTING , OPAMP_FUNCTIONAL_MODE_FOLLOWER ,
  OPAMP_FUNCTIONAL_MODE_STANDALONE
}
 @def_driverbackendgroup{OPAMP,opamp_interface} More...
typedef int(* opamp_api_set_gain_t) (const struct device *dev, enum opamp_gain gain)
 Callback API to set opamp gain.

Detailed Description

Interfaces for operational amplifiers (OPAMP).

Since
4.3
Version
0.1.0

Typedef Documentation

◆ opamp_api_set_gain_t

typedef int(* opamp_api_set_gain_t) (const struct device *dev, enum opamp_gain gain)

#include </__w/bridle/bridle/workspace/zephyr/include/zephyr/drivers/opamp.h>

Callback API to set opamp gain.

See opamp_set_gain() for argument description

Enumeration Type Documentation

◆ opamp_functional_mode

#include </__w/bridle/bridle/workspace/zephyr/include/zephyr/drivers/opamp.h>

@def_driverbackendgroup{OPAMP,opamp_interface}

OPAMP functional mode.

Values correspond 1:1 to the functional-mode property in dts/bindings/opamp/opamp-controller.yaml.

Enumerator
OPAMP_FUNCTIONAL_MODE_DIFFERENTIAL 

Differential amplifier mode.

OPAMP_FUNCTIONAL_MODE_INVERTING 

Inverting amplifier mode.

OPAMP_FUNCTIONAL_MODE_NON_INVERTING 

Non-inverting amplifier mode.

OPAMP_FUNCTIONAL_MODE_FOLLOWER 

Follower mode.

OPAMP_FUNCTIONAL_MODE_STANDALONE 

Standalone mode.

The gain is set by external resistors. The API call to set the gain is ignored in this mode or has no impact.

◆ opamp_gain

enum opamp_gain

#include </__w/bridle/bridle/workspace/zephyr/include/zephyr/drivers/opamp.h>

OPAMP gain factors.

Enumerator
OPAMP_GAIN_1_7 

x 1/7.

OPAMP_GAIN_1_3 

x 1/3.

OPAMP_GAIN_1 

x 1.

OPAMP_GAIN_5_3 

x 5/3.

OPAMP_GAIN_2 

x 2.

OPAMP_GAIN_11_5 

x 11/5.

OPAMP_GAIN_3 

x 3.

OPAMP_GAIN_4 

x 4.

OPAMP_GAIN_13_3 

x 13/3.

OPAMP_GAIN_7 

x 7.

OPAMP_GAIN_8 

x 8.

OPAMP_GAIN_15 

x 15.

OPAMP_GAIN_16 

x 16.

OPAMP_GAIN_31 

x 31.

OPAMP_GAIN_32 

x 32.

OPAMP_GAIN_33 

x 33.

OPAMP_GAIN_63 

x 63.

OPAMP_GAIN_64 

x 64.

Function Documentation

◆ opamp_set_gain()

int opamp_set_gain ( const struct device * dev,
enum opamp_gain gain )

#include </__w/bridle/bridle/workspace/zephyr/include/zephyr/drivers/opamp.h>

Set opamp gain.

Parameters
devPointer to the device structure for the driver instance.
gainOpamp gain, refer to enum opamp_gain.
Return values
0If opamp gain has been successfully set.
-errnoNegative errno in case of failure.