no-OS
Loading...
Searching...
No Matches
ad5446.h File Reference

Header file of AD5446 Driver. This driver supporting the following devices: AD5553, AD5543, AD5542A, AD5541A, AD5512A, AD5453, AD5452, AD5451, AD5450, AD5446, AD5444. More...

#include <stdint.h>
#include "no_os_gpio.h"
#include "no_os_spi.h"
Include dependency graph for ad5446.h:

Classes

struct  ad5446_chip_info
 
struct  ad5446_dev
 
struct  ad5446_init_param
 

Macros

#define AD5446_CTRL_LOAD_UPDATE   0x0
 
#define AD5446_CTRL_ACTIVE_POSEDGE   0x3
 
#define AD5446_LDAC_OUT
 
#define AD5446_LDAC_LOW
 
#define AD5446_LDAC_HIGH
 
#define AD5446_CLR_OUT
 
#define AD5446_CLR_LOW
 
#define AD5446_CLR_HIGH
 

Enumerations

enum  active_clk_t {
  negedge ,
  posedge
}
 
enum  bool_t {
  false ,
  true
}
 
enum  vout_type_t {
  unipolar ,
  unipolar_inv ,
  bipolar
}
 
enum  ad5446_type_t {
  ID_AD5600 ,
  ID_AD5553 ,
  ID_AD5543 ,
  ID_AD5542A ,
  ID_AD5541A ,
  ID_AD5512A ,
  ID_AD5453 ,
  ID_AD5452 ,
  ID_AD5451 ,
  ID_AD5450 ,
  ID_AD5446 ,
  ID_AD5444
}
 

Functions

int8_t ad5446_init (struct ad5446_dev **device, struct ad5446_init_param init_param)
 Initialize SPI and Initial Values for AD5446 Board.
 
int32_t ad5446_remove (struct ad5446_dev *dev)
 Free the resources allocated by ad5446_init().
 
void ad5446_set_register (struct ad5446_dev *dev, uint8_t command, uint16_t data)
 Writes to input register via SPI.
 
float ad5446_set_voltage (struct ad5446_dev *dev, float voltage, float vref, enum vout_type_t vout_type)
 Sets the output voltage.
 

Detailed Description

Header file of AD5446 Driver. This driver supporting the following devices: AD5553, AD5543, AD5542A, AD5541A, AD5512A, AD5453, AD5452, AD5451, AD5450, AD5446, AD5444.

Author
Istvan Csomortani (istva.nosp@m.n.cs.nosp@m.omort.nosp@m.ani@.nosp@m.analo.nosp@m.g.co.nosp@m.m)

Copyright 2013(c) Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Macro Definition Documentation

◆ AD5446_CLR_HIGH

#define AD5446_CLR_HIGH
Value:
no_os_gpio_set_value(dev->gpio_clrout, \
int32_t no_os_gpio_set_value(struct no_os_gpio_desc *desc, uint8_t value)
Set the value of the specified GPIO.
Definition no_os_gpio.c:170
@ NO_OS_GPIO_HIGH
Definition no_os_gpio.h:82

◆ AD5446_CLR_LOW

#define AD5446_CLR_LOW
Value:
no_os_gpio_set_value(dev->gpio_clrout, \
@ NO_OS_GPIO_LOW
Definition no_os_gpio.h:80

◆ AD5446_CLR_OUT

#define AD5446_CLR_OUT
Value:
no_os_gpio_direction_output(dev->gpio_clrout, \
int32_t no_os_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition no_os_gpio.c:120

◆ AD5446_CTRL_ACTIVE_POSEDGE

#define AD5446_CTRL_ACTIVE_POSEDGE   0x3

◆ AD5446_CTRL_LOAD_UPDATE

#define AD5446_CTRL_LOAD_UPDATE   0x0

◆ AD5446_LDAC_HIGH

#define AD5446_LDAC_HIGH
Value:

◆ AD5446_LDAC_LOW

#define AD5446_LDAC_LOW
Value:

◆ AD5446_LDAC_OUT

#define AD5446_LDAC_OUT
Value:

Enumeration Type Documentation

◆ active_clk_t

Enumerator
negedge 
posedge 

◆ ad5446_type_t

Enumerator
ID_AD5600 
ID_AD5553 
ID_AD5543 
ID_AD5542A 
ID_AD5541A 
ID_AD5512A 
ID_AD5453 
ID_AD5452 
ID_AD5451 
ID_AD5450 
ID_AD5446 
ID_AD5444 

◆ bool_t

enum bool_t
Enumerator
false 
true 

◆ vout_type_t

Enumerator
unipolar 
unipolar_inv 
bipolar 

Function Documentation

◆ ad5446_init()

int8_t ad5446_init ( struct ad5446_dev ** device,
struct ad5446_init_param init_param )

Initialize SPI and Initial Values for AD5446 Board.

Parameters
device- The device structure.
init_param- The structure that contains the device initial parameters.
Returns
retValue - Result of the initialization. Example: 0 - if initialization was successful; -1 - if initialization was unsuccessful.

◆ ad5446_remove()

int32_t ad5446_remove ( struct ad5446_dev * dev)

Free the resources allocated by ad5446_init().

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ad5446_set_register()

void ad5446_set_register ( struct ad5446_dev * dev,
uint8_t command,
uint16_t data )

Writes to input register via SPI.

Parameters
dev- The device structure.
command- Command to be transmitted to the device.
data- Data to be written in input register.

◆ ad5446_set_voltage()

float ad5446_set_voltage ( struct ad5446_dev * dev,
float voltage,
float vref,
enum vout_type_t vout_type )

Sets the output voltage.

Parameters
dev- The device structure.
voltage- The voltage value in volts
vref- The voltage reference used by the device in volts.
vout_type- Voltage output type: unipolar/unipolar_inv/bipolar
Returns
Actual voltage that the device can output.