no-OS
|
Header file of ad3552r Driver. More...
#include <stdint.h>
#include <stdbool.h>
#include "no_os_spi.h"
#include "no_os_gpio.h"
#include "no_os_crc8.h"
Go to the source code of this file.
Classes | |
struct | ad3552_transfer_config |
struct | ad3552_transfer_data |
struct | ad3552r_ch_data |
struct | ad3552r_desc |
struct | ad3552r_custom_output_range_cfg |
struct | ad3552r_channel_init |
struct | ad3552r_init_param |
Functions | |
uint8_t | ad3552r_reg_len (uint8_t addr) |
uint8_t | ad3552r_get_code_reg_addr (uint8_t ch, uint8_t is_dac, uint8_t is_fast) |
int32_t | ad3552r_init (struct ad3552r_desc **desc, struct ad3552r_init_param *init_param) |
int32_t | ad3552r_remove (struct ad3552r_desc *desc) |
int32_t | ad3552r_reset (struct ad3552r_desc *desc) |
int32_t | ad3552r_get_status (struct ad3552r_desc *desc, uint32_t *status, uint8_t clr_err) |
int32_t | ad3552r_transfer (struct ad3552r_desc *desc, struct ad3552_transfer_data *data) |
int32_t | ad3552r_write_reg (struct ad3552r_desc *desc, uint8_t addr, uint16_t val) |
int32_t | ad3552r_read_reg (struct ad3552r_desc *desc, uint8_t addr, uint16_t *val) |
int32_t | ad3552r_get_dev_value (struct ad3552r_desc *desc, enum ad3552r_dev_attributes attr, uint16_t *val) |
int32_t | ad3552r_set_dev_value (struct ad3552r_desc *desc, enum ad3552r_dev_attributes attr, uint16_t val) |
int32_t | ad3552r_get_ch_value (struct ad3552r_desc *desc, enum ad3552r_ch_attributes attr, uint8_t ch, uint16_t *val) |
int32_t | ad3552r_set_ch_value (struct ad3552r_desc *desc, enum ad3552r_ch_attributes attr, uint8_t ch, uint16_t val) |
int32_t | ad3552r_get_scale (struct ad3552r_desc *desc, uint8_t ch, int32_t *integer, int32_t *dec) |
int32_t | ad3552r_get_offset (struct ad3552r_desc *desc, uint8_t ch, int32_t *integer, int32_t *dec) |
int32_t | ad3552r_ldac_trigger (struct ad3552r_desc *desc, uint16_t mask, uint8_t is_fast) |
int32_t | ad3552r_set_asynchronous (struct ad3552r_desc *desc, uint8_t enable) |
int32_t | ad3552r_write_samples (struct ad3552r_desc *desc, uint16_t *data, uint32_t samples, uint32_t ch_mask, enum ad3552r_write_mode mode) |
int32_t | ad3552r_simulatneous_update_enable (struct ad3552r_desc *desc) |
int32_t | ad3552r_axi_write_data (struct ad3552r_desc *desc, uint32_t *buf, uint16_t samples, bool cyclic, int cyclic_secs) |
Write data samples to dac. More... | |
Header file of ad3552r Driver.
IIO Header file of ad3552r Driver.
Copyright 2021(c) Analog Devices, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define AD3552R_BOTH_CH_DESELECT 0x0 |
#define AD3552R_CH_OUTPUT_RANGE_CUSTOM 100 |
#define AD3552R_LDAC_PULSE_US 1 |
#define AD3552R_MASK_ADDR_ASCENSION NO_OS_BIT(5) |
#define AD3552R_MASK_ALERT_ENABLE_PULLUP NO_OS_BIT(6) |
#define AD3552R_MASK_CH | ( | ch | ) | NO_OS_BIT(ch) |
#define AD3552R_MASK_CH_AMPLIFIER_POWERDOWN | ( | ch | ) | NO_OS_BIT(ch) |
#define AD3552R_MASK_CH_DAC_POWERDOWN | ( | ch | ) | NO_OS_BIT(4 + (ch)) |
#define AD3552R_MASK_CH_OFFSET_BIT_8 NO_OS_BIT(0) |
#define AD3552R_MASK_CH_OFFSET_BITS_0_7 0xFF |
#define AD3552R_MASK_CH_OFFSET_POLARITY NO_OS_BIT(2) |
#define AD3552R_MASK_CH_OUTPUT_RANGE_SEL | ( | ch | ) | ((ch) ? 0xF0 : 0xF) |
#define AD3552R_MASK_CH_RANGE_OVERRIDE NO_OS_BIT(7) |
#define AD3552R_MASK_CLASS NO_OS_GENMASK(7, 0) |
#define AD3552R_MASK_CLOCK_COUNT_ERR_ALARM NO_OS_BIT(5) |
#define AD3552R_MASK_CLOCK_COUNTING_ERROR NO_OS_BIT(5) |
#define AD3552R_MASK_DAC_12B 0xFFF0 |
#define AD3552R_MASK_DEVICE_REVISION NO_OS_GENMASK(3, 0) |
#define AD3552R_MASK_DEVICE_STATUS | ( | n | ) | NO_OS_BIT(4 + (n)) |
#define AD3552R_MASK_DUAL_SPI_STREAM_EXCEEDS_DAC_ERR_STATUS NO_OS_BIT(5) |
#define AD3552R_MASK_DUAL_SPI_SYNCHROUNOUS_EN NO_OS_BIT(1) |
#define AD3552R_MASK_GRADE NO_OS_GENMASK(7, 4) |
#define AD3552R_MASK_IDUMP_FAST_MODE NO_OS_BIT(6) |
#define AD3552R_MASK_INTERFACE_NOT_READY NO_OS_BIT(7) |
#define AD3552R_MASK_INVALID_OR_NO_CRC NO_OS_BIT(3) |
#define AD3552R_MASK_LENGTH 0xFF |
#define AD3552R_MASK_MEM_CRC_EN NO_OS_BIT(4) |
#define AD3552R_MASK_MEM_CRC_ERR_ALARM NO_OS_BIT(4) |
#define AD3552R_MASK_MEM_CRC_ERR_STATUS NO_OS_BIT(4) |
#define AD3552R_MASK_OPERATING_MODES NO_OS_GENMASK(1, 0) |
#define AD3552R_MASK_PARTIAL_REGISTER_ACCESS NO_OS_BIT(1) |
#define AD3552R_MASK_PARTIAL_REGISTER_ACCESS_ALARM NO_OS_BIT(1) |
#define AD3552R_MASK_REF_RANGE_ALARM NO_OS_BIT(6) |
#define AD3552R_MASK_REF_RANGE_ERR_STATUS NO_OS_BIT(6) |
#define AD3552R_MASK_REGISTER_ADDRESS_INVALID NO_OS_BIT(0) |
#define AD3552R_MASK_REGISTER_ADDRESS_INVALID_ALARM NO_OS_BIT(0) |
#define AD3552R_MASK_RESET_STATUS NO_OS_BIT(0) |
#define AD3552R_MASK_SAMPLE_HOLD_DIFFERENTIAL_USER_EN NO_OS_BIT(5) |
#define AD3552R_MASK_SAMPLE_HOLD_USER_ENABLE NO_OS_BIT(2) |
#define AD3552R_MASK_SDO_ACTIVE NO_OS_BIT(4) |
#define AD3552R_MASK_SHORT_INSTRUCTION NO_OS_BIT(3) |
#define AD3552R_MASK_SINGLE_INST NO_OS_BIT(7) |
#define AD3552R_MASK_SPI_CONFIG_DDR NO_OS_BIT(0) |
#define AD3552R_MASK_SPI_CRC_ERR_ALARM NO_OS_BIT(3) |
#define AD3552R_MASK_STREAM_LENGTH_KEEP_VALUE NO_OS_BIT(2) |
#define AD3552R_MASK_STRICT_REGISTER_ACCESS NO_OS_BIT(5) |
#define AD3552R_MASK_WRITE_TO_READ_ONLY_ALARM NO_OS_BIT(2) |
#define AD3552R_MASK_WRITE_TO_READ_ONLY_REGISTER NO_OS_BIT(2) |
#define AD3552R_MAX_NUM_CH 2 |
#define AD3552R_MAX_OFFSET 511 |
#define AD3552R_REAL_BITS_FAST_MODE 12 |
#define AD3552R_REAL_BITS_PREC_MODE 16 |
#define AD3552R_REG_ADDR_CH0_CH1_OUTPUT_RANGE 0x19 |
#define AD3552R_REG_ADDR_CH_DAC_16B | ( | ch | ) | (0x2C - (1 - ch) * 2) |
#define AD3552R_REG_ADDR_CH_DAC_24B | ( | ch | ) | (0x3D - (1 - ch) * 3) |
#define AD3552R_REG_ADDR_CH_GAIN | ( | ch | ) | (0x1C + (ch) * 2) |
#define AD3552R_REG_ADDR_CH_INPUT_16B | ( | ch | ) | (0x36 - (1 - ch) * 2) |
#define AD3552R_REG_ADDR_CH_INPUT_24B | ( | ch | ) | (0x4B - (1 - ch) * 3) |
#define AD3552R_REG_ADDR_CH_OFFSET | ( | ch | ) | (0x1B + (ch) * 2) |
#define AD3552R_REG_ADDR_CH_SELECT_16B 0x2F |
#define AD3552R_REG_ADDR_CH_SELECT_24B 0x41 |
#define AD3552R_REG_ADDR_CHIP_GRADE 0x06 |
#define AD3552R_REG_ADDR_CHIP_TYPE 0x03 |
#define AD3552R_REG_ADDR_DAC_PAGE_MASK_16B 0x2E |
#define AD3552R_REG_ADDR_DAC_PAGE_MASK_24B 0x40 |
#define AD3552R_REG_ADDR_DEVICE_CONFIG 0x02 |
#define AD3552R_REG_ADDR_ERR_ALARM_MASK 0x16 |
#define AD3552R_REG_ADDR_ERR_STATUS 0x17 |
#define AD3552R_REG_ADDR_HW_LDAC_16B 0x28 |
#define AD3552R_REG_ADDR_HW_LDAC_24B 0x37 |
#define AD3552R_REG_ADDR_INPUT_PAGE_MASK_16B 0x31 |
#define AD3552R_REG_ADDR_INPUT_PAGE_MASK_24B 0x44 |
#define AD3552R_REG_ADDR_INTERFACE_CONFIG_A 0x00 |
#define AD3552R_REG_ADDR_INTERFACE_CONFIG_B 0x01 |
#define AD3552R_REG_ADDR_INTERFACE_CONFIG_C 0x10 |
#define AD3552R_REG_ADDR_INTERFACE_CONFIG_D 0x14 |
#define AD3552R_REG_ADDR_INTERFACE_STATUS_A 0x11 |
#define AD3552R_REG_ADDR_MAX 0x4B |
#define AD3552R_REG_ADDR_POWERDOWN_CONFIG 0x18 |
#define AD3552R_REG_ADDR_PRODUCT_ID_H 0x05 |
#define AD3552R_REG_ADDR_PRODUCT_ID_L 0x04 |
#define AD3552R_REG_ADDR_SCRATCH_PAD 0x0A |
#define AD3552R_REG_ADDR_SH_REFERENCE_CONFIG 0x15 |
#define AD3552R_REG_ADDR_SPI_REVISION 0x0B |
#define AD3552R_REG_ADDR_STREAM_MODE 0x0E |
#define AD3552R_REG_ADDR_SW_LDAC_16B 0x32 |
#define AD3552R_REG_ADDR_SW_LDAC_24B 0x45 |
#define AD3552R_REG_ADDR_TRANSFER_REGISTER 0x0F |
#define AD3552R_REG_ADDR_VENDOR_H 0x0D |
#define AD3552R_REG_ADDR_VENDOR_L 0x0C |
#define AD3552R_REG_START_24B 0x37 |
#define AD3552R_SECONDARY_REGION_START 0x28 |
#define AD3552R_STORAGE_BITS_FAST_MODE 16 |
#define AD3552R_STORAGE_BITS_PREC_MODE 24 |
enum ad3552r_id |
enum ad3552r_status |
enum ad3552r_write_mode |
enum num_channels |
int32_t ad3552r_axi_write_data | ( | struct ad3552r_desc * | desc, |
uint32_t * | buf, | ||
uint16_t | samples, | ||
bool | cyclic, | ||
int | cyclic_secs | ||
) |
Write data samples to dac.
desc | - The device structure. |
buf | - The buffer to fill. |
samples | - number of samples to write. |
cyclic | - cyclic transfer. |
cyclic_secs | - 0 means forever. |
int32_t ad3552r_get_ch_value | ( | struct ad3552r_desc * | desc, |
enum ad3552r_ch_attributes | attr, | ||
uint8_t | ch, | ||
uint16_t * | val | ||
) |
uint8_t ad3552r_get_code_reg_addr | ( | uint8_t | ch, |
uint8_t | is_dac, | ||
uint8_t | is_fast | ||
) |
int32_t ad3552r_get_dev_value | ( | struct ad3552r_desc * | desc, |
enum ad3552r_dev_attributes | attr, | ||
uint16_t * | val | ||
) |
int32_t ad3552r_get_offset | ( | struct ad3552r_desc * | desc, |
uint8_t | ch, | ||
int32_t * | integer, | ||
int32_t * | dec | ||
) |
int32_t ad3552r_get_scale | ( | struct ad3552r_desc * | desc, |
uint8_t | ch, | ||
int32_t * | integer, | ||
int32_t * | dec | ||
) |
int32_t ad3552r_get_status | ( | struct ad3552r_desc * | desc, |
uint32_t * | status, | ||
uint8_t | clr_err | ||
) |
int32_t ad3552r_init | ( | struct ad3552r_desc ** | desc, |
struct ad3552r_init_param * | init_param | ||
) |
int32_t ad3552r_ldac_trigger | ( | struct ad3552r_desc * | desc, |
uint16_t | mask, | ||
uint8_t | is_fast | ||
) |
int32_t ad3552r_read_reg | ( | struct ad3552r_desc * | desc, |
uint8_t | addr, | ||
uint16_t * | val | ||
) |
uint8_t ad3552r_reg_len | ( | uint8_t | addr | ) |
int32_t ad3552r_remove | ( | struct ad3552r_desc * | desc | ) |
int32_t ad3552r_reset | ( | struct ad3552r_desc * | desc | ) |
int32_t ad3552r_set_asynchronous | ( | struct ad3552r_desc * | desc, |
uint8_t | enable | ||
) |
int32_t ad3552r_set_ch_value | ( | struct ad3552r_desc * | desc, |
enum ad3552r_ch_attributes | attr, | ||
uint8_t | ch, | ||
uint16_t | val | ||
) |
int32_t ad3552r_set_dev_value | ( | struct ad3552r_desc * | desc, |
enum ad3552r_dev_attributes | attr, | ||
uint16_t | val | ||
) |
int32_t ad3552r_simulatneous_update_enable | ( | struct ad3552r_desc * | desc | ) |
int32_t ad3552r_transfer | ( | struct ad3552r_desc * | desc, |
struct ad3552_transfer_data * | data | ||
) |
int32_t ad3552r_write_reg | ( | struct ad3552r_desc * | desc, |
uint8_t | addr, | ||
uint16_t | val | ||
) |
int32_t ad3552r_write_samples | ( | struct ad3552r_desc * | desc, |
uint16_t * | data, | ||
uint32_t | samples, | ||
uint32_t | ch_mask, | ||
enum ad3552r_write_mode | mode | ||
) |