no-OS
|
Header file of AD525X Driver for Microblaze processor. This driver supporting the following devices : AD5232, AD5235, AD5252, AD5251, AD5254, AD5253, ADN2850. More...
#include <stdint.h>
#include "no_os_delay.h"
#include "no_os_gpio.h"
#include "no_os_spi.h"
#include "no_os_i2c.h"
Go to the source code of this file.
Classes | |
struct | ad525x_chip_info |
struct | ad525x_dev |
struct | ad525x_init_param |
Enumerations | |
enum | bool_t { false, true, false, true, false, true } |
enum | ad525_x_type_t { ID_AD5232, ID_AD5235, ID_ADN2850, ID_AD5252, ID_AD5251, ID_AD5254, ID_AD5253 } |
enum | comm_type_t { com_spi, com_i2c, SPI, I2C } |
Functions | |
int8_t | ad525x_init (struct ad525x_dev **device, struct ad525x_init_param init_param) |
Initialize SPI and Initial Values for AD5172 Board. More... | |
int32_t | ad525x_remove (struct ad525x_dev *dev) |
Free the resources allocated by ad525x_init(). More... | |
uint16_t | ad525x_read_mem (struct ad525x_dev *dev, uint8_t address) |
Read data from the EEMEM. More... | |
void | ad525x_write_mem (struct ad525x_dev *dev, uint8_t address, uint16_t data) |
Write data to EEMEM. More... | |
uint16_t | ad525x_read_rdac (struct ad525x_dev *dev, uint8_t address) |
Read data from the RDAC register. More... | |
void | ad525x_write_rdac (struct ad525x_dev *dev, uint8_t address, uint16_t data) |
Write data to RDAC register. More... | |
void | ad525x_write_command (struct ad525x_dev *dev, uint8_t command, uint8_t address) |
Write quick commands to the device. More... | |
Header file of AD525X Driver for Microblaze processor. This driver supporting the following devices : AD5232, AD5235, AD5252, AD5251, AD5254, AD5253, ADN2850.
Copyright 2013(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 AD525X_CMD_DECALLRDAC_6DB 0x4 |
#define AD525X_CMD_DECALLRDAC_ONE 0x6 |
#define AD525X_CMD_DECRDAC_6DB 0x3 |
#define AD525X_CMD_DECRDAC_ONE 0x5 |
#define AD525X_CMD_I2C_OFFSET 0x3 |
#define AD525X_CMD_INCALLRDAC_6DB 0x9 |
#define AD525X_CMD_INCALLRDAC_ONE 0xB |
#define AD525X_CMD_INCRDAC_6DB 0x8 |
#define AD525X_CMD_INCRDAC_ONE 0xA |
#define AD525X_CMD_MASK 0xF |
#define AD525X_CMD_MEM2RDAC 0x1 |
#define AD525X_CMD_NOP 0x0 |
#define AD525X_CMD_RDAC2MEM 0x2 |
#define AD525X_CMD_RESET 0x7 |
#define AD525X_CMD_SPI_MEM2SREG 0x9 |
#define AD525X_CMD_SPI_OFFSET 0x4 |
#define AD525X_CMD_SPI_RDAC2SREG 0xA |
#define AD525X_CMD_SPI_SREG2MEM 0x3 |
#define AD525X_CMD_SPI_SREG2RDAC 0xB |
#define AD525X_DATA10_MASK 0x3FF |
#define AD525X_DATA8_MASK 0xFF |
#define AD525X_I2C_CMD_OR_REG 0x80 |
#define AD525X_I2C_CNTR_MASK 0xBF |
#define AD525X_I2C_EE_OR_RDAC 0x20 |
#define AD525X_I2C_HARD_ADDR 0x2C |
#define AD525X_I2C_MEM_ADDR_MASK 0x1F |
#define AD525X_I2C_PIN_ADDR_MASK 0x03 |
#define AD525X_MEM_ADDR_MASK 0xF |
#define AD525X_RDAC0_DECIMAL_TOL 0x19 |
#define AD525X_RDAC0_SIGN_TOL 0x18 |
#define AD525X_RDAC1_DECIMAL_TOL 0x1B |
#define AD525X_RDAC1_SIGN_TOL 0x1A |
#define AD525X_RDAC2_DECIMAL_TOL 0x1D |
#define AD525X_RDAC2_SIGN_TOL 0x1C |
#define AD525X_RDAC3_SIGN_TOL 0x1E |
#define AD525X_RDAC4_DECIMAL_TOL 0x1F |
#define AD525X_RDAC_ADDR_MASK_1BIT 0x1 |
#define AD525X_RDAC_ADDR_MASK_3BIT 0x7 |
#define AD525x_RDAC_TOLERANCE 0x0F |
#define AD525X_READY_HIGH |
#define AD525X_READY_IN no_os_gpio_direction_input(dev->gpio_ready) |
#define AD525X_READY_LOW |
#define AD525X_RESET_HIGH |
#define AD525X_RESET_LOW |
#define AD525X_RESET_OUT |
#define AD525X_SHUTDOWN_HIGH |
#define AD525X_SHUTDOWN_LOW |
#define AD525X_SHUTDOWN_OUT |
#define AD525X_WP_BF_HIGH |
#define AD525X_WP_BF_LOW |
#define AD525X_WP_BF_OUT |
enum ad525_x_type_t |
enum bool_t |
enum comm_type_t |
int8_t ad525x_init | ( | struct ad525x_dev ** | device, |
struct ad525x_init_param | init_param | ||
) |
Initialize SPI and Initial Values for AD5172 Board.
device | - The device structure. |
init_param | - The structure that contains the device initial parameters. |
uint16_t ad525x_read_mem | ( | struct ad525x_dev * | dev, |
uint8_t | address | ||
) |
Read data from the EEMEM.
dev | - The device structure. |
address | - desired address of the EEMEM memory |
uint16_t ad525x_read_rdac | ( | struct ad525x_dev * | dev, |
uint8_t | address | ||
) |
Read data from the RDAC register.
dev | - The device structure. |
address | - desired address of the RDAC registers |
int32_t ad525x_remove | ( | struct ad525x_dev * | dev | ) |
Free the resources allocated by ad525x_init().
dev | - The device structure. |
void ad525x_write_command | ( | struct ad525x_dev * | dev, |
uint8_t | command, | ||
uint8_t | address | ||
) |
Write quick commands to the device.
dev | - The device structure. |
command | - desired command, the functionality of a command it may vary at diffrent devices |
address | - Address to be written |
void ad525x_write_mem | ( | struct ad525x_dev * | dev, |
uint8_t | address, | ||
uint16_t | data | ||
) |
Write data to EEMEM.
dev | - The device structure. |
address | - desired address of the EEMEM memory |
data | - the data which will be written to the memory |
void ad525x_write_rdac | ( | struct ad525x_dev * | dev, |
uint8_t | address, | ||
uint16_t | data | ||
) |
Write data to RDAC register.
dev | - The device structure. |
address | - desired address of the RDAC register |
data | - the data which will be written to the RDAC register |