no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ltc2312.h
Go to the documentation of this file.
1
39
44
45#ifndef LTC231X_H
46#define LTC231X_H
47
49#ifndef LTC2315_CS
50#define LTC2315_CS QUIKEVAL_CS
51#endif
52
55// Channel Address
56#define LTC2315_ADDRESS 0x00
58
59#define LTC2312_READ_BYTES_NUMBER 2
60#define LTC2312_READ_VALUES_NUMBER 100
61
62#include <stdint.h>
63#include "no_os_delay.h"
64#include "no_os_spi.h"
65
70
72 /* Device characteristics */
74 /* SPI */
76};
77
79 /* Device characteristics */
81 /* SPI */
83};
84
85/* Initializes the ltc231x. */
86int32_t ltc2312_setup(struct ltc2312_dev **device,
88
89/* Free the resources allocated by ltc231x_setup(). */
90int32_t ltc2312_remove(struct ltc2312_dev *dev);
91
92/* Reads the LTC2315 and returns 32-bit data in offset binary format. */
93int32_t ltc2312_read(struct ltc2312_dev *dev, uint16_t *ptr_adc_code);
94
95/* Calculates the LTC2315 input voltage given the binary data and LSB weight. */
96void ltc2312_code_to_voltage(struct ltc2312_dev *dev, uint16_t adc_code,
97 float vref, float *voltage);
98
99#endif // LTC2315_H
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
int32_t ltc2312_read(struct ltc2312_dev *dev, uint16_t *ptr_adc_code)
Definition ltc2312.c:143
int32_t ltc2312_remove(struct ltc2312_dev *dev)
Definition ltc2312.c:93
int32_t ltc2312_setup(struct ltc2312_dev **device, struct ltc2312_init_param *init_param)
Definition ltc2312.c:61
void ltc2312_code_to_voltage(struct ltc2312_dev *dev, uint16_t adc_code, float vref, float *voltage)
Definition ltc2312.c:196
device_type
Definition ltc2312.h:66
@ LTC2312_14
Definition ltc2312.h:68
@ LTC2312_12
Definition ltc2312.h:67
Header file of Delay functions.
Header file of SPI Interface.
Definition ad9361_util.h:63
Definition ltc2312.h:71
enum device_type type
Definition ltc2312.h:73
struct no_os_spi_desc * spi_desc
Definition ltc2312.h:75
Definition ltc2312.h:78
enum device_type type
Definition ltc2312.h:80
struct no_os_spi_init_param spi_init
Definition ltc2312.h:82
Structure holding SPI descriptor.
Definition no_os_spi.h:180
Structure holding the parameters for SPI initialization.
Definition no_os_spi.h:128