no-OS
iio_ad7091r8.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef IIO_AD7091R8_H
34 #define IIO_AD7091R8_H
35 
36 /******************************************************************************/
37 /***************************** Include Files **********************************/
38 /******************************************************************************/
39 #include "iio.h"
40 
41 /******************************************************************************/
42 /***************************** Define Section *********************************/
43 /******************************************************************************/
44 #define ad7091r8_iio_device(chans) { \
45  .num_ch = NO_OS_ARRAY_SIZE(chans), \
46  .channels = chans, \
47  .pre_enable = (int32_t (*)())ad7091r8_buffer_preenable, \
48  .trigger_handler = (int32_t (*)())ad7091r8_trigger_handler, \
49  .debug_reg_read = (int32_t (*)())ad7091r8_iio_read_reg, \
50  .debug_reg_write = (int32_t (*)())ad7091r8_iio_write_reg \
51 }
52 
53 /******************************************************************************/
54 /*************************** Types Declarations *******************************/
55 /******************************************************************************/
57 
64 };
65 
71 };
72 
73 /******************************************************************************/
74 /************************ Functions Declarations ******************************/
75 /******************************************************************************/
77 int ad7091r8_iio_init(struct ad7091r8_iio_dev **iio_dev,
79 
81 int ad7091r8_iio_remove(struct ad7091r8_iio_dev *desc);
82 
83 #endif
ad7091r8_iio_remove
int ad7091r8_iio_remove(struct ad7091r8_iio_dev *desc)
Free the resources allocated by ad7091r8_iio_init().
Definition: iio_ad7091r8.c:351
no_os_alloc.h
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:116
ad7091r8_iio_device
#define ad7091r8_iio_device(chans)
Definition: iio_ad7091r8.h:44
ad7091r8_remove
int ad7091r8_remove(struct ad7091r8_dev *dev)
Free the resources allocated by ad7091r8_init().
Definition: ad7091r8.c:458
IIO_VAL_INT
@ IIO_VAL_INT
Definition: iio_types.h:50
iio_channel
Struct describing the scan type.
Definition: iio_types.h:168
scan_type::sign
char sign
Definition: iio_types.h:153
IIO_SHARED_BY_TYPE
@ IIO_SHARED_BY_TYPE
Definition: iio_types.h:120
ad7091r8_iio_init
int ad7091r8_iio_init(struct ad7091r8_iio_dev **iio_dev, struct ad7091r8_iio_dev_init_param *init_param)
Initializes the AD7091R8 IIO driver.
Definition: iio_ad7091r8.c:302
iio_ad7091r8.h
Header file of IIO AD7091R8 driver header file.
IIO_VAL_FRACTIONAL_LOG2
@ IIO_VAL_FRACTIONAL_LOG2
Definition: iio_types.h:56
iio_device_data::dev
void * dev
Definition: iio_types.h:227
AD7091R8_CHANNEL
#define AD7091R8_CHANNEL(index)
Definition: iio_ad7091r8.c:84
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:103
no_os_units.h
Header file of Units.
ad7091r8_iio_timer_trig_desc
struct iio_trigger ad7091r8_iio_timer_trig_desc
Definition: iio_ad7091r8_trig.c:48
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
ad7091r8.h
Implementation of AD7091R-8 driver header file.
AD7091R8_REG_CHANNEL
#define AD7091R8_REG_CHANNEL
Definition: ad7091r8.h:55
ad7091r8_init_param
Definition: ad7091r8.h:182
ad7091r8_dev
Definition: ad7091r8.h:164
ad7091r8_dev::device_id
enum ad7091r8_device_id device_id
Definition: ad7091r8.h:177
iio.h
Header file of iio.
no_os_error.h
Error codes definition.
iio_attribute::name
const char * name
Definition: iio_types.h:131
ad7091r8_iio_remove
int ad7091r8_iio_remove(struct ad7091r8_iio_dev *desc)
Free the resources allocated by ad7091r8_iio_init().
Definition: iio_ad7091r8.c:351
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:129
ad7091r8_iio_dev
AD7091r8 IIO device descriptor structure.
Definition: iio_ad7091r8.h:61
AD7091R_NUM_CHANNELS
#define AD7091R_NUM_CHANNELS(id)
Definition: ad7091r8.h:48
iio_buffer::active_mask
uint32_t active_mask
Definition: iio_types.h:211
AD7091R8_REG_RESULT_DATA_MASK
#define AD7091R8_REG_RESULT_DATA_MASK
Definition: ad7091r8.h:63
ad7091r8_iio_dev_init_param::ad7091r8_dev_init
struct ad7091r8_init_param * ad7091r8_dev_init
Definition: iio_ad7091r8.h:70
AD7091R4
@ AD7091R4
Definition: ad7091r8.h:88
iio_device_data::buffer
struct iio_buffer * buffer
Definition: iio_types.h:228
AD7091R2
@ AD7091R2
Definition: ad7091r8.h:87
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
ad7091r8_sequenced_read
int ad7091r8_sequenced_read(struct ad7091r8_dev *dev, uint16_t *read_val)
Definition: ad7091r8.c:533
no_os_field_get
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
NO_OS_BIT
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
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
AD7091R8
@ AD7091R8
Definition: ad7091r8.h:89
ad7091r8_spi_reg_write
int ad7091r8_spi_reg_write(struct ad7091r8_dev *dev, uint8_t reg_addr, uint16_t reg_data)
Definition: ad7091r8.c:69
AD7091R8_REG_RESULT_CH_ID_MASK
#define AD7091R8_REG_RESULT_CH_ID_MASK
Definition: ad7091r8.h:65
iio_trigger
Definition: iio_types.h:231
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
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
ad7091r8_iio_dev::iio_dev
struct iio_device * iio_dev
Definition: iio_ad7091r8.h:63
ad7091r8_init
int ad7091r8_init(struct ad7091r8_dev **device, struct ad7091r8_init_param *init_param)
Definition: ad7091r8.c:380
ad7091r8_iio_dev_init_param
AD7091r8 IIO device initial parameters structure.
Definition: iio_ad7091r8.h:69
scan_type
Definition: iio_types.h:151
ad7091r8_iio_init
int ad7091r8_iio_init(struct ad7091r8_iio_dev **iio_dev, struct ad7091r8_iio_dev_init_param *init_param)
Initializes the AD7091R8 IIO driver.
Definition: iio_ad7091r8.c:302
no_os_util.h
Header file of utility functions.
iio_device_data
Definition: iio_types.h:226
ad7091r8_spi_reg_read
int ad7091r8_spi_reg_read(struct ad7091r8_dev *dev, uint8_t reg_addr, uint16_t *reg_data)
Definition: ad7091r8.c:97
ad7091r8_iio_dev::ad7091r8_dev
struct ad7091r8_dev * ad7091r8_dev
Definition: iio_ad7091r8.h:62
ad7091r8_pulse_convst
int ad7091r8_pulse_convst(struct ad7091r8_dev *dev)
Definition: ad7091r8.c:48
ad7091r8_dev::vref_mv
int vref_mv
Definition: ad7091r8.h:169
ad7091r8_read_one
int ad7091r8_read_one(struct ad7091r8_dev *dev, uint8_t channel, uint16_t *read_val)
Definition: ad7091r8.c:509
iio_buffer_push_scan
int iio_buffer_push_scan(struct iio_buffer *buffer, void *data)
Definition: iio.c:1434