Zephyr API Documentation  3.6.0
A Scalable Open Source RTOS
3.6.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ad5592.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Grinn
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
6#ifndef ZEPHYR_INCLUDE_DRIVERS_MFD_AD5592_H_
7#define ZEPHYR_INCLUDE_DRIVERS_MFD_AD5592_H_
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13#include <zephyr/device.h>
14
15#define AD5592_REG_SEQ_ADC 0x02U
16#define AD5592_REG_ADC_CONFIG 0x04U
17#define AD5592_REG_LDAC_EN 0x05U
18#define AD5592_REG_GPIO_PULLDOWN 0x06U
19#define AD5592_REG_READ_AND_LDAC 0x07U
20#define AD5592_REG_GPIO_OUTPUT_EN 0x08U
21#define AD5592_REG_GPIO_SET 0x09U
22#define AD5592_REG_GPIO_INPUT_EN 0x0AU
23#define AD5592_REG_PD_REF_CTRL 0x0BU
24
25#define AD5592_EN_REF BIT(9)
26
27#define AD5592_PIN_MAX 8U
28
44int mfd_ad5592_read_raw(const struct device *dev, uint16_t *val);
45
56int mfd_ad5592_write_raw(const struct device *dev, uint16_t val);
57
69int mfd_ad5592_read_reg(const struct device *dev, uint8_t reg, uint8_t reg_data, uint16_t *val);
70
81int mfd_ad5592_write_reg(const struct device *dev, uint8_t reg, uint16_t val);
82
87#ifdef __cplusplus
88}
89#endif
90
91#endif /* ZEPHYR_INCLUDE_DRIVERS_MFD_AD5952_H_ */
int mfd_ad5592_read_reg(const struct device *dev, uint8_t reg, uint8_t reg_data, uint16_t *val)
Read data from provided register.
int mfd_ad5592_write_raw(const struct device *dev, uint16_t val)
Write raw data to chip.
int mfd_ad5592_read_raw(const struct device *dev, uint16_t *val)
Read raw data from the chip.
int mfd_ad5592_write_reg(const struct device *dev, uint8_t reg, uint16_t val)
Write data to provided register.
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
__UINT16_TYPE__ uint16_t
Definition: stdint.h:89
Runtime device structure (in ROM) per driver instance.
Definition: device.h:387