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
7#ifndef ZEPHYR_INCLUDE_DRIVERS_OPAMP_H_
8#define ZEPHYR_INCLUDE_DRIVERS_OPAMP_H_
9
18
20#include <zephyr/device.h>
21#include <errno.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
48
54
55typedef int (*opamp_api_set_gain_t)(const struct device *dev, enum opamp_gain gain);
56
57__subsystem struct opamp_driver_api {
58 opamp_api_set_gain_t set_gain;
59};
60
62
72__syscall int opamp_set_gain(const struct device *dev, enum opamp_gain gain);
73
74static inline int z_impl_opamp_set_gain(const struct device *dev, enum opamp_gain gain)
75{
76 return DEVICE_API_GET(opamp, dev)->set_gain(dev, gain);
77}
78
79#ifdef __cplusplus
80}
81#endif
82
84
85#include <zephyr/syscalls/opamp.h>
86
87#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:28
@ OPAMP_GAIN_64
x 64.
Definition opamp.h:46
@ OPAMP_GAIN_2
x 2.
Definition opamp.h:33
@ OPAMP_GAIN_5_3
x 5/3.
Definition opamp.h:32
@ OPAMP_GAIN_11_5
x 11/5.
Definition opamp.h:34
@ OPAMP_GAIN_1
x 1.
Definition opamp.h:31
@ OPAMP_GAIN_4
x 4.
Definition opamp.h:36
@ OPAMP_GAIN_31
x 31.
Definition opamp.h:42
@ OPAMP_GAIN_7
x 7.
Definition opamp.h:38
@ OPAMP_GAIN_1_3
x 1/3.
Definition opamp.h:30
@ OPAMP_GAIN_15
x 15.
Definition opamp.h:40
@ OPAMP_GAIN_16
x 16.
Definition opamp.h:41
@ OPAMP_GAIN_1_7
x 1/7.
Definition opamp.h:29
@ OPAMP_GAIN_63
x 63.
Definition opamp.h:45
@ OPAMP_GAIN_3
x 3.
Definition opamp.h:35
@ OPAMP_GAIN_32
x 32.
Definition opamp.h:43
@ OPAMP_GAIN_33
x 33.
Definition opamp.h:44
@ OPAMP_GAIN_8
x 8.
Definition opamp.h:39
@ OPAMP_GAIN_13_3
x 13/3.
Definition opamp.h:37
Runtime device structure (in ROM) per driver instance.
Definition device.h:510