43#define MAX14906_CHANNELS 4
45#define MAX14906_SETOUT_REG 0x0
46#define MAX14906_SETLED_REG 0x1
47#define MAX14906_DOILEVEL_REG 0x2
48#define MAX14906_INT_REG 0x3
49#define MAX14906_OVR_LD_REG 0x4
50#define MAX14906_OPN_WIR_FLT_REG 0x5
51#define MAX14906_SHD_VDD_FLT_REG 0x6
52#define MAX14906_GLOBAL_FLT_REG 0x7
53#define MAX14906_CONFIG1_REG 0xA
54#define MAX14906_CONFIG2_REG 0xB
55#define MAX14906_CONFIG_DI_REG 0xC
56#define MAX14906_CONFIG_DO_REG 0xD
57#define MAX14906_CONFIG_CURR_LIM 0xE
58#define MAX14906_CONFIG_MASK 0xF
61#define MAX14906_DOI_LEVEL_MASK(x) NO_OS_BIT(x)
64#define MAX14906_HIGHO_MASK(x) NO_OS_BIT(x)
66#define MAX14906_DO_MASK(x) (NO_OS_GENMASK(1, 0) << (2 * (x)))
67#define MAX14906_CH_DIR_MASK(x) NO_OS_BIT((x) + 4)
68#define MAX14906_CH(x) (x)
69#define MAX14906_IEC_TYPE_MASK NO_OS_BIT(7)
70#define MAX14906_CL_MASK(x) (NO_OS_GENMASK(1, 0) << (2 * (x)))
73#define MAX14906_SLED_MASK NO_OS_BIT(1)
74#define MAX14906_FLED_MASK NO_OS_BIT(0)
max14906_function
Channel configuration options.
Definition max14906.h:84
@ MAX14906_HIGH_Z
Definition max14906.h:87
@ MAX14906_IN
Definition max14906.h:86
@ MAX14906_OUT
Definition max14906.h:85
int max14906_remove(struct max149x6_desc *)
Free the resources allocated during init and place all the channels in high-z.
Definition max14906.c:278
int max14906_ch_set(struct max149x6_desc *, uint32_t, uint32_t)
Write the (logic) state of a channel (only for output channels).
Definition max14906.c:70
max14906_do_mode
Configuration options for the output driver (on each channel).
Definition max14906.h:93
@ MAX14906_PUSH_PULL
Definition max14906.h:97
@ MAX14906_PUSH_PULL_CLAMP
Definition max14906.h:96
@ MAX14906_HIGH_SIDE_INRUSH
Definition max14906.h:95
@ MAX14906_HIGH_SIDE
Definition max14906.h:94
int max14906_init(struct max149x6_desc **, struct max149x6_init_param *)
Initialize and configure the MAX14906 device.
Definition max14906.c:168
int max14906_climit_set(struct max149x6_desc *, uint32_t, enum max14906_climit)
Configure the current limit for output channels.
Definition max14906.c:130
int max14906_ch_get(struct max149x6_desc *, uint32_t, uint32_t *)
Read the (voltage) state of a channel (works for both input or output).
Definition max14906.c:47
int max14906_climit_get(struct max149x6_desc *, uint32_t, enum max14906_climit *)
Read an output channel's current limit.
Definition max14906.c:144
max14906_climit
Current limit options for output channels.
Definition max14906.h:103
@ MAX14906_CL_130
Definition max14906.h:105
@ MAX14906_CL_600
Definition max14906.h:104
@ MAX14906_CL_300
Definition max14906.h:106
@ MAX14906_CL_1200
Definition max14906.h:107
max14906_iec_type
Definition max14906.h:76
@ MAX14906_TYPE_1_3
Definition max14906.h:77
@ MAX14906_TYPE_2
Definition max14906.h:78
int max14906_ch_func(struct max149x6_desc *, uint32_t, enum max14906_function)
Configure a channel's function.
Definition max14906.c:87
Header file of MAX149X6 Base Driver.
Header file of GPIO Interface.
Header file of SPI Interface.
Header file of utility functions.
Device descriptor for MAX149X6.
Definition max149x6-base.h:67
Initialization parameter for the MAX149X6 device.
Definition max149x6-base.h:54