no-OS
iio_ad713x.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef IIO_AD713X
40 #define IIO_AD713X
41 
42 #ifdef IIO_SUPPORT
43 
44 /******************************************************************************/
45 /***************************** Include Files **********************************/
46 /******************************************************************************/
47 
48 #include "iio_types.h"
49 #include "no_os_spi.h"
50 
51 /******************************************************************************/
52 /*************************** Types Declarations *******************************/
53 /******************************************************************************/
54 
55 struct ad713x_iio;
56 
61 struct ad713x_iio_init_param {
63  struct ad713x_dev *drv_dev;
65  struct iio_device *iio_dev;
67  uint32_t vref_int;
69  uint32_t vref_micro;
71  struct no_os_spi_desc *spi_eng_desc;
73  void (*dcache_invalidate_range)(uint32_t address, uint32_t bytes_count);
74 };
75 
76 extern struct iio_device ad713x_iio_desc;
77 
79 int iio_ad713x_init(struct ad713x_iio **desc,
80  struct ad713x_iio_init_param *param);
81 
83 int iio_ad713x_remove(struct ad713x_iio *desc);
84 
85 #endif /* IIO_SUPPORT */
86 
87 #endif /* IIO_AD713X */
no_os_alloc.h
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:121
spi_engine_offload_message::no_commands
uint32_t no_commands
Definition: spi_engine.h:167
ad713x.h
Header file for the ad713x Driver.
IIO_VAL_INT
@ IIO_VAL_INT
Definition: iio_types.h:56
iio_channel
Struct describing the scan type.
Definition: iio_types.h:173
dev_err
#define dev_err(dev, format,...)
Definition: ad9361_util.h:69
scan_type::sign
char sign
Definition: iio_types.h:158
SINC6
@ SINC6
Definition: ad713x.h:645
SINC3
@ SINC3
Definition: ad713x.h:647
IIO_SEPARATE
@ IIO_SEPARATE
Definition: iio_types.h:124
AD713X_REG_CH1_OFFSET_LSB
#define AD713X_REG_CH1_OFFSET_LSB
Definition: ad713x.h:112
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_INT_PLUS_MICRO
@ IIO_VAL_INT_PLUS_MICRO
Definition: iio_types.h:57
spi_engine_offload_message::commands_data
uint32_t * commands_data
Definition: spi_engine.h:169
ad713x_channels
ad713x_channels
AD713x list of channels.
Definition: ad713x.h:656
AD713X_CH_MAX
@ AD713X_CH_MAX
Definition: ad713x.h:666
spi_engine_offload_message
Structure representing an offload message.
Definition: spi_engine.h:160
device
Definition: ad9361_util.h:75
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
FIR
@ FIR
Definition: ad713x.h:643
AD713X_CH_OFFSET_CAL_EN_MSK
#define AD713X_CH_OFFSET_CAL_EN_MSK
Definition: ad713x.h:437
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:127
iio_channel::channel
int channel
Definition: iio_types.h:179
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:135
iio_attribute::name
const char * name
Definition: iio_types.h:136
SINC3_50_60_REJ
@ SINC3_50_60_REJ
Definition: ad713x.h:649
spi_engine.h
AD713X_FIR_BW_SEL_CH_MSK
#define AD713X_FIR_BW_SEL_CH_MSK(ch)
Definition: ad713x.h:348
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:134
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:171
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:177
AD713X_REG_FIR_BW_SEL
#define AD713X_REG_FIR_BW_SEL
Definition: ad713x.h:95
iio_parse_value
int32_t iio_parse_value(char *buf, enum iio_val fmt, int32_t *val, int32_t *val2)
Definition: iio.c:615
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:110
AD713X_DIGFILTER_SEL_CH_MSK
#define AD713X_DIGFILTER_SEL_CH_MSK(ch)
Definition: ad713x.h:342
spi_engine_offload_message::commands
uint32_t * commands
Definition: spi_engine.h:165
ad713x_dev::mode_master_nslave
bool mode_master_nslave
Definition: ad713x.h:706
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_types.h
Header file for iio_types.
iio_device::num_ch
uint16_t num_ch
Definition: iio_types.h:257
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
NULL
#define NULL
Definition: wrapper.h:64
AD713X_REG_CHAN_DIG_FILTER_SEL
#define AD713X_REG_CHAN_DIG_FILTER_SEL
Definition: ad713x.h:94
ad713x_dev
AD713x driver handler structure.
Definition: ad713x.h:686
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
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:805
scan_type
Definition: iio_types.h:156
MEGA
#define MEGA
Definition: no_os_units.h:48
no_os_util.h
Header file of utility functions.
AD713X_REG_CH0_OFFSET_LSB
#define AD713X_REG_CH0_OFFSET_LSB
Definition: ad713x.h:106
spi_engine_offload_message::rx_addr
uint32_t rx_addr
Definition: spi_engine.h:173
adc_buffer
uint16_t adc_buffer[ADC_BUFFER_SAMPLES *ADC_CHANNELS]
Definition: main.c:106
AD713X_REG_ODR_VAL_INT_LSB
#define AD713X_REG_ODR_VAL_INT_LSB
Definition: ad713x.h:86
READ
#define READ(no_bytes)
Definition: spi_engine.h:68
AD713X_REG_CH3_OFFSET_LSB
#define AD713X_REG_CH3_OFFSET_LSB
Definition: ad713x.h:124
errno.h
Error macro definition for ARM Compiler.
AD713X_REG_CH2_OFFSET_LSB
#define AD713X_REG_CH2_OFFSET_LSB
Definition: ad713x.h:118