no-OS
ltc2672.h
Go to the documentation of this file.
1 /***************************************************************************/
34 #ifndef __LTC2672_H__
35 #define __LTC2672_H__
36 
37 /******************************************************************************/
38 /***************************** Include Files **********************************/
39 /******************************************************************************/
40 #include <stdint.h>
41 #include <stdbool.h>
42 #include "no_os_spi.h"
43 #include "no_os_error.h"
44 #include "no_os_units.h"
45 
46 /******************************************************************************/
47 /********************** Macros and Constants Definitions **********************/
48 /******************************************************************************/
49 /* LTC2672 Masks */
50 #define LTC2672_16_DONT_CARE 0xFFF0
51 #define LTC2672_MUX_DONT_CARE 0xFFFE0
52 #define LTC2672_DUMMY 0xFFFF
53 #define LTC2672_FAULT_REG_MASK 0xFF0000
54 
55 /* LTC2672 Constants */
56 #define LTC2672_BASE_CURRENT 3.125 // base current in mA
57 #define LTC2672_VMINUS_FIXED_CURRENT -80 // Fixed V- Current as per data sheet
58 #define LTC2672_OFF_CURRENT 0
59 #define LTC2672_300MA_CURRENT 300
60 #define LTC2672_16BIT_RESO 65535
61 #define LTC2672_12BIT_RESO 4095
62 #define LTC2672_TOTAL_CHANNELS 5
63 #define LTC2672_MAX_CONFIG_MASK 15
64 #define LTC2672_MAX_TOGGLE_MASK 31
65 #define LTC2672_BIT_SHIFT_12BIT 4
66 #define LTC2672_NUM_MUX_SELECTS 22
67 #define LTC2672_NUM_CURRENT_SPANS 10
68 #define LTC2672_NUM_FAULTS 7
69 
87 };
88 
89 /* LTC2672 Command Generation */
90 #define LTC2672_COMMAND32_GENERATE(comm, add, dat) \
91  (0xFF << 24) | (comm << 20) | (add << 16) | (dat)
92 
93 #define LTC2672_COMMAND24_GENERATE(comm, add, dat) \
94  (comm << 20) | (add << 16) | (dat)
95 
96 #define LTC2672_SPAN_SET(span_code) LTC2672_16_DONT_CARE | span_code
97 
98 #define LTC2672_MUX_SET(mux_code) LTC2672_MUX_DONT_CARE | mux_code
99 
100 #define LTC2672_MUX32_GENERATE(comm, dat) \
101  (0xFF << 24) | (comm << 20) | (dat)
102 
103 #define LTC2672_MUX24_GENERATE(comm, dat) \
104  (comm << 20) | (dat)
105 
106 /* Device Family */
110 };
111 
112 /* DAC Channels */
119 };
120 
121 /* Output Range */
123  LTC2672_OFF, // Off mode
124  LTC2672_50VREF, // 3.125mA
125  LTC2672_100VREF, // 6.25mA
126  LTC2672_200VREF, //12.5mA
131  LTC2672_VMINUS_VREF, // Fixed, -80mA
132  LTC2672_4800VREF = 0XF // 300mA
133 };
134 
135 /* Multiplexer Command Codes */
159 };
160 
161 /* Faults */
163  LTC2672_OPEN_OUT0, // Open circuit CH0
164  LTC2672_OPEN_OUT1, // Open circuit CH0
165  LTC2672_OPEN_OUT2, // Open circuit CH0
166  LTC2672_OPEN_OUT3, // Open circuit CH0
167  LTC2672_OPEN_OUT4, // Open circuit CH0
168  LTC2672_OVER_TEMP, // Over-temperature (T > 175 deg C)
169  LTC2672_UNUSED, // Unused fault register bit
170  LTC2672_INV_LENGTH, // Invalid SPI Length (len != 24 or 32 * n)
171 };
172 
177 struct ltc2672_dev {
178  /* SPI descriptor */
180  /* Device Variant indicator */
182  /* DAC Channel Spans */
184  /* Maximum Current Per Channel in uA */
186  /* Previous command tracker */
187  uint32_t prev_command;
188  /* Global toggle bit flag */
190 };
191 
197  /* SPI descriptor */
199  /* Device Variant indicator */
201 };
202 
204 int ltc2672_init(struct ltc2672_dev **, struct ltc2672_init_param *);
205 
207 int ltc2672_remove(struct ltc2672_dev *);
208 
210 int ltc2672_transaction(struct ltc2672_dev *device, uint32_t, bool);
211 
213 uint32_t ltc2672_current_to_code(struct ltc2672_dev *device, uint32_t,
214  enum ltc2672_dac_ch);
215 
217 int ltc2672_set_code_channel(struct ltc2672_dev *device, uint16_t code,
218  enum ltc2672_dac_ch out_ch);
219 
221 int ltc2672_set_current_channel(struct ltc2672_dev *, uint32_t,
222  enum ltc2672_dac_ch);
223 
225 int ltc2672_set_code_all_channels(struct ltc2672_dev *device, uint16_t code);
226 
228 int ltc2672_set_current_all_channels(struct ltc2672_dev *, uint32_t);
229 
232  enum ltc2672_dac_ch);
233 
236 
239 
242 
245 
248 
251  uint32_t, uint32_t);
252 
254 int ltc2672_enable_toggle_channel(struct ltc2672_dev *, uint32_t);
255 
257 int ltc2672_global_toggle(struct ltc2672_dev *, bool);
258 
260 int ltc2672_config_command(struct ltc2672_dev *, uint8_t);
261 
262 #endif // __LTC2672_H__
LTC2672_NO_OP
@ LTC2672_NO_OP
Definition: ltc2672.h:86
LTC2672_100VREF
@ LTC2672_100VREF
Definition: ltc2672.h:125
no_os_alloc.h
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:116
ltc2672_enable_toggle_channel
int ltc2672_enable_toggle_channel(struct ltc2672_dev *, uint32_t)
enables or disables selected channel/s for toggling
Definition: ltc2672.c:532
iio_trigger.h
Header file for iio_trigger.
LTC2672_MUX_VOUT1
@ LTC2672_MUX_VOUT1
Definition: ltc2672.h:155
LTC2672_MAX_CONFIG_MASK
#define LTC2672_MAX_CONFIG_MASK
Definition: ltc2672.h:63
ltc2672_set_span_all_channels
int ltc2672_set_span_all_channels(struct ltc2672_dev *device, enum ltc2672_out_range ch_span)
sets the same output span for all channels
Definition: ltc2672.c:333
LTC2672_MUX_VDD2
@ LTC2672_MUX_VDD2
Definition: ltc2672.h:149
iio_dac_demo.h
Header file of DAC Demo iio.
ltc2672_commands
ltc2672_commands
Definition: ltc2672.h:70
LTC2672_BIT_SHIFT_12BIT
#define LTC2672_BIT_SHIFT_12BIT
Definition: ltc2672.h:65
ltc2672_config_command
int ltc2672_config_command(struct ltc2672_dev *device, uint8_t mask)
configures the fault detection bits
Definition: ltc2672.c:568
ltc2672_monitor_mux
int ltc2672_monitor_mux(struct ltc2672_dev *device, enum ltc2672_mux_commands mux_comm)
configures mux output depending on target measurement
Definition: ltc2672.c:443
ltc2672_remove
int ltc2672_remove(struct ltc2672_dev *device)
Remove resources allocated by the init function.
Definition: ltc2672.c:88
no_os_spi_write_and_read
int32_t no_os_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI.
Definition: no_os_spi.c:159
LTC2672_CODE_TO_CHANNEL_X_PWRUP_UPD_CHANNEL_ALL
@ LTC2672_CODE_TO_CHANNEL_X_PWRUP_UPD_CHANNEL_ALL
Definition: ltc2672.h:73
LTC2672_SPAN_TO_CHANNEL_ALL
@ LTC2672_SPAN_TO_CHANNEL_ALL
Definition: ltc2672.h:85
LTC2672_MUX_IOUT4
@ LTC2672_MUX_IOUT4
Definition: ltc2672.h:142
no_os_spi.h
Header file of SPI Interface.
LTC2672_PWRDWN_DEV
@ LTC2672_PWRDWN_DEV
Definition: ltc2672.h:76
ltc2672_set_span_all_channels
int ltc2672_set_span_all_channels(struct ltc2672_dev *, enum ltc2672_out_range)
sets the same output span for all channels
Definition: ltc2672.c:333
ltc2672_chip_power_down
int ltc2672_chip_power_down(struct ltc2672_dev *device)
power down ltc2672
Definition: ltc2672.c:384
ltc2672_out_range
ltc2672_out_range
Definition: ltc2672.h:122
LTC2672_MAX_TOGGLE_MASK
#define LTC2672_MAX_TOGGLE_MASK
Definition: ltc2672.h:64
LTC2672_MUX_VDD4
@ LTC2672_MUX_VDD4
Definition: ltc2672.h:151
ltc2672_global_toggle
int ltc2672_global_toggle(struct ltc2672_dev *, bool)
enables or disables global toggle bit
Definition: ltc2672.c:550
LTC2672_OVER_TEMP
@ LTC2672_OVER_TEMP
Definition: ltc2672.h:168
no_os_units.h
Header file of Units.
ltc2672_power_down_channel
int ltc2672_power_down_channel(struct ltc2672_dev *device, enum ltc2672_dac_ch out_ch)
power down a channel
Definition: ltc2672.c:400
LTC2672_DAC4
@ LTC2672_DAC4
Definition: ltc2672.h:118
LTC2672_MUX_VOUT4
@ LTC2672_MUX_VOUT4
Definition: ltc2672.h:158
LTC2672_VMINUS_FIXED_CURRENT
#define LTC2672_VMINUS_FIXED_CURRENT
Definition: ltc2672.h:57
iio_trig_disable
int iio_trig_disable(void *trig)
Disable system interrupt which is linked to the given trigger.
Definition: iio_trigger.c:127
ltc2672_set_code_all_channels
int ltc2672_set_code_all_channels(struct ltc2672_dev *device, uint16_t code)
sets the same dac code for all channels
Definition: ltc2672.c:222
LTC2672_50VREF
@ LTC2672_50VREF
Definition: ltc2672.h:124
LTC2672_MUX_SET
#define LTC2672_MUX_SET(mux_code)
Definition: ltc2672.h:98
LTC2672_MUX_GND
@ LTC2672_MUX_GND
Definition: ltc2672.h:153
LTC2672_OFF
@ LTC2672_OFF
Definition: ltc2672.h:123
LTC2672_TOGGLE_GLBL
@ LTC2672_TOGGLE_GLBL
Definition: ltc2672.h:84
LTC2672_PWRUP_UPD_CHANNEL_X
@ LTC2672_PWRUP_UPD_CHANNEL_X
Definition: ltc2672.h:72
LTC2672_SPAN_TO_CHANNEL_X
@ LTC2672_SPAN_TO_CHANNEL_X
Definition: ltc2672.h:77
LTC2672_16
@ LTC2672_16
Definition: ltc2672.h:109
device
Definition: ad9361_util.h:69
ltc2672_power_down_all_channels
int ltc2672_power_down_all_channels(struct ltc2672_dev *)
power down ALL channels
Definition: ltc2672.c:419
LTC2672_DAC3
@ LTC2672_DAC3
Definition: ltc2672.h:117
ltc2672_device_id
ltc2672_device_id
Definition: ltc2672.h:107
LTC2672_400VREF
@ LTC2672_400VREF
Definition: ltc2672.h:127
LTC2672_MUX_IOUT1
@ LTC2672_MUX_IOUT1
Definition: ltc2672.h:139
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
ltc2672_monitor_mux
int ltc2672_monitor_mux(struct ltc2672_dev *, enum ltc2672_mux_commands)
configures mux output depending on target measurement
Definition: ltc2672.c:443
LTC2672_MUX_VDD3
@ LTC2672_MUX_VDD3
Definition: ltc2672.h:150
LTC2672_CODE_TO_CHANNEL_ALL
@ LTC2672_CODE_TO_CHANNEL_ALL
Definition: ltc2672.h:79
dac_iio_sw_trig_desc
struct iio_trigger dac_iio_sw_trig_desc
Definition: iio_dac_demo_trig.c:55
LTC2672_200VREF
@ LTC2672_200VREF
Definition: ltc2672.h:126
LTC2672_MUC_VCC
@ LTC2672_MUC_VCC
Definition: ltc2672.h:143
LTC2672_800VREF
@ LTC2672_800VREF
Definition: ltc2672.h:128
iio_sw_trig_handler
int iio_sw_trig_handler(void *trig, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv)
Handles the write request for trigger_now attribute.
Definition: iio_trigger.c:208
LTC2672_VMINUS_VREF
@ LTC2672_VMINUS_VREF
Definition: ltc2672.h:131
ltc2672_power_down_all_channels
int ltc2672_power_down_all_channels(struct ltc2672_dev *device)
power down ALL channels
Definition: ltc2672.c:419
ltc2672_config_command
int ltc2672_config_command(struct ltc2672_dev *, uint8_t)
configures the fault detection bits
Definition: ltc2672.c:568
LTC2672_MUX24_GENERATE
#define LTC2672_MUX24_GENERATE(comm, dat)
Definition: ltc2672.h:103
iio.h
Header file of iio.
no_os_error.h
Error codes definition.
LTC2672_DUMMY
#define LTC2672_DUMMY
Definition: ltc2672.h:52
ltc2672_set_current_all_channels
int ltc2672_set_current_all_channels(struct ltc2672_dev *device, uint32_t current)
sets the same current for all channels
Definition: ltc2672.c:254
ltc2672_set_current_all_channels
int ltc2672_set_current_all_channels(struct ltc2672_dev *, uint32_t)
sets the same current for all channels
Definition: ltc2672.c:254
iio_attribute::name
const char * name
Definition: iio_types.h:131
LTC2672_OPEN_OUT3
@ LTC2672_OPEN_OUT3
Definition: ltc2672.h:166
ltc2672_set_code_all_channels
int ltc2672_set_code_all_channels(struct ltc2672_dev *device, uint16_t code)
sets the same dac code for all channels
Definition: ltc2672.c:222
LTC2672_DAC2
@ LTC2672_DAC2
Definition: ltc2672.h:116
ltc2672_init
int ltc2672_init(struct ltc2672_dev **device, struct ltc2672_init_param *init_param)
Device and communication init function.
Definition: ltc2672.c:58
LTC2672_PWRUP_UPD_CHANNEL_ALL
@ LTC2672_PWRUP_UPD_CHANNEL_ALL
Definition: ltc2672.h:80
ltc2672_enable_toggle_channel
int ltc2672_enable_toggle_channel(struct ltc2672_dev *device, uint32_t mask)
enables or disables selected channel/s for toggling
Definition: ltc2672.c:532
LTC2672_MON_MUX
@ LTC2672_MON_MUX
Definition: ltc2672.h:82
LTC2672_MUX_IOUT2
@ LTC2672_MUX_IOUT2
Definition: ltc2672.h:140
LTC2672_MUX_VOUT3
@ LTC2672_MUX_VOUT3
Definition: ltc2672.h:157
ltc2672_transaction
int ltc2672_transaction(struct ltc2672_dev *device, uint32_t, bool)
Write raw register value.
Definition: ltc2672.c:109
LTC2672_300MA_CURRENT
#define LTC2672_300MA_CURRENT
Definition: ltc2672.h:59
iio_trig_enable
int iio_trig_enable(void *trig)
Enable system interrupt which is linked to the given trigger.
Definition: iio_trigger.c:110
LTC2672_CODE_PWRUP_UPD_CHANNEL_ALL
@ LTC2672_CODE_PWRUP_UPD_CHANNEL_ALL
Definition: ltc2672.h:81
ltc2672_set_current_channel
int ltc2672_set_current_channel(struct ltc2672_dev *device, uint32_t current, enum ltc2672_dac_ch out_ch)
set the current for a selected DAC channel
Definition: ltc2672.c:201
LTC2672_OPEN_OUT2
@ LTC2672_OPEN_OUT2
Definition: ltc2672.h:165
LTC2672_MUX_DISABLED
@ LTC2672_MUX_DISABLED
Definition: ltc2672.h:137
LTC2672_1600VREF
@ LTC2672_1600VREF
Definition: ltc2672.h:129
ltc2672_dev
Structure holding ltc2672 descriptor.
Definition: ltc2672.h:177
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:129
ltc2672_transaction
int ltc2672_transaction(struct ltc2672_dev *device, uint32_t comm, bool is_32)
Write raw register value.
Definition: ltc2672.c:109
ltc2672_set_span_channel
int ltc2672_set_span_channel(struct ltc2672_dev *device, enum ltc2672_out_range ch_span, enum ltc2672_dac_ch out_ch)
sets output span for channel
Definition: ltc2672.c:282
LTC2672_BASE_CURRENT
#define LTC2672_BASE_CURRENT
Definition: ltc2672.h:56
LTC2672_UNUSED
@ LTC2672_UNUSED
Definition: ltc2672.h:169
LTC2672_DAC1
@ LTC2672_DAC1
Definition: ltc2672.h:115
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
ltc2672_chip_power_down
int ltc2672_chip_power_down(struct ltc2672_dev *)
power down ltc2672
Definition: ltc2672.c:384
LTC2672_OPEN_OUT1
@ LTC2672_OPEN_OUT1
Definition: ltc2672.h:164
ltc2672_dac_ch
ltc2672_dac_ch
Definition: ltc2672.h:113
ltc2672_set_code_channel
int ltc2672_set_code_channel(struct ltc2672_dev *device, uint16_t code, enum ltc2672_dac_ch out_ch)
sets the dac code for channel
Definition: ltc2672.c:165
LTC2672_3200VREF
@ LTC2672_3200VREF
Definition: ltc2672.h:130
ltc2672_mux_commands
ltc2672_mux_commands
Definition: ltc2672.h:136
LTC2672_INV_LENGTH
@ LTC2672_INV_LENGTH
Definition: ltc2672.h:170
ltc2672_init
int ltc2672_init(struct ltc2672_dev **, struct ltc2672_init_param *)
Device and communication init function.
Definition: ltc2672.c:58
ltc2672_init_param
Structure holding the parameters for ltc2672 initialization.
Definition: ltc2672.h:196
dac_iio_timer_trig_desc
struct iio_trigger dac_iio_timer_trig_desc
Definition: iio_dac_demo_trig.c:61
ltc2672_dev::max_currents
uint32_t max_currents[LTC2672_TOTAL_CHANNELS]
Definition: ltc2672.h:185
LTC2672_OPEN_OUT4
@ LTC2672_OPEN_OUT4
Definition: ltc2672.h:167
LTC2672_12
@ LTC2672_12
Definition: ltc2672.h:108
ltc2672_set_code_channel
int ltc2672_set_code_channel(struct ltc2672_dev *device, uint16_t code, enum ltc2672_dac_ch out_ch)
sets the dac code for channel
Definition: ltc2672.c:165
LTC2672_MUX_DIE_TEMP
@ LTC2672_MUX_DIE_TEMP
Definition: ltc2672.h:146
LTC2672_OFF_CURRENT
#define LTC2672_OFF_CURRENT
Definition: ltc2672.h:58
LTC2672_TOGGLE_SEL
@ LTC2672_TOGGLE_SEL
Definition: ltc2672.h:83
LTC2672_OPEN_OUT0
@ LTC2672_OPEN_OUT0
Definition: ltc2672.h:163
ltc2672_dev::id
enum ltc2672_device_id id
Definition: ltc2672.h:181
ltc2672.h
Header file of ltc2672 Driver.
ltc2672_init_param::spi_init
struct no_os_spi_init_param spi_init
Definition: ltc2672.h:198
NO_OS_BIT
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
ltc2672_init_param::id
enum ltc2672_device_id id
Definition: ltc2672.h:200
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
LTC2672_MUX_VOUT2
@ LTC2672_MUX_VOUT2
Definition: ltc2672.h:156
MICROAMPER_PER_MILLIAMPER
#define MICROAMPER_PER_MILLIAMPER
Definition: no_os_units.h:63
ltc2672_set_current_channel
int ltc2672_set_current_channel(struct ltc2672_dev *, uint32_t, enum ltc2672_dac_ch)
set the current for a selected DAC channel
Definition: ltc2672.c:201
iio_trigger
Definition: iio_types.h:231
LTC2672_SPAN_SET
#define LTC2672_SPAN_SET(span_code)
Definition: ltc2672.h:96
ltc2672_set_span_channel
int ltc2672_set_span_channel(struct ltc2672_dev *, enum ltc2672_out_range, enum ltc2672_dac_ch)
sets output span for channel
Definition: ltc2672.c:282
LTC2672_CODE_PWRUP_UPD_CHANNEL_X
@ LTC2672_CODE_PWRUP_UPD_CHANNEL_X
Definition: ltc2672.h:74
LTC2672_MUX_VOUT0
@ LTC2672_MUX_VOUT0
Definition: ltc2672.h:154
LTC2672_MUX_IOUT0
@ LTC2672_MUX_IOUT0
Definition: ltc2672.h:138
LTC2672_CODE_TO_CHANNEL_X
@ LTC2672_CODE_TO_CHANNEL_X
Definition: ltc2672.h:71
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
LTC2672_TOTAL_CHANNELS
#define LTC2672_TOTAL_CHANNELS
Definition: ltc2672.h:62
ltc2672_dev::out_spans
enum ltc2672_out_range out_spans[LTC2672_TOTAL_CHANNELS]
Definition: ltc2672.h:183
LTC2672_4800VREF
@ LTC2672_4800VREF
Definition: ltc2672.h:132
LTC2672_16BIT_RESO
#define LTC2672_16BIT_RESO
Definition: ltc2672.h:60
ltc2672_setup_toggle_channel
int ltc2672_setup_toggle_channel(struct ltc2672_dev *device, enum ltc2672_dac_ch out_ch, uint32_t current_reg_a, uint32_t current_reg_b)
setup toggle parameters for a channel
Definition: ltc2672.c:467
LTC2672_PWRDWN_CHANNEL_X
@ LTC2672_PWRDWN_CHANNEL_X
Definition: ltc2672.h:75
LTC2672_MUX_VDD1
@ LTC2672_MUX_VDD1
Definition: ltc2672.h:148
LTC2672_CNFG_CMD
@ LTC2672_CNFG_CMD
Definition: ltc2672.h:78
ltc2672_dev::global_toggle
bool global_toggle
Definition: ltc2672.h:189
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
LTC2672_12BIT_RESO
#define LTC2672_12BIT_RESO
Definition: ltc2672.h:61
ltc2672_current_to_code
uint32_t ltc2672_current_to_code(struct ltc2672_dev *device, uint32_t, enum ltc2672_dac_ch)
get dac code value from current of a selected DAC channel
Definition: ltc2672.c:142
LTC2672_MUX_IOUT3
@ LTC2672_MUX_IOUT3
Definition: ltc2672.h:141
LTC2672_MUX_VREF
@ LTC2672_MUX_VREF
Definition: ltc2672.h:144
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
ltc2672_power_down_channel
int ltc2672_power_down_channel(struct ltc2672_dev *, enum ltc2672_dac_ch)
power down a channel
Definition: ltc2672.c:400
iio_trigger::is_synchronous
bool is_synchronous
Definition: iio_types.h:234
LTC2672_DAC0
@ LTC2672_DAC0
Definition: ltc2672.h:114
ltc2672_remove
int ltc2672_remove(struct ltc2672_dev *)
Remove resources allocated by the init function.
Definition: ltc2672.c:88
no_os_util.h
Header file of utility functions.
LTC2672_MUX_VDD0
@ LTC2672_MUX_VDD0
Definition: ltc2672.h:147
ltc2672_dev::prev_command
uint32_t prev_command
Definition: ltc2672.h:187
LTC2672_MUX_VREF_LO
@ LTC2672_MUX_VREF_LO
Definition: ltc2672.h:145
ltc2672_dev::comm_desc
struct no_os_spi_desc * comm_desc
Definition: ltc2672.h:179
LTC2672_COMMAND24_GENERATE
#define LTC2672_COMMAND24_GENERATE(comm, add, dat)
Definition: ltc2672.h:93
ltc2672_setup_toggle_channel
int ltc2672_setup_toggle_channel(struct ltc2672_dev *, enum ltc2672_dac_ch, uint32_t, uint32_t)
setup toggle parameters for a channel
Definition: ltc2672.c:467
errno.h
Error macro definition for ARM Compiler.
ltc2672_faults
ltc2672_faults
Definition: ltc2672.h:162
ltc2672_current_to_code
uint32_t ltc2672_current_to_code(struct ltc2672_dev *device, uint32_t dac_current, enum ltc2672_dac_ch out_ch)
get dac code value from current of a selected DAC channel
Definition: ltc2672.c:142
LTC2672_MUX_VMINUS
@ LTC2672_MUX_VMINUS
Definition: ltc2672.h:152
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
ltc2672_global_toggle
int ltc2672_global_toggle(struct ltc2672_dev *device, bool is_enable)
enables or disables global toggle bit
Definition: ltc2672.c:550