Skip to content

Commit 783d4a1

Browse files
KozhinovAlexanderkartben
authored andcommitted
opamp: adjust modes enum to avoid clash with STM32 HAL macros
In the enum opamp_functional_mode becomes prefix OPAMP_FUNCTIONAL_MODE_ to avoid clash with STM32 HAL macros The suffix _MODE were removed to make the names shorter Signed-off-by: Alexander Kozhinov <[email protected]>
1 parent 181082e commit 783d4a1

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

drivers/opamp/opamp_mcux_opamp.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,17 @@ static int mcux_opamp_set_gain(const struct device *dev, enum opamp_gain gain)
8181
}
8282

8383
switch (config->functional_mode) {
84-
case OPAMP_DIFFERENTIAL_MODE:
85-
case OPAMP_INVERTING_MODE:
86-
case OPAMP_NON_INVERTING_MODE:
84+
case OPAMP_FUNCTIONAL_MODE_DIFFERENTIAL:
85+
case OPAMP_FUNCTIONAL_MODE_INVERTING:
86+
case OPAMP_FUNCTIONAL_MODE_NON_INVERTING:
8787
/* For differential, inverting and non-inverting mode,
8888
* set Ngain to select different gains, and set Pgain
8989
* to be the same as Ngain.
9090
*/
9191
OPAMP_DoNegGainConfig(config->base, gain_index);
9292
OPAMP_DoPosGainConfig(config->base, gain_index);
9393
break;
94-
case OPAMP_FOLLOWER_MODE:
94+
case OPAMP_FUNCTIONAL_MODE_FOLLOWER:
9595
OPAMP_DoNegGainConfig(config->base, kOPAMP_NegGainBufferMode);
9696
OPAMP_DoPosGainConfig(config->base, kOPAMP_PosGainNonInvert1X);
9797
default:
@@ -179,11 +179,11 @@ int mcux_opamp_init(const struct device *dev)
179179
#endif
180180

181181
switch (config->functional_mode) {
182-
case OPAMP_DIFFERENTIAL_MODE:
183-
case OPAMP_INVERTING_MODE:
184-
case OPAMP_NON_INVERTING_MODE:
182+
case OPAMP_FUNCTIONAL_MODE_DIFFERENTIAL:
183+
case OPAMP_FUNCTIONAL_MODE_INVERTING:
184+
case OPAMP_FUNCTIONAL_MODE_NON_INVERTING:
185185
break;
186-
case OPAMP_FOLLOWER_MODE:
186+
case OPAMP_FUNCTIONAL_MODE_FOLLOWER:
187187
#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN
188188
base->OPAMP_CTR &= ~OPAMP_OPAMP_CTR_BUFEN_MASK;
189189
#else

include/zephyr/dt-bindings/opamp/opamp.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
*/
1313
enum opamp_functional_mode {
1414
/** Differential amplifier mode */
15-
OPAMP_DIFFERENTIAL_MODE = 0,
15+
OPAMP_FUNCTIONAL_MODE_DIFFERENTIAL = 0,
1616
/** Inverting amplifier mode */
17-
OPAMP_INVERTING_MODE,
17+
OPAMP_FUNCTIONAL_MODE_INVERTING,
1818
/** Non-inverting amplifier mode */
19-
OPAMP_NON_INVERTING_MODE,
19+
OPAMP_FUNCTIONAL_MODE_NON_INVERTING,
2020
/** Follower mode */
21-
OPAMP_FOLLOWER_MODE,
21+
OPAMP_FUNCTIONAL_MODE_FOLLOWER,
2222
};
2323

2424
#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_OPAMP_OPAMP_H_ */

0 commit comments

Comments
 (0)