no-OS
Loading...
Searching...
No Matches
iio_ad405x.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include "no_os_error.h"
#include "no_os_util.h"
#include "iio_ad405x.h"
#include "ad405x.h"
Include dependency graph for iio_ad405x.c:

Enumerations

enum  ad405x_iio_accel_chans {
  CHAN_ADC_MODE = 0 ,
  CHAN_BURST_AVERAGING_MODE = 1
}
 

Functions

int ad405x_iio_read_debug_attrs (void *dev, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv)
 Handles the read request for debug attributes.
 
int ad405x_iio_write_debug_attrs (void *dev, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv)
 Handles the write request for debug attributes.
 
int ad405x_iio_write_sample_rate (void *dev, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv)
 Handles the write request for sampling rate attribute.
 
int ad405x_iio_read_sample_rate (void *dev, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv)
 Handles the read request for sample rate attribute.
 
int ad405x_iio_write_avg_filter_length (void *dev, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv)
 Handles the write request for average filter length attribute.
 
int ad405x_iio_read_avg_filter_length (void *dev, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv)
 Handles the read request for average filter length attribute.
 
int ad405x_iio_init (struct ad405x_iio_dev **iio_dev, struct ad405x_iio_dev_init_param *init_param)
 Initializes the AD405X IIO driver.
 
int ad405x_iio_remove (struct ad405x_iio_dev *desc)
 Free the resources allocated by ad405x_iio_init().
 

Variables

const uint8_t ad405x_realbits_adc [] = {12, 14, 16, 12, 14, 16}
 
const uint8_t ad405x_realbits_burst [] = {16, 16, 24, 16, 16, 24}
 
const int32_t ad405x_sample_rate []
 

Enumeration Type Documentation

◆ ad405x_iio_accel_chans

Enumerator
CHAN_ADC_MODE 
CHAN_BURST_AVERAGING_MODE 

Function Documentation

◆ ad405x_iio_init()

int ad405x_iio_init ( struct ad405x_iio_dev ** iio_dev,
struct ad405x_iio_dev_init_param * init_param )

Initializes the AD405X IIO driver.

Parameters
iio_dev- The iio device structure.
init_param- The structure that contains the device initial parameters.
Returns
Result of the initialization procedure.
Here is the caller graph for this function:

◆ ad405x_iio_read_avg_filter_length()

int ad405x_iio_read_avg_filter_length ( void * dev,
char * buf,
uint32_t len,
const struct iio_ch_info * channel,
intptr_t priv )

Handles the read request for average filter length attribute.

Parameters
dev- The iio device structure.
buf- Command buffer to be filled with requested data.
len- Length of the received command buffer in bytes.
channel- Command channel info.
priv- Command attribute id.
Returns
The size of the read data in case of success, error code otherwise.

◆ ad405x_iio_read_debug_attrs()

int ad405x_iio_read_debug_attrs ( void * dev,
char * buf,
uint32_t len,
const struct iio_ch_info * channel,
intptr_t priv )

Handles the read request for debug attributes.

Parameters
dev- The iio device structure.
buf- Command buffer to be filled with requested data.
len- Length of the received command buffer in bytes.
channel- Command channel info.
priv- Command attribute id.
Returns
The size of the read data in case of success, error code otherwise.

◆ ad405x_iio_read_sample_rate()

int ad405x_iio_read_sample_rate ( void * dev,
char * buf,
uint32_t len,
const struct iio_ch_info * channel,
intptr_t priv )

Handles the read request for sample rate attribute.

Parameters
dev- The iio device structure.
buf- Command buffer to be filled with requested data.
len- Length of the received command buffer in bytes.
channel- Command channel info.
priv- Command attribute id.
Returns
the size of the read data in case of success, error code otherwise.

◆ ad405x_iio_remove()

int ad405x_iio_remove ( struct ad405x_iio_dev * desc)

Free the resources allocated by ad405x_iio_init().

Parameters
desc- The IIO device structure.
Returns
Result of the remove procedure.

◆ ad405x_iio_write_avg_filter_length()

int ad405x_iio_write_avg_filter_length ( void * dev,
char * buf,
uint32_t len,
const struct iio_ch_info * channel,
intptr_t priv )

Handles the write request for average filter length attribute.

Parameters
dev- The iio device structure.
buf- Command buffer to be filled with the data to be written.
len- Length of the received command buffer in bytes.
channel- Command channel info.
priv- Command attribute id.
Returns
Number of bytes received in case of success, error code otherwise.

◆ ad405x_iio_write_debug_attrs()

int ad405x_iio_write_debug_attrs ( void * dev,
char * buf,
uint32_t len,
const struct iio_ch_info * channel,
intptr_t priv )

Handles the write request for debug attributes.

Parameters
dev- The iio device structure.
buf- Command buffer to be filled with the data to be written.
len- Length of the received command buffer in bytes.
channel- Command channel info.
priv- Command attribute id.
Returns
Number of bytes received in case of success, error code otherwise.

◆ ad405x_iio_write_sample_rate()

int ad405x_iio_write_sample_rate ( void * dev,
char * buf,
uint32_t len,
const struct iio_ch_info * channel,
intptr_t priv )

Handles the write request for sampling rate attribute.

Parameters
dev- The iio device structure.
buf- Command buffer to be filled with the data to be written.
len- Length of the received command buffer in bytes.
channel- Command channel info.
priv- Command attribute id.
Returns
Number of bytes received in case of success, error code otherwise.

Variable Documentation

◆ ad405x_realbits_adc

const uint8_t ad405x_realbits_adc[] = {12, 14, 16, 12, 14, 16}

◆ ad405x_realbits_burst

const uint8_t ad405x_realbits_burst[] = {16, 16, 24, 16, 16, 24}

◆ ad405x_sample_rate

const int32_t ad405x_sample_rate[]
Initial value:
= {2000000, 1000000, 333000, 100000, 33000,
10000, 3000, 1000, 500, 333, 250, 200,
166, 140, 125, 111
}