Go to the documentation of this file.
50 #define LTC2688_DAC_CHANNELS 16
52 #define LTC2688_CMD_CH_CODE(x) (0x00 + x)
53 #define LTC2688_CMD_CH_SETTING(x) (0x10 + x)
54 #define LTC2688_CMD_CH_OFFSET(x) (0X20 + x)
55 #define LTC2688_CMD_CH_GAIN(x) (0x30 + x)
56 #define LTC2688_CMD_CH_CODE_UPDATE(x) (0x40 + x)
57 #define LTC2688_CMD_CH_CODE_UPDATE_ALL(x) (0x50 + x)
58 #define LTC2688_CMD_CH_UPDATE(x) (0x60 + x)
60 #define LTC2688_CMD_CONFIG_REG 0x70
61 #define LTC2688_CMD_POWERDOWN_REG 0x71
62 #define LTC2688_CMD_A_B_SELECT_REG 0x72
63 #define LTC2688_CMD_SW_TOGGLE_REG 0x73
64 #define LTC2688_CMD_TOGGLE_DITHER_EN_REG 0x74
65 #define LTC2688_CMD_MUX_CTRL_REG 0x75
66 #define LTC2688_CMD_FAULT_REG 0x76
67 #define LTC2688_CMD_CODE_ALL 0x78
68 #define LTC2688_CMD_CODE_UPDATE_ALL 0x79
69 #define LTC2688_CMD_SETTING_ALL 0x7A
70 #define LTC2688_CMD_SETTING_UPDATE_ALL 0x7B
71 #define LTC2688_CMD_UPDATE_ALL 0x7C
72 #define LTC2688_CMD_NOOP 0xFF
74 #define LTC2688_READ_OPERATION 0x80
77 #define LTC2688_CH_SPAN_MSK NO_OS_GENMASK(3, 0)
78 #define LTC2688_CH_SPAN(x) no_os_field_prep(LTC2688_CH_SPAN_MSK, x)
79 #define LTC2688_CH_TD_SEL_MSK NO_OS_GENMASK(5, 4)
80 #define LTC2688_CH_TD_SEL(x) no_os_field_prep(LTC2688_CH_TD_SEL_MSK, x)
81 #define LTC2688_CH_DIT_PER_MSK NO_OS_GENMASK(8, 6)
82 #define LTC2688_CH_DIT_PER(x) no_os_field_prep(LTC2688_CH_DIT_PER_MSK, x)
83 #define LTC2688_CH_DIT_PH_MSK NO_OS_GENMASK(10, 9)
84 #define LTC2688_CH_DIT_PH(x) no_os_field_prep(LTC2688_CH_DIT_PH_MSK, x)
85 #define LTC2688_CH_MODE NO_OS_BIT(11)
88 #define LTC2688_CONFIG_RST NO_OS_BIT(15)
90 #define LTC2688_PWDN(x) (1 << ((x) & 0xF))
91 #define LTC2688_DITH_EN(x) (1 << ((x) & 0xF))
187 #endif // __LTC2688_H__
@ LTC2688_VOLTAGE_RANGE_0V_5V
Definition: ltc2688.h:98
int32_t ltc2688_software_toggle(struct ltc2688_dev *dev, uint8_t channel)
Definition: ltc2688.c:336
Header file of LTC2688 Driver.
#define LTC2688_CMD_TOGGLE_DITHER_EN_REG
Definition: ltc2688.h:64
@ LTC2688_DITH_PHASE_90
Definition: ltc2688.h:120
@ LTC2688_DITH_PERIOD_8
Definition: ltc2688.h:112
Definition: ltc2688.h:150
int32_t ltc2688_set_dither_mode(struct ltc2688_dev *dev, uint8_t channel, bool en)
Definition: ltc2688.c:183
int32_t ltc2688_select_reg(struct ltc2688_dev *dev, uint8_t channel, enum ltc2688_a_b_register sel_reg)
Definition: ltc2688.c:287
#define LTC2688_CH_DIT_PER_MSK
Definition: ltc2688.h:81
#define LTC2688_CMD_A_B_SELECT_REG
Definition: ltc2688.h:62
bool dither_mode[16]
Definition: ltc2688.h:141
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:82
ltc2688_dither_phase
Definition: ltc2688.h:118
Header file of SPI Interface.
int32_t ltc2688_software_reset(struct ltc2688_dev *dev)
Definition: ltc2688.c:358
enum ltc2688_dither_period dither_period[16]
Definition: ltc2688.h:158
@ LTC2688_VOLTAGE_RANGE_M10V_10V
Definition: ltc2688.h:101
int32_t ltc2688_select_tg_dith_clk(struct ltc2688_dev *dev, uint8_t channel, enum ltc2688_clk_input clk_input)
Definition: ltc2688.c:312
Header file of Delay functions.
int32_t ltc2688_select_reg(struct ltc2688_dev *dev, uint8_t channel, enum ltc2688_a_b_register sel_reg)
Definition: ltc2688.c:287
#define LTC2688_CMD_CH_GAIN(x)
Definition: ltc2688.h:55
#define LTC2688_CH_TD_SEL_MSK
Definition: ltc2688.h:79
#define LTC2688_CMD_CH_OFFSET(x)
Definition: ltc2688.h:54
int32_t ltc2688_set_dither_period(struct ltc2688_dev *dev, uint8_t channel, enum ltc2688_dither_period period)
Definition: ltc2688.c:262
int32_t ltc2688_software_toggle(struct ltc2688_dev *dev, uint8_t channel)
Definition: ltc2688.c:336
#define LTC2688_DAC_CHANNELS
Definition: ltc2688.h:50
Definition: ad9361_util.h:75
@ LTC2688_TGP2
Definition: ltc2688.h:134
#define LTC2688_CH_SPAN(x)
Definition: ltc2688.h:78
@ LTC2688_SOFT_TGL
Definition: ltc2688.h:131
int32_t ltc2688_set_dither_mode(struct ltc2688_dev *dev, uint8_t channel, bool en)
Definition: ltc2688.c:183
enum ltc2688_a_b_register reg_select[16]
Definition: ltc2688.h:147
#define LTC2688_CH_DIT_PH_MSK
Definition: ltc2688.h:83
ltc2688_dither_period
Definition: ltc2688.h:110
@ LTC2688_SELECT_A_REG
Definition: ltc2688.h:126
@ LTC2688_SELECT_B_REG
Definition: ltc2688.h:127
enum ltc2688_dither_period dither_period[16]
Definition: ltc2688.h:145
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: delay.c:130
#define LTC2688_CMD_CONFIG_REG
Definition: ltc2688.h:60
#define LTC2688_CMD_SW_TOGGLE_REG
Definition: ltc2688.h:63
ltc2688_clk_input
Definition: ltc2688.h:130
enum ltc2688_voltage_range crt_range[16]
Definition: ltc2688.h:143
@ LTC2688_TGP0
Definition: ltc2688.h:132
@ LTC2688_DITH_PHASE_270
Definition: ltc2688.h:122
int32_t ltc2688_set_dither_toggle(struct ltc2688_dev *dev, uint16_t setting)
Definition: ltc2688.c:162
#define LTC2688_CH_DIT_PH(x)
Definition: ltc2688.h:84
@ LTC2688_DITH_PHASE_0
Definition: ltc2688.h:119
enum ltc2688_clk_input clk_input[16]
Definition: ltc2688.h:159
ltc2688_voltage_range
Definition: ltc2688.h:97
@ LTC2688_DITH_PERIOD_16
Definition: ltc2688.h:113
#define LTC2688_CH_MODE
Definition: ltc2688.h:85
int32_t ltc2688_set_dither_period(struct ltc2688_dev *dev, uint8_t channel, enum ltc2688_dither_period period)
Definition: ltc2688.c:262
@ LTC2688_DITH_PERIOD_32
Definition: ltc2688.h:114
#define LTC2688_CMD_UPDATE_ALL
Definition: ltc2688.h:71
int32_t ltc2688_set_dither_phase(struct ltc2688_dev *dev, uint8_t channel, enum ltc2688_dither_phase phase)
Definition: ltc2688.c:237
#define LTC2688_CH_SPAN_MSK
Definition: ltc2688.h:77
@ LTC2688_VOLTAGE_RANGE_M15V_15V
Definition: ltc2688.h:102
int32_t ltc2688_set_pwr_dac(struct ltc2688_dev *dev, uint16_t setting)
Definition: ltc2688.c:141
#define LTC2688_READ_OPERATION
Definition: ltc2688.h:74
#define LTC2688_CH_TD_SEL(x)
Definition: ltc2688.h:80
@ LTC2688_DITH_PERIOD_64
Definition: ltc2688.h:115
uint16_t pwd_dac_setting
Definition: ltc2688.h:153
int32_t ltc2688_set_pwr_dac(struct ltc2688_dev *dev, uint16_t setting)
Definition: ltc2688.c:141
uint16_t dither_toggle_en
Definition: ltc2688.h:154
int32_t ltc2688_software_reset(struct ltc2688_dev *dev)
Definition: ltc2688.c:358
Structure holding SPI descriptor.
Definition: no_os_spi.h:132
int max
Definition: ltc2688.h:107
enum ltc2688_voltage_range crt_range[16]
Definition: ltc2688.h:156
int32_t ltc2688_set_span(struct ltc2688_dev *dev, uint8_t channel, enum ltc2688_voltage_range range)
Definition: ltc2688.c:212
int32_t ltc2688_select_tg_dith_clk(struct ltc2688_dev *dev, uint8_t channel, enum ltc2688_clk_input clk_input)
Definition: ltc2688.c:312
no_os_spi_desc * spi_desc
Definition: ltc2688.h:138
int32_t ltc2688_set_dither_phase(struct ltc2688_dev *dev, uint8_t channel, enum ltc2688_dither_phase phase)
Definition: ltc2688.c:237
@ LTC2688_DITH_PERIOD_4
Definition: ltc2688.h:111
enum ltc2688_a_b_register reg_select[16]
Definition: ltc2688.h:160
#define NO_OS_BIT(x)
Definition: no_os_util.h:51
no_os_spi_init_param spi_init
Definition: ltc2688.h:152
ltc2688_a_b_register
Definition: ltc2688.h:125
#define LTC2688_CMD_CH_CODE_UPDATE(x)
Definition: ltc2688.h:56
int32_t ltc2688_set_span(struct ltc2688_dev *dev, uint8_t channel, enum ltc2688_voltage_range range)
Definition: ltc2688.c:212
#define LTC2688_CH_DIT_PER(x)
Definition: ltc2688.h:82
int32_t ltc2688_set_voltage(struct ltc2688_dev *dev, uint8_t channel, float voltage)
Definition: ltc2688.c:374
#define LTC2688_CMD_POWERDOWN_REG
Definition: ltc2688.h:61
@ LTC2688_DITH_PHASE_180
Definition: ltc2688.h:121
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:96
Definition: ltc2688.h:137
#define LTC2688_CMD_CH_SETTING(x)
Definition: ltc2688.h:53
uint16_t dither_toggle_en
Definition: ltc2688.h:140
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:70
int32_t ltc2688_set_dither_toggle(struct ltc2688_dev *dev, uint16_t setting)
Definition: ltc2688.c:162
int32_t ltc2688_remove(struct ltc2688_dev *dev)
Free the resources allocated by ltc2688_init().
Definition: ltc2688.c:492
@ LTC2688_VOLTAGE_RANGE_M5V_5V
Definition: ltc2688.h:100
uint16_t dac_code[16]
Definition: ltc2688.h:142
enum ltc2688_clk_input clk_input[16]
Definition: ltc2688.h:146
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:51
Definition: ltc2688.h:105
int32_t ltc2688_remove(struct ltc2688_dev *dev)
Free the resources allocated by ltc2688_init().
Definition: ltc2688.c:492
uint16_t pwd_dac_setting
Definition: ltc2688.h:139
bool dither_mode[16]
Definition: ltc2688.h:155
Implementation of utility functions.
enum ltc2688_dither_phase dither_phase[16]
Definition: ltc2688.h:144
#define LTC2688_CONFIG_RST
Definition: ltc2688.h:88
@ LTC2688_TGP1
Definition: ltc2688.h:133
#define LTC2688_CMD_NOOP
Definition: ltc2688.h:72
int min
Definition: ltc2688.h:106
@ LTC2688_VOLTAGE_RANGE_0V_10V
Definition: ltc2688.h:99
int32_t ltc2688_init(struct ltc2688_dev **device, struct ltc2688_init_param init_param)
Definition: ltc2688.c:411
int32_t ltc2688_set_voltage(struct ltc2688_dev *dev, uint8_t channel, float voltage)
Definition: ltc2688.c:374
Error macro definition for ARM Compiler.
enum ltc2688_dither_phase dither_phase[16]
Definition: ltc2688.h:157
int32_t ltc2688_init(struct ltc2688_dev **device, struct ltc2688_init_param init_param)
Definition: ltc2688.c:411
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:112