no-OS
|
Header file of AD5628 Driver. More...
Go to the source code of this file.
Classes | |
struct | ad5628_dev |
struct | ad5628_init_param |
Functions | |
int32_t | ad5628_init (struct ad5628_dev **device, struct ad5628_init_param init_param) |
Initializes the communication peripheral and the initial Values for AD5628 Board and resets the device. More... | |
int32_t | ad5628_remove (struct ad5628_dev *dev) |
Free the resources allocated by ad5628_init(). More... | |
void | ad5628_power_mode (struct ad5628_dev *dev, uint8_t pwr_mode, uint8_t channel) |
Sets the device in a specific power mode. More... | |
void | ad5628_reset (struct ad5628_dev *dev) |
Resets the device. More... | |
void | ad5628_set_input_register (struct ad5628_dev *dev, uint32_t register_value) |
Writes a 32-bit data-word to the Input Register of the device. More... | |
Header file of AD5628 Driver.
Copyright 2012(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 AD5628_ADDR | ( | x | ) | ((0x000F & (int32_t)(x)) << 20) |
#define AD5628_ADDR_DAC_A 0x00 |
#define AD5628_ADDR_DAC_ALL 0x0F |
#define AD5628_ADDR_DAC_B 0x01 |
#define AD5628_ADDR_DAC_C 0x02 |
#define AD5628_ADDR_DAC_D 0x03 |
#define AD5628_ADDR_DAC_E 0x04 |
#define AD5628_ADDR_DAC_F 0x05 |
#define AD5628_ADDR_DAC_G 0x06 |
#define AD5628_ADDR_DAC_H 0x07 |
#define AD5628_CMD | ( | x | ) | ((0x000F & (int32_t)(x)) << 24) |
#define AD5628_CMD_LOAD_CLEAR_CODE 5 |
#define AD5628_CMD_LOAD_LDAC_REG 6 |
#define AD5628_CMD_POWERDOWN 4 |
#define AD5628_CMD_RESET 7 |
#define AD5628_CMD_SET_INT_REF 8 |
#define AD5628_CMD_UPDATE_DAC_N 1 |
#define AD5628_CMD_WRITE_INPUT_N 0 |
#define AD5628_CMD_WRITE_INPUT_N_UPDATE_ALL 2 |
#define AD5628_CMD_WRITE_INPUT_N_UPDATE_N 3 |
#define AD5628_CODE_0X0000 0 |
#define AD5628_CODE_0X8000 1 |
#define AD5628_CODE_0XFFFF 2 |
#define AD5628_CODE_NOP 3 |
#define AD5628_DATA_BITS | ( | x | ) | ((0x0FFF & (int32_t)(x)) << 8) |
#define AD5628_INT_REF_OFF 0 |
#define AD5628_INT_REF_ON 1 |
#define AD5628_POWER_MODE | ( | x | ) | ((0x03 & (uint16_t) (x)) << 8) |
#define AD5628_PWRDN_100K 2 |
#define AD5628_PWRDN_1K 1 |
#define AD5628_PWRDN_3STATE 3 |
#define AD5628_PWRDN_NONE 0 |
int32_t ad5628_init | ( | struct ad5628_dev ** | device, |
struct ad5628_init_param | init_param | ||
) |
Initializes the communication peripheral and the initial Values for AD5628 Board and resets the device.
Resets the device and performs several initializations.
device | - The device structure. |
init_param | - The structure that contains the device initial parameters. |
void ad5628_power_mode | ( | struct ad5628_dev * | dev, |
uint8_t | pwr_mode, | ||
uint8_t | channel | ||
) |
Sets the device in a specific power mode.
Sets the device in a specific power mode.
dev | - The device structure. |
pwr_mode | - power mode of the device. Example: AD5628_PWRDN_NONE AD5628_PWRDN_1K AD5628_PWRDN_100K AD5628_PWRDN_3STATE |
channel | - The channel or channels that are being configured. Example: AD5628_ADDR_DAC_A AD5628_ADDR_DAC_B ... AD5628_ADDR_DAC_ALL |
int32_t ad5628_remove | ( | struct ad5628_dev * | dev | ) |
Free the resources allocated by ad5628_init().
Free the resources allocated by AD5628_Init().
dev | - The device structure. |
void ad5628_reset | ( | struct ad5628_dev * | dev | ) |
Resets the device.
Resets the device.
dev | - The device structure. |
void ad5628_set_input_register | ( | struct ad5628_dev * | dev, |
uint32_t | register_value | ||
) |
Writes a 32-bit data-word to the Input Register of the device.
Writes a 32-bit data-word to the Input Register of the device.
dev | - The device structure. |
register_value | - Value of the register. |