no-OS
Classes | Macros | Enumerations | Functions
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:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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,
  false,
  true,
  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. More...
 
int32_t ad5446_remove (struct ad5446_dev *dev)
 Free the resources allocated by ad5446_init(). More...
 
void ad5446_set_register (struct ad5446_dev *dev, uint8_t command, uint16_t data)
 Writes to input register via SPI. More...
 
float ad5446_set_voltage (struct ad5446_dev *dev, float voltage, float vref, enum vout_type_t vout_type)
 Sets the output voltage. More...
 

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.

All rights reserved.

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 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT

Macro Definition Documentation

◆ AD5446_CLR_HIGH

#define AD5446_CLR_HIGH
Value:
no_os_gpio_set_value(dev->gpio_clrout, \

◆ AD5446_CLR_LOW

#define AD5446_CLR_LOW
Value:
no_os_gpio_set_value(dev->gpio_clrout, \

◆ AD5446_CLR_OUT

#define AD5446_CLR_OUT
Value:

◆ 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 
false 
true 
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.
Returns
None.

◆ 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.
NO_OS_GPIO_HIGH
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:123
NO_OS_GPIO_LOW
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:121
no_os_gpio_set_value
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:203
no_os_gpio_direction_output
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:153