Go to the documentation of this file.
45 #define ADGS1408_REG_SW_DATA 0x01
46 #define ADGS1408_REG_ERR_CONFIG 0x02
47 #define ADGS1408_REG_ERR_FLAGS 0x03
48 #define ADGS1408_REG_BURST_EN 0x05
49 #define ADGS1408_REG_ROUND_ROBIN_EN 0x06
50 #define ADGS1408_REG_RROBIN_CHANNEL_CONFIG 0x07
51 #define ADGS1408_REG_CNV_EDGE_SEL 0x09
52 #define ADGS1408_REG_SOFT_RESETB 0x0B
55 #define ADGS1408_SW1_EN 0x01
56 #define ADGS1408_SW2_EN 0x03
57 #define ADGS1408_SW3_EN 0x05
58 #define ADGS1408_SW4_EN 0x07
59 #define ADGS1408_SW5_EN 0x09
60 #define ADGS1408_SW6_EN 0x0B
61 #define ADGS1408_SW7_EN 0x0D
62 #define ADGS1408_SW8_EN 0x0F
65 #define ADGS1409_SW1_EN 0x01
66 #define ADGS1409_SW2_EN 0x03
67 #define ADGS1409_SW3_EN 0x05
68 #define ADGS1409_SW4_EN 0x07
71 #define ADGS1408_RW_ERR_EN (1 << 2)
72 #define ADGS1408_SCLK_ERR_EN (1 << 1)
73 #define ADGS1408_CRC_ERR_EN (1 << 0)
76 #define ADGS1408_RW_ERR_FLAG (1 << 2)
77 #define ADGS1408_SCLK_ERR_FLAG (1 << 1)
78 #define ADGS1408_CRC_ERR_FLAG (1 << 0)
79 #define ADGS1408_CLR_1 0x6C
80 #define ADGS1408_CLR_2 0xA9
83 #define ADGS1408_BURST_MODE_EN (1 << 0)
86 #define ADGS1408_ROUND_ROBIN_EN (1 << 0)
89 #define ADGS1408_RROBIN_SW1(x) (((x) & 0x1) << 0)
90 #define ADGS1408_RROBIN_SW2(x) (((x) & 0x1) << 1)
91 #define ADGS1408_RROBIN_SW3(x) (((x) & 0x1) << 2)
92 #define ADGS1408_RROBIN_SW4(x) (((x) & 0x1) << 3)
93 #define ADGS1408_RROBIN_SW5(x) (((x) & 0x1) << 4)
94 #define ADGS1408_RROBIN_SW6(x) (((x) & 0x1) << 5)
95 #define ADGS1408_RROBIN_SW7(x) (((x) & 0x1) << 6)
96 #define ADGS1408_RROBIN_SW8(x) (((x) & 0x1) << 7)
99 #define ADGS1408_RROBIN_SW1(x) (((x) & 0x1) << 0)
100 #define ADGS1408_RROBIN_SW2(x) (((x) & 0x1) << 1)
101 #define ADGS1408_RROBIN_SW3(x) (((x) & 0x1) << 2)
102 #define ADGS1408_RROBIN_SW4(x) (((x) & 0x1) << 3)
105 #define ADGS1408_CNV_EDGE_RISING (1 << 0)
108 #define ADGS1408_SOFT_RESETB(x) (((x) & 0xFF) << 0)
109 #define ADGS1408_RESET_1 0xA3
110 #define ADGS1408_RESET_2 0x05
112 #define ADGS1408_DAISY_CHAIN_1 0x25
113 #define ADGS1408_DAISY_CHAIN_2 0x00
116 #define ADGS1408_RROBIN_EXIT_1 0xA3
117 #define ADGS1408_RROBIN_EXIT_2 0x18
118 #define ADGS1408_RROBIN_EXIT_3 0xE3
119 #define ADGS1408_RROBIN_EXIT_4 0xB4
121 #define ADGS1408_ALIGNMENT 0x25
123 #define ADGS1408_CRC8_POLY 0x07
211 uint8_t cnv_polarity);
219 #endif // ADGS1408_H_
#define ADGS1408_REG_ROUND_ROBIN_EN
Definition: adgs1408.h:49
enum adgs1408_state burst_mode_en
Definition: adgs1408.h:154
int32_t adgs1408_configure_round_robin(struct adgs1408_dev *dev, uint8_t cnv_polarity)
Definition: adgs1408.c:320
int32_t adgs1408_clear_err_flags(struct adgs1408_dev *dev)
Definition: adgs1408.c:226
int32_t adgs1408_remove(struct adgs1408_dev *dev)
Free the resources allocated by adgs1408_init().
Definition: adgs1408.c:448
struct adgs1408_rrobin_config rrobin_sw_config
Definition: adgs1408.h:157
int32_t adgs1408_spi_reg_write_mask(struct adgs1408_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t data)
Definition: adgs1408.c:172
#define ADGS1408_RESET_2
Definition: adgs1408.h:110
#define ADGS1408_BURST_MODE_EN
Definition: adgs1408.h:83
uint8_t adgs1408_compute_crc8(uint8_t *data, uint8_t data_size)
Definition: adgs1408.c:53
#define ADGS1408_DAISY_CHAIN_2
Definition: adgs1408.h:113
int32_t adgs1408_do_soft_reset(struct adgs1408_dev *dev)
Definition: adgs1408.c:200
int32_t adgs1408_exit_round_robin(struct adgs1408_dev *dev)
Definition: adgs1408.c:361
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
bool rrobin_sw8
Definition: adgs1408.h:146
Header file of SPI Interface.
int32_t adgs1408_spi_reg_read(struct adgs1408_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Definition: adgs1408.c:82
enum adgs1408_state burst_mode_en
Definition: adgs1408.h:166
enum adgs1408_state daisy_chain_en
Definition: adgs1408.h:155
#define ADGS1408_REG_ERR_CONFIG
Definition: adgs1408.h:46
struct no_os_spi_init_param spi_init
Definition: adgs1408.h:163
@ ID_ADGS1409
Definition: adgs1408.h:130
#define ADGS1408_RROBIN_SW8(x)
Definition: adgs1408.h:96
int32_t adgs1408_enter_daisy_chain(struct adgs1408_dev *dev)
Definition: adgs1408.c:253
#define ADGS1408_ROUND_ROBIN_EN
Definition: adgs1408.h:86
bool rrobin_sw5
Definition: adgs1408.h:143
int32_t adgs1408_do_soft_reset(struct adgs1408_dev *dev)
Definition: adgs1408.c:200
#define ADGS1408_DAISY_CHAIN_1
Definition: adgs1408.h:112
Definition: ad9361_util.h:69
@ ADGS1408_ENABLE
Definition: adgs1408.h:134
#define ADGS1408_ALIGNMENT
Definition: adgs1408.h:121
bool rrobin_sw7
Definition: adgs1408.h:145
Definition: adgs1408.h:161
#define ADGS1408_REG_CNV_EDGE_SEL
Definition: adgs1408.h:51
#define ADGS1408_RROBIN_SW3(x)
Definition: adgs1408.h:101
int32_t adgs1408_init(struct adgs1408_dev **device, struct adgs1408_init_param init_param)
Definition: adgs1408.c:386
Header file of ADGS1408 Driver.
#define ADGS1408_RROBIN_SW7(x)
Definition: adgs1408.h:95
@ ADGS1408_DISABLE
Definition: adgs1408.h:135
#define ADGS1408_CLR_1
Definition: adgs1408.h:79
bool rrobin_sw6
Definition: adgs1408.h:144
bool rrobin_sw3
Definition: adgs1408.h:141
int32_t adgs1408_send_daisy_chain_cmds(struct adgs1408_dev *dev, uint8_t *cmds, uint8_t cmds_size)
Definition: adgs1408.c:277
Definition: adgs1408.h:138
#define ADGS1408_RESET_1
Definition: adgs1408.h:109
int32_t adgs1408_spi_reg_read_mask(struct adgs1408_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t *data)
int32_t adgs1408_enter_daisy_chain(struct adgs1408_dev *dev)
Definition: adgs1408.c:253
enum adgs1408_type act_device
Definition: adgs1408.h:158
int32_t adgs1408_enter_round_robin(struct adgs1408_dev *dev)
Definition: adgs1408.c:297
int32_t adgs1408_enter_round_robin(struct adgs1408_dev *dev)
Definition: adgs1408.c:297
@ ID_ADGS1408
Definition: adgs1408.h:129
struct no_os_spi_desc * spi_desc
Definition: adgs1408.h:151
int32_t adgs1408_init(struct adgs1408_dev **device, struct adgs1408_init_param init_param)
Definition: adgs1408.c:386
enum adgs1408_state daisy_chain_en
Definition: adgs1408.h:167
#define ADGS1408_RROBIN_SW6(x)
Definition: adgs1408.h:94
enum adgs1408_type act_device
Definition: adgs1408.h:170
int32_t adgs1408_spi_reg_write(struct adgs1408_dev *dev, uint8_t reg_addr, uint8_t reg_data)
Definition: adgs1408.c:134
enum adgs1408_state round_robin_en
Definition: adgs1408.h:156
#define ADGS1408_REG_BURST_EN
Definition: adgs1408.h:48
enum adgs1408_state round_robin_en
Definition: adgs1408.h:168
int32_t adgs1408_configure_round_robin(struct adgs1408_dev *dev, uint8_t cnv_polarity)
Definition: adgs1408.c:320
int32_t adgs1408_spi_reg_write(struct adgs1408_dev *dev, uint8_t reg_addr, uint8_t reg_data)
Definition: adgs1408.c:134
adgs1408_type
Definition: adgs1408.h:128
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
bool rrobin_sw2
Definition: adgs1408.h:140
int32_t adgs1408_exit_round_robin(struct adgs1408_dev *dev)
Definition: adgs1408.c:361
#define ADGS1408_RROBIN_SW4(x)
Definition: adgs1408.h:102
Definition: adgs1408.h:149
int32_t adgs1408_spi_reg_write_mask(struct adgs1408_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t data)
Definition: adgs1408.c:172
#define ADGS1408_RROBIN_SW5(x)
Definition: adgs1408.h:93
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
#define ADGS1408_REG_SOFT_RESETB
Definition: adgs1408.h:52
enum adgs1408_state crc_en
Definition: adgs1408.h:165
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
enum adgs1408_state crc_en
Definition: adgs1408.h:153
bool rrobin_sw4
Definition: adgs1408.h:142
#define ADGS1408_CRC_ERR_EN
Definition: adgs1408.h:73
#define ADGS1408_RROBIN_EXIT_4
Definition: adgs1408.h:119
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
adgs1408_state
Definition: adgs1408.h:133
struct adgs1408_rrobin_config rrobin_sw_config
Definition: adgs1408.h:169
int32_t adgs1408_remove(struct adgs1408_dev *dev)
Free the resources allocated by adgs1408_init().
Definition: adgs1408.c:448
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 ADGS1408_RROBIN_EXIT_1
Definition: adgs1408.h:116
#define ADGS1408_RROBIN_EXIT_3
Definition: adgs1408.h:118
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 ADGS1408_RROBIN_EXIT_2
Definition: adgs1408.h:117
#define ADGS1408_RROBIN_SW2(x)
Definition: adgs1408.h:100
int32_t adgs1408_send_daisy_chain_cmds(struct adgs1408_dev *dev, uint8_t *cmds, uint8_t cmds_size)
Definition: adgs1408.c:277
uint8_t adgs1408_compute_crc8(uint8_t *data, uint8_t data_size)
Definition: adgs1408.c:53
#define ADGS1408_REG_RROBIN_CHANNEL_CONFIG
Definition: adgs1408.h:50
#define ADGS1408_CLR_2
Definition: adgs1408.h:80
int32_t adgs1408_clear_err_flags(struct adgs1408_dev *dev)
Definition: adgs1408.c:226
int32_t adgs1408_spi_reg_read(struct adgs1408_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Definition: adgs1408.c:82
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
#define ADGS1408_CRC8_POLY
Definition: adgs1408.h:123
bool rrobin_sw1
Definition: adgs1408.h:139
#define ADGS1408_RROBIN_SW1(x)
Definition: adgs1408.h:99