no-OS
Classes | Macros | Functions
ad5110.h File Reference

Header file of ad5110 Driver for Microblaze processor. More...

#include <stdint.h>
#include "no_os_i2c.h"
Include dependency graph for ad5110.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ad5110_dev
 
struct  ad5110_init_param
 

Macros

#define COMMAND   8
 
#define CMD_NOP   0
 
#define CMD_WR_RDAC_EEPROM   1
 
#define CMD_WR_RDAC   2
 
#define CMD_SHUT_DOWN   3
 
#define CMD_RESET   4
 
#define CMD_RD_RDAC   5
 
#define CMD_RD_EEPROM   6
 
#define SHUT_DOWN_OFF   0
 
#define SHUT_DOWN_ON   1
 
#define WIPER_POSITION   0
 
#define RESISTOR_TOLERANCE   1
 

Functions

int8_t ad5110_init (struct ad5110_dev **device, struct ad5110_init_param init_param)
 Initializes the communication with the device. More...
 
int32_t ad5110_remove (struct ad5110_dev *dev)
 Free the resources allocated by ad5110_init(). More...
 
void ad5110_write_rdac (struct ad5110_dev *dev, uint8_t rdac_value)
 Write the content of serial register data to RDAC. More...
 
uint8_t ad5110_read_rdac (struct ad5110_dev *dev)
 Read the content of RDAC register. More...
 
void ad5110_write_rdac_eeprom (struct ad5110_dev *dev)
 Write the content of RDAC register to EEPROM. More...
 
uint8_t ad5110_read_wiper (struct ad5110_dev *dev)
 Read wiper position from EEPROM. More...
 
uint8_t ad5110_read_res_tolerance (struct ad5110_dev *dev)
 Read resistor tolerance from EEPROM. More...
 
void ad5110_reset (struct ad5110_dev *dev)
 Software reset; makes a refresh of RDAC register with EEPROM. More...
 
void ad5110_shut_down (struct ad5110_dev *dev, uint8_t value)
 Software shutdown. More...
 

Detailed Description

Header file of ad5110 Driver for Microblaze processor.

Author
Lucian Sin (Lucia.nosp@m.n.Si.nosp@m.n@ana.nosp@m.log..nosp@m.com)

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:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

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.

Macro Definition Documentation

◆ CMD_NOP

#define CMD_NOP   0

◆ CMD_RD_EEPROM

#define CMD_RD_EEPROM   6

Shutdown modes

◆ CMD_RD_RDAC

#define CMD_RD_RDAC   5

◆ CMD_RESET

#define CMD_RESET   4

◆ CMD_SHUT_DOWN

#define CMD_SHUT_DOWN   3

◆ CMD_WR_RDAC

#define CMD_WR_RDAC   2

◆ CMD_WR_RDAC_EEPROM

#define CMD_WR_RDAC_EEPROM   1

◆ COMMAND

#define COMMAND   8

< Command position in transmitted bytes Available Commands

◆ RESISTOR_TOLERANCE

#define RESISTOR_TOLERANCE   1

◆ SHUT_DOWN_OFF

#define SHUT_DOWN_OFF   0

◆ SHUT_DOWN_ON

#define SHUT_DOWN_ON   1

Read modes

◆ WIPER_POSITION

#define WIPER_POSITION   0

Function Documentation

◆ ad5110_init()

int8_t ad5110_init ( struct ad5110_dev **  device,
struct ad5110_init_param  init_param 
)

Initializes the communication with the device.

< Initializes the communication with the device. Free the resources allocated by ad5110_init().

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

◆ ad5110_read_rdac()

uint8_t ad5110_read_rdac ( struct ad5110_dev dev)

Read the content of RDAC register.

Write the content of RDAC register to EEPROM.

Parameters
dev- The device structure.
Returns
rdacValue - Value read from register.

◆ ad5110_read_res_tolerance()

uint8_t ad5110_read_res_tolerance ( struct ad5110_dev dev)

Read resistor tolerance from EEPROM.

Software reset; makes a refresh of RDAC register with EEPROM.

Parameters
dev- The device structure.
Returns
resTolerance - Value read from EEPROM.

◆ ad5110_read_wiper()

uint8_t ad5110_read_wiper ( struct ad5110_dev dev)

Read wiper position from EEPROM.

Read resistor tolerance from EEPROM.

Parameters
dev- The device structure.
Returns
wiperValue - Value read from EEPROM.

◆ ad5110_remove()

int32_t ad5110_remove ( struct ad5110_dev dev)

Free the resources allocated by ad5110_init().

Write the content of serial register data to RDAC.

Parameters
dev- The device structure.
Returns
ret - The result of the remove procedure.

◆ ad5110_reset()

void ad5110_reset ( struct ad5110_dev dev)

Software reset; makes a refresh of RDAC register with EEPROM.

Software shutdown.

Parameters
dev- The device structure.
Returns
none.

◆ ad5110_shut_down()

void ad5110_shut_down ( struct ad5110_dev dev,
uint8_t  value 
)

Software shutdown.

Parameters
dev- The device structure.
value- the value written to shut down register. Example: ShutDownOff - the device is on. ShutDownOn - the device is shut down.
Returns
none.

◆ ad5110_write_rdac()

void ad5110_write_rdac ( struct ad5110_dev dev,
uint8_t  rdac_value 
)

Write the content of serial register data to RDAC.

Read the content of RDAC register.

Parameters
dev- The device structure.
rdac_value- Value of the serial register.
Returns
none.

◆ ad5110_write_rdac_eeprom()

void ad5110_write_rdac_eeprom ( struct ad5110_dev dev)

Write the content of RDAC register to EEPROM.

Read wiper position from EEPROM.

Parameters
dev- The device structure.
Returns
none.