Developing The Application - Analog Devices ADRV9001 User Manual

System development user guide for the rf agile transceiver family
Hide thumbs Also See for ADRV9001:
Table of Contents

Advertisement

UG-1828
API Error Handling and Debug
Logging Functions
The API provides a simple logging feature function that may be enabled for debugging purposes. Available logging levels are given by
adi_common_LogLevel_e as shown in Table 11.
Table 11. Logging Level
Function Name
ADI_COMMON_LOG_NONE
ADI_COMMON_LOG_MSG
ADI_COMMON_LOG_WARN
ADI_COMMON_LOG_ERR
ADI_COMMON_LOG_API
ADI_COMMON_LOG_API_PRIV
ADI_COMMON_LOG_BF
ADI_COMMON_LOG_HAL
ADI_COMMON_LOG_SPI
ADI_COMMON_LOG_ALL
When logging is enabled, the APIs call to send debug information to the system via the HAL. The function adi_hal_LogLevelSet is used
to configure flags in the HAL to control the processing of message types from the API layer. ADI transceiver open hardware function,
adi_hal_HwOpen, calls this function to set the desired logging operation. This feature requires an implementation for the
adi_hal_LogWrite function. The developer must specify the logging level by assigning the appropriate flag values to the #define
ADI_ADRV9001_LOGGING in adi_adrv9001_user.h
Error Handling
Each ADRV9001 API function returns an int32_t value representing a recovery action, with 0 being "no action" or success. Recovery
actions are divided into:
Warning actions are those that don't have an impact at the time of executing the device API but can cause performance issues or
logging problems. The value of this actions is positive.
Error actions are those that cause API not to be able to run and an action is required for API to go back to a good state. The value of
this actions is negative.
See the ADRV9001_API.chm document for additional details.

DEVELOPING THE APPLICATION

The user application needs to allocate the init (adi_adrv9001_Init_t) and device (adi_adrv9001_Device_t) structures. Users may want to
consider allocating memory from the heap for the adi_adrv9001_Device_t and adi_adrv9001_Init_t as the structures have members
expected to be on the order of TBD KB.
The adi_adrv9001_Init_t structure is used to contain the customer profile initialization settings to configure an ADRV9001 device. This
init structure is passed to the ADRV9001 API init functions during the initialization phase. This structure contains the device profile
settings, system clock settings, data interface settings, and ADRV9001 specific SPI slave controller settings. The application layer passes a
pointer to an instance of the adi_adrv9001_Init_t structure for a particular ADRV9001 device to handle the majority of the device core
initialization. After initialization is complete, the adi_adrv9001_Init_t structure may be deallocated if desired.
The adi_adrv9001_Device_t data structure contains information for a particular ADRV9001 device, including devHalInfo, error and
caching structures. To support multiple ADRV9001 devices, the Application would need to instantiate multiple adi_adrv9001_Device_t
structures to describe each physical ADRV9001 device. Multiple ADRV9001 devices can have their own adi_adrv9001_Init_t or can
share a common adi_adrv9001_Init_t if they are to be configurated identically.
devHalInfo
devHalInfo is a structure that allows the user to define and pass any platform hardware settings to the platform HAL layer functions. The
common device structure adi_common_Device_t contains devHalInfo. devHalInfo is passed to the platform specific HAL function as a
void *devHalCfg. ADRV9001 API functions shall not read or write the devHalInfo but pass it as parameter to all HAL function calls.
The Application developer must define devHalInfo per system HAL implementation requirements. The Application developer may
implement any structure to pass any hardware configuration information that the hardware requires between application layer and
platform layer. For example, devHalInfo contains SPI chip select information to be used for the physical ADRV9001 device.
Purpose
All types of log messages not selected
Log message type
Warning message type
Error message type
API function entry for logging purposes
Private API function entry for logging purposes
BF function entry for logging purposes
ADI HAL function entry for logging purposes
SPI transaction type
All types of log messages selected
Rev. PrA | Page 34 of 253
Preliminary Technical Data

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ADRV9001 and is the answer not in the manual?

This manual is also suitable for:

Adrv9002

Table of Contents

Save PDF