no-OS
Classes | Macros | Typedefs | Enumerations
api_def.h File Reference

API definitions header file. More...

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

Go to the source code of this file.

Classes

struct  adi_reg_data
 
struct  adi_chip_id_t
 
struct  jesd_param_t
 

Macros

#define ADI_POW2_48   ((uint64_t)1u<<48)
 
#define ADI_MAXUINT48   (ADI_POW2_48 - 1)
 
#define ADI_POW2_32   ((uint64_t)1u<<32)
 
#define ADI_MAXUINT32   (ADI_POW2_32 - 1)
 
#define ADI_MAXUINT24   (0xFFFFFF)
 
#define ADI_GET_BYTE(w, p)   (uint8_t)(((w) >> (p)) & 0xFF)
 
#define ALL   -1
 
#define U64MSB   0x8000000000000000ull
 

Typedefs

typedef int32_t(* spi_xfer_t) (void *user_data, uint8_t *indata, uint8_t *outdata, int32_t size_bytes)
 Platform dependent SPI access functions. More...
 
typedef int32_t(* delay_us_t) (void *user_data, uint32_t us)
 Delay for specified number of microseconds. Platform Dependant. More...
 
typedef int(* hw_open_t) (void *user_data)
 Platform hardware initialisation for the AD9164 Device. More...
 
typedef int(* hw_close_t) (void *user_data)
 Closes any platform hardware resources for the AD9164 Device. More...
 
typedef int(* event_handler_t) (uint16_t event, uint8_t ref, void *data)
 Client Event Handler. More...
 
typedef int(* tx_en_pin_ctrl_t) (void *user_data, uint8_t enable)
 TX_ENABLE PIN CONTROL FUNCTION. More...
 
typedef int(* reset_pin_ctrl_t) (void *user_data, uint8_t enable)
 RESETB PIN CONTROL FUNCTION. More...
 

Enumerations

enum  spi_sdo_config_t {
  SPI_NONE = 0,
  SPI_SDO = 1,
  SPI_SDIO = 2,
  SPI_CONFIG_MAX = 3,
  SPI_NONE = 0,
  SPI_SDO = 1,
  SPI_SDIO = 2,
  SPI_CONFIG_MAX = 3
}
 
enum  signal_type_t {
  SIGNAL_CMOS = 0,
  SIGNAL_LVDS,
  SIGNAL_UNKNOWN,
  SIGNAL_CMOS = 0,
  SIGNAL_LVDS,
  SIGNAL_UNKNOWN
}
 
enum  signal_coupling_t {
  COUPLING_AC = 0,
  COUPLING_DC,
  COUPLING_UNKNOWN,
  COUPLING_AC = 0,
  COUPLING_DC,
  COUPLING_UNKNOWN
}
 
enum  jesd_link_t {
  JESD_LINK_0 = 0x0,
  JESD_LINK_1 = 0x1,
  JESD_LINK_ALL = 0xFF,
  JESD_LINK_0 = 0x0,
  JESD_LINK_1 = 0x1,
  JESD_LINK_ALL = 0xFF
}
 
enum  jesd_syncoutb_t {
  SYNCOUTB_0 = 0x0,
  SYNCOUTB_1 = 0x1,
  SYNCOUTB_ALL = 0xFF,
  SYNCOUTB_0 = 0x0,
  SYNCOUTB_1 = 0x1,
  SYNCOUTB_ALL = 0xFF
}
 
enum  jesd_sysref_mode_t {
  SYSREF_NONE = 0x0,
  SYSREF_ONESHOT,
  SYSREF_CONT,
  SYSREF_MON,
  SYSREF_MODE_INVLD,
  SYSREF_NONE,
  SYSREF_ONESHOT,
  SYSREF_CONT,
  SYSREF_MON,
  SYSREF_MODE_INVLD
}
 
enum  jesd_prbs_pattern_t {
  PRBS_NONE,
  PRBS7,
  PRBS15,
  PRBS31,
  PRBS_MAX,
  PRBS_NONE,
  PRBS7,
  PRBS15,
  PRBS31,
  PRBS_MAX
}
 

Detailed Description

API definitions header file.

This file contains all common API definitions.

Copyright(c) 2016 Analog Devices, Inc. All Rights Reserved. This software is proprietary to Analog Devices, Inc. and its licensors. By using this software you agree to the terms of the associated Analog Devices Software License Agreement.

Macro Definition Documentation

◆ ADI_GET_BYTE

#define ADI_GET_BYTE (   w,
 
)    (uint8_t)(((w) >> (p)) & 0xFF)

◆ ADI_MAXUINT24

#define ADI_MAXUINT24   (0xFFFFFF)

◆ ADI_MAXUINT32

#define ADI_MAXUINT32   (ADI_POW2_32 - 1)

◆ ADI_MAXUINT48

#define ADI_MAXUINT48   (ADI_POW2_48 - 1)

◆ ADI_POW2_32

#define ADI_POW2_32   ((uint64_t)1u<<32)

◆ ADI_POW2_48

#define ADI_POW2_48   ((uint64_t)1u<<48)

◆ ALL

#define ALL   -1

◆ U64MSB

#define U64MSB   0x8000000000000000ull

Typedef Documentation

◆ delay_us_t

typedef int32_t(* delay_us_t) (void *user_data, uint32_t us)

Delay for specified number of microseconds. Platform Dependant.

Performs a blocking or sleep delay for the specified time in microseconds The implementation of this function is platform dependant and is required for correct operation of the API.

Return values
0for success
Anynon-zero value indicates an error
Parameters
us- time to delay/sleep in microseconds.

◆ event_handler_t

typedef int(* event_handler_t) (uint16_t event, uint8_t ref, void *data)

Client Event Handler.

Parameters
eventA uint16_t value representing the event that occurred.
refA uint8_t value indicating the reference for that event if any. For example 0 if even occured on lane 0.
dataA void pointer to any user data that may pertain to that event.
Return values
0for success
Anynon-zero value indicates an error
Note

◆ hw_close_t

typedef int(* hw_close_t) (void *user_data)

Closes any platform hardware resources for the AD9164 Device.

This function shall close or shutdown all external hardware resources required by the AD9164 Device and API for correct functionatlity as per the target platform. For example initialisation of SPI, GPIO resources, clocks etc. It should close and free any resources assigned in the hw_open_t function.

Parameters
*user_data- A void pointer to a client defined structure containing any parameters/settings that may be required by the function to close/shutdown the hardware for the ADI Device.
Return values
0for success
Anynon-zero value indicates an error

◆ hw_open_t

typedef int(* hw_open_t) (void *user_data)

Platform hardware initialisation for the AD9164 Device.

This function shall initialize all external hardware resources required by the ADI Device and API for correct functionatlity as per the target platform. For example initialisation of SPI, GPIO resources, clocks etc.

Parameters
*user_data- A void pointer to a client defined structure containing any parameters/settings that may be required by the function to initialise the hardware for the ADI Device.
Return values
0for success
Anynon-zero value indicates an error

◆ reset_pin_ctrl_t

typedef int(* reset_pin_ctrl_t) (void *user_data, uint8_t enable)

RESETB PIN CONTROL FUNCTION.

Parameters
*user_dataA void pointer to a client defined structure containing any parameters/settings that may be required by the function to control the hardware for the ADI Device RESETB PIN.
enableA uint8_t value indicating the desired enable/disable reset via the ADI device RESETB pin. A value of 1 indicates RESETB pin is set LOW A value of 0 indicates RESETB pin is set HIGH
Return values
0for success
Anynon-zero value indicates an error
Note

◆ spi_xfer_t

typedef int32_t(* spi_xfer_t) (void *user_data, uint8_t *indata, uint8_t *outdata, int32_t size_bytes)

Platform dependent SPI access functions.

Parameters
indataPointer to array with the data to be sent on the SPI
outdataPointer to array where the data to which the SPI will be written
size_bytesThe size in bytes allocated for each of the indata and outdata arrays.
Return values
0for success
Anynon-zero value indicates an error
Note
indata and outdata arrays are of same size.

◆ tx_en_pin_ctrl_t

typedef int(* tx_en_pin_ctrl_t) (void *user_data, uint8_t enable)

TX_ENABLE PIN CONTROL FUNCTION.

Parameters
*user_dataA void pointer to a client defined structure containing any parameters/settings that may be required by the function to control the hardware for the ADI Device TX_ENABLE PIN.
enableA uint8_t value indicating the desired enable/disable setting for the tx_enable pin. A value of 1 indicates TX_ENABLE pin is set HIGH A value of 0 indicates TX_ENABLE pin is set LOW
Return values
0for success
Anynon-zero value indicates an error
Note

Enumeration Type Documentation

◆ jesd_link_t

Enumerates JESD LINK Signals

Enumerator
JESD_LINK_0 

JESD LINK 0

JESD_LINK_1 

JESD LINK 1

JESD_LINK_ALL 

ALL JESD LINKS

JESD_LINK_0 

JESD LINK 0

JESD_LINK_1 

JESD LINK 1

JESD_LINK_ALL 

ALL JESD LINKS

◆ jesd_prbs_pattern_t

Enumerates all available PRBS patterns

Enumerator
PRBS_NONE 

PRBS OFF

PRBS7 

PRBS7 pattern

PRBS15 

PRBS15 pattern

PRBS31 

PRBS31 pattern

PRBS_MAX 

Number of member in this enum

PRBS_NONE 

PRBS OFF

PRBS7 

PRBS7 pattern

PRBS15 

PRBS15 pattern

PRBS31 

PRBS31 pattern

PRBS_MAX 

Number of member in this enum

◆ jesd_syncoutb_t

Enumerates SYNCOUTB Output Signals

Enumerator
SYNCOUTB_0 

SYNCOUTB 0

SYNCOUTB_1 

SYNCOUTB 1

SYNCOUTB_ALL 

ALL SYNCOUTB SIGNALS

SYNCOUTB_0 

SYNCOUTB 0

SYNCOUTB_1 

SYNCOUTB 1

SYNCOUTB_ALL 

ALL SYNCOUTB SIGNALS

◆ jesd_sysref_mode_t

Enumerates SYSREF Synchronization Mode

Enumerator
SYSREF_NONE 

No SYSREF Support

SYSREF_ONESHOT 

ONE-SHOT SYSREF

SYSREF_CONT 

Continuous Sysref Synchronisation

SYSREF_MON 

SYSREF monitor Mode

SYSREF_MODE_INVLD 
SYSREF_NONE 

No SYSREF Support

SYSREF_ONESHOT 

ONE-SHOT SYSREF

SYSREF_CONT 

Continuous Sysref Synchronisation

SYSREF_MON 

SYSREF monitor Mode

SYSREF_MODE_INVLD 

◆ signal_coupling_t

Enumerate coupling mode

Enumerator
COUPLING_AC 
COUPLING_DC 

AC COUPLED SIGNAL

COUPLING_UNKNOWN 

DC SIGNAL
UNKNOWN/UNDEFINED COUPLING

COUPLING_AC 
COUPLING_DC 

AC COUPLED SIGNAL

COUPLING_UNKNOWN 

DC SIGNAL
UNKNOWN/UNDEFINED COUPLING

◆ signal_type_t

Enumerate Signal Types

Enumerator
SIGNAL_CMOS 
SIGNAL_LVDS 

CMOS SIGNAL TYPE

SIGNAL_UNKNOWN 

LVDS SIGNAL TYPE UNKNOW/UNDEFINED SIGNAL TYPE

SIGNAL_CMOS 
SIGNAL_LVDS 

CMOS SIGNAL TYPE

SIGNAL_UNKNOWN 

LVDS SIGNAL TYPE UNKNOW/UNDEFINED SIGNAL TYPE

◆ spi_sdo_config_t

SPI Interface Parameters.

Enumerator
SPI_NONE 
SPI_SDO 
SPI_SDIO 
SPI_CONFIG_MAX 
SPI_NONE 
SPI_SDO 
SPI_SDIO 
SPI_CONFIG_MAX