Go to the documentation of this file.
45 #define ADGS5412_REG_SW_DATA 0x01
46 #define ADGS5412_REG_ERR_CONFIG 0x02
47 #define ADGS5412_REG_ERR_FLAGS 0x03
48 #define ADGS5412_REG_BURST_EN 0x05
49 #define ADGS5412_REG_SOFT_RESETB 0x0B
52 #define ADGS5412_SW4_EN (1 << 3)
53 #define ADGS5412_SW3_EN (1 << 2)
54 #define ADGS5412_SW2_EN (1 << 1)
55 #define ADGS5412_SW1_EN (1 << 0)
58 #define ADGS5414_SW7_EN (1 << 7)
59 #define ADGS5414_SW6_EN (1 << 6)
60 #define ADGS5414_SW5_EN (1 << 5)
61 #define ADGS5414_SW4_EN (1 << 4)
62 #define ADGS5414_SW3_EN (1 << 3)
63 #define ADGS5414_SW2_EN (1 << 2)
64 #define ADGS5414_SW1_EN (1 << 1)
65 #define ADGS5414_SW0_EN (1 << 0)
68 #define ADGS5412_RW_ERR_EN (1 << 2)
69 #define ADGS5412_SCLK_ERR_EN (1 << 1)
70 #define ADGS5412_CRC_ERR_EN (1 << 0)
73 #define ADGS5412_RW_ERR_FLAG (1 << 2)
74 #define ADGS5412_SCLK_ERR_FLAG (1 << 1)
75 #define ADGS5412_CRC_ERR_FLAG (1 << 0)
76 #define ADGS5412_CLR_1 0x6C
77 #define ADGS5412_CLR_2 0xA9
80 #define ADGS5412_BURST_MODE_EN (1 << 0)
83 #define ADGS5412_SOFT_RESETB(x) (((x) & 0xFF) << 0)
84 #define ADGS5412_RESET_1 0xA3
85 #define ADGS5412_RESET_2 0x05
87 #define ADGS5412_DAISY_CHAIN_1 0x25
88 #define ADGS5412_DAISY_CHAIN_2 0x00
90 #define ADGS5412_ALIGNMENT 0x25
92 #define ADGS5412_CRC8_POLY 0x07
159 #endif // ADGS5412_H_
#define ADGS5412_CRC_ERR_EN
Definition: adgs5412.h:70
struct no_os_spi_desc * spi_desc
Definition: adgs5412.h:104
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
uint8_t adgs5412_compute_crc8(uint8_t *data, uint8_t data_size)
Definition: adgs5412.c:52
int32_t adgs5412_send_daisy_chain_cmds(adgs5412_dev *dev, uint8_t *cmds, uint8_t cmds_size)
Definition: adgs5412.c:295
#define ADGS5412_CLR_1
Definition: adgs5412.h:76
Header file of SPI Interface.
#define ADGS5412_CLR_2
Definition: adgs5412.h:77
adgs5412_state daisy_chain_en
Definition: adgs5412.h:108
@ ADGS5412_DISABLE
Definition: adgs5412.h:99
Definition: adgs5412.h:111
#define ADGS5412_RESET_1
Definition: adgs5412.h:84
int32_t adgs5412_remove(adgs5412_dev *dev)
Free the resources allocated by adgs5412_init().
Definition: adgs5412.c:372
@ ADGS5412_ENABLE
Definition: adgs5412.h:98
int32_t adgs5412_spi_reg_read(adgs5412_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Definition: adgs5412.c:80
Definition: ad9361_util.h:69
#define ADGS5412_ALIGNMENT
Definition: adgs5412.h:90
int32_t adgs5412_spi_reg_read_mask(adgs5412_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t *data)
Definition: adgs5412.c:162
adgs5412_state crc_en
Definition: adgs5412.h:106
Header file of ADGS5412 Driver.
int32_t adgs5412_enter_daisy_chain(adgs5412_dev *dev)
Definition: adgs5412.c:270
int32_t adgs5412_spi_reg_write_mask(adgs5412_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t data)
Definition: adgs5412.c:190
#define ADGS5412_REG_SOFT_RESETB
Definition: adgs5412.h:49
#define ADGS5412_REG_ERR_CONFIG
Definition: adgs5412.h:46
int32_t adgs5412_clear_err_flags(adgs5412_dev *dev)
Definition: adgs5412.c:242
#define ADGS5412_RESET_2
Definition: adgs5412.h:85
#define ADGS5412_CRC8_POLY
Definition: adgs5412.h:92
int32_t adgs5412_spi_reg_write(adgs5412_dev *dev, uint8_t reg_addr, uint8_t reg_data)
Definition: adgs5412.c:125
int32_t adgs5412_do_soft_reset(adgs5412_dev *dev)
Definition: adgs5412.c:217
int32_t adgs5412_init(adgs5412_dev **device, adgs5412_init_param init_param)
Definition: adgs5412.c:319
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
adgs5412_state crc_en
Definition: adgs5412.h:115
struct no_os_spi_init_param spi_init
Definition: common_data.c:120
int32_t adgs5412_spi_reg_read(adgs5412_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Definition: adgs5412.c:80
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
int32_t adgs5412_clear_err_flags(adgs5412_dev *dev)
Definition: adgs5412.c:242
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
uint8_t adgs5412_compute_crc8(uint8_t *data, uint8_t data_size)
Definition: adgs5412.c:52
#define ADGS5412_DAISY_CHAIN_1
Definition: adgs5412.h:87
int32_t adgs5412_spi_reg_read_mask(adgs5412_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t *data)
Definition: adgs5412.c:162
adgs5412_state burst_mode_en
Definition: adgs5412.h:116
adgs5412_state daisy_chain_en
Definition: adgs5412.h:117
int32_t adgs5412_spi_reg_write(adgs5412_dev *dev, uint8_t reg_addr, uint8_t reg_data)
Definition: adgs5412.c:125
int32_t adgs5412_do_soft_reset(adgs5412_dev *dev)
Definition: adgs5412.c:217
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
int32_t adgs5412_enter_daisy_chain(adgs5412_dev *dev)
Definition: adgs5412.c:270
int32_t adgs5412_spi_reg_write_mask(adgs5412_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t data)
Definition: adgs5412.c:190
int32_t adgs5412_init(adgs5412_dev **device, adgs5412_init_param init_param)
Definition: adgs5412.c:319
int32_t adgs5412_remove(adgs5412_dev *dev)
Free the resources allocated by adgs5412_init().
Definition: adgs5412.c:372
adgs5412_state
Definition: adgs5412.h:97
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 ADGS5412_DAISY_CHAIN_2
Definition: adgs5412.h:88
#define ADGS5412_REG_BURST_EN
Definition: adgs5412.h:48
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
int32_t adgs5412_send_daisy_chain_cmds(adgs5412_dev *dev, uint8_t *cmds, uint8_t cmds_size)
Definition: adgs5412.c:295
#define ADGS5412_BURST_MODE_EN
Definition: adgs5412.h:80
adgs5412_state burst_mode_en
Definition: adgs5412.h:107
Definition: adgs5412.h:102
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140