123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- #ifndef ZEPHYR_INCLUDE_DRIVERS_REGULATOR_H_
- #define ZEPHYR_INCLUDE_DRIVERS_REGULATOR_H_
- #include <zephyr/types.h>
- #include <drivers/gpio.h>
- #include <sys/onoff.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- __subsystem struct regulator_driver_api {
- int (*enable)(const struct device *dev, struct onoff_client *cli);
- int (*disable)(const struct device *dev);
- };
- static inline int regulator_enable(const struct device *reg,
- struct onoff_client *cli)
- {
- const struct regulator_driver_api *api =
- (const struct regulator_driver_api *)reg->api;
- return api->enable(reg, cli);
- }
- static inline int regulator_disable(const struct device *reg)
- {
- const struct regulator_driver_api *api =
- (const struct regulator_driver_api *)reg->api;
- return api->disable(reg);
- }
- #ifdef __cplusplus
- }
- #endif
- #endif
|