UG-1295 ADRV9008-1/ADRV9008-2/ADRV9009 Hardware Reference Manual
Rev. 0 | Page 20 of 247
SOFTWARE INTEGRATION
The API package was developed on a Xilinx Zynq ZC706 reference platform and utilizes a Cortex®-A9 processor that runs a Linux
variant. Using the provided API in a custom hardware and software environment is readily accomplished because the API was developed
abiding by ANSI C constructs and maintaining Linux system call transparency. The ANSI C standard was followed to ensure agnostic
processor and operating system integration with the API code.
IMPLEMENTING HARDWARE ABSTRACTION INTERFACE
Users develop code to target custom hardware platforms and therefore use different drivers for the peripherals, for example, SPI and
GPIO, in comparison to the drivers chosen for the Analog Devices evaluation platform. The HAL interface is a library of functions that
the API uses when the API must access the target platform hardware. The HAL is defined by adi_hal.h. The implementation of this
interface is platform dependent and is implemented by the developer in the adi_hal.c file. The prototypes of the required functions
defined in the adi_hal.h file must not be modified because doing so breaks the API.
Table 1 lists the functions required by the HAL interface for integration. For full details on the definition and required operation of these
functions, see the Hardware Abstraction Layer section and the HAL Interface Definition section.
Table 1. HAL Interface Functions for User Integration
ADIHAL_openHw Open and initialize all platform drivers/resources and peripherals required to control the device (SPI, timer, logging)
ADIHAL_closeHw Close any resources opened by ADIHAL_openHw
ADIHAL_resetHw Toggle the hardware reset signal for the device
ADIHAL_setTimeout Set the maximum time in which the API expects the HAL functions to complete and return
ADIHAL_spiWriteByte Write a single byte of data to a 15-bit register address on the targeted SPI device
ADIHAL_spiReadByte Read a single byte of data from a 15-bit register address on the targeted SPI device
ADIHAL_spiWriteBytes Write an array of data bytes to an array of register addresses on the targeted SPI device
ADIHAL_spiReadBytes Read an array of data bytes from an array of register addresses on the targeted SPI device
ADIHAL_spiWriteField Perform a read/modify/write to a bit field in a particular SPI register
ADIHAL_spiReadField Read a particular bit field of data from a SPI register
ADIHAL_wait_us Perform a wait/thread/sleep operation in units of μs
Mask to set the severity of information to write to the log (error/warning/message)
ADIHAL_writeToLog Log a debug message (message/warning/error) from the API to the platform log
DEVELOPING THE APPLICATION
The /src/app/example/headless.c file provides a user example demonstrating top level configuration and control. The example
application was written to support the control of one device. The API was written to support the control of multiple devices. Because the
API is written in C, a pointer to a
taliseDevice_t data structure is used to describe or point to a particular device. To support
multiple devices, the application layer code must instantiate multiple
taliseDevice_t structures to describe each physical device.
Many initialization settings also have data structures that are defined by the API.
Include Files
The API has multiple .h header files. For core API functionality, Table 2 shows the mandatory .h header files that must be included in the
application layer program. Optional add on API functions can be included if the application requires those features as shown in Table 3.
Note that the places
typedef definitions in files with _types suffixes, for example, talise_types.h. These _types.h files are included
within their corresponding .h files and do no need to be manually included in the application layer code.
Table 2. Mandatory .h Header Files for the Application Layer
Mandatory Include Files Description
talise.h
Core run-time functions
talise_error.h
Core error handling functions
talise_arm.h
Arm related functions
Calibration related functions
talise_gpio.h
GPIO related functions
talise_jesd204.h
JESD204B interface related functions
talise_radioctrl.h
Functions for controlling the radio
talise_rx.h
Receiver related functions
talise_tx.h
Transmitter related functions