no-OS
iio_max22017.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef IIO_MAX22017_H
34 #define IIO_MAX22017_H
35 
36 #include <stdint.h>
37 #include <stdbool.h>
38 #include "iio.h"
39 #include "max22017.h"
40 
46 };
47 
52 };
53 
61 };
62 
67 };
68 
79 };
80 
87 };
88 
94 };
95 
99 
102 
103 #endif /* IIO_MAX22017_H */
MAX22017_IIO_CM_SENSE
@ MAX22017_IIO_CM_SENSE
Definition: iio_max22017.h:50
MAX22017_IIO_RANGE
@ MAX22017_IIO_RANGE
Definition: iio_max22017.h:43
MAX22017_250_OHM_RESISTOR
@ MAX22017_250_OHM_RESISTOR
Definition: max22017.h:127
MAX22017_UPDATE_RATE_64KHZ_32KHZ
@ MAX22017_UPDATE_RATE_64KHZ_32KHZ
Definition: max22017.h:162
no_os_alloc.h
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:116
MAX22017_IIO_OVC_SHTDN
@ MAX22017_IIO_OVC_SHTDN
Definition: iio_max22017.h:58
max22017_iio_remove
int max22017_iio_remove(struct max22017_iio_desc *)
Definition: iio_max22017.c:775
IIO_VAL_INT
@ IIO_VAL_INT
Definition: iio_types.h:50
iio_channel
Struct describing the scan type.
Definition: iio_types.h:168
MAX22017_TIMEOUT_800MS
@ MAX22017_TIMEOUT_800MS
Definition: max22017.h:138
MAX22017_TIMEOUT_1300MS
@ MAX22017_TIMEOUT_1300MS
Definition: max22017.h:143
MAX22017_TIMEOUT_900MS
@ MAX22017_TIMEOUT_900MS
Definition: max22017.h:139
MAX22017_SR_SEL_MASK
#define MAX22017_SR_SEL_MASK
Definition: max22017.h:81
max22017_iio_init
int max22017_iio_init(struct max22017_iio_desc **iio_desc, struct max22017_iio_desc_init_param *init_param)
Definition: iio_max22017.c:745
max22017_iio_desc::iio_dev
struct iio_device * iio_dev
Definition: iio_max22017.h:86
MAX22017_INPUT_VOLTAGE_MODE
@ MAX22017_INPUT_VOLTAGE_MODE
Definition: max22017.h:112
MAX22017_EXT_DAC_REF_MASK
#define MAX22017_EXT_DAC_REF_MASK
Definition: max22017.h:75
MAX22017_IIO_TH_SHTDN
@ MAX22017_IIO_TH_SHTDN
Definition: iio_max22017.h:59
iio_device::channels
struct iio_channel * channels
Definition: iio_types.h:254
MAX22017_SR_STEP_SIZE_MASK
#define MAX22017_SR_STEP_SIZE_MASK
Definition: max22017.h:82
MAX22017_GEN_INTEN
#define MAX22017_GEN_INTEN
Definition: max22017.h:52
MAX22017_AO_SLEW_RATE_CH2
#define MAX22017_AO_SLEW_RATE_CH2
Definition: max22017.h:60
MAX22017_UPDATE_RATE_12KHZ_6KHZ
@ MAX22017_UPDATE_RATE_12KHZ_6KHZ
Definition: max22017.h:165
MAX22017_STEP_SIZE_26BITS
@ MAX22017_STEP_SIZE_26BITS
Definition: max22017.h:154
MAX22017_AO_CNFG
#define MAX22017_AO_CNFG
Definition: max22017.h:58
MAX22017_CH1
@ MAX22017_CH1
Definition: max22017.h:172
MAX22017_OUTPUT_VOLTAGE_NO_MONITORRING
@ MAX22017_OUTPUT_VOLTAGE_NO_MONITORRING
Definition: max22017.h:114
iio_desc
Definition: iio.c:204
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:103
no_os_units.h
Header file of Units.
MAX22017_AO_SLEW_RATE_CH1
#define MAX22017_AO_SLEW_RATE_CH1
Definition: max22017.h:59
MAX22017_IIO_LDAC
@ MAX22017_IIO_LDAC
Definition: iio_max22017.h:51
iio_max22017.h
Header file of IIO MAX22017 Driver.
max22017.h
Header file of MAX22017 Driver.
MAX22017_TIMEOUT_1600MS
@ MAX22017_TIMEOUT_1600MS
Definition: max22017.h:146
MAX22017_TIMEOUT_1000MS
@ MAX22017_TIMEOUT_1000MS
Definition: max22017.h:140
MAX22017_UPDATE_RATE_15KHZ_7KHZ
@ MAX22017_UPDATE_RATE_15KHZ_7KHZ
Definition: max22017.h:166
MAX22017_IIO_ENABLE_AVAILABLE
@ MAX22017_IIO_ENABLE_AVAILABLE
Definition: iio_max22017.h:70
MAX22017_STEP_SIZE_1024BITS
@ MAX22017_STEP_SIZE_1024BITS
Definition: max22017.h:151
MAX22017_IIO_CNFG_MASK
#define MAX22017_IIO_CNFG_MASK(x, y)
Definition: iio_max22017.c:55
MAX22017_IIO_STEP_SIZE_AVAILABLE
@ MAX22017_IIO_STEP_SIZE_AVAILABLE
Definition: iio_max22017.h:72
MAX22017_UNI_MASK
#define MAX22017_UNI_MASK(x)
Definition: max22017.h:93
max22017_set_data
int max22017_set_data(struct max22017_desc *desc, enum max22017_channel ch, int32_t data)
Set data of the selected channel.
Definition: max22017.c:274
MAX22017_STEP_SIZE_16384BITS
@ MAX22017_STEP_SIZE_16384BITS
Definition: max22017.h:153
max22017_iio_slew_rate
max22017_iio_slew_rate
Definition: iio_max22017.h:41
max22017_cm_sense
max22017_cm_sense
Definition: max22017.h:125
MAX22017_GEN_INT
#define MAX22017_GEN_INT
Definition: max22017.h:51
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
MAX22017_TIMEOUT_700MS
@ MAX22017_TIMEOUT_700MS
Definition: max22017.h:137
MAX22017_UNIPOLAR
@ MAX22017_UNIPOLAR
Definition: max22017.h:122
MAX22017_TIMEOUT_600MS
@ MAX22017_TIMEOUT_600MS
Definition: max22017.h:136
max22017_config
int max22017_config(struct max22017_desc *desc, enum max22017_channel ch, enum max22017_out_mode uni, enum max22017_cm_sense cm_sense, bool ldac)
Set AO configuration.
Definition: max22017.c:404
MAX22017_AO_OFFSET_CORR_CH1
#define MAX22017_AO_OFFSET_CORR_CH1
Definition: max22017.h:63
MAX22017_OUTPUT_VOLTAGE_MONITORRING
@ MAX22017_OUTPUT_VOLTAGE_MONITORRING
Definition: max22017.h:116
max22017_iio_read_avail
int max22017_iio_read_avail(const char *const *array_avail, char *buf, uint32_t len)
Definition: iio_max22017.c:400
no_os_field_prep
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
MAX22017_TIMEOUT_CNFG_MASK
#define MAX22017_TIMEOUT_CNFG_MASK
Definition: max22017.h:99
MAX22017_TIMEOUT_100MS
@ MAX22017_TIMEOUT_100MS
Definition: max22017.h:131
iio.h
Header file of iio.
no_os_error.h
Error codes definition.
max22017_init
int max22017_init(struct max22017_desc **desc, struct max22017_init_param *param)
Initialize and configure the MAX22017 device.
Definition: max22017.c:566
iio_attribute::name
const char * name
Definition: iio_types.h:131
MAX22017_IIO_TIMEOUT
@ MAX22017_IIO_TIMEOUT
Definition: iio_max22017.h:64
max22017_iio_init
int max22017_iio_init(struct max22017_iio_desc **, struct max22017_iio_desc_init_param *)
Definition: iio_max22017.c:745
MAX22017_TIMEOUT_1400MS
@ MAX22017_TIMEOUT_1400MS
Definition: max22017.h:144
MAX22017_IIO_SLEW_RATE
@ MAX22017_IIO_SLEW_RATE
Definition: iio_max22017.h:42
MAX22017_50_OHM_RESISTOR
@ MAX22017_50_OHM_RESISTOR
Definition: max22017.h:126
MAX22017_LD_CNFG_MASK
#define MAX22017_LD_CNFG_MASK(x)
Definition: max22017.h:91
max22017_iio_desc_init_param::max22017_init_param
struct max22017_init_param * max22017_init_param
Definition: iio_max22017.h:93
MAX22017_UPDATE_RATE_160KHZ_80KHZ
@ MAX22017_UPDATE_RATE_160KHZ_80KHZ
Definition: max22017.h:163
max22017_iio_ao_config
max22017_iio_ao_config
Definition: iio_max22017.h:48
MAX22017_IIO_OP_MODE_AVAILABLE
@ MAX22017_IIO_OP_MODE_AVAILABLE
Definition: iio_max22017.h:74
MAX22017_CM_SENSE_MASK
#define MAX22017_CM_SENSE_MASK(x)
Definition: max22017.h:92
max22017_init_param
Structure holding the MAX22017 initialization parameter.
Definition: max22017.h:187
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:129
max22017_out_mode
max22017_out_mode
Definition: max22017.h:120
MAX22017_IIO_CURR_LIM
@ MAX22017_IIO_CURR_LIM
Definition: iio_max22017.h:57
max22017_remove
int max22017_remove(struct max22017_desc *desc)
Free the resources allocated during init and perform a soft reset.
Definition: max22017.c:652
MAX22017_HIGH_Z
@ MAX22017_HIGH_Z
Definition: max22017.h:111
MAX22017_IIO_POLARITY
@ MAX22017_IIO_POLARITY
Definition: iio_max22017.h:49
MAX22017_STEP_SIZE_512BITS
@ MAX22017_STEP_SIZE_512BITS
Definition: max22017.h:150
max22017_op_mode
max22017_op_mode
Definition: max22017.h:110
max22017_iio_config
max22017_iio_config
Definition: iio_max22017.h:54
max22017_iio_desc::max22017_desc
struct max22017_desc * max22017_desc
Definition: iio_max22017.h:85
MAX22017_UPDATE_RATE_32KHZ_16KHZ
@ MAX22017_UPDATE_RATE_32KHZ_16KHZ
Definition: max22017.h:168
max22017_get_data
int max22017_get_data(struct max22017_desc *desc, enum max22017_channel ch, int32_t *data)
Get data from requestec channel.
Definition: max22017.c:294
MAX22017_TIMEOUT_MASK
#define MAX22017_TIMEOUT_MASK
Definition: max22017.h:101
MAX22017_TIMEOUT_200MS
@ MAX22017_TIMEOUT_200MS
Definition: max22017.h:132
MAX22017_TIMEOUT_1200MS
@ MAX22017_TIMEOUT_1200MS
Definition: max22017.h:142
MAX22017_SR_UPDATE_RATE_MASK
#define MAX22017_SR_UPDATE_RATE_MASK
Definition: max22017.h:83
MAX22017_GEN_CNFG
#define MAX22017_GEN_CNFG
Definition: max22017.h:46
MAX22017_TIMEOUT_300MS
@ MAX22017_TIMEOUT_300MS
Definition: max22017.h:133
iio_parse_value
int32_t iio_parse_value(char *buf, enum iio_val fmt, int32_t *val, int32_t *val2)
Definition: iio.c:630
MAX22017_IIO_CONFIG_ENABLE_AVAILABLE
@ MAX22017_IIO_CONFIG_ENABLE_AVAILABLE
Definition: iio_max22017.h:77
MAX22017_IIO_OW_DETECT
@ MAX22017_IIO_OW_DETECT
Definition: iio_max22017.h:60
MAX22017_AO_CMD
#define MAX22017_AO_CMD
Definition: max22017.h:56
MAX22017_OUTPUT_CURRENT_NO_MONITORRING
@ MAX22017_OUTPUT_CURRENT_NO_MONITORRING
Definition: max22017.h:115
MAX22017_TIMEOUT_EN_MASK
#define MAX22017_TIMEOUT_EN_MASK
Definition: max22017.h:100
MAX22017_IIO_RANGE_AVAILABLE
@ MAX22017_IIO_RANGE_AVAILABLE
Definition: iio_max22017.h:71
max22017_sr_step_size
max22017_sr_step_size
Definition: max22017.h:149
MAX22017_TIMEOUT_1100MS
@ MAX22017_TIMEOUT_1100MS
Definition: max22017.h:141
MAX22017_IIO_POLARITY_AVAILABLE
@ MAX22017_IIO_POLARITY_AVAILABLE
Definition: iio_max22017.h:75
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
iio_ch_info::address
uint32_t address
Definition: iio_types.h:113
MAX22017_UPDATE_RATE_4KHZ_2KHZ
@ MAX22017_UPDATE_RATE_4KHZ_2KHZ
Definition: max22017.h:161
no_os_field_get
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
max22017_iio_timeout
max22017_iio_timeout
Definition: iio_max22017.h:63
max22017_gain_calib
int max22017_gain_calib(struct max22017_desc *desc, enum max22017_channel ch, uint16_t gain)
Set gain value for calibration of requested channel.
Definition: max22017.c:362
MAX22017_IIO_UPDATE_RATE_AVAILABLE
@ MAX22017_IIO_UPDATE_RATE_AVAILABLE
Definition: iio_max22017.h:73
MAX22017_STEP_SIZE_4096BITS
@ MAX22017_STEP_SIZE_4096BITS
Definition: max22017.h:152
iio_types.h
Header file for iio_types.
MAX22017_IIO_TIMEOUT_AVAILABLE
@ MAX22017_IIO_TIMEOUT_AVAILABLE
Definition: iio_max22017.h:78
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
max22017_iio_desc
Structure holding the MAX22017 IIO descriptor.
Definition: iio_max22017.h:84
max22017_reg_read
int max22017_reg_read(struct max22017_desc *desc, uint32_t addr, uint32_t *val)
Read the value of a device register.
Definition: max22017.c:468
MAX22017_IIO_STEP_SIZE
@ MAX22017_IIO_STEP_SIZE
Definition: iio_max22017.h:44
NULL
#define NULL
Definition: wrapper.h:64
MAX22017_UPDATE_RATE_20KHZ_10KHZ
@ MAX22017_UPDATE_RATE_20KHZ_10KHZ
Definition: max22017.h:167
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
MAX22017_TIMEOUT_1500MS
@ MAX22017_TIMEOUT_1500MS
Definition: max22017.h:145
MAX22017_IIO_LD_CTRL
@ MAX22017_IIO_LD_CTRL
Definition: iio_max22017.h:56
max22017_iio_remove
int max22017_iio_remove(struct max22017_iio_desc *iio_desc)
Definition: iio_max22017.c:775
MAX22017_STEP_SIZE_31BITS
@ MAX22017_STEP_SIZE_31BITS
Definition: max22017.h:156
max22017_offset_calib
int max22017_offset_calib(struct max22017_desc *desc, enum max22017_channel ch, int16_t offset)
Set offset value for output calibration.
Definition: max22017.c:344
MAX22017_STEP_SIZE_28BITS
@ MAX22017_STEP_SIZE_28BITS
Definition: max22017.h:155
MAX22017_IIO_TIMEOUT_CFG
@ MAX22017_IIO_TIMEOUT_CFG
Definition: iio_max22017.h:66
MAX22017_CHANNEL
#define MAX22017_CHANNEL(_addr)
Definition: iio_max22017.c:45
MAX22017_TIMEOUT_500MS
@ MAX22017_TIMEOUT_500MS
Definition: max22017.h:135
MAX22017_UPDATE_RATE_200KHZ_100KHZ
@ MAX22017_UPDATE_RATE_200KHZ_100KHZ
Definition: max22017.h:164
MAX22017_TIMEOUT_400MS
@ MAX22017_TIMEOUT_400MS
Definition: max22017.h:134
MAX22017_BIPOLAR
@ MAX22017_BIPOLAR
Definition: max22017.h:121
max22017_reg_update
int max22017_reg_update(struct max22017_desc *desc, uint32_t addr, uint32_t mask, uint32_t val)
Update the value of a device register (read/write sequence).
Definition: max22017.c:544
MAX22017_IIO_UPDATE_RATE
@ MAX22017_IIO_UPDATE_RATE
Definition: iio_max22017.h:45
max22017_reg_write
int max22017_reg_write(struct max22017_desc *desc, uint32_t addr, uint32_t val)
Write the value of a device register.
Definition: max22017.c:513
MAX22017_INPUT_CURRENT_MODE
@ MAX22017_INPUT_CURRENT_MODE
Definition: max22017.h:113
MAX22017_IIO_CM_SENSE_AVAILABLE
@ MAX22017_IIO_CM_SENSE_AVAILABLE
Definition: iio_max22017.h:76
MAX22017_AO_OFFSET_CORR_CH2
#define MAX22017_AO_OFFSET_CORR_CH2
Definition: max22017.h:65
max22017_channel
max22017_channel
Definition: max22017.h:171
no_os_util.h
Header file of utility functions.
MAX22017_OUTPUT_CURRENT_MONITORRING
@ MAX22017_OUTPUT_CURRENT_MONITORRING
Definition: max22017.h:117
MAX22017_IIO_DAC_REF
@ MAX22017_IIO_DAC_REF
Definition: iio_max22017.h:55
max22017_desc
Structure holding the MAX22017 device descriptor.
Definition: max22017.h:200
max22017_slew_rate
int max22017_slew_rate(struct max22017_desc *desc, enum max22017_channel ch, enum max22017_sr_step_size step_size, enum max22017_sr_update_rate update_rate, bool enable, bool hart)
Set slew rate settings for requested channels.
Definition: max22017.c:321
max22017_iio_available
max22017_iio_available
Definition: iio_max22017.h:69
MAX22017_STEP_SIZE_35BITS
@ MAX22017_STEP_SIZE_35BITS
Definition: max22017.h:157
MAX22017_IIO_TIMEOUT_EN
@ MAX22017_IIO_TIMEOUT_EN
Definition: iio_max22017.h:65
MAX22017_CH2
@ MAX22017_CH2
Definition: max22017.h:173
max22017_sr_update_rate
max22017_sr_update_rate
Definition: max22017.h:160
MAX22017_SR_EN_MASK
#define MAX22017_SR_EN_MASK
Definition: max22017.h:80
max22017_iio_desc_init_param
Structure holding the MAX22017 IIO initialization parameter.
Definition: iio_max22017.h:92