Go to the documentation of this file.
33 #ifndef IIO_MAX14906_H
34 #define IIO_MAX14906_H
41 #define MAX14906_FUNCTION_CNT 3
63 static const char *
const max14906_do_mode_avail[4] = {
73 static const char *
const max14906_iec_avail[2] = {
@ MAX14906_OUT
Definition: max14906.h:85
struct max14906_ch_config channel_configs[MAX14906_CHANNELS]
Definition: iio_max14906.h:86
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:116
int max149x6_reg_read(struct max149x6_desc *desc, uint32_t addr, uint32_t *val)
Read the value of a device register.
Definition: max149x6-base.c:126
@ IIO_VAL_INT
Definition: iio_types.h:50
Struct describing the scan type.
Definition: iio_types.h:168
struct max149x6_desc * max14906_desc
Definition: iio_max14906.h:82
Device descriptor for MAX149X6.
Definition: max149x6-base.h:67
struct iio_channel * channels
Definition: iio_types.h:254
int max14906_remove(struct max149x6_desc *desc)
Free the resources allocated during init and place all the channels in high-z.
Definition: max14906.c:278
#define MAX14906_DO_MASK(x)
Definition: max14906.h:66
Structure holding channel attributess.
Definition: iio_types.h:103
bool ch_out
Definition: iio_types.h:107
Initialization parameter for the MAX14906 IIO descriptor.
Definition: iio_max14906.h:92
#define MAX14906_CONFIG_CURR_LIM
Definition: max14906.h:57
int max149x6_reg_update(struct max149x6_desc *desc, uint32_t addr, uint32_t mask, uint32_t val)
Update the value of a device register (read/write sequence).
Definition: max149x6-base.c:172
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
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
int32_t(* debug_reg_read)(void *dev, uint32_t reg, uint32_t *readval)
Definition: iio_types.h:283
MAX14906 specific IIO descriptor.
Definition: iio_max14906.h:81
#define MAX14906_FUNCTION_CNT
Definition: iio_max14906.h:41
bool ch_out
Definition: iio_types.h:188
struct max14906_ch_config channel_configs[MAX14906_CHANNELS]
Definition: iio_max14906.h:94
@ IIO_SHARED_BY_ALL
Definition: iio_types.h:122
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
int max14906_ch_set(struct max149x6_desc *desc, uint32_t ch, uint32_t val)
Write the (logic) state of a channel (only for output channels).
Definition: max14906.c:70
int max149x6_reg_write(struct max149x6_desc *desc, uint32_t addr, uint32_t val)
Write the value of a device register.
Definition: max149x6-base.c:98
@ MAX14906_HIGH_Z
Definition: max14906.h:87
int max14906_ch_get(struct max149x6_desc *desc, uint32_t ch, uint32_t *val)
Read the (voltage) state of a channel (works for both input or output).
Definition: max14906.c:47
int max14906_iio_init(struct max14906_iio_desc **iio_desc, struct max14906_iio_desc_init_param *init_param)
Initializes the MAX14906 IIO descriptor.
Definition: iio_max14906.c:579
Header file of MAX14906 IIO Driver.
const char * name
Definition: iio_types.h:131
uint32_t active_channels
Definition: iio_max14906.h:84
@ MAX14906_HIGH_SIDE_INRUSH
Definition: max14906.h:95
int max14906_iio_remove(struct max14906_iio_desc *)
Free resources allocated by the init function.
Definition: iio_max14906.c:622
Structure holding pointers to show and store functions.
Definition: iio_types.h:129
max14906_iec_type
Definition: max14906.h:76
@ MAX14906_IN
Definition: max14906.h:86
max14906_function
Channel configuration options.
Definition: max14906.h:84
int32_t iio_parse_value(char *buf, enum iio_val fmt, int32_t *val, int32_t *val2)
Definition: iio.c:630
bool enabled
Definition: iio_max14906.h:47
int max14906_iio_init(struct max14906_iio_desc **, struct max14906_iio_desc_init_param *)
Initializes the MAX14906 IIO descriptor.
Definition: iio_max14906.c:579
uint32_t no_active_channels
Definition: iio_max14906.h:85
@ MAX14906_PUSH_PULL
Definition: max14906.h:97
int max14906_iio_remove(struct max14906_iio_desc *iio_desc)
Free resources allocated by the init function.
Definition: iio_max14906.c:622
#define MAX14906_CHANNELS
Definition: max14906.h:43
int iio_format_value(char *buf, uint32_t len, enum iio_val fmt, int32_t size, int32_t *vals)
Definition: iio.c:686
uint32_t address
Definition: iio_types.h:113
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
struct iio_attribute * attributes
Definition: iio_types.h:186
uint16_t num_ch
Definition: iio_types.h:252
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
@ MAX14906_PUSH_PULL_CLAMP
Definition: max14906.h:96
#define MAX14906_CONFIG_DO_REG
Definition: max14906.h:56
#define MAX14906_CHANNEL(_addr)
Definition: iio_max14906.c:44
#define NULL
Definition: wrapper.h:64
@ MAX14906_HIGH_SIDE
Definition: max14906.h:94
int max14906_ch_func(struct max149x6_desc *desc, uint32_t ch, enum max14906_function function)
Configure a channel's function.
Definition: max14906.c:87
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
Header file of MAX14906 Driver.
int16_t ch_num
Definition: iio_types.h:105
Structure holding channels and attributes of a device.
Definition: iio_types.h:247
#define MAX14906_CL_MASK(x)
Definition: max14906.h:70
int max14906_init(struct max149x6_desc **desc, struct max149x6_init_param *param)
Initialize and configure the MAX14906 device.
Definition: max14906.c:168
Configuration structure for a MAX14906 channel.
Definition: iio_max14906.h:46
struct max149x6_init_param * max14906_init_param
Definition: iio_max14906.h:93
#define MAX14906_CONFIG_DI_REG
Definition: max14906.h:55
#define MAX14906_IEC_TYPE_MASK
Definition: max14906.h:69
int max14906_iio_setup_channels(struct max14906_iio_desc *desc)
Configure a set if IIO channels based on the operation modes of the enabled physical channels.
Definition: iio_max14906.c:492
Initialization parameter for the MAX149X6 device.
Definition: max149x6-base.h:54
Header file of utility functions.
@ IIO_SHARED_BY_DIR
Definition: iio_types.h:121
struct iio_device * iio_dev
Definition: iio_max14906.h:83
enum max14906_function function
Definition: iio_max14906.h:48