no-OS
iio_ad5791.h
Go to the documentation of this file.
1 /***************************************************************************/
40 #ifndef IIO_AD5791_H_
41 #define IIO_AD5791_H_
42 
43 #include "iio.h"
44 #include "no_os_util.h"
45 #include "ad5791.h"
46 
47 #define AD5791_CH_NO 1
48 
56 };
57 
66  uint32_t vref_mv;
67  uint32_t vref_neg_mv;
68 };
69 
76  uint32_t vref_mv;
77  uint32_t vref_neg_mv;
78 };
79 
80 /* Initialize the AD5791 IIO driver. */
81 int32_t ad5791_iio_init(struct ad5791_iio_desc **iio_dev,
83 
84 /* Free memory allocated by ad5791_iio_init(). */
85 int32_t ad5791_iio_remove(struct ad5791_iio_desc *desc);
86 
87 /*****************************************************************************/
88 /***************************** Constant definition ***************************/
89 /*****************************************************************************/
90 extern struct iio_device const iio_ad5791_device;
91 
92 #endif /* IIO_AD5791_H_ */
no_os_alloc.h
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:121
iio_ad5791_device
struct iio_device const iio_ad5791_device
Definition: iio_ad5791.c:368
AD5791_REG_DAC
#define AD5791_REG_DAC
Definition: ad5791.h:134
iio_channel
Struct describing the scan type.
Definition: iio_types.h:173
ad5791_iio_remove
int32_t ad5791_iio_remove(struct ad5791_iio_desc *desc)
Free memory allocated by ad5791_iio_init().
Definition: iio_ad5791.c:420
scan_type::sign
char sign
Definition: iio_types.h:158
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:287
ad5791_init_param
Definition: ad5791.h:90
AD5791_THREE_STATE
@ AD5791_THREE_STATE
Definition: iio_ad5791.h:55
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:108
ad5791.h
Header file of AD5791 Driver.
iio_ad5791_device
struct iio_device const iio_ad5791_device
Definition: iio_ad5791.c:368
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:260
AD5791_CTRL_DACTRI
#define AD5791_CTRL_DACTRI
Definition: ad5791.h:151
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:80
device
Definition: ad9361_util.h:75
ad5791_iio_init_param::vref_neg_mv
uint32_t vref_neg_mv
Definition: iio_ad5791.h:77
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
AD5791_CTRL_OPGND
#define AD5791_CTRL_OPGND
Definition: ad5791.h:152
ad5791_iio_init_param
AD5791 IIO driver initialization structure.
Definition: iio_ad5791.h:74
ad5791_iio_desc::vref_mv
uint32_t vref_mv
Definition: iio_ad5791.h:66
ad5791_iio_desc::vref_neg_mv
uint32_t vref_neg_mv
Definition: iio_ad5791.h:67
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:185
AD5791_CH_NO
#define AD5791_CH_NO
Definition: iio_ad5791.h:47
ad5791_iio_desc
D5791 IIO driver handler.
Definition: iio_ad5791.h:62
ad5791_remove
int32_t ad5791_remove(struct ad5791_dev *dev)
Free the resources allocated by ad5791_init().
Definition: ad5791.c:118
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:63
iio_attribute::name
const char * name
Definition: iio_types.h:136
ad5791_iio_init_param::ad5791_initial
struct ad5791_init_param * ad5791_initial
Definition: iio_ad5791.h:75
iio_channel::name
const char * name
Definition: iio_types.h:175
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:134
IIO_VOLTAGE
@ IIO_VOLTAGE
Definition: iio_types.h:71
ad5791_iio_powerdown_modes
ad5791_iio_powerdown_modes
AD5791 channel power down modes.
Definition: iio_ad5791.h:53
ad5791_iio_init_param::vref_mv
uint32_t vref_mv
Definition: iio_ad5791.h:76
AD5791_SOFT_CTRL_LDAC
#define AD5791_SOFT_CTRL_LDAC
Definition: ad5791.h:159
iio_channel::attributes
struct iio_attribute * attributes
Definition: iio_types.h:191
iio_device::num_ch
uint16_t num_ch
Definition: iio_types.h:257
ad5791_dev
Definition: ad5791.h:79
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
AD5791_6kOHMS_TO_GND
@ AD5791_6kOHMS_TO_GND
Definition: iio_ad5791.h:54
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:147
ad5791_iio_desc::ad5791_iio_dev
struct iio_device * ad5791_iio_dev
Definition: iio_ad5791.h:64
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:119
iio_device
Structure holding channels and attributes of a device.
Definition: iio_types.h:252
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:387
scan_type
Definition: iio_types.h:156
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:65
ad5791_iio_remove
int32_t ad5791_iio_remove(struct ad5791_iio_desc *desc)
Free memory allocated by ad5791_iio_init().
Definition: iio_ad5791.c:420
iio_ad5791.h
Header of AD5791 IIO Driver.
AD5791_REG_CTRL
#define AD5791_REG_CTRL
Definition: ad5791.h:135
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:387