no-OS
iio_ad5791.h
Go to the documentation of this file.
1 /***************************************************************************/
34 #ifndef IIO_AD5791_H_
35 #define IIO_AD5791_H_
36 
37 #include "iio.h"
38 #include "no_os_util.h"
39 #include "ad5791.h"
40 
41 #define AD5791_CH_NO 1
42 
50 };
51 
60  uint32_t vref_mv;
61  uint32_t vref_neg_mv;
62 };
63 
70  uint32_t vref_mv;
71  uint32_t vref_neg_mv;
72 };
73 
74 /* Initialize the AD5791 IIO driver. */
75 int32_t ad5791_iio_init(struct ad5791_iio_desc **iio_dev,
77 
78 /* Free memory allocated by ad5791_iio_init(). */
79 int32_t ad5791_iio_remove(struct ad5791_iio_desc *desc);
80 
81 /*****************************************************************************/
82 /***************************** Constant definition ***************************/
83 /*****************************************************************************/
84 extern struct iio_device const iio_ad5791_device;
85 
86 #endif /* IIO_AD5791_H_ */
no_os_alloc.h
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:116
iio_ad5791_device
struct iio_device const iio_ad5791_device
Definition: iio_ad5791.c:362
AD5791_REG_DAC
#define AD5791_REG_DAC
Definition: ad5791.h:130
iio_channel
Struct describing the scan type.
Definition: iio_types.h:168
ad5791_iio_remove
int32_t ad5791_iio_remove(struct ad5791_iio_desc *desc)
Free memory allocated by ad5791_iio_init().
Definition: iio_ad5791.c:414
scan_type::sign
char sign
Definition: iio_types.h:153
ad5791_soft_instruction
int32_t ad5791_soft_instruction(struct ad5791_dev *dev, uint8_t instruction_bit)
Asserts RESET, CLR or LDAC in a software manner.
Definition: ad5791.c:282
ad5791_init_param
Definition: ad5791.h:85
AD5791_THREE_STATE
@ AD5791_THREE_STATE
Definition: iio_ad5791.h:49
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:103
ad5791.h
Header file of AD5791 Driver.
iio_ad5791_device
struct iio_device const iio_ad5791_device
Definition: iio_ad5791.c:362
ad5791_set_dac_value
int32_t ad5791_set_dac_value(struct ad5791_dev *dev, uint32_t value)
Writes to the DAC register.
Definition: ad5791.c:255
AD5791_CTRL_DACTRI
#define AD5791_CTRL_DACTRI
Definition: ad5791.h:147
ad5791_init
int32_t ad5791_init(struct ad5791_dev **device, struct ad5791_init_param init_param)
Initializes the communication with the device.
Definition: ad5791.c:74
device
Definition: ad9361_util.h:69
ad5791_iio_init_param::vref_neg_mv
uint32_t vref_neg_mv
Definition: iio_ad5791.h:71
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
AD5791_CTRL_OPGND
#define AD5791_CTRL_OPGND
Definition: ad5791.h:148
ad5791_iio_init_param
AD5791 IIO driver initialization structure.
Definition: iio_ad5791.h:68
ad5791_iio_desc::vref_mv
uint32_t vref_mv
Definition: iio_ad5791.h:60
ad5791_iio_desc::vref_neg_mv
uint32_t vref_neg_mv
Definition: iio_ad5791.h:61
ad5791_get_register_value
int32_t ad5791_get_register_value(struct ad5791_dev *dev, uint8_t register_address, uint32_t *value)
Reads the value of a register.
Definition: ad5791.c:180
AD5791_CH_NO
#define AD5791_CH_NO
Definition: iio_ad5791.h:41
ad5791_iio_desc
D5791 IIO driver handler.
Definition: iio_ad5791.h:56
ad5791_remove
int32_t ad5791_remove(struct ad5791_dev *dev)
Free the resources allocated by ad5791_init().
Definition: ad5791.c:113
iio.h
Header file of iio.
no_os_error.h
Error codes definition.
ad5791_iio_desc::ad5791_handle
struct ad5791_dev * ad5791_handle
Definition: iio_ad5791.h:57
iio_attribute::name
const char * name
Definition: iio_types.h:131
ad5791_iio_init_param::ad5791_initial
struct ad5791_init_param * ad5791_initial
Definition: iio_ad5791.h:69
iio_channel::name
const char * name
Definition: iio_types.h:170
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:129
IIO_VOLTAGE
@ IIO_VOLTAGE
Definition: iio_types.h:65
ad5791_iio_powerdown_modes
ad5791_iio_powerdown_modes
AD5791 channel power down modes.
Definition: iio_ad5791.h:47
ad5791_iio_init_param::vref_mv
uint32_t vref_mv
Definition: iio_ad5791.h:70
AD5791_SOFT_CTRL_LDAC
#define AD5791_SOFT_CTRL_LDAC
Definition: ad5791.h:155
iio_channel::attributes
struct iio_attribute * attributes
Definition: iio_types.h:186
iio_device::num_ch
uint16_t num_ch
Definition: iio_types.h:252
ad5791_dev
Definition: ad5791.h:73
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
AD5791_6kOHMS_TO_GND
@ AD5791_6kOHMS_TO_GND
Definition: iio_ad5791.h:48
NULL
#define NULL
Definition: wrapper.h:64
ad5791_set_register_value
int32_t ad5791_set_register_value(struct ad5791_dev *dev, uint8_t register_address, uint32_t register_value)
Writes data into a register.
Definition: ad5791.c:142
ad5791_iio_desc::ad5791_iio_dev
struct iio_device * ad5791_iio_dev
Definition: iio_ad5791.h:58
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
iio_device
Structure holding channels and attributes of a device.
Definition: iio_types.h:247
ad5791_iio_init
int32_t ad5791_iio_init(struct ad5791_iio_desc **iio_dev, struct ad5791_iio_init_param *init_param)
Initialize the AD5791 IIO driver.
Definition: iio_ad5791.c:381
scan_type
Definition: iio_types.h:151
no_os_util.h
Header file of utility functions.
ad5791_iio_desc::curr_mode
enum ad5791_iio_powerdown_modes curr_mode
Definition: iio_ad5791.h:59
ad5791_iio_remove
int32_t ad5791_iio_remove(struct ad5791_iio_desc *desc)
Free memory allocated by ad5791_iio_init().
Definition: iio_ad5791.c:414
iio_ad5791.h
Header of AD5791 IIO Driver.
AD5791_REG_CTRL
#define AD5791_REG_CTRL
Definition: ad5791.h:131
ad5791_iio_init
int32_t ad5791_iio_init(struct ad5791_iio_desc **iio_dev, struct ad5791_iio_init_param *init_param)
Initialize the AD5791 IIO driver.
Definition: iio_ad5791.c:381