no-OS
iio_ad7606.h
Go to the documentation of this file.
1 /***************************************************************************/
13 #ifndef _AD7606_IIO_H_
14 #define _AD7606_IIO_H_
15 
16 /******************************************************************************/
17 /***************************** Include Files **********************************/
18 /******************************************************************************/
19 #include <stdint.h>
20 
21 #include "iio.h"
22 #include "iio_types.h"
23 #include "ad7606.h"
24 
25 /******************************************************************************/
26 /********************** Public/Extern Declarations ****************************/
27 /******************************************************************************/
28 
32  int sign_bit;
33 };
34 
35 /* Init the IIO interface */
36 int ad7606_iio_init(struct ad7606_iio_dev **dev,
38 int ad7606_iio_remove(struct ad7606_iio_dev *dev);
39 
40 #endif /* __AD7606_IIO_H__ */
ad7606_get_ch_scale
int32_t ad7606_get_ch_scale(struct ad7606_dev *dev, uint8_t ch, double *scale)
Get the value of scale for the channel.
Definition: ad7606.c:1502
ad7606_get_resolution_bits
int32_t ad7606_get_resolution_bits(struct ad7606_dev *dev)
Get the resolution bits of this device.
Definition: ad7606.c:1524
no_os_alloc.h
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:116
iio_buffer::samples
uint32_t samples
Definition: iio_types.h:217
iio_channel
Struct describing the scan type.
Definition: iio_types.h:168
scan_type::sign
char sign
Definition: iio_types.h:153
ad7606.h
Header file for the ad7606 Driver.
ad7606_range::min
int32_t min
Definition: ad7606.h:237
iio_device_data::dev
void * dev
Definition: iio_types.h:227
ad7606_sw_mode_enabled
bool ad7606_sw_mode_enabled(struct ad7606_dev *dev)
Returns true if SW mode is enabled.
Definition: ad7606.c:1435
ad7606_get_channels_number
int32_t ad7606_get_channels_number(struct ad7606_dev *dev)
Returns the number of channels this ADC has.
Definition: ad7606.c:330
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:103
ad7606_oversampling
Definition: ad7606.h:248
ad7606_oversampling::os_ratio
enum ad7606_osr os_ratio
Definition: ad7606.h:252
AD7606_OSR_8
@ AD7606_OSR_8
Definition: ad7606.h:162
device
Definition: ad9361_util.h:69
AD7606_CHN_ATTR
#define AD7606_CHN_ATTR(_name, _priv)
Definition: iio_ad7606.c:35
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
iio_buffer_block_done
int iio_buffer_block_done(struct iio_buffer *buffer)
Definition: iio.c:1422
ad7606_iio_dev::ad7606_dev
struct ad7606_dev * ad7606_dev
Definition: iio_ad7606.h:30
OSR_ATTR_ID
@ OSR_ATTR_ID
Definition: iio_ad7606.c:45
ad7606_get_ch_ranges
const struct ad7606_range * ad7606_get_ch_ranges(struct ad7606_dev *dev, uint8_t ch, uint32_t *num_ranges)
Get the available channel ranges for the given channel.
Definition: ad7606.c:1366
ad7606_range::max
int32_t max
Definition: ad7606.h:239
ad7606_read_samples
int32_t ad7606_read_samples(struct ad7606_dev *dev, uint32_t *data, uint32_t samples)
Read muliple raw samples from device.
Definition: ad7606.c:1065
iio.h
Header file of iio.
no_os_error.h
Error codes definition.
ad7606_iio_remove
int ad7606_iio_remove(struct ad7606_iio_dev *dev)
Definition: iio_ad7606.c:467
iio_attribute::name
const char * name
Definition: iio_types.h:131
ad7606_set_oversampling
int32_t ad7606_set_oversampling(struct ad7606_dev *dev, struct ad7606_oversampling oversampling)
Set the oversampling ratio.
Definition: ad7606.c:1295
ad7606_iio_remove
int ad7606_iio_remove(struct ad7606_iio_dev *dev)
Definition: iio_ad7606.c:467
ad7606_init_param
Device driver initialization parameters.
Definition: ad7606.h:309
AD7606_OSR_16
@ AD7606_OSR_16
Definition: ad7606.h:164
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:129
iio_buffer
Definition: iio_types.h:209
iio_buffer::active_mask
uint32_t active_mask
Definition: iio_types.h:211
ad7606_iio_attributes_id
ad7606_iio_attributes_id
Definition: iio_ad7606.c:44
ad7606_iio_dev::iio_dev
struct iio_device * iio_dev
Definition: iio_ad7606.h:31
iio_device_data::buffer
struct iio_buffer * buffer
Definition: iio_types.h:228
ad7606_remove
int32_t ad7606_remove(struct ad7606_dev *dev)
Free any resource used by the driver.
Definition: ad7606.c:2073
ad7606_iio_init
int ad7606_iio_init(struct ad7606_iio_dev **dev, struct ad7606_init_param *init_param)
Initialize AD7606 for IIO interfacing.
Definition: iio_ad7606.c:437
AD7606_OSR_2
@ AD7606_OSR_2
Definition: ad7606.h:158
iio_channel::attributes
struct iio_attribute * attributes
Definition: iio_types.h:186
ad7606_get_oversampling
int32_t ad7606_get_oversampling(struct ad7606_dev *dev, struct ad7606_oversampling *oversampling)
Get the oversampling ratio.
Definition: ad7606.c:1345
iio_types.h
Header file for iio_types.
iio_device::num_ch
uint16_t num_ch
Definition: iio_types.h:252
NO_OS_BIT
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
ad7606_iio_init
int ad7606_iio_init(struct ad7606_iio_dev **dev, struct ad7606_init_param *init_param)
Initialize AD7606 for IIO interfacing.
Definition: iio_ad7606.c:437
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
ad7606_set_ch_range
int32_t ad7606_set_ch_range(struct ad7606_dev *dev, uint8_t ch, struct ad7606_range range)
Set the channel operation range.
Definition: ad7606.c:1456
AD7606_OSR_32
@ AD7606_OSR_32
Definition: ad7606.h:166
OSR_AVAILABLE_ID
@ OSR_AVAILABLE_ID
Definition: iio_ad7606.c:46
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
AD7606_OSR_4
@ AD7606_OSR_4
Definition: ad7606.h:160
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
ad7606_reg_write
int32_t ad7606_reg_write(struct ad7606_dev *dev, uint8_t reg_addr, uint8_t reg_data)
Write a device register via SPI or AXI Parallel core.
Definition: ad7606.c:568
AD7606_OSR_256
@ AD7606_OSR_256
Definition: ad7606.h:172
ad7606_init
int32_t ad7606_init(struct ad7606_dev **device, struct ad7606_init_param *init_param)
Initialize the ad7606 device structure.
Definition: ad7606.c:1833
ad7606_iio_dev
Definition: iio_ad7606.h:29
ad7606_capture_post_disable
void ad7606_capture_post_disable(struct ad7606_dev *dev)
Disables buffer capture for an AXI SPI Engine or AXI Parallel interface.
Definition: ad7606.c:1036
ad7606_range
Operation range as specified in datasheet (in uV)
Definition: ad7606.h:235
scan_type
Definition: iio_types.h:151
ad7606_iio_dev::sign_bit
int sign_bit
Definition: iio_ad7606.h:32
iio_buffer_get_block
int iio_buffer_get_block(struct iio_buffer *buffer, void **addr)
Definition: iio.c:1409
no_os_util.h
Header file of utility functions.
iio_device_data
Definition: iio_types.h:226
AD7606_OSR_128
@ AD7606_OSR_128
Definition: ad7606.h:170
no_os_sign_extend32
int32_t no_os_sign_extend32(uint32_t value, int index)
ad7606_capture_pre_enable
int32_t ad7606_capture_pre_enable(struct ad7606_dev *dev)
Prepares buffer capture for an AXI SPI Engine or AXI Parallel interface.
Definition: ad7606.c:1018
AD7606_OSR_64
@ AD7606_OSR_64
Definition: ad7606.h:168
AD7606_CH
#define AD7606_CH(_idx, bits)
Definition: iio_ad7606.c:24
iio_ad7606.h
Header file for AD7606 IIO interface.
AD7606_OSR_1
@ AD7606_OSR_1
Definition: ad7606.h:156
ad7606_reg_read
int32_t ad7606_reg_read(struct ad7606_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Write a device register via SPI or AXI Parallel core.
Definition: ad7606.c:542
ad7606_dev
Device driver structure.
Definition: ad7606.c:268