no-OS
iio_ad463x.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef IIO_AD463x
34 #define IIO_AD463x
35 
36 #ifdef IIO_SUPPORT
37 
38 /******************************************************************************/
39 /***************************** Include Files **********************************/
40 /******************************************************************************/
41 
42 #include <stdio.h>
43 #include "iio_types.h"
44 #include "no_os_spi.h"
45 
46 /******************************************************************************/
47 /*************************** Types Declarations *******************************/
48 /******************************************************************************/
49 
50 struct iio_ad463x {
51  /* Mask of active ch */
52  uint32_t mask;
54  struct iio_device iio_dev_desc;
56  struct ad463x_dev *ad463x_desc;
57 };
58 
59 /******************************************************************************/
60 /************************ Functions Declarations ******************************/
61 /******************************************************************************/
62 
63 /* Init function. */
64 int32_t iio_ad463x_init(struct iio_ad463x **desc,
65  struct ad463x_dev *dev);
66 
67 /* Free the resources allocated by iio_ad463x_init(). */
68 int32_t iio_ad463x_remove(struct iio_ad463x *desc);
69 
70 #endif /* IIO_SUPPORT */
71 
72 #endif /* IIO_AD463x */
no_os_alloc.h
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:116
ad463x_dev::scale_table
int32_t scale_table[4][2]
Definition: ad463x.h:272
IIO_VAL_INT
@ IIO_VAL_INT
Definition: iio_types.h:50
iio_channel
Struct describing the scan type.
Definition: iio_types.h:168
IIO_VAL_INT_PLUS_NANO
@ IIO_VAL_INT_PLUS_NANO
Definition: iio_types.h:52
ad463x_dev::pgia_idx
uint8_t pgia_idx
Definition: ad463x.h:270
scan_type::sign
char sign
Definition: iio_types.h:153
iio_device::channels
struct iio_channel * channels
Definition: iio_types.h:254
ad463x_calc_pgia_gain
int32_t ad463x_calc_pgia_gain(int32_t gain_int, int32_t gain_fract, int32_t vref, int32_t precision, enum ad463x_pgia_gain *gain_idx)
Calculate the PGIA gain.
Definition: ad463x.c:888
IIO_VAL_FRACTIONAL_LOG2
@ IIO_VAL_FRACTIONAL_LOG2
Definition: iio_types.h:56
no_os_spi.h
Header file of SPI Interface.
iio_desc
Definition: iio.c:204
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:103
IIO_VAL_FRACTIONAL
@ IIO_VAL_FRACTIONAL
Definition: iio_types.h:55
BITS_PER_SAMPLE
#define BITS_PER_SAMPLE
Definition: basic_example.c:42
no_os_calloc
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
NO_OS_ARRAY_SIZE
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
ad463x_dev::real_bits_precision
uint8_t real_bits_precision
Definition: ad463x.h:276
iio.h
Header file of iio.
no_os_error.h
Error codes definition.
iio_attribute::name
const char * name
Definition: iio_types.h:131
ID_AD4632_16
@ ID_AD4632_16
Definition: ad463x.h:167
ad463x.h
Header file of AD463x Driver.
ad463x_read_data
int32_t ad463x_read_data(struct ad463x_dev *dev, uint32_t *buf, uint16_t samples)
Read from device. Enter register mode to read/write registers.
Definition: ad463x.c:628
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:129
REAL_BITS
#define REAL_BITS
Definition: basic_example.c:43
iio_parse_value
int32_t iio_parse_value(char *buf, enum iio_val fmt, int32_t *val, int32_t *val2)
Definition: iio.c:630
ad463x_dev::vref
int32_t vref
Definition: ad463x.h:268
iio_format_value
int iio_format_value(char *buf, uint32_t len, enum iio_val fmt, int32_t size, int32_t *vals)
Definition: iio.c:686
iio_ad463x.h
Header file of iio_ad463x.
adc_scan_type
struct scan_type adc_scan_type
Definition: iio_adc_demo.c:229
iio_types.h
Header file for iio_types.
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
ad463x_set_pgia_gain
int32_t ad463x_set_pgia_gain(struct ad463x_dev *dev, enum ad463x_pgia_gain gain_idx)
Set the PGIA gain.
Definition: ad463x.c:916
iio_ch_info::ch_num
int16_t ch_num
Definition: iio_types.h:105
iio_device
Structure holding channels and attributes of a device.
Definition: iio_types.h:247
ad463x_dev
Device initialization parameters.
Definition: ad463x.h:237
ad463x_dev::device_id
enum ad463x_id device_id
Definition: ad463x.h:254
scan_type
Definition: iio_types.h:151
no_os_sign_extend32
int32_t no_os_sign_extend32(uint32_t value, int index)
ad463x_dev::has_pgia
bool has_pgia
Definition: ad463x.h:278
ad463x_exit_reg_cfg_mode
int32_t ad463x_exit_reg_cfg_mode(struct ad463x_dev *dev)
Exit register configuration mode.
Definition: ad463x.c:262