43#define LTC2378_RESOLUTION_UNIPOLAR (1 << 20)
44#define LTC2378_RESOLUTION_BIPOLAR (1 << 19)
47#define LTC2378_BUSY_TIMEOUT_US 1000
48#define LTC2378_CNV_PULSE_WIDTH_US 1
49#define LTC2378_CONVERSION_DELAY_US 1
50#define LTC2378_POWERDOWN_DELAY_US 2
53#define LTC2378_IIO_SCALE_UNIPOLAR_SHIFT 20
54#define LTC2378_IIO_SCALE_BIPOLAR_SHIFT 19
57#define LTC2378_DATA_MASK 0xFFFFF
58#define LTC2378_DATA_SHIFT_BYTE0 12
59#define LTC2378_DATA_SHIFT_BYTE1 4
60#define LTC2378_DATA_SHIFT_BYTE2 4
61#define LTC2378_SIGN_BIT_POSITION 19
117 int32_t *voltage_uv);
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
ltc2378_input_mode
Input mode configuration for LTC2378-20.
Definition ltc2378.h:67
@ LTC2378_BIPOLAR
Definition ltc2378.h:68
@ LTC2378_UNIPOLAR
Definition ltc2378.h:69
int ltc2378_read_avg(struct ltc2378_dev *dev, uint32_t *avg_data, uint16_t samples)
Read and average multiple ADC conversion results.
Definition ltc2378.c:195
int ltc2378_raw_to_uv(struct ltc2378_dev *dev, uint32_t raw, int32_t *voltage_uv)
Convert raw ADC value to voltage in microvolts.
Definition ltc2378.c:224
int ltc2378_remove(struct ltc2378_dev *dev)
Remove the LTC2378-20 device and free allocated resources.
Definition ltc2378.c:103
int ltc2378_read_raw(struct ltc2378_dev *dev, uint32_t *data)
Read a single raw ADC conversion result.
Definition ltc2378.c:148
int ltc2378_start_conversion(struct ltc2378_dev *dev)
Start a single ADC conversion.
Definition ltc2378.c:122
int ltc2378_power_down(struct ltc2378_dev *dev)
Put the LTC2378-20 into power-down mode.
Definition ltc2378.c:255
int ltc2378_init(struct ltc2378_dev **device, const struct ltc2378_init_param *init_param)
Initialize the LTC2378-20 device.
Definition ltc2378.c:46
Header file of Delay functions.
Header file of GPIO Interface.
Header file of SPI Interface.
Definition ad9361_util.h:63
Device descriptor for LTC2378-20.
Definition ltc2378.h:76
struct no_os_gpio_desc * gpio_cnv
Definition ltc2378.h:78
struct no_os_spi_desc * spi_desc
Definition ltc2378.h:77
enum ltc2378_input_mode input_mode
Definition ltc2378.h:81
struct no_os_gpio_desc * gpio_busy
Definition ltc2378.h:79
uint32_t vref_uv
Definition ltc2378.h:80
Initialization parameters for LTC2378-20.
Definition ltc2378.h:88
enum ltc2378_input_mode input_mode
Definition ltc2378.h:93
uint32_t vref_uv
Definition ltc2378.h:92
const struct no_os_gpio_init_param * gpio_cnv_init
Definition ltc2378.h:90
const struct no_os_gpio_init_param * gpio_busy_init
Definition ltc2378.h:91
const struct no_os_spi_init_param * spi_init
Definition ltc2378.h:89
Structure holding the GPIO descriptor.
Definition no_os_gpio.h:84
Structure holding the parameters for GPIO initialization.
Definition no_os_gpio.h:67
Structure holding SPI descriptor.
Definition no_os_spi.h:180
Structure holding the parameters for SPI initialization.
Definition no_os_spi.h:128