no-OS
iio_ad463x.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef IIO_AD463x
40 #define IIO_AD463x
41 
42 #ifdef IIO_SUPPORT
43 
44 /******************************************************************************/
45 /***************************** Include Files **********************************/
46 /******************************************************************************/
47 
48 #include <stdio.h>
49 #include "iio_types.h"
50 #include "no_os_spi.h"
51 
52 /******************************************************************************/
53 /*************************** Types Declarations *******************************/
54 /******************************************************************************/
55 
56 struct iio_ad463x {
57  /* Mask of active ch */
58  uint32_t mask;
60  struct iio_device iio_dev_desc;
62  struct ad463x_dev *ad463x_desc;
63 };
64 
65 /******************************************************************************/
66 /************************ Functions Declarations ******************************/
67 /******************************************************************************/
68 
69 /* Init function. */
70 int32_t iio_ad463x_init(struct iio_ad463x **desc,
71  struct ad463x_dev *dev);
72 
73 /* Free the resources allocated by iio_ad463x_init(). */
74 int32_t iio_ad463x_remove(struct iio_ad463x *desc);
75 
76 #endif /* IIO_SUPPORT */
77 
78 #endif /* IIO_AD463x */
no_os_alloc.h
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:121
ad463x_dev::scale_table
int32_t scale_table[4][2]
Definition: ad463x.h:272
IIO_VAL_INT
@ IIO_VAL_INT
Definition: iio_types.h:56
iio_channel
Struct describing the scan type.
Definition: iio_types.h:173
IIO_VAL_INT_PLUS_NANO
@ IIO_VAL_INT_PLUS_NANO
Definition: iio_types.h:58
ad463x_dev::pgia_idx
uint8_t pgia_idx
Definition: ad463x.h:270
scan_type::sign
char sign
Definition: iio_types.h:158
iio_device::channels
struct iio_channel * channels
Definition: iio_types.h:259
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:673
IIO_VAL_FRACTIONAL_LOG2
@ IIO_VAL_FRACTIONAL_LOG2
Definition: iio_types.h:62
no_os_spi.h
Header file of SPI Interface.
iio_desc
Definition: iio.c:209
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:108
IIO_VAL_FRACTIONAL
@ IIO_VAL_FRACTIONAL
Definition: iio_types.h:61
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:60
NO_OS_ARRAY_SIZE
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:53
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:136
ID_AD4632_16
@ ID_AD4632_16
Definition: ad463x.h:173
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:410
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:134
ad463x_enter_config_mode
int32_t ad463x_enter_config_mode(struct ad463x_dev *dev)
Enter register configuration mode.
Definition: ad463x.c:129
iio_parse_value
int32_t iio_parse_value(char *buf, enum iio_val fmt, int32_t *val, int32_t *val2)
Definition: iio.c:615
ad463x_dev::capture_data_width
uint8_t capture_data_width
Definition: ad463x.h:260
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:666
iio_ad463x.h
Header file of iio_ad463x.
adc_scan_type
struct scan_type adc_scan_type
Definition: iio_adc_demo.c:233
iio_types.h
Header file for iio_types.
NO_OS_BIT
#define NO_OS_BIT(x)
Definition: no_os_util.h:51
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:75
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:701
iio_ch_info::ch_num
int16_t ch_num
Definition: iio_types.h:110
iio_device
Structure holding channels and attributes of a device.
Definition: iio_types.h:252
ad463x_dev
Device initialization parameters.
Definition: ad463x.h:238
ad463x_dev::device_id
enum ad463x_id device_id
Definition: ad463x.h:254
scan_type
Definition: iio_types.h:156
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:266