Go to the documentation of this file.
44 #define LTC268X_CHANNEL_SEL(x, id) (id ? x : (x << 1))
46 #define LTC268X_CMD_CH_CODE(x, id) (0x00 + LTC268X_CHANNEL_SEL(x, id))
47 #define LTC268X_CMD_CH_SETTING(x, id) (0x10 + LTC268X_CHANNEL_SEL(x, id))
48 #define LTC268X_CMD_CH_OFFSET(x, id) (0X20 + LTC268X_CHANNEL_SEL(x, id))
49 #define LTC268X_CMD_CH_GAIN(x, id) (0x30 + LTC268X_CHANNEL_SEL(x, id))
50 #define LTC268X_CMD_CH_CODE_UPDATE(x, id) (0x40 + LTC268X_CHANNEL_SEL(x, id))
51 #define LTC268X_CMD_CH_CODE_UPDATE_ALL(x, id) (0x50 + LTC268X_CHANNEL_SEL(x, id))
52 #define LTC268X_CMD_CH_UPDATE(x, id) (0x60 + LTC268X_CHANNEL_SEL(x, id))
54 #define LTC268X_CMD_CONFIG_REG 0x70
55 #define LTC268X_CMD_POWERDOWN_REG 0x71
56 #define LTC268X_CMD_A_B_SELECT_REG 0x72
57 #define LTC268X_CMD_SW_TOGGLE_REG 0x73
58 #define LTC268X_CMD_TOGGLE_DITHER_EN_REG 0x74
59 #define LTC268X_CMD_MUX_CTRL_REG 0x75
60 #define LTC268X_CMD_FAULT_REG 0x76
61 #define LTC268X_CMD_CODE_ALL 0x78
62 #define LTC268X_CMD_CODE_UPDATE_ALL 0x79
63 #define LTC268X_CMD_SETTING_ALL 0x7A
64 #define LTC268X_CMD_SETTING_UPDATE_ALL 0x7B
65 #define LTC268X_CMD_UPDATE_ALL 0x7C
66 #define LTC268X_CMD_NOOP 0xFF
68 #define LTC268X_READ_OPERATION 0x80
71 #define LTC268X_CH_SPAN_MSK NO_OS_GENMASK(3, 0)
72 #define LTC268X_CH_SPAN(x) no_os_field_prep(LTC268X_CH_SPAN_MSK, x)
73 #define LTC268X_CH_TD_SEL_MSK NO_OS_GENMASK(5, 4)
74 #define LTC268X_CH_TD_SEL(x) no_os_field_prep(LTC268X_CH_TD_SEL_MSK, x)
75 #define LTC268X_CH_DIT_PER_MSK NO_OS_GENMASK(8, 6)
76 #define LTC268X_CH_DIT_PER(x) no_os_field_prep(LTC268X_CH_DIT_PER_MSK, x)
77 #define LTC268X_CH_DIT_PH_MSK NO_OS_GENMASK(10, 9)
78 #define LTC268X_CH_DIT_PH(x) no_os_field_prep(LTC268X_CH_DIT_PH_MSK, x)
79 #define LTC268X_CH_MODE NO_OS_BIT(11)
82 #define LTC268X_CONFIG_RST NO_OS_BIT(15)
84 #define LTC268X_PWDN(x) (1 << ((x) & 0xF))
85 #define LTC268X_DITH_EN(x) (1 << ((x) & 0xF))
188 #endif // __LTC268X_H__
#define LTC268X_CMD_CH_OFFSET(x, id)
Definition: ltc268x.h:48
#define LTC268X_CMD_POWERDOWN_REG
Definition: ltc268x.h:55
@ LTC268X_DITH_PHASE_0
Definition: ltc268x.h:112
int32_t ltc268x_set_voltage(struct ltc268x_dev *dev, uint8_t channel, float voltage)
Definition: ltc268x.c:374
uint16_t dac_code[16]
Definition: ltc268x.h:141
@ LTC268X_VOLTAGE_RANGE_M10V_10V
Definition: ltc268x.h:94
uint16_t dither_toggle_en
Definition: ltc268x.h:155
#define LTC268X_CMD_CH_SETTING(x, id)
Definition: ltc268x.h:47
int32_t ltc268x_set_voltage(struct ltc268x_dev *dev, uint8_t channel, float voltage)
Definition: ltc268x.c:374
Definition: ltc268x.h:150
enum ltc268x_dither_period dither_period[16]
Definition: ltc268x.h:159
@ LTC2686
Definition: ltc268x.h:131
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
Header file of SPI Interface.
#define LTC268X_CMD_TOGGLE_DITHER_EN_REG
Definition: ltc268x.h:58
@ LTC268X_DITH_PERIOD_16
Definition: ltc268x.h:106
int32_t ltc268x_set_span(struct ltc268x_dev *dev, uint8_t channel, enum ltc268x_voltage_range range)
Definition: ltc268x.c:208
int32_t ltc268x_set_dither_mode(struct ltc268x_dev *dev, uint8_t channel, bool en)
Definition: ltc268x.c:178
#define LTC268X_CMD_SW_TOGGLE_REG
Definition: ltc268x.h:57
@ LTC268X_SELECT_B_REG
Definition: ltc268x.h:120
#define LTC268X_CH_DIT_PH_MSK
Definition: ltc268x.h:77
Header file of Delay functions.
@ LTC268X_SELECT_A_REG
Definition: ltc268x.h:119
int32_t ltc268x_select_reg(struct ltc268x_dev *dev, uint8_t channel, enum ltc268x_a_b_register sel_reg)
Definition: ltc268x.c:286
int32_t ltc268x_set_dither_mode(struct ltc268x_dev *dev, uint8_t channel, bool en)
Definition: ltc268x.c:178
Definition: ad9361_util.h:69
@ LTC268X_SOFT_TGL
Definition: ltc268x.h:124
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
int32_t ltc268x_select_tg_dith_clk(struct ltc268x_dev *dev, uint8_t channel, enum ltc268x_clk_input clk_input)
Definition: ltc268x.c:311
#define LTC268X_CMD_CONFIG_REG
Definition: ltc268x.h:54
enum ltc268x_device_id dev_id
Definition: ltc268x.h:137
int32_t ltc268x_remove(struct ltc268x_dev *dev)
Free the resources allocated by ltc268x_init().
Definition: ltc268x.c:501
#define LTC268X_CONFIG_RST
Definition: ltc268x.h:82
@ LTC268X_DITH_PHASE_270
Definition: ltc268x.h:115
#define LTC268X_CH_MODE
Definition: ltc268x.h:79
int32_t ltc268x_init(struct ltc268x_dev **device, struct ltc268x_init_param init_param)
Definition: ltc268x.c:413
uint16_t pwd_dac_setting
Definition: ltc268x.h:138
ltc268x_voltage_range
Definition: ltc268x.h:90
@ LTC268X_VOLTAGE_RANGE_0V_10V
Definition: ltc268x.h:92
#define LTC268X_CH_SPAN_MSK
Definition: ltc268x.h:71
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
int32_t ltc268x_set_dither_phase(struct ltc268x_dev *dev, uint8_t channel, enum ltc268x_dither_phase phase)
Definition: ltc268x.c:234
Header file of LTC2686/8 Driver.
#define LTC268X_CH_TD_SEL(x)
Definition: ltc268x.h:74
enum ltc268x_dither_period dither_period[16]
Definition: ltc268x.h:145
int32_t ltc268x_select_reg(struct ltc268x_dev *dev, uint8_t channel, enum ltc268x_a_b_register sel_reg)
Definition: ltc268x.c:286
@ LTC268X_DITH_PHASE_180
Definition: ltc268x.h:114
enum ltc268x_a_b_register reg_select[16]
Definition: ltc268x.h:161
int32_t ltc268x_set_dither_period(struct ltc268x_dev *dev, uint8_t channel, enum ltc268x_dither_period period)
Definition: ltc268x.c:260
#define LTC268X_CH_DIT_PER_MSK
Definition: ltc268x.h:75
ltc268x_a_b_register
Definition: ltc268x.h:118
struct no_os_spi_init_param spi_init
Definition: ltc268x.h:152
#define LTC268X_CH_SPAN(x)
Definition: ltc268x.h:72
bool dither_mode[16]
Definition: ltc268x.h:156
int32_t ltc268x_set_dither_period(struct ltc268x_dev *dev, uint8_t channel, enum ltc268x_dither_period period)
Definition: ltc268x.c:260
int min
Definition: ltc268x.h:99
int32_t ltc268x_select_tg_dith_clk(struct ltc268x_dev *dev, uint8_t channel, enum ltc268x_clk_input clk_input)
Definition: ltc268x.c:311
@ LTC268X_TGP2
Definition: ltc268x.h:127
#define LTC268X_CMD_A_B_SELECT_REG
Definition: ltc268x.h:56
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
int32_t ltc268x_set_dither_toggle(struct ltc268x_dev *dev, uint16_t setting)
Definition: ltc268x.c:157
enum ltc268x_voltage_range crt_range[16]
Definition: ltc268x.h:143
enum ltc268x_device_id dev_id
Definition: ltc268x.h:153
int32_t ltc268x_init(struct ltc268x_dev **device, struct ltc268x_init_param init_param)
Definition: ltc268x.c:413
int32_t ltc268x_set_span(struct ltc268x_dev *dev, uint8_t channel, enum ltc268x_voltage_range range)
Definition: ltc268x.c:208
#define LTC268X_CMD_CH_GAIN(x, id)
Definition: ltc268x.h:49
enum ltc268x_dither_phase dither_phase[16]
Definition: ltc268x.h:158
int32_t ltc268x_software_toggle(struct ltc268x_dev *dev, uint8_t channel)
Definition: ltc268x.c:336
ltc268x_clk_input
Definition: ltc268x.h:123
@ LTC268X_VOLTAGE_RANGE_0V_5V
Definition: ltc268x.h:91
enum ltc268x_voltage_range crt_range[16]
Definition: ltc268x.h:157
uint16_t pwd_dac_setting
Definition: ltc268x.h:154
uint16_t dither_toggle_en
Definition: ltc268x.h:139
@ LTC268X_TGP0
Definition: ltc268x.h:125
#define LTC268X_CH_DIT_PER(x)
Definition: ltc268x.h:76
@ LTC268X_DITH_PERIOD_8
Definition: ltc268x.h:105
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
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
int32_t ltc268x_set_pwr_dac(struct ltc268x_dev *dev, uint16_t setting)
Definition: ltc268x.c:136
#define LTC268X_CH_TD_SEL_MSK
Definition: ltc268x.h:73
#define LTC268X_CMD_CH_CODE_UPDATE(x, id)
Definition: ltc268x.h:50
int32_t ltc268x_software_toggle(struct ltc268x_dev *dev, uint8_t channel)
Definition: ltc268x.c:336
#define LTC268X_CMD_UPDATE_ALL
Definition: ltc268x.h:65
enum ltc268x_a_b_register reg_select[16]
Definition: ltc268x.h:147
@ LTC268X_VOLTAGE_RANGE_M5V_5V
Definition: ltc268x.h:93
#define LTC268X_READ_OPERATION
Definition: ltc268x.h:68
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
int32_t ltc268x_software_reset(struct ltc268x_dev *dev)
Definition: ltc268x.c:358
ltc268x_device_id
Definition: ltc268x.h:130
int32_t ltc268x_set_dither_phase(struct ltc268x_dev *dev, uint8_t channel, enum ltc268x_dither_phase phase)
Definition: ltc268x.c:234
int32_t ltc268x_set_dither_toggle(struct ltc268x_dev *dev, uint16_t setting)
Definition: ltc268x.c:157
#define LTC268X_CMD_NOOP
Definition: ltc268x.h:66
struct no_os_spi_desc * spi_desc
Definition: ltc268x.h:136
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
enum ltc268x_clk_input clk_input[16]
Definition: ltc268x.h:160
ltc268x_dither_phase
Definition: ltc268x.h:111
@ LTC268X_DITH_PERIOD_64
Definition: ltc268x.h:108
@ LTC268X_DITH_PERIOD_4
Definition: ltc268x.h:104
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
int max
Definition: ltc268x.h:100
enum ltc268x_dither_phase dither_phase[16]
Definition: ltc268x.h:144
int32_t ltc268x_remove(struct ltc268x_dev *dev)
Free the resources allocated by ltc268x_init().
Definition: ltc268x.c:501
@ LTC2688
Definition: ltc268x.h:132
Header file of utility functions.
ltc268x_dither_period
Definition: ltc268x.h:103
#define LTC268X_CH_DIT_PH(x)
Definition: ltc268x.h:78
@ LTC268X_DITH_PERIOD_32
Definition: ltc268x.h:107
@ LTC268X_DITH_PHASE_90
Definition: ltc268x.h:113
bool dither_mode[16]
Definition: ltc268x.h:140
Definition: ltc268x.h:135
int32_t ltc268x_set_pwr_dac(struct ltc268x_dev *dev, uint16_t setting)
Definition: ltc268x.c:136
@ LTC268X_VOLTAGE_RANGE_M15V_15V
Definition: ltc268x.h:95
Error macro definition for ARM Compiler.
uint8_t num_channels
Definition: ltc268x.h:142
@ LTC268X_TGP1
Definition: ltc268x.h:126
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
enum ltc268x_clk_input clk_input[16]
Definition: ltc268x.h:146
int32_t ltc268x_software_reset(struct ltc268x_dev *dev)
Definition: ltc268x.c:358