Go to the documentation of this file.
49 #define LTC6953_NUM_REGADDR 57
52 #define LTC6953_REG_VCO_STATUS 0x00
53 #define LTC6953_REG_STAT 0x01
54 #define LTC6953_REG_PD_CTL 0x02
55 #define LTC6953_REG_CHAN_POWER_DOWN(x) 0x03 + (x / 4)
56 #define LTC6953_REG_TEMP 0x05
57 #define LTC6953_REG_SYNC_CONFIG 0x0B
58 #define LTC6953_REG_OUTPUT_DIVIDER(x) 0x0C + (x * 4)
59 #define LTC6953_REG_OUTPUT_CONFIG(x) 0x0D + (x * 4)
60 #define LTC6953_REG_DDEL_HIGH(x) 0x0D + (x * 4)
61 #define LTC6953_REG_DDEL_LOW(x) 0x0E + (x * 4)
62 #define LTC6953_REG_ADEL(x) 0x0F + (x * 4)
63 #define LTC6953_REG_CHIP_INFO 0x38
66 #define LTC6953_VCOOK_MSK NO_OS_BIT(2)
67 #define LTC6953_NVCOOK_MSK NO_OS_BIT(3)
70 #define LTC6953_INVSTAT_MSK NO_OS_BIT(7)
71 #define LTC6953_STAT_OUT_MSK NO_OS_GENMASK(6, 0)
74 #define LTC6953_PDALL_MSK NO_OS_BIT(7)
75 #define LTC6953_PDVCOPK_MSK NO_OS_BIT(5)
76 #define LTC6953_FILTV_MSK NO_OS_BIT(1)
77 #define LTC6953_POR_MSK NO_OS_BIT(0)
80 #define LTC6953_PD_MSK(ch) NO_OS_GENMASK( \
81 ((ch) & NO_OS_GENMASK(1, 0)) * 2 + 1, \
82 ((ch) & NO_OS_GENMASK(1, 0)) * 2)
83 #define LTC6953_PD(ch, x) no_os_field_prep(LTC6953_PD_MSK(ch), x)
86 #define LTC6953_TEMPO_MSK NO_OS_BIT(7)
89 #define LTC6953_EZMD_MSK NO_OS_BIT(4)
90 #define LTC6953_SRQMD_MSK NO_OS_BIT(3)
91 #define LTC6953_SYSCT_MSK NO_OS_GENMASK(2, 1)
92 #define LTC6953_SSRQ_MSK NO_OS_BIT(0)
95 #define LTC6953_MP_MSK NO_OS_GENMASK(7, 3)
96 #define LTC6953_MD_MSK NO_OS_GENMASK(2, 0)
99 #define LTC6953_SRQEN_MSK NO_OS_BIT(7)
100 #define LTC6953_MODE_MSK NO_OS_GENMASK(6, 5)
101 #define LTC6953_OINV_MSK NO_OS_BIT(4)
102 #define LTC6953_DDEL_HIGH_MSK NO_OS_GENMASK(3, 0)
105 #define LTC6953_DDEL_LOW_MSK NO_OS_GENMASK(7, 0)
108 #define LTC6953_ADEL_MSK NO_OS_GENMASK(5, 0)
111 #define LTC6953_REV_MSK NO_OS_GENMASK(7, 4)
112 #define LTC6953_PART_MSK NO_OS_GENMASK(3, 0)
114 #define LTC6953_NUM_CHAN 11
116 #define LTC6953_OUT_DIV_MIN 1
117 #define LTC6953_OUT_DIV_MAX 1048576
118 #define LTC6953_X_MAX 127
120 #define LTC6953_ADDRX 0
121 #define LTC6953_DXMSB 1
122 #define LTC6953_NUMBITS 2
123 #define LTC6953_R_ONLY 3
126 #define LTC6953_SPI_WRITE_CMD 0x00
127 #define LTC6953_SPI_READ_CMD 0x01
128 #define LTC6953_SPI_ADDR_CMD(x) ((x) << 1)
129 #define LTC6953_BUFF_SIZE_BYTES 2
130 #define LTC6953_DUMMY_BYTES 0x00
199 uint8_t mask, uint8_t data);
274 #endif // __LTC6953_H__
#define LTC6953_BUFF_SIZE_BYTES
Definition: ltc6953.h:129
int8_t extended_name[16]
Definition: ltc6953.h:150
int ltc6953_ssrq_mode(struct ltc6953_dev *dev, bool is_en)
Set LTC6953 SSRQ mode.
Definition: ltc6953.c:443
int ltc6953_reset(struct ltc6953_dev *device)
Software reset of the device.
Definition: ltc6953.c:112
#define LTC6953_INVSTAT_MSK
Definition: ltc6953.h:70
#define LTC6953_REG_DDEL_LOW(x)
Definition: ltc6953.h:61
int ltc6953_enable_temp_stat(struct ltc6953_dev *dev, bool is_en)
Set LTC6953 TEMPO value.
Definition: ltc6953.c:470
struct ltc6953_channel_spec chans[LTC6953_NUM_CHAN]
Definition: ltc6953.h:171
#define LTC6953_EZMD_MSK
Definition: ltc6953.h:89
int ltc6953_read_rev(struct ltc6953_dev *dev, uint8_t *rev)
Read LTC6953 Part number.
Definition: ltc6953.c:569
uint8_t analog_delay
Definition: ltc6953.h:147
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
int ltc6953_enable_sync(struct ltc6953_dev *dev, uint32_t channel, bool enable)
Set LTC6953 Channel Sync mode.
Definition: ltc6953.c:314
int ltc6953_set_analog_delay(struct ltc6953_dev *dev, uint32_t channel, uint16_t delay)
Set analog delay/phase of LTC6953 output channel.
Definition: ltc6953.c:364
Header file of SPI Interface.
int ltc6953_ezsync_mode(struct ltc6953_dev *dev, bool is_en)
Set LTC6953 EZSYNC mode.
Definition: ltc6953.c:419
#define LTC6953_SRQEN_MSK
Definition: ltc6953.h:99
struct ltc6953_channel_spec chans[LTC6953_NUM_CHAN]
Definition: ltc6953.h:160
int ltc6953_ssrq_mode(struct ltc6953_dev *dev, bool is_en)
Set LTC6953 SSRQ mode.
Definition: ltc6953.c:443
LTC6953 Initialization Parameters structure.
Definition: ltc6953.h:157
int ltc6953_power_down_all(struct ltc6953_dev *dev, bool is_pwdn)
Powers down all LTC6953 output channels.
Definition: ltc6953.c:211
int ltc6953_set_mode(struct ltc6953_dev *dev, uint32_t channel, uint8_t mode)
Set LTC6953 output channel mode.
Definition: ltc6953.c:384
uint8_t mp
Definition: ltc6953.h:144
int ltc6953_update(struct ltc6953_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t data)
Update LTC6953 register.
Definition: ltc6953.c:171
float vco_frequency
Definition: ltc6953.h:161
uint8_t out_divider
Definition: ltc6953.h:143
int ltc6953_get_invstat(struct ltc6953_dev *dev, bool *status)
Read LTC6953 INVSTAT bit.
Definition: ltc6953.c:502
Definition: ad9361_util.h:69
#define LTC6953_TEMPO_MSK
Definition: ltc6953.h:86
int ltc6953_enable_filter(struct ltc6953_dev *dev, bool is_en)
Enable LTC6953 VCO Input filter.
Definition: ltc6953.c:223
uint8_t power_down_mode
Definition: ltc6953.h:149
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
int ltc6953_power_down_vco(struct ltc6953_dev *dev, bool is_pwdn)
Powers down LTC6953 VCO Input channel.
Definition: ltc6953.c:235
#define LTC6953_X_MAX
Definition: ltc6953.h:118
#define LTC6953_DDEL_HIGH_MSK
Definition: ltc6953.h:102
#define LTC6953_REG_ADEL(x)
Definition: ltc6953.h:62
bool
Definition: common.h:48
#define LTC6953_PD(ch, x)
Definition: ltc6953.h:83
#define LTC6953_REG_VCO_STATUS
Definition: ltc6953.h:52
uint8_t digital_delay
Definition: ltc6953.h:146
struct no_os_spi_desc * spi_desc
Definition: ltc6953.h:170
#define LTC6953_OINV_MSK
Definition: ltc6953.h:101
int ltc6953_power_down_vco(struct ltc6953_dev *dev, bool is_pwdn)
Powers down LTC6953 VCO Input channel.
Definition: ltc6953.c:235
int ltc6953_num_pulse(struct ltc6953_dev *dev, uint8_t num_pulse)
Set LTC6953 SYSCT/Num pulse value.
Definition: ltc6953.c:455
int ltc6953_set_analog_delay(struct ltc6953_dev *dev, uint32_t channel, uint16_t delay)
Set analog delay/phase of LTC6953 output channel.
Definition: ltc6953.c:364
#define LTC6953_ADEL_MSK
Definition: ltc6953.h:108
#define LTC6953_POR_MSK
Definition: ltc6953.h:77
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
#define LTC6953_SSRQ_MSK
Definition: ltc6953.h:92
int ltc6953_sync_mode(struct ltc6953_dev *dev, bool is_en)
Set LTC6953 SRQ mode.
Definition: ltc6953.c:431
int ltc6953_num_pulse(struct ltc6953_dev *dev, uint8_t num_pulse)
Set LTC6953 SYSCT/Num pulse value.
Definition: ltc6953.c:455
int ltc6953_set_mode(struct ltc6953_dev *dev, uint32_t channel, uint8_t mode)
Set LTC6953 output channel mode.
Definition: ltc6953.c:384
#define LTC6953_REG_CHAN_POWER_DOWN(x)
Definition: ltc6953.h:55
int ltc6953_remove(struct ltc6953_dev *dev)
Free resources allocated for LTC6953.
Definition: ltc6953.c:192
int ltc6953_update(struct ltc6953_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t data)
Update LTC6953 register.
Definition: ltc6953.c:171
int ltc6953_get_x(struct ltc6953_dev *dev, uint8_t *x)
Set LTC6953 x bitfield status.
Definition: ltc6953.c:549
int ltc6953_reset(struct ltc6953_dev *dev)
Software reset of the device.
Definition: ltc6953.c:112
int ltc6953_remove(struct ltc6953_dev *dev)
Free resources allocated for LTC6953.
Definition: ltc6953.c:192
#define LTC6953_SRQMD_MSK
Definition: ltc6953.h:90
int ltc6953_invert_output(struct ltc6953_dev *dev, uint32_t channel, bool is_invert)
Set LTC6953 output channel inversion.
Definition: ltc6953.c:403
int ltc6953_set_invstat(struct ltc6953_dev *dev, bool status)
Write LTC6953 INVSTAT bit.
Definition: ltc6953.c:522
int ltc6953_write(struct ltc6953_dev *dev, uint8_t reg_addr, uint16_t data)
Writes data to LTC6953 over SPI.
Definition: ltc6953.c:125
int ltc6953_set_x(struct ltc6953_dev *dev, uint8_t x)
Set LTC6953 x bitfield status.
Definition: ltc6953.c:534
int ltc6953_read_rev(struct ltc6953_dev *dev, uint8_t *rev)
Read LTC6953 Part number.
Definition: ltc6953.c:569
int ltc6953_init(struct ltc6953_dev **device, struct ltc6953_init_param *init_param)
Initializes the SPI communication with LTC6953.
Definition: ltc6953.c:77
int ltc6953_enable_filter(struct ltc6953_dev *dev, bool is_en)
Enable LTC6953 VCO Input filter.
Definition: ltc6953.c:223
#define LTC6953_REG_STAT
Definition: ltc6953.h:53
#define LTC6953_SPI_READ_CMD
Definition: ltc6953.h:127
struct no_os_spi_init_param spi_init
Definition: ltc6953.h:159
int ltc6953_read(struct ltc6953_dev *dev, uint8_t reg_addr, uint8_t *data)
Read device register.
Definition: ltc6953.c:145
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
uint8_t sysref_mode
Definition: ltc6953.h:148
int ltc6953_set_output_divider(struct ltc6953_dev *dev, uint32_t channel, uint32_t divider)
Set output divider for LTC6953 output channel.
Definition: ltc6953.c:248
#define LTC6953_DDEL_LOW_MSK
Definition: ltc6953.h:105
int ltc6953_write(struct ltc6953_dev *dev, uint8_t addr, uint16_t data)
Writes data to LTC6953 over SPI.
Definition: ltc6953.c:125
int ltc6953_invert_output(struct ltc6953_dev *dev, uint32_t channel, bool is_invert)
Set LTC6953 output channel inversion.
Definition: ltc6953.c:403
Output channel configuration.
Definition: ltc6953.h:141
#define LTC6953_PART_MSK
Definition: ltc6953.h:112
int ltc6953_sync_mode(struct ltc6953_dev *dev, bool is_en)
Set LTC6953 SRQ mode.
Definition: ltc6953.c:431
int ltc6953_set_digital_delay(struct ltc6953_dev *dev, uint32_t channel, uint16_t delay)
Set digital delay/phase of LTC6953 output channel.
Definition: ltc6953.c:332
#define LTC6953_VCOOK_MSK
Definition: ltc6953.h:66
#define LTC6953_REV_MSK
Definition: ltc6953.h:111
#define LTC6953_NUM_REGADDR
Definition: ltc6953.h:49
int ltc6953_power_mode(struct ltc6953_dev *dev, uint32_t channel, int32_t mode)
Set LTC6953 Channel Power Mode.
Definition: ltc6953.c:294
#define LTC6953_MP_MSK
Definition: ltc6953.h:95
#define LTC6953_REG_TEMP
Definition: ltc6953.h:56
int ltc6953_get_invstat(struct ltc6953_dev *dev, bool *status)
Read LTC6953 INVSTAT bit.
Definition: ltc6953.c:502
#define LTC6953_FILTV_MSK
Definition: ltc6953.h:76
int ltc6953_read(struct ltc6953_dev *dev, uint8_t addr, uint8_t *data)
Read device register.
Definition: ltc6953.c:145
int ltc6953_get_x(struct ltc6953_dev *dev, uint8_t *x)
Set LTC6953 x bitfield status.
Definition: ltc6953.c:549
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
int ltc6953_enable_sync(struct ltc6953_dev *dev, uint32_t channel, bool enable)
Set LTC6953 Channel Sync mode.
Definition: ltc6953.c:314
int ltc6953_set_output_divider(struct ltc6953_dev *dev, uint32_t channel, uint32_t divider)
Set output divider for LTC6953 output channel.
Definition: ltc6953.c:248
#define LTC6953_MODE_MSK
Definition: ltc6953.h:100
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
#define LTC6953_REG_OUTPUT_DIVIDER(x)
Definition: ltc6953.h:58
int ltc6953_vco_status(struct ltc6953_dev *dev, bool *is_ok)
Read LTC6953 Check VCO Input stats.
Definition: ltc6953.c:482
#define LTC6953_REG_PD_CTL
Definition: ltc6953.h:54
int ltc6953_set_x(struct ltc6953_dev *dev, uint8_t x)
Set LTC6953 x bitfield status.
Definition: ltc6953.c:534
#define LTC6953_PD_MSK(ch)
Definition: ltc6953.h:80
#define no_os_shift_right(x, s)
Definition: no_os_util.h:119
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
float vco_frequency
Definition: ltc6953.h:172
int ltc6953_read_part(struct ltc6953_dev *dev, uint8_t *part)
Read LTC6953 Part number.
Definition: ltc6953.c:590
int ltc6953_enable_temp_stat(struct ltc6953_dev *dev, bool is_en)
Set LTC6953 TEMPO value.
Definition: ltc6953.c:470
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
#define LTC6953_SPI_WRITE_CMD
Definition: ltc6953.h:126
uint8_t num
Definition: ltc6953.h:142
#define LTC6953_REG_CHIP_INFO
Definition: ltc6953.h:63
int ltc6953_read_part(struct ltc6953_dev *dev, uint8_t *part)
Read LTC6953 Part number.
Definition: ltc6953.c:590
int ltc6953_set_digital_delay(struct ltc6953_dev *dev, uint32_t channel, uint16_t delay)
Set digital delay/phase of LTC6953 output channel.
Definition: ltc6953.c:332
uint8_t md
Definition: ltc6953.h:145
int ltc6953_vco_status(struct ltc6953_dev *dev, bool *is_ok)
Read LTC6953 Check VCO Input stats.
Definition: ltc6953.c:482
#define LTC6953_PDALL_MSK
Definition: ltc6953.h:74
int ltc6953_power_mode(struct ltc6953_dev *dev, uint32_t channel, int32_t mode)
Set LTC6953 Channel Power Mode.
Definition: ltc6953.c:294
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
#define LTC6953_SPI_ADDR_CMD(x)
Definition: ltc6953.h:128
Implementation of LTC6953 Driver.
int ltc6953_set_invstat(struct ltc6953_dev *dev, bool status)
Write LTC6953 INVSTAT bit.
Definition: ltc6953.c:522
Header file of utility functions.
#define LTC6953_MD_MSK
Definition: ltc6953.h:96
int ltc6953_init(struct ltc6953_dev **dev, struct ltc6953_init_param *init_param)
Initializes the SPI communication with LTC6953.
Definition: ltc6953.c:77
#define LTC6953_SYSCT_MSK
Definition: ltc6953.h:91
LTC6953 Device Descriptor.
Definition: ltc6953.h:168
int ltc6953_power_down_all(struct ltc6953_dev *dev, bool is_pwdn)
Powers down all LTC6953 output channels.
Definition: ltc6953.c:211
#define LTC6953_REG_OUTPUT_CONFIG(x)
Definition: ltc6953.h:59
#define LTC6953_REG_DDEL_HIGH(x)
Definition: ltc6953.h:60
Error macro definition for ARM Compiler.
#define LTC6953_PDVCOPK_MSK
Definition: ltc6953.h:75
#define LTC6953_REG_SYNC_CONFIG
Definition: ltc6953.h:57
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
int ltc6953_ezsync_mode(struct ltc6953_dev *dev, bool is_en)
Set LTC6953 EZSYNC mode.
Definition: ltc6953.c:419
#define LTC6953_NUM_CHAN
Definition: ltc6953.h:114
#define LTC6953_STAT_OUT_MSK
Definition: ltc6953.h:71