Header file of ADGS1408 Driver.
More...
#include <stdint.h>
#include "no_os_spi.h"
|
| uint8_t | adgs1408_compute_crc8 (uint8_t *data, uint8_t data_size) |
| |
| int32_t | adgs1408_spi_reg_read (struct adgs1408_dev *dev, uint8_t reg_addr, uint8_t *reg_data) |
| |
| int32_t | adgs1408_spi_reg_write (struct adgs1408_dev *dev, uint8_t reg_addr, uint8_t reg_data) |
| |
| int32_t | adgs1408_spi_reg_read_mask (struct adgs1408_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t *data) |
| |
| int32_t | adgs1408_spi_reg_write_mask (struct adgs1408_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t data) |
| |
| int32_t | adgs1408_do_soft_reset (struct adgs1408_dev *dev) |
| |
| int32_t | adgs1408_clear_err_flags (struct adgs1408_dev *dev) |
| |
| int32_t | adgs1408_enter_daisy_chain (struct adgs1408_dev *dev) |
| |
| int32_t | adgs1408_send_daisy_chain_cmds (struct adgs1408_dev *dev, uint8_t *cmds, uint8_t cmds_size) |
| |
| int32_t | adgs1408_enter_round_robin (struct adgs1408_dev *dev) |
| |
| int32_t | adgs1408_configure_round_robin (struct adgs1408_dev *dev, uint8_t cnv_polarity) |
| |
| int32_t | adgs1408_exit_round_robin (struct adgs1408_dev *dev) |
| |
| int32_t | adgs1408_init (struct adgs1408_dev **device, struct adgs1408_init_param init_param) |
| |
| int32_t | adgs1408_remove (struct adgs1408_dev *dev) |
| | Free the resources allocated by adgs1408_init().
|
| |
Header file of ADGS1408 Driver.
- Author
- Mircea Caprioru (mirce.nosp@m.a.ca.nosp@m.prior.nosp@m.u@an.nosp@m.alog..nosp@m.com)
Copyright 2018(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
◆ ADGS1408_ALIGNMENT
| #define ADGS1408_ALIGNMENT 0x25 |
◆ ADGS1408_BURST_MODE_EN
| #define ADGS1408_BURST_MODE_EN (1 << 0) |
◆ ADGS1408_CLR_1
| #define ADGS1408_CLR_1 0x6C |
◆ ADGS1408_CLR_2
| #define ADGS1408_CLR_2 0xA9 |
◆ ADGS1408_CNV_EDGE_RISING
| #define ADGS1408_CNV_EDGE_RISING (1 << 0) |
◆ ADGS1408_CRC8_POLY
| #define ADGS1408_CRC8_POLY 0x07 |
◆ ADGS1408_CRC_ERR_EN
| #define ADGS1408_CRC_ERR_EN (1 << 0) |
◆ ADGS1408_CRC_ERR_FLAG
| #define ADGS1408_CRC_ERR_FLAG (1 << 0) |
◆ ADGS1408_DAISY_CHAIN_1
| #define ADGS1408_DAISY_CHAIN_1 0x25 |
◆ ADGS1408_DAISY_CHAIN_2
| #define ADGS1408_DAISY_CHAIN_2 0x00 |
◆ ADGS1408_REG_BURST_EN
| #define ADGS1408_REG_BURST_EN 0x05 |
◆ ADGS1408_REG_CNV_EDGE_SEL
| #define ADGS1408_REG_CNV_EDGE_SEL 0x09 |
◆ ADGS1408_REG_ERR_CONFIG
| #define ADGS1408_REG_ERR_CONFIG 0x02 |
◆ ADGS1408_REG_ERR_FLAGS
| #define ADGS1408_REG_ERR_FLAGS 0x03 |
◆ ADGS1408_REG_ROUND_ROBIN_EN
| #define ADGS1408_REG_ROUND_ROBIN_EN 0x06 |
◆ ADGS1408_REG_RROBIN_CHANNEL_CONFIG
| #define ADGS1408_REG_RROBIN_CHANNEL_CONFIG 0x07 |
◆ ADGS1408_REG_SOFT_RESETB
| #define ADGS1408_REG_SOFT_RESETB 0x0B |
◆ ADGS1408_REG_SW_DATA
| #define ADGS1408_REG_SW_DATA 0x01 |
◆ ADGS1408_RESET_1
| #define ADGS1408_RESET_1 0xA3 |
◆ ADGS1408_RESET_2
| #define ADGS1408_RESET_2 0x05 |
◆ ADGS1408_ROUND_ROBIN_EN
| #define ADGS1408_ROUND_ROBIN_EN (1 << 0) |
◆ ADGS1408_RROBIN_EXIT_1
| #define ADGS1408_RROBIN_EXIT_1 0xA3 |
◆ ADGS1408_RROBIN_EXIT_2
| #define ADGS1408_RROBIN_EXIT_2 0x18 |
◆ ADGS1408_RROBIN_EXIT_3
| #define ADGS1408_RROBIN_EXIT_3 0xE3 |
◆ ADGS1408_RROBIN_EXIT_4
| #define ADGS1408_RROBIN_EXIT_4 0xB4 |
◆ ADGS1408_RROBIN_SW1 [1/2]
| #define ADGS1408_RROBIN_SW1 |
( |
| x | ) |
|
◆ ADGS1408_RROBIN_SW1 [2/2]
| #define ADGS1408_RROBIN_SW1 |
( |
| x | ) |
|
◆ ADGS1408_RROBIN_SW2 [1/2]
| #define ADGS1408_RROBIN_SW2 |
( |
| x | ) |
|
◆ ADGS1408_RROBIN_SW2 [2/2]
| #define ADGS1408_RROBIN_SW2 |
( |
| x | ) |
|
◆ ADGS1408_RROBIN_SW3 [1/2]
| #define ADGS1408_RROBIN_SW3 |
( |
| x | ) |
|
◆ ADGS1408_RROBIN_SW3 [2/2]
| #define ADGS1408_RROBIN_SW3 |
( |
| x | ) |
|
◆ ADGS1408_RROBIN_SW4 [1/2]
| #define ADGS1408_RROBIN_SW4 |
( |
| x | ) |
|
◆ ADGS1408_RROBIN_SW4 [2/2]
| #define ADGS1408_RROBIN_SW4 |
( |
| x | ) |
|
◆ ADGS1408_RROBIN_SW5
| #define ADGS1408_RROBIN_SW5 |
( |
| x | ) |
|
◆ ADGS1408_RROBIN_SW6
| #define ADGS1408_RROBIN_SW6 |
( |
| x | ) |
|
◆ ADGS1408_RROBIN_SW7
| #define ADGS1408_RROBIN_SW7 |
( |
| x | ) |
|
◆ ADGS1408_RROBIN_SW8
| #define ADGS1408_RROBIN_SW8 |
( |
| x | ) |
|
◆ ADGS1408_RW_ERR_EN
| #define ADGS1408_RW_ERR_EN (1 << 2) |
◆ ADGS1408_RW_ERR_FLAG
| #define ADGS1408_RW_ERR_FLAG (1 << 2) |
◆ ADGS1408_SCLK_ERR_EN
| #define ADGS1408_SCLK_ERR_EN (1 << 1) |
◆ ADGS1408_SCLK_ERR_FLAG
| #define ADGS1408_SCLK_ERR_FLAG (1 << 1) |
◆ ADGS1408_SOFT_RESETB
| #define ADGS1408_SOFT_RESETB |
( |
| x | ) |
|
◆ ADGS1408_SW1_EN
| #define ADGS1408_SW1_EN 0x01 |
◆ ADGS1408_SW2_EN
| #define ADGS1408_SW2_EN 0x03 |
◆ ADGS1408_SW3_EN
| #define ADGS1408_SW3_EN 0x05 |
◆ ADGS1408_SW4_EN
| #define ADGS1408_SW4_EN 0x07 |
◆ ADGS1408_SW5_EN
| #define ADGS1408_SW5_EN 0x09 |
◆ ADGS1408_SW6_EN
| #define ADGS1408_SW6_EN 0x0B |
◆ ADGS1408_SW7_EN
| #define ADGS1408_SW7_EN 0x0D |
◆ ADGS1408_SW8_EN
| #define ADGS1408_SW8_EN 0x0F |
◆ ADGS1409_SW1_EN
| #define ADGS1409_SW1_EN 0x01 |
◆ ADGS1409_SW2_EN
| #define ADGS1409_SW2_EN 0x03 |
◆ ADGS1409_SW3_EN
| #define ADGS1409_SW3_EN 0x05 |
◆ ADGS1409_SW4_EN
| #define ADGS1409_SW4_EN 0x07 |
◆ adgs1408_state
| Enumerator |
|---|
| ADGS1408_ENABLE | |
| ADGS1408_DISABLE | |
◆ adgs1408_type
| Enumerator |
|---|
| ID_ADGS1408 | |
| ID_ADGS1409 | |
◆ adgs1408_clear_err_flags()
| int32_t adgs1408_clear_err_flags |
( |
struct adgs1408_dev * | dev | ) |
|
Clear the Error Flags Register.
- Parameters
-
| dev | - The device structure. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ adgs1408_compute_crc8()
| uint8_t adgs1408_compute_crc8 |
( |
uint8_t * | data, |
|
|
uint8_t | data_size ) |
Compute CRC8 checksum.
- Parameters
-
| data | - The data buffer. |
| data_size | - The size of the data buffer. |
- Returns
- CRC8 checksum.
◆ adgs1408_configure_round_robin()
| int32_t adgs1408_configure_round_robin |
( |
struct adgs1408_dev * | dev, |
|
|
uint8_t | cnv_polarity ) |
Configure Round Robin Mode.
- Parameters
-
| dev | - The device structure. |
| cnv_polarity | - The CNV pin polarity. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ adgs1408_do_soft_reset()
Do a software reset.
- Parameters
-
| dev | - The device structure. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ adgs1408_enter_daisy_chain()
| int32_t adgs1408_enter_daisy_chain |
( |
struct adgs1408_dev * | dev | ) |
|
Enter Daisy-Chain Mode.
- Parameters
-
| dev | - The device structure. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ adgs1408_enter_round_robin()
| int32_t adgs1408_enter_round_robin |
( |
struct adgs1408_dev * | dev | ) |
|
Enter Round Robin Mode.
- Parameters
-
| dev | - The device structure. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ adgs1408_exit_round_robin()
| int32_t adgs1408_exit_round_robin |
( |
struct adgs1408_dev * | dev | ) |
|
Exit Round Robin Mode.
- Parameters
-
| dev | - The device structure. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ adgs1408_init()
Initialize the device.
- Parameters
-
| device | - The device structure. |
| init_param | - The structure that contains the device initial parameters. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ adgs1408_remove()
Free the resources allocated by adgs1408_init().
- Parameters
-
| dev | - The device structure. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ adgs1408_send_daisy_chain_cmds()
| int32_t adgs1408_send_daisy_chain_cmds |
( |
struct adgs1408_dev * | dev, |
|
|
uint8_t * | cmds, |
|
|
uint8_t | cmds_size ) |
Send Daisy-Chain commands.
- Parameters
-
| dev | - The device structure. |
| cmds | - The commands to be sent. |
| cmds_size | - The number of commands. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ adgs1408_spi_reg_read()
| int32_t adgs1408_spi_reg_read |
( |
struct adgs1408_dev * | dev, |
|
|
uint8_t | reg_addr, |
|
|
uint8_t * | reg_data ) |
SPI register read from device.
- Parameters
-
| dev | - The device structure. |
| reg_addr | - The register address. |
| reg_data | - The register data. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ adgs1408_spi_reg_read_mask()
| int32_t adgs1408_spi_reg_read_mask |
( |
struct adgs1408_dev * | dev, |
|
|
uint8_t | reg_addr, |
|
|
uint8_t | mask, |
|
|
uint8_t * | data ) |
◆ adgs1408_spi_reg_write()
| int32_t adgs1408_spi_reg_write |
( |
struct adgs1408_dev * | dev, |
|
|
uint8_t | reg_addr, |
|
|
uint8_t | reg_data ) |
SPI register write to device.
- Parameters
-
| dev | - The device structure. |
| reg_addr | - The register address. |
| reg_data | - The register data. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ adgs1408_spi_reg_write_mask()
| int32_t adgs1408_spi_reg_write_mask |
( |
struct adgs1408_dev * | dev, |
|
|
uint8_t | reg_addr, |
|
|
uint8_t | mask, |
|
|
uint8_t | data ) |
SPI internal register write to device using a mask.
- Parameters
-
| dev | - The device structure. |
| reg_addr | - The register address. |
| mask | - The mask. |
| data | - The register data. |
- Returns
- 0 in case of success, negative error code otherwise.