no-OS
Macros | Functions
ad525x.c File Reference
#include <stdlib.h>
#include "ad525x.h"
#include "no_os_alloc.h"
Include dependency graph for ad525x.c:

Macros

#define MSB_BYTE_MASK   0xFF00
 
#define LSB_BYTE_MASK   0x00FF
 
#define ONEBYTE_OFFSET   0x8
 

Functions

int8_t ad525x_init (struct ad525x_dev **device, struct ad525x_init_param init_param)
 Initialize SPI and Initial Values for AD5172 Board. More...
 
int32_t ad525x_remove (struct ad525x_dev *dev)
 Free the resources allocated by ad525x_init(). More...
 
uint16_t ad525x_read_mem (struct ad525x_dev *dev, uint8_t address)
 Read data from the EEMEM. More...
 
void ad525x_write_mem (struct ad525x_dev *dev, uint8_t address, uint16_t data)
 Write data to EEMEM. More...
 
uint16_t ad525x_read_rdac (struct ad525x_dev *dev, uint8_t address)
 Read data from the RDAC register. More...
 
void ad525x_write_rdac (struct ad525x_dev *dev, uint8_t address, uint16_t data)
 Write data to RDAC register. More...
 
void ad525x_write_command (struct ad525x_dev *dev, uint8_t command, uint8_t address)
 Write quick commands to the device. More...
 

Macro Definition Documentation

◆ LSB_BYTE_MASK

#define LSB_BYTE_MASK   0x00FF

◆ MSB_BYTE_MASK

#define MSB_BYTE_MASK   0xFF00

◆ ONEBYTE_OFFSET

#define ONEBYTE_OFFSET   0x8

Function Documentation

◆ ad525x_init()

int8_t ad525x_init ( struct ad525x_dev **  device,
struct ad525x_init_param  init_param 
)

Initialize SPI and Initial Values for AD5172 Board.

Parameters
device- The device structure.
init_param- The structure that contains the device initial parameters.
Returns
success

◆ ad525x_read_mem()

uint16_t ad525x_read_mem ( struct ad525x_dev dev,
uint8_t  address 
)

Read data from the EEMEM.

Parameters
dev- The device structure.
address- desired address of the EEMEM memory
Returns
success

◆ ad525x_read_rdac()

uint16_t ad525x_read_rdac ( struct ad525x_dev dev,
uint8_t  address 
)

Read data from the RDAC register.

Parameters
dev- The device structure.
address- desired address of the RDAC registers
Returns
success

◆ ad525x_remove()

int32_t ad525x_remove ( struct ad525x_dev dev)

Free the resources allocated by ad525x_init().

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

◆ ad525x_write_command()

void ad525x_write_command ( struct ad525x_dev dev,
uint8_t  command,
uint8_t  address 
)

Write quick commands to the device.

Parameters
dev- The device structure.
command- desired command, the functionality of a command it may vary at diffrent devices
address- Address to be written
Returns
success

◆ ad525x_write_mem()

void ad525x_write_mem ( struct ad525x_dev dev,
uint8_t  address,
uint16_t  data 
)

Write data to EEMEM.

Parameters
dev- The device structure.
address- desired address of the EEMEM memory
data- the data which will be written to the memory
Returns
success

◆ ad525x_write_rdac()

void ad525x_write_rdac ( struct ad525x_dev dev,
uint8_t  address,
uint16_t  data 
)

Write data to RDAC register.

Parameters
dev- The device structure.
address- desired address of the RDAC register
data- the data which will be written to the RDAC register
Returns
success