Go to the documentation of this file.
39 #ifndef IIO_MAX14906_H
40 #define IIO_MAX14906_H
47 #define MAX14906_FUNCTION_CNT 3
69 static const char *
const max14906_do_mode_avail[4] = {
79 static const char *
const max14906_iec_avail[2] = {
@ MAX14906_OUT
Definition: max14906.h:91
struct max14906_ch_config channel_configs[MAX14906_CHANNELS]
Definition: iio_max14906.h:92
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:122
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:132
@ IIO_VAL_INT
Definition: iio_types.h:56
Struct describing the scan type.
Definition: iio_types.h:174
struct max149x6_desc * max14906_desc
Definition: iio_max14906.h:88
Device descriptor for MAX149X6.
Definition: max149x6-base.h:73
struct iio_channel * channels
Definition: iio_types.h:260
int max14906_remove(struct max149x6_desc *desc)
Free the resources allocated during init and place all the channels in high-z.
Definition: max14906.c:284
#define MAX14906_DO_MASK(x)
Definition: max14906.h:72
Structure holding channel attributess.
Definition: iio_types.h:109
bool ch_out
Definition: iio_types.h:113
Initialization parameter for the MAX14906 IIO descriptor.
Definition: iio_max14906.h:98
#define MAX14906_CONFIG_CURR_LIM
Definition: max14906.h:63
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:178
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
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:55
int32_t(* debug_reg_read)(void *dev, uint32_t reg, uint32_t *readval)
Definition: iio_types.h:289
MAX14906 specific IIO descriptor.
Definition: iio_max14906.h:87
#define MAX14906_FUNCTION_CNT
Definition: iio_max14906.h:47
bool ch_out
Definition: iio_types.h:194
struct max14906_ch_config channel_configs[MAX14906_CHANNELS]
Definition: iio_max14906.h:100
@ IIO_SHARED_BY_ALL
Definition: iio_types.h:128
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:76
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:104
@ MAX14906_HIGH_Z
Definition: max14906.h:93
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:53
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:585
Header file of MAX14906 IIO Driver.
const char * name
Definition: iio_types.h:137
uint32_t active_channels
Definition: iio_max14906.h:90
@ MAX14906_HIGH_SIDE_INRUSH
Definition: max14906.h:101
int max14906_iio_remove(struct max14906_iio_desc *)
Free resources allocated by the init function.
Definition: iio_max14906.c:628
Structure holding pointers to show and store functions.
Definition: iio_types.h:135
max14906_iec_type
Definition: max14906.h:82
@ MAX14906_IN
Definition: max14906.h:92
max14906_function
Channel configuration options.
Definition: max14906.h:90
int32_t iio_parse_value(char *buf, enum iio_val fmt, int32_t *val, int32_t *val2)
Definition: iio.c:616
bool enabled
Definition: iio_max14906.h:53
int max14906_iio_init(struct max14906_iio_desc **, struct max14906_iio_desc_init_param *)
Initializes the MAX14906 IIO descriptor.
Definition: iio_max14906.c:585
uint32_t no_active_channels
Definition: iio_max14906.h:91
@ MAX14906_PUSH_PULL
Definition: max14906.h:103
int max14906_iio_remove(struct max14906_iio_desc *iio_desc)
Free resources allocated by the init function.
Definition: iio_max14906.c:628
#define MAX14906_CHANNELS
Definition: max14906.h:49
int iio_format_value(char *buf, uint32_t len, enum iio_val fmt, int32_t size, int32_t *vals)
Definition: iio.c:667
uint32_t address
Definition: iio_types.h:119
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
struct iio_attribute * attributes
Definition: iio_types.h:192
uint16_t num_ch
Definition: iio_types.h:258
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
@ MAX14906_PUSH_PULL_CLAMP
Definition: max14906.h:102
#define MAX14906_CONFIG_DO_REG
Definition: max14906.h:62
#define MAX14906_CHANNEL(_addr)
Definition: iio_max14906.c:50
#define NULL
Definition: wrapper.h:64
@ MAX14906_HIGH_SIDE
Definition: max14906.h:100
int max14906_ch_func(struct max149x6_desc *desc, uint32_t ch, enum max14906_function function)
Configure a channel's function.
Definition: max14906.c:93
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:119
Header file of MAX14906 Driver.
int16_t ch_num
Definition: iio_types.h:111
Structure holding channels and attributes of a device.
Definition: iio_types.h:253
#define MAX14906_CL_MASK(x)
Definition: max14906.h:76
int max14906_init(struct max149x6_desc **desc, struct max149x6_init_param *param)
Initialize and configure the MAX14906 device.
Definition: max14906.c:174
Configuration structure for a MAX14906 channel.
Definition: iio_max14906.h:52
struct max149x6_init_param * max14906_init_param
Definition: iio_max14906.h:99
#define MAX14906_CONFIG_DI_REG
Definition: max14906.h:61
#define MAX14906_IEC_TYPE_MASK
Definition: max14906.h:75
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:498
Initialization parameter for the MAX149X6 device.
Definition: max149x6-base.h:60
Header file of utility functions.
@ IIO_SHARED_BY_DIR
Definition: iio_types.h:127
struct iio_device * iio_dev
Definition: iio_max14906.h:89
enum max14906_function function
Definition: iio_max14906.h:54