Implementation of AD5628 Driver.
More...
#include <stdlib.h>
#include "ad5628.h"
#include "no_os_alloc.h"
Implementation of AD5628 Driver.
- Author
- DNechita (Dan.N.nosp@m.echi.nosp@m.ta@an.nosp@m.alog.nosp@m..com)
Copyright 2012(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
◆ ad5628_init()
Initializes the communication peripheral and the initial Values for AD5628 Board and resets the device.
- Parameters
-
| device | - The device structure. |
| init_param | - The structure that contains the device initial parameters. |
- Returns
- ret - The result of the initialization procedure. Example: -1 - SPI peripheral was not initialized or the device is not present. 0 - SPI peripheral was initialized and the device is present.
◆ ad5628_power_mode()
| void ad5628_power_mode |
( |
struct ad5628_dev * | dev, |
|
|
uint8_t | pwr_mode, |
|
|
uint8_t | channel ) |
Sets the device in a specific power mode.
- Parameters
-
| 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 |
◆ ad5628_remove()
Free the resources allocated by ad5628_init().
- Parameters
-
| dev | - The device structure. |
- Returns
- ret - The result of the remove procedure.
◆ ad5628_reset()
Resets the device.
- Parameters
-
| dev | - The device structure. |
◆ ad5628_set_input_register()
| 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.
- Parameters
-
| dev | - The device structure. |
| register_value | - Value of the register. |