no-OS
Classes | Macros | Functions
ad9081.c File Reference

Implementation of AD9081 Driver. More...

#include <stdlib.h>
#include <string.h>
#include "no_os_error.h"
#include "adi_cms_api_common.h"
#include "no_os_util.h"
#include "no_os_delay.h"
#include "no_os_alloc.h"
#include "adi_ad9081_hal.h"
#include "no_os_print_log.h"
#include "ad9081.h"
#include <inttypes.h>
Include dependency graph for ad9081.c:

Classes

struct  ad9081_jesd204_priv
 

Macros

#define __STDC_FORMAT_MACROS
 
#define AD9081_PERI_SEL_GPIO6   2
 
#define AD9081_PERI_SEL_GPIO7   3
 
#define AD9081_PERI_SEL_GPIO8   4
 
#define AD9081_PERI_SEL_GPIO9   5
 
#define AD9081_PERI_SEL_GPIO10   6
 
#define AD9081_PERI_SEL_SYNCINB1_P   7
 
#define AD9081_PERI_SEL_SYNCINB1_N   8
 
#define CHIPID_AD9081   0x9081
 
#define CHIPID_AD9082   0x9082
 
#define CHIPID_MASK   0xFFFF
 
#define for_each_cddc(bit, mask)
 
#define for_each_fddc(bit, mask)
 

Functions

int adi_ad9081_device_gpio_set_highz (adi_ad9081_device_t *device, uint8_t gpio_index)
 
int ad9081_jesd_tx_link_status_print (struct ad9081_phy *phy, struct jesd204_link *lnk, int retry)
 
int32_t ad9081_reset_pin_ctrl (void *user_data, uint8_t enable)
 
int32_t ad9081_log_write (void *user_data, int32_t log_type, const char *message, va_list argp)
 
int32_t ad9081_parse_jesd_link_init_param (struct ad9081_jesd_link *link, const struct link_init_param *init_param, bool jtx)
 
int32_t ad9081_parse_init_param (struct ad9081_phy *phy, const struct ad9081_init_param *init_param)
 
int ad9081_jesd204_uninit (struct jesd204_dev *jdev, enum jesd204_state_op_reason reason)
 
int32_t ad9081_init (struct ad9081_phy **dev, const struct ad9081_init_param *init_param)
 
int32_t ad9081_remove (struct ad9081_phy *dev)
 

Detailed Description

Implementation of AD9081 Driver.

Author
DBogdan (drago.nosp@m.s.bo.nosp@m.gdan@.nosp@m.anal.nosp@m.og.co.nosp@m.m)

Copyright 2020(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

◆ __STDC_FORMAT_MACROS

#define __STDC_FORMAT_MACROS

◆ AD9081_PERI_SEL_GPIO10

#define AD9081_PERI_SEL_GPIO10   6

◆ AD9081_PERI_SEL_GPIO6

#define AD9081_PERI_SEL_GPIO6   2

◆ AD9081_PERI_SEL_GPIO7

#define AD9081_PERI_SEL_GPIO7   3

◆ AD9081_PERI_SEL_GPIO8

#define AD9081_PERI_SEL_GPIO8   4

◆ AD9081_PERI_SEL_GPIO9

#define AD9081_PERI_SEL_GPIO9   5

◆ AD9081_PERI_SEL_SYNCINB1_N

#define AD9081_PERI_SEL_SYNCINB1_N   8

◆ AD9081_PERI_SEL_SYNCINB1_P

#define AD9081_PERI_SEL_SYNCINB1_P   7

◆ CHIPID_AD9081

#define CHIPID_AD9081   0x9081

◆ CHIPID_AD9082

#define CHIPID_AD9082   0x9082

◆ CHIPID_MASK

#define CHIPID_MASK   0xFFFF

◆ for_each_cddc

#define for_each_cddc (   bit,
  mask 
)
Value:
for ((bit) = 0; (bit) < MAX_NUM_MAIN_DATAPATHS; (bit)++) \
if ((mask) & NO_OS_BIT(bit))

◆ for_each_fddc

#define for_each_fddc (   bit,
  mask 
)
Value:
for ((bit) = 0; (bit) < MAX_NUM_CHANNELIZER; (bit)++) \
if ((mask) & NO_OS_BIT(bit))

Function Documentation

◆ ad9081_init()

int32_t ad9081_init ( struct ad9081_phy **  dev,
const struct ad9081_init_param init_param 
)

Initialize the device.

Parameters
dev- The device structure.
init_param- The structure that contains the device initial parameters.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ ad9081_jesd204_uninit()

int ad9081_jesd204_uninit ( struct jesd204_dev *  jdev,
enum jesd204_state_op_reason  reason 
)

◆ ad9081_jesd_tx_link_status_print()

int ad9081_jesd_tx_link_status_print ( struct ad9081_phy phy,
struct jesd204_link lnk,
int  retry 
)

◆ ad9081_log_write()

int32_t ad9081_log_write ( void *  user_data,
int32_t  log_type,
const char *  message,
va_list  argp 
)

◆ ad9081_parse_init_param()

int32_t ad9081_parse_init_param ( struct ad9081_phy phy,
const struct ad9081_init_param init_param 
)
Here is the caller graph for this function:

◆ ad9081_parse_jesd_link_init_param()

int32_t ad9081_parse_jesd_link_init_param ( struct ad9081_jesd_link link,
const struct link_init_param init_param,
bool  jtx 
)
Here is the caller graph for this function:

◆ ad9081_remove()

int32_t ad9081_remove ( struct ad9081_phy dev)

Remove the device - release resources.

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

◆ ad9081_reset_pin_ctrl()

int32_t ad9081_reset_pin_ctrl ( void *  user_data,
uint8_t  enable 
)

◆ adi_ad9081_device_gpio_set_highz()

int adi_ad9081_device_gpio_set_highz ( adi_ad9081_device_t *  device,
uint8_t  gpio_index 
)
NO_OS_BIT
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
MAX_NUM_MAIN_DATAPATHS
#define MAX_NUM_MAIN_DATAPATHS
Definition: ad9081.h:50
MAX_NUM_CHANNELIZER
#define MAX_NUM_CHANNELIZER
Definition: ad9081.h:51