no-OS
max22200.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef _MAX22200_H
34 #define _MAX22200_H
35 
36 #include <stdint.h>
37 #include <stdbool.h>
38 #include "no_os_gpio.h"
39 #include "no_os_spi.h"
40 #include "no_os_util.h"
41 
42 #define MAX22200_FRAME_SIZE 4
43 
44 #define MAX22200_CHANNELS 8
45 #define MAX22200_CHANNELS_CONFIG 4
46 #define MAX22200_MAX_CHN_IDX 7
47 #define MAX22200_HIT_MAX_VAL 0x7F
48 #define MAX22200_HIT_NO_TIME 0x00
49 
50 #define MAX22200_R1B NO_OS_BIT(0)
51 
52 #define MAX22200_STATUS_REG 0x00
53 #define MAX22200_CFG_CH(x) (0x02 + (0x02 * (x)))
54 #define MAX22200_FAULT_REG 0x0C
55 #define MAX22200_CFG_DPM_REG 0x0E
56 
57 /* Write/Read Masks */
58 #define MAX22200_RW_MASK NO_OS_BIT(7)
59 #define MAX22200_ADDR_MASK NO_OS_GENMASK(6, 0)
60 
61 /* Status Register Masks */
62 #define MAX22200_ONCH_MASK(x) NO_OS_BIT((x) + 24)
63 #define MAX22200_STATUS_ONCH_MASK NO_OS_GENMASK(31, 24)
64 #define MAX22200_STATUS_FREQ_MASK NO_OS_BIT(16)
65 #define MAX22200_STATUS_FAULT_MASK(x) NO_OS_BIT(x)
66 #define MAX22200_STATUS_MODE_MASK NO_OS_GENMASK(15, 8)
67 #define MAX22200_CH_MODE_MASK(x) NO_OS_GENMASK(8 + (2 * (x)), 9 + (2 * (x)))
68 #define MAX22200_STATUS_FLAG_MASK NO_OS_GENMASK(7, 0)
69 #define MAX22200_ACTIVE_MASK NO_OS_BIT(0)
70 
71 /* CFG CH Register Masks */
72 #define MAX22200_HFS_MASK NO_OS_BIT(31)
73 #define MAX22200_HOLD_MASK NO_OS_GENMASK(30, 24)
74 #define MAX22200_TRGNSP_IO_MASK NO_OS_BIT(23)
75 #define MAX22200_HIT_MASK NO_OS_GENMASK(22, 16)
76 #define MAX22200_HIT_T_MASK NO_OS_GENMASK(15, 8)
77 #define MAX22200_VDRNCDR_MASK NO_OS_BIT(7)
78 #define MAX22200_HSNLS_MASK NO_OS_BIT(6)
79 #define MAX22200_FREQ_CFG_MASK NO_OS_GENMASK(5, 4)
80 #define MAX22200_CH_ENABLE_MASK(x) NO_OS_BIT(x)
81 
82 /* CFG DPM Register Masks */
83 #define MAX22200_DPM_ISTART_MASK NO_OS_GENMASK(14, 8)
84 #define MAX22200_DPM_TDEB_MASK NO_OS_GENMASK(7, 4)
85 #define MAX22200_DPM_IPTH_MASK NO_OS_GENMASK(3, 0)
86 
95 };
96 
100 };
101 
106 };
107 
111 };
112 
116 };
117 
121 };
122 
126 };
127 
133 };
134 
140 };
141 
149 };
150 
161 };
162 
164 int max22200_reg_read(struct max22200_desc *, uint32_t, uint32_t *);
165 
167 int max22200_reg_write(struct max22200_desc *, uint32_t, uint32_t);
168 
170 int max22200_reg_update(struct max22200_desc *, uint32_t, uint32_t, uint32_t);
171 
173 int max22200_set_trig_state(struct max22200_desc *, bool);
174 
176 int max22200_set_ch_state(struct max22200_desc *, uint32_t, bool);
177 
180  bool);
181 
184 
186 int max22200_set_ch_hit(struct max22200_desc *, uint32_t, uint8_t, uint8_t);
187 
189 int max22200_set_ch_hold(struct max22200_desc *, uint32_t, uint8_t);
190 
192 int max22200_set_ch_scale(struct max22200_desc *, uint32_t,
193  enum max22200_scale);
194 
196 int max22200_set_ch_trig(struct max22200_desc *, uint32_t, enum max22200_trig);
197 
199 int max22200_set_ch_mode(struct max22200_desc *, uint32_t,
201  enum max22200_ch_op_mode);
202 
204 int max22200_set_ch_freq(struct max22200_desc *, uint32_t,
205  enum max22200_ch_freq);
206 
208 int max22200_set_ch_enable(struct max22200_desc *, uint32_t,
209  enum max22200_ch_enable, bool);
210 
212 int max22200_set_cfg_dpm(struct max22200_desc *, uint8_t, uint8_t);
213 
216  bool *);
217 
219 int max22200_get_ch_state(struct max22200_desc *, uint32_t, bool *);
220 
223  enum max22200_chopping_freq *);
224 
226 int max22200_get_ch_hit(struct max22200_desc *, uint32_t, uint8_t *, uint8_t *);
227 
229 int max22200_get_ch_hold(struct max22200_desc *, uint32_t, uint8_t *);
230 
232 int max22200_get_ch_scale(struct max22200_desc *, uint32_t,
233  enum max22200_scale *);
234 
236 int max22200_get_ch_trig(struct max22200_desc *, uint32_t,
237  enum max22200_trig *);
238 
240 int max22200_get_ch_mode(struct max22200_desc *, uint32_t,
241  enum max22200_ch_drive *, enum max22200_ch_side *,
242  enum max22200_ch_op_mode *);
243 
245 int max22200_get_ch_freq(struct max22200_desc *, uint32_t,
246  enum max22200_ch_freq *);
247 
249 int max22200_get_ch_enable(struct max22200_desc *, uint32_t,
250  enum max22200_ch_enable, bool *);
251 
254 int max22200_get_cfg_dpm(struct max22200_desc *, uint8_t *, uint8_t *);
255 
257 int max22200_init(struct max22200_desc **, struct max22200_init_param *);
258 
260 int max22200_remove(struct max22200_desc *);
261 
262 #endif /* _MAX22200_H */
max22200_get_ch_mode
int max22200_get_ch_mode(struct max22200_desc *desc, uint32_t ch, enum max22200_ch_drive *ch_drive, enum max22200_ch_side *ch_side, enum max22200_ch_op_mode *ch_op_mode)
Read channel's mode configuration.
Definition: max22200.c:609
MAX22200_HHF_ENABLE
@ MAX22200_HHF_ENABLE
Definition: max22200.h:136
max22200_init_param::comm_param
struct no_os_spi_init_param * comm_param
Definition: max22200.h:143
max22200_set_ch_mode
int max22200_set_ch_mode(struct max22200_desc *desc, uint32_t ch, enum max22200_ch_drive ch_drive, enum max22200_ch_side ch_side, enum max22200_ch_op_mode ch_op_mode)
Set chanmel operation mode, high-side/low-side and drive.
Definition: max22200.c:324
max22200_fault_mask_get
int max22200_fault_mask_get(struct max22200_desc *, enum max22200_fault_mask, bool *)
Fault mask bit get function.
Definition: max22200.c:433
MAX22200_M_DPM
@ MAX22200_M_DPM
Definition: max22200.h:90
max22200_get_ch_freq
int max22200_get_ch_freq(struct max22200_desc *desc, uint32_t ch, enum max22200_ch_freq *ch_freq)
Read channel's frequency.
Definition: max22200.c:644
no_os_alloc.h
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
MAX22200_FREQMAIN_DIV_2
@ MAX22200_FREQMAIN_DIV_2
Definition: max22200.h:131
MAX22200_FREQ_80KHZ
@ MAX22200_FREQ_80KHZ
Definition: max22200.h:99
max22200_get_ch_state
int max22200_get_ch_state(struct max22200_desc *desc, uint32_t ch, bool *ch_state)
Read the state of a channel.
Definition: max22200.c:456
max22200_desc::cmd_desc
struct no_os_gpio_desc * cmd_desc
Definition: max22200.h:155
max22200_get_ch_mode
int max22200_get_ch_mode(struct max22200_desc *, uint32_t, enum max22200_ch_drive *, enum max22200_ch_side *, enum max22200_ch_op_mode *)
Read channel's mode configuration.
Definition: max22200.c:609
max22200_set_ch_hit
int max22200_set_ch_hit(struct max22200_desc *, uint32_t, uint8_t, uint8_t)
Set channel HIT time and HIT current.
Definition: max22200.c:231
max22200_get_ch_hold
int max22200_get_ch_hold(struct max22200_desc *, uint32_t, uint8_t *)
Read channel HOLD configuration.
Definition: max22200.c:530
MAX22200_FREQ_CFG_MASK
#define MAX22200_FREQ_CFG_MASK
Definition: max22200.h:79
max22200_init_param::fault_param
struct no_os_gpio_init_param * fault_param
Definition: max22200.h:144
MAX22200_SRC
@ MAX22200_SRC
Definition: max22200.h:139
max22200_set_cfg_dpm
int max22200_set_cfg_dpm(struct max22200_desc *, uint8_t, uint8_t)
Set configuration DPM.
Definition: max22200.c:409
max22200_set_ch_mode
int max22200_set_ch_mode(struct max22200_desc *, uint32_t, enum max22200_ch_drive, enum max22200_ch_side, enum max22200_ch_op_mode)
Set chanmel operation mode, high-side/low-side and drive.
Definition: max22200.c:324
max22200_desc::chan_side
enum max22200_ch_side chan_side
Definition: max22200.h:159
MAX22200_FREQMAIN_DIV_3
@ MAX22200_FREQMAIN_DIV_3
Definition: max22200.h:130
no_os_spi.h
Header file of SPI Interface.
max22200_fault_mask_set
int max22200_fault_mask_set(struct max22200_desc *, enum max22200_fault_mask, bool)
Set fault mask bits in the status register.
Definition: max22200.c:197
MAX22200_FREQMAIN
@ MAX22200_FREQMAIN
Definition: max22200.h:132
MAX22200_INDEPENDENT_MODE
@ MAX22200_INDEPENDENT_MODE
Definition: max22200.h:103
max22200_init
int max22200_init(struct max22200_desc **, struct max22200_init_param *)
MAX22200 descriptor initialization function.
Definition: max22200.c:724
max22200_set_ch_hit
int max22200_set_ch_hit(struct max22200_desc *desc, uint32_t ch, uint8_t hit_current, uint8_t hit_time)
Set channel HIT time and HIT current.
Definition: max22200.c:231
max22200_get_ch_enable
int max22200_get_ch_enable(struct max22200_desc *desc, uint32_t ch, enum max22200_ch_enable ch_enable, bool *enabled)
Read channel's enable bits state.
Definition: max22200.c:670
no_os_spi_msg
Definition: no_os_spi.h:100
no_os_delay.h
Header file of Delay functions.
max22200_desc
Definition: max22200.h:151
max22200_chopping_freq
max22200_chopping_freq
Definition: max22200.h:97
max22200_get_ch_scale
int max22200_get_ch_scale(struct max22200_desc *, uint32_t, enum max22200_scale *)
Read channel's scale.
Definition: max22200.c:555
MAX22200_STATUS_REG
#define MAX22200_STATUS_REG
Definition: max22200.h:52
MAX22200_ADDR_MASK
#define MAX22200_ADDR_MASK
Definition: max22200.h:59
max22200_ch_enable
max22200_ch_enable
Definition: max22200.h:135
MAX22200_HFS_MASK
#define MAX22200_HFS_MASK
Definition: max22200.h:72
MAX22200_M_OCP
@ MAX22200_M_OCP
Definition: max22200.h:93
max22200_init
int max22200_init(struct max22200_desc **desc, struct max22200_init_param *init_param)
MAX22200 descriptor initialization function.
Definition: max22200.c:724
NO_OS_GPIO_HIGH
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
MAX22200_DPM_IPTH_MASK
#define MAX22200_DPM_IPTH_MASK
Definition: max22200.h:85
max22200_desc::chan_drive
enum max22200_ch_drive chan_drive
Definition: max22200.h:160
MAX22200_STATUS_FAULT_MASK
#define MAX22200_STATUS_FAULT_MASK(x)
Definition: max22200.h:65
MAX22200_OL_ENABLE
@ MAX22200_OL_ENABLE
Definition: max22200.h:138
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_gpio_direction_input
int32_t no_os_gpio_direction_input(struct no_os_gpio_desc *desc)
Enable the input direction of the specified GPIO.
Definition: no_os_gpio.c:124
MAX22200_VDRNCDR_MASK
#define MAX22200_VDRNCDR_MASK
Definition: max22200.h:77
max22200_get_ch_scale
int max22200_get_ch_scale(struct max22200_desc *desc, uint32_t ch, enum max22200_scale *scale)
Read channel's scale.
Definition: max22200.c:555
MAX22200_M_OVT
@ MAX22200_M_OVT
Definition: max22200.h:94
MAX22200_CURRENT_DRIVE
@ MAX22200_CURRENT_DRIVE
Definition: max22200.h:119
NO_OS_GPIO_LOW
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
no_os_spi_msg::tx_buff
uint8_t * tx_buff
Definition: no_os_spi.h:102
max22200_set_chop_freq
int max22200_set_chop_freq(struct max22200_desc *, enum max22200_chopping_freq)
Set chopping frequency value.
Definition: max22200.c:214
max22200_get_ch_hold
int max22200_get_ch_hold(struct max22200_desc *desc, uint32_t ch, uint8_t *hold_current)
Read channel HOLD configuration.
Definition: max22200.c:530
MAX22200_CFG_CH
#define MAX22200_CFG_CH(x)
Definition: max22200.h:53
no_os_field_prep
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
max22200_scale
max22200_scale
Definition: max22200.h:108
max22200_desc::trig_desc
struct no_os_gpio_desc * trig_desc
Definition: max22200.h:156
max22200_get_ch_hit
int max22200_get_ch_hit(struct max22200_desc *, uint32_t, uint8_t *, uint8_t *)
Read channel HIT configuration.
Definition: max22200.c:504
MAX22200_FREQMAIN_DIV_4
@ MAX22200_FREQMAIN_DIV_4
Definition: max22200.h:129
max22200_set_ch_scale
int max22200_set_ch_scale(struct max22200_desc *, uint32_t, enum max22200_scale)
Set channel's scale to fullscale or half fullscale.
Definition: max22200.c:280
MAX22200_HIGH_SIDE
@ MAX22200_HIGH_SIDE
Definition: max22200.h:125
no_os_error.h
Error codes definition.
max22200_reg_write
int max22200_reg_write(struct max22200_desc *, uint32_t, uint32_t)
Write data to desired register for MAX22200.
Definition: max22200.c:95
max22200_reg_read
int max22200_reg_read(struct max22200_desc *desc, uint32_t reg, uint32_t *val)
Read data from desired register for MAX22200.
Definition: max22200.c:48
max22200_set_ch_enable
int max22200_set_ch_enable(struct max22200_desc *desc, uint32_t ch, enum max22200_ch_enable ch_enable, bool enabled)
Set channel's enables for different checks, detection and functions.
Definition: max22200.c:391
MAX22200_HSNLS_MASK
#define MAX22200_HSNLS_MASK
Definition: max22200.h:78
max22200_fault_mask
max22200_fault_mask
Definition: max22200.h:87
max22200_set_cfg_dpm
int max22200_set_cfg_dpm(struct max22200_desc *desc, uint8_t dpm_istart_byte, uint8_t dpm_tdeb_ipth_byte)
Set configuration DPM.
Definition: max22200.c:409
max22200.h
Header file of MAX22200 Driver.
max22200_set_ch_enable
int max22200_set_ch_enable(struct max22200_desc *, uint32_t, enum max22200_ch_enable, bool)
Set channel's enables for different checks, detection and functions.
Definition: max22200.c:391
MAX22200_LOW_SIDE
@ MAX22200_LOW_SIDE
Definition: max22200.h:124
MAX22200_DPM_ENABLE
@ MAX22200_DPM_ENABLE
Definition: max22200.h:137
MAX22200_M_HHF
@ MAX22200_M_HHF
Definition: max22200.h:91
MAX22200_TRIG
@ MAX22200_TRIG
Definition: max22200.h:115
max22200_get_ch_state
int max22200_get_ch_state(struct max22200_desc *, uint32_t, bool *)
Read the state of a channel.
Definition: max22200.c:456
max22200_ch_drive
max22200_ch_drive
Definition: max22200.h:118
max22200_get_chop_freq
int max22200_get_chop_freq(struct max22200_desc *, enum max22200_chopping_freq *)
Read chopping frequency.
Definition: max22200.c:481
max22200_init_param::ch_config
enum max22200_ch_op_mode ch_config[MAX22200_CHANNELS_CONFIG]
Definition: max22200.h:148
MAX22200_MAX_CHN_IDX
#define MAX22200_MAX_CHN_IDX
Definition: max22200.h:46
no_os_gpio_remove
int32_t no_os_gpio_remove(struct no_os_gpio_desc *desc)
Free the resources allocated by no_os_gpio_get().
Definition: no_os_gpio.c:104
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
max22200_set_chop_freq
int max22200_set_chop_freq(struct max22200_desc *desc, enum max22200_chopping_freq chopping_freq)
Set chopping frequency value.
Definition: max22200.c:214
MAX22200_M_OLF
@ MAX22200_M_OLF
Definition: max22200.h:92
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
max22200_desc::enable_desc
struct no_os_gpio_desc * enable_desc
Definition: max22200.h:154
max22200_init_param
Definition: max22200.h:142
MAX22200_FREQ_100KHZ
@ MAX22200_FREQ_100KHZ
Definition: max22200.h:98
max22200_set_ch_hold
int max22200_set_ch_hold(struct max22200_desc *, uint32_t, uint8_t)
Set channel hold current.
Definition: max22200.c:260
MAX22200_ONCH_SPI
@ MAX22200_ONCH_SPI
Definition: max22200.h:114
max22200_set_ch_scale
int max22200_set_ch_scale(struct max22200_desc *desc, uint32_t ch, enum max22200_scale scale)
Set channel's scale to fullscale or half fullscale.
Definition: max22200.c:280
max22200_set_trig_state
int max22200_set_trig_state(struct max22200_desc *desc, bool trig_state)
Set external trigger's state of the MAX22200.
Definition: max22200.c:164
MAX22200_STATUS_FREQ_MASK
#define MAX22200_STATUS_FREQ_MASK
Definition: max22200.h:64
no_os_spi_msg::bytes_number
uint32_t bytes_number
Definition: no_os_spi.h:106
no_os_spi_transfer
int32_t no_os_spi_transfer(struct no_os_spi_desc *desc, struct no_os_spi_msg *msgs, uint32_t len)
Iterate over head list and send all spi messages.
Definition: no_os_spi.c:185
max22200_get_cfg_dpm
int max22200_get_cfg_dpm(struct max22200_desc *desc, uint8_t *dpm_istart_byte, uint8_t *dpm_tdeb_ipth_byte)
Read configuration for the detection of the plunger movement of the device.
Definition: max22200.c:700
max22200_desc::fault_desc
struct no_os_gpio_desc * fault_desc
Definition: max22200.h:153
MAX22200_R1B
#define MAX22200_R1B
Definition: max22200.h:50
max22200_ch_freq
max22200_ch_freq
Definition: max22200.h:128
no_os_gpio_get
int32_t no_os_gpio_get(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Obtain the GPIO decriptor.
Definition: no_os_gpio.c:49
max22200_set_ch_trig
int max22200_set_ch_trig(struct max22200_desc *desc, uint32_t ch, enum max22200_trig trig)
Set channel's trigger to be either SPI or external trigger.
Definition: max22200.c:302
MAX22200_HIT_NO_TIME
#define MAX22200_HIT_NO_TIME
Definition: max22200.h:48
MAX22200_FULLSCALE
@ MAX22200_FULLSCALE
Definition: max22200.h:109
max22200_set_ch_hold
int max22200_set_ch_hold(struct max22200_desc *desc, uint32_t ch, uint8_t hold_current)
Set channel hold current.
Definition: max22200.c:260
no_os_field_get
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
max22200_desc::buff
uint8_t buff[MAX22200_FRAME_SIZE]
Definition: max22200.h:157
max22200_get_ch_hit
int max22200_get_ch_hit(struct max22200_desc *desc, uint32_t ch, uint8_t *hit_current, uint8_t *hit_time)
Read channel HIT configuration.
Definition: max22200.c:504
MAX22200_M_UVM
@ MAX22200_M_UVM
Definition: max22200.h:88
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
MAX22200_FRAME_SIZE
#define MAX22200_FRAME_SIZE
Definition: max22200.h:42
max22200_ch_side
max22200_ch_side
Definition: max22200.h:123
MAX22200_HALF_FULL_SCALE
@ MAX22200_HALF_FULL_SCALE
Definition: max22200.h:110
max22200_set_ch_freq
int max22200_set_ch_freq(struct max22200_desc *desc, uint32_t ch, enum max22200_ch_freq ch_freq)
Set channel's frequency.
Definition: max22200.c:372
max22200_remove
int max22200_remove(struct max22200_desc *desc)
Deallocates all the resources used at initialization.
Definition: max22200.c:866
max22200_init_param::enable_param
struct no_os_gpio_init_param * enable_param
Definition: max22200.h:145
MAX22200_RW_MASK
#define MAX22200_RW_MASK
Definition: max22200.h:58
MAX22200_HALF_BRIDGE_MODE
@ MAX22200_HALF_BRIDGE_MODE
Definition: max22200.h:105
max22200_fault_mask_get
int max22200_fault_mask_get(struct max22200_desc *desc, enum max22200_fault_mask fault_mask, bool *enabled)
Fault mask bit get function.
Definition: max22200.c:433
MAX22200_CHANNELS
#define MAX22200_CHANNELS
Definition: max22200.h:44
MAX22200_PARALLEL_MODE
@ MAX22200_PARALLEL_MODE
Definition: max22200.h:104
no_os_udelay
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
max22200_ch_op_mode
max22200_ch_op_mode
Definition: max22200.h:102
max22200_reg_read
int max22200_reg_read(struct max22200_desc *, uint32_t, uint32_t *)
Read data from desired register for MAX22200.
Definition: max22200.c:48
max22200_desc::ch_config
enum max22200_ch_op_mode ch_config[MAX22200_CHANNELS_CONFIG]
Definition: max22200.h:158
no_os_get_unaligned_be32
uint32_t no_os_get_unaligned_be32(uint8_t *buf)
no_os_gpio_set_value
int32_t no_os_gpio_set_value(struct no_os_gpio_desc *desc, uint8_t value)
Set the value of the specified GPIO.
Definition: no_os_gpio.c:197
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
max22200_set_ch_freq
int max22200_set_ch_freq(struct max22200_desc *, uint32_t, enum max22200_ch_freq)
Set channel's frequency.
Definition: max22200.c:372
MAX22200_HIT_MASK
#define MAX22200_HIT_MASK
Definition: max22200.h:75
MAX22200_HIT_MAX_VAL
#define MAX22200_HIT_MAX_VAL
Definition: max22200.h:47
max22200_set_ch_state
int max22200_set_ch_state(struct max22200_desc *, uint32_t, bool)
Set channel state for specific channel.
Definition: max22200.c:180
MAX22200_DPM_ISTART_MASK
#define MAX22200_DPM_ISTART_MASK
Definition: max22200.h:83
max22200_get_ch_trig
int max22200_get_ch_trig(struct max22200_desc *desc, uint32_t ch, enum max22200_trig *trig)
Read channel's selected trigger for specific channel.
Definition: max22200.c:581
max22200_get_ch_enable
int max22200_get_ch_enable(struct max22200_desc *, uint32_t, enum max22200_ch_enable, bool *)
Read channel's enable bits state.
Definition: max22200.c:670
max22200_reg_update
int max22200_reg_update(struct max22200_desc *desc, uint32_t reg, uint32_t mask, uint32_t val)
Update data in the desired register.
Definition: max22200.c:142
MAX22200_TRGNSP_IO_MASK
#define MAX22200_TRGNSP_IO_MASK
Definition: max22200.h:74
max22200_get_ch_trig
int max22200_get_ch_trig(struct max22200_desc *, uint32_t, enum max22200_trig *)
Read channel's selected trigger for specific channel.
Definition: max22200.c:581
MAX22200_HIT_T_MASK
#define MAX22200_HIT_T_MASK
Definition: max22200.h:76
no_os_spi_remove
int32_t no_os_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by no_os_spi_init().
Definition: no_os_spi.c:116
max22200_init_param::cmd_param
struct no_os_gpio_init_param * cmd_param
Definition: max22200.h:146
max22200_set_trig_state
int max22200_set_trig_state(struct max22200_desc *, bool)
Set external trigger's state of the MAX22200.
Definition: max22200.c:164
MAX22200_VOLTAGE_DRIVE
@ MAX22200_VOLTAGE_DRIVE
Definition: max22200.h:120
no_os_gpio.h
Header file of GPIO Interface.
MAX22200_ACTIVE_MASK
#define MAX22200_ACTIVE_MASK
Definition: max22200.h:69
MAX22200_CH_MODE_MASK
#define MAX22200_CH_MODE_MASK(x)
Definition: max22200.h:67
max22200_get_chop_freq
int max22200_get_chop_freq(struct max22200_desc *desc, enum max22200_chopping_freq *chopping_freq)
Read chopping frequency.
Definition: max22200.c:481
max22200_reg_update
int max22200_reg_update(struct max22200_desc *, uint32_t, uint32_t, uint32_t)
Update data in the desired register.
Definition: max22200.c:142
MAX22200_DPM_TDEB_MASK
#define MAX22200_DPM_TDEB_MASK
Definition: max22200.h:84
MAX22200_CHANNELS_CONFIG
#define MAX22200_CHANNELS_CONFIG
Definition: max22200.h:45
no_os_spi_init
int32_t no_os_spi_init(struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param)
Initialize the SPI communication peripheral.
Definition: no_os_spi.c:52
max22200_desc::comm_desc
struct no_os_spi_desc * comm_desc
Definition: max22200.h:152
MAX22200_ONCH_MASK
#define MAX22200_ONCH_MASK(x)
Definition: max22200.h:62
no_os_util.h
Header file of utility functions.
max22200_get_cfg_dpm
int max22200_get_cfg_dpm(struct max22200_desc *, uint8_t *, uint8_t *)
Read configuration for the detection of the plunger movement of the device.
Definition: max22200.c:700
MAX22200_CFG_DPM_REG
#define MAX22200_CFG_DPM_REG
Definition: max22200.h:55
max22200_init_param::trig_param
struct no_os_gpio_init_param * trig_param
Definition: max22200.h:147
no_os_gpio_direction_output
int32_t no_os_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition: no_os_gpio.c:147
max22200_trig
max22200_trig
Definition: max22200.h:113
max22200_reg_write
int max22200_reg_write(struct max22200_desc *desc, uint32_t reg, uint32_t val)
Write data to desired register for MAX22200.
Definition: max22200.c:95
max22200_fault_mask_set
int max22200_fault_mask_set(struct max22200_desc *desc, enum max22200_fault_mask fault_mask, bool enabled)
Set fault mask bits in the status register.
Definition: max22200.c:197
max22200_remove
int max22200_remove(struct max22200_desc *)
Deallocates all the resources used at initialization.
Definition: max22200.c:866
max22200_set_ch_trig
int max22200_set_ch_trig(struct max22200_desc *, uint32_t, enum max22200_trig)
Set channel's trigger to be either SPI or external trigger.
Definition: max22200.c:302
no_os_put_unaligned_le32
void no_os_put_unaligned_le32(uint32_t val, uint8_t *buf)
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
MAX22200_M_COMF
@ MAX22200_M_COMF
Definition: max22200.h:89
max22200_get_ch_freq
int max22200_get_ch_freq(struct max22200_desc *, uint32_t, enum max22200_ch_freq *)
Read channel's frequency.
Definition: max22200.c:644
max22200_set_ch_state
int max22200_set_ch_state(struct max22200_desc *desc, uint32_t ch, bool ch_state)
Set channel state for specific channel.
Definition: max22200.c:180
MAX22200_HOLD_MASK
#define MAX22200_HOLD_MASK
Definition: max22200.h:73
MAX22200_CH_ENABLE_MASK
#define MAX22200_CH_ENABLE_MASK(x)
Definition: max22200.h:80
no_os_gpio_get_optional
int32_t no_os_gpio_get_optional(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Get the value of an optional GPIO.
Definition: no_os_gpio.c:75