no-OS
iio_ad7091r8.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef IIO_AD7091R8_H
40 #define IIO_AD7091R8_H
41 
42 /******************************************************************************/
43 /***************************** Include Files **********************************/
44 /******************************************************************************/
45 #include "iio.h"
46 
47 /******************************************************************************/
48 /***************************** Define Section *********************************/
49 /******************************************************************************/
50 #define ad7091r8_iio_device(chans) { \
51  .num_ch = NO_OS_ARRAY_SIZE(chans), \
52  .channels = chans, \
53  .pre_enable = (int32_t (*)())ad7091r8_buffer_preenable, \
54  .trigger_handler = (int32_t (*)())ad7091r8_trigger_handler, \
55  .debug_reg_read = (int32_t (*)())ad7091r8_iio_read_reg, \
56  .debug_reg_write = (int32_t (*)())ad7091r8_iio_write_reg \
57 }
58 
59 /******************************************************************************/
60 /*************************** Types Declarations *******************************/
61 /******************************************************************************/
63 
70 };
71 
77 };
78 
79 /******************************************************************************/
80 /************************ Functions Declarations ******************************/
81 /******************************************************************************/
83 int ad7091r8_iio_init(struct ad7091r8_iio_dev **iio_dev,
85 
87 int ad7091r8_iio_remove(struct ad7091r8_iio_dev *desc);
88 
89 #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:357
no_os_alloc.h
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:121
ad7091r8_iio_device
#define ad7091r8_iio_device(chans)
Definition: iio_ad7091r8.h:50
ad7091r8_remove
int ad7091r8_remove(struct ad7091r8_dev *dev)
Free the resources allocated by ad7091r8_init().
Definition: ad7091r8.c:464
IIO_VAL_INT
@ IIO_VAL_INT
Definition: iio_types.h:56
iio_channel
Struct describing the scan type.
Definition: iio_types.h:173
scan_type::sign
char sign
Definition: iio_types.h:158
IIO_SHARED_BY_TYPE
@ IIO_SHARED_BY_TYPE
Definition: iio_types.h:125
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:308
iio_ad7091r8.h
Header file of IIO AD7091R8 driver header file.
IIO_VAL_FRACTIONAL_LOG2
@ IIO_VAL_FRACTIONAL_LOG2
Definition: iio_types.h:62
iio_device_data::dev
void * dev
Definition: iio_types.h:232
AD7091R8_CHANNEL
#define AD7091R8_CHANNEL(index)
Definition: iio_ad7091r8.c:90
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:108
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:54
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
ad7091r8.h
Implementation of AD7091R-8 driver header file.
AD7091R8_REG_CHANNEL
#define AD7091R8_REG_CHANNEL
Definition: ad7091r8.h:61
ad7091r8_init_param
Definition: ad7091r8.h:188
ad7091r8_dev
Definition: ad7091r8.h:170
ad7091r8_dev::device_id
enum ad7091r8_device_id device_id
Definition: ad7091r8.h:183
iio.h
Header file of iio.
no_os_error.h
Error codes definition.
iio_attribute::name
const char * name
Definition: iio_types.h:136
ad7091r8_iio_remove
int ad7091r8_iio_remove(struct ad7091r8_iio_dev *desc)
Free the resources allocated by ad7091r8_iio_init().
Definition: iio_ad7091r8.c:357
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:134
ad7091r8_iio_dev
AD7091r8 IIO device descriptor structure.
Definition: iio_ad7091r8.h:67
AD7091R_NUM_CHANNELS
#define AD7091R_NUM_CHANNELS(id)
Definition: ad7091r8.h:54
iio_buffer::active_mask
uint32_t active_mask
Definition: iio_types.h:216
AD7091R8_REG_RESULT_DATA_MASK
#define AD7091R8_REG_RESULT_DATA_MASK
Definition: ad7091r8.h:69
ad7091r8_iio_dev_init_param::ad7091r8_dev_init
struct ad7091r8_init_param * ad7091r8_dev_init
Definition: iio_ad7091r8.h:76
AD7091R4
@ AD7091R4
Definition: ad7091r8.h:94
iio_device_data::buffer
struct iio_buffer * buffer
Definition: iio_types.h:233
AD7091R2
@ AD7091R2
Definition: ad7091r8.h:93
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
ad7091r8_sequenced_read
int ad7091r8_sequenced_read(struct ad7091r8_dev *dev, uint16_t *read_val)
Definition: ad7091r8.c:539
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:51
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
AD7091R8
@ AD7091R8
Definition: ad7091r8.h:95
ad7091r8_spi_reg_write
int ad7091r8_spi_reg_write(struct ad7091r8_dev *dev, uint8_t reg_addr, uint16_t reg_data)
Definition: ad7091r8.c:75
AD7091R8_REG_RESULT_CH_ID_MASK
#define AD7091R8_REG_RESULT_CH_ID_MASK
Definition: ad7091r8.h:71
iio_trigger
Definition: iio_types.h:236
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:119
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
ad7091r8_iio_dev::iio_dev
struct iio_device * iio_dev
Definition: iio_ad7091r8.h:69
ad7091r8_init
int ad7091r8_init(struct ad7091r8_dev **device, struct ad7091r8_init_param *init_param)
Definition: ad7091r8.c:386
ad7091r8_iio_dev_init_param
AD7091r8 IIO device initial parameters structure.
Definition: iio_ad7091r8.h:75
scan_type
Definition: iio_types.h:156
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:308
no_os_util.h
Header file of utility functions.
iio_device_data
Definition: iio_types.h:231
ad7091r8_spi_reg_read
int ad7091r8_spi_reg_read(struct ad7091r8_dev *dev, uint8_t reg_addr, uint16_t *reg_data)
Definition: ad7091r8.c:103
ad7091r8_iio_dev::ad7091r8_dev
struct ad7091r8_dev * ad7091r8_dev
Definition: iio_ad7091r8.h:68
ad7091r8_pulse_convst
int ad7091r8_pulse_convst(struct ad7091r8_dev *dev)
Definition: ad7091r8.c:54
ad7091r8_dev::vref_mv
int vref_mv
Definition: ad7091r8.h:175
ad7091r8_read_one
int ad7091r8_read_one(struct ad7091r8_dev *dev, uint8_t channel, uint16_t *read_val)
Definition: ad7091r8.c:515
iio_buffer_push_scan
int iio_buffer_push_scan(struct iio_buffer *buffer, void *data)
Definition: iio.c:1412