Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
opamp.h
Go to the documentation of this file.
1/*
2 * Copyright 2025 NXP
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12
13#ifndef ZEPHYR_INCLUDE_DRIVERS_OPAMP_H_
14#define ZEPHYR_INCLUDE_DRIVERS_OPAMP_H_
15
24
26#include <zephyr/device.h>
27#include <errno.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
54
60
61typedef int (*opamp_api_set_gain_t)(const struct device *dev, enum opamp_gain gain);
62
63__subsystem struct opamp_driver_api {
64 opamp_api_set_gain_t set_gain;
65};
66
68
78__syscall int opamp_set_gain(const struct device *dev, enum opamp_gain gain);
79
80static inline int z_impl_opamp_set_gain(const struct device *dev, enum opamp_gain gain)
81{
82 return DEVICE_API_GET(opamp, dev)->set_gain(dev, gain);
83}
84
85#ifdef __cplusplus
86}
87#endif
88
90
91#include <zephyr/syscalls/opamp.h>
92
93#endif /* ZEPHYR_INCLUDE_DRIVERS_OPAMP_H_ */
#define DEVICE_API_GET(_class, _dev)
Expands to the pointer of a device's API for a given class.
Definition device.h:1350
System error numbers.
int opamp_set_gain(const struct device *dev, enum opamp_gain gain)
Set opamp gain.
opamp_gain
OPAMP gain factors.
Definition opamp.h:34
@ OPAMP_GAIN_64
x 64.
Definition opamp.h:52
@ OPAMP_GAIN_2
x 2.
Definition opamp.h:39
@ OPAMP_GAIN_5_3
x 5/3.
Definition opamp.h:38
@ OPAMP_GAIN_11_5
x 11/5.
Definition opamp.h:40
@ OPAMP_GAIN_1
x 1.
Definition opamp.h:37
@ OPAMP_GAIN_4
x 4.
Definition opamp.h:42
@ OPAMP_GAIN_31
x 31.
Definition opamp.h:48
@ OPAMP_GAIN_7
x 7.
Definition opamp.h:44
@ OPAMP_GAIN_1_3
x 1/3.
Definition opamp.h:36
@ OPAMP_GAIN_15
x 15.
Definition opamp.h:46
@ OPAMP_GAIN_16
x 16.
Definition opamp.h:47
@ OPAMP_GAIN_1_7
x 1/7.
Definition opamp.h:35
@ OPAMP_GAIN_63
x 63.
Definition opamp.h:51
@ OPAMP_GAIN_3
x 3.
Definition opamp.h:41
@ OPAMP_GAIN_32
x 32.
Definition opamp.h:49
@ OPAMP_GAIN_33
x 33.
Definition opamp.h:50
@ OPAMP_GAIN_8
x 8.
Definition opamp.h:45
@ OPAMP_GAIN_13_3
x 13/3.
Definition opamp.h:43
Runtime device structure (in ROM) per driver instance.
Definition device.h:510