no-OS
iio_ad713x.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef IIO_AD713X
34 #define IIO_AD713X
35 
36 #ifdef IIO_SUPPORT
37 
38 /******************************************************************************/
39 /***************************** Include Files **********************************/
40 /******************************************************************************/
41 
42 #include "iio_types.h"
43 #include "no_os_spi.h"
44 
45 /******************************************************************************/
46 /*************************** Types Declarations *******************************/
47 /******************************************************************************/
48 
49 struct ad713x_iio;
50 
55 struct ad713x_iio_init_param {
57  struct ad713x_dev *drv_dev;
59  struct iio_device *iio_dev;
61  uint32_t vref_int;
63  uint32_t vref_micro;
65  struct no_os_spi_desc *spi_eng_desc;
67  void (*dcache_invalidate_range)(uint32_t address, uint32_t bytes_count);
68 };
69 
70 extern struct iio_device ad713x_iio_desc;
71 
73 int iio_ad713x_init(struct ad713x_iio **desc,
74  struct ad713x_iio_init_param *param);
75 
77 int iio_ad713x_remove(struct ad713x_iio *desc);
78 
79 #endif /* IIO_SUPPORT */
80 
81 #endif /* IIO_AD713X */
no_os_alloc.h
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:116
spi_engine_offload_message::no_commands
uint32_t no_commands
Definition: spi_engine.h:165
ad713x.h
Header file for the ad713x Driver.
IIO_VAL_INT
@ IIO_VAL_INT
Definition: iio_types.h:50
iio_channel
Struct describing the scan type.
Definition: iio_types.h:168
dev_err
#define dev_err(dev, format,...)
Definition: ad9361_util.h:63
scan_type::sign
char sign
Definition: iio_types.h:153
SINC6
@ SINC6
Definition: ad713x.h:639
SINC3
@ SINC3
Definition: ad713x.h:641
IIO_SEPARATE
@ IIO_SEPARATE
Definition: iio_types.h:119
AD713X_REG_CH1_OFFSET_LSB
#define AD713X_REG_CH1_OFFSET_LSB
Definition: ad713x.h:106
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_INT_PLUS_MICRO
@ IIO_VAL_INT_PLUS_MICRO
Definition: iio_types.h:51
spi_engine_offload_message::commands_data
uint32_t * commands_data
Definition: spi_engine.h:167
ad713x_channels
ad713x_channels
AD713x list of channels.
Definition: ad713x.h:650
AD713X_CH_MAX
@ AD713X_CH_MAX
Definition: ad713x.h:660
spi_engine_offload_message
Structure representing an offload message.
Definition: spi_engine.h:158
device
Definition: ad9361_util.h:69
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
FIR
@ FIR
Definition: ad713x.h:637
AD713X_CH_OFFSET_CAL_EN_MSK
#define AD713X_CH_OFFSET_CAL_EN_MSK
Definition: ad713x.h:431
no_os_do_div
uint64_t no_os_do_div(uint64_t *n, uint64_t base)
IIO_SHARED_BY_ALL
@ IIO_SHARED_BY_ALL
Definition: iio_types.h:122
iio_channel::channel
int channel
Definition: iio_types.h:174
iio.h
Header file of iio.
ad713x_spi_reg_write
int32_t ad713x_spi_reg_write(struct ad713x_dev *dev, uint8_t reg_addr, uint8_t reg_data)
Write to device.
Definition: ad713x.c:129
iio_attribute::name
const char * name
Definition: iio_types.h:131
SINC3_50_60_REJ
@ SINC3_50_60_REJ
Definition: ad713x.h:643
spi_engine.h
AD713X_FIR_BW_SEL_CH_MSK
#define AD713X_FIR_BW_SEL_CH_MSK(ch)
Definition: ad713x.h:342
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:129
no_os_mul_u32_u32
uint64_t no_os_mul_u32_u32(uint32_t a, uint32_t b)
spi_engine_offload_message::tx_addr
uint32_t tx_addr
Definition: spi_engine.h:169
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
AD713X_REG_FIR_BW_SEL
#define AD713X_REG_FIR_BW_SEL
Definition: ad713x.h:89
iio_parse_value
int32_t iio_parse_value(char *buf, enum iio_val fmt, int32_t *val, int32_t *val2)
Definition: iio.c:630
iio_ad713x.h
Header file of iio_axi_adc.
ad713x_spi_reg_read
int32_t ad713x_spi_reg_read(struct ad713x_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Read from device.
Definition: ad713x.c:104
AD713X_DIGFILTER_SEL_CH_MSK
#define AD713X_DIGFILTER_SEL_CH_MSK(ch)
Definition: ad713x.h:336
spi_engine_offload_message::commands
uint32_t * commands
Definition: spi_engine.h:163
ad713x_dev::mode_master_nslave
bool mode_master_nslave
Definition: ad713x.h:702
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_types.h
Header file for iio_types.
iio_device::num_ch
uint16_t num_ch
Definition: iio_types.h:252
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
NULL
#define NULL
Definition: wrapper.h:64
AD713X_REG_CHAN_DIG_FILTER_SEL
#define AD713X_REG_CHAN_DIG_FILTER_SEL
Definition: ad713x.h:88
ad713x_dev
AD713x driver handler structure.
Definition: ad713x.h:680
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
spi_engine_offload_transfer
int32_t spi_engine_offload_transfer(struct no_os_spi_desc *desc, struct spi_engine_offload_message msg, uint32_t no_samples)
Initiate a SPI transfer in offload mode.
Definition: spi_engine.c:809
scan_type
Definition: iio_types.h:151
MEGA
#define MEGA
Definition: no_os_units.h:42
no_os_util.h
Header file of utility functions.
AD713X_REG_CH0_OFFSET_LSB
#define AD713X_REG_CH0_OFFSET_LSB
Definition: ad713x.h:100
spi_engine_offload_message::rx_addr
uint32_t rx_addr
Definition: spi_engine.h:171
adc_buffer
uint16_t adc_buffer[ADC_BUFFER_SAMPLES *ADC_CHANNELS]
Definition: main.c:100
AD713X_REG_ODR_VAL_INT_LSB
#define AD713X_REG_ODR_VAL_INT_LSB
Definition: ad713x.h:80
READ
#define READ(no_bytes)
Definition: spi_engine.h:62
AD713X_REG_CH3_OFFSET_LSB
#define AD713X_REG_CH3_OFFSET_LSB
Definition: ad713x.h:118
errno.h
Error macro definition for ARM Compiler.
AD713X_REG_CH2_OFFSET_LSB
#define AD713X_REG_CH2_OFFSET_LSB
Definition: ad713x.h:112