no-OS
Loading...
Searching...
No Matches
ad9523.c File Reference

Implementation of AD9523 Driver. More...

#include <stdlib.h>
#include <stdio.h>
#include "ad9523.h"
#include "no_os_alloc.h"
Include dependency graph for ad9523.c:

Macros

#define AD_IFE(_pde, _a, _b)
 
#define AD_IF(_pde, _a)
 

Functions

int32_t ad9523_spi_read (struct ad9523_dev *dev, uint32_t reg_addr, uint32_t *reg_data)
 Reads the value of the selected register.
 
int32_t ad9523_spi_write (struct ad9523_dev *dev, uint32_t reg_addr, uint32_t reg_data)
 Writes a value to the selected register.
 
int32_t ad9523_io_update (struct ad9523_dev *dev)
 Updates the AD9523 configuration.
 
int32_t ad9523_vco_out_map (struct ad9523_dev *dev, uint32_t ch, uint32_t out)
 Sets the clock provider for selected channel.
 
int32_t ad9523_calibrate (struct ad9523_dev *dev)
 Updates the AD9523 configuration.
 
int32_t ad9523_status (struct ad9523_dev *dev)
 Updates the AD9523 configuration.
 
int32_t ad9523_sync (struct ad9523_dev *dev)
 Updates the AD9523 configuration.
 
int32_t ad9523_init (struct ad9523_init_param *init_param)
 Initialize the AD9523 data structure with the default register values.
 
int32_t ad9523_setup (struct ad9523_dev **device, const struct ad9523_init_param *init_param)
 Setup the AD9523 device.
 
int32_t ad9523_remove (struct ad9523_dev *dev)
 Free the resources allocated by ad9523_setup().
 

Detailed Description

Implementation of AD9523 Driver.

Author
ACozma(andre.nosp@m.i.co.nosp@m.zma@a.nosp@m.nalo.nosp@m.g.com)

Copyright 2012-2016(c) Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Macro Definition Documentation

◆ AD_IF

#define AD_IF ( _pde,
_a )
Value:
AD_IFE(_pde, _a, 0)
#define AD_IFE(_pde, _a, _b)
Definition ad9523.c:18

◆ AD_IFE

#define AD_IFE ( _pde,
_a,
_b )
Value:
((dev->pdata->_pde) ? _a : _b)

Function Documentation

◆ ad9523_calibrate()

int32_t ad9523_calibrate ( struct ad9523_dev * dev)

Updates the AD9523 configuration.

Returns
Returns 0 in case of success or negative error code.

◆ ad9523_init()

int32_t ad9523_init ( struct ad9523_init_param * init_param)

Initialize the AD9523 data structure with the default register values.

Parameters
init_param- The device initial parameters.
Returns
Always return 0.

◆ ad9523_io_update()

int32_t ad9523_io_update ( struct ad9523_dev * dev)

Updates the AD9523 configuration.

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

◆ ad9523_remove()

int32_t ad9523_remove ( struct ad9523_dev * dev)

Free the resources allocated by ad9523_setup().

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

◆ ad9523_setup()

int32_t ad9523_setup ( struct ad9523_dev ** device,
const struct ad9523_init_param * init_param )

Setup the AD9523 device.

Parameters
device- The device structure.
init_param- The structure holding the device initial parameters.
Returns
Returns 0 in case of success or negative error code.

◆ ad9523_spi_read()

int32_t ad9523_spi_read ( struct ad9523_dev * dev,
uint32_t reg_addr,
uint32_t * reg_data )

Reads the value of the selected register.

Parameters
dev- The device structure.
reg_addr- The address of the register to read.
reg_data- Pointer to the read value.
Returns
Returns 0 in case of success or negative error code.

◆ ad9523_spi_write()

int32_t ad9523_spi_write ( struct ad9523_dev * dev,
uint32_t reg_addr,
uint32_t reg_data )

Writes a value to the selected register.

Parameters
dev- The device structure.
reg_addr- The address of the register to write to.
reg_data- The value to write to the register.
Returns
Returns 0 in case of success or negative error code.

◆ ad9523_status()

int32_t ad9523_status ( struct ad9523_dev * dev)

Updates the AD9523 configuration.

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

◆ ad9523_sync()

int32_t ad9523_sync ( struct ad9523_dev * dev)

Updates the AD9523 configuration.

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

◆ ad9523_vco_out_map()

int32_t ad9523_vco_out_map ( struct ad9523_dev * dev,
uint32_t ch,
uint32_t out )

Sets the clock provider for selected channel.

Parameters
dev- The device structure.
ch- Selected channel.
out- Selected clock provider.
Returns
Returns 0 in case of success or negative error code.