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

Runtime control (NCO test tones, loopback) for AD9088. More...

#include "ad9088.h"
#include "no_os_util.h"
#include "adi_apollo_loopback.h"
Include dependency graph for ad9088_runtime.c:

Functions

int ad9088_set_cnco_test_tone (struct ad9088_phy *phy, adi_apollo_terminal_e terminal, uint8_t side, uint8_t cddc_num, bool enable, uint16_t offset)
 Enable or disable the coarse NCO DC test tone.
 
int ad9088_set_fnco_test_tone (struct ad9088_phy *phy, adi_apollo_terminal_e terminal, uint8_t side, uint8_t fddc_num, bool enable, uint16_t offset)
 Enable or disable the fine NCO DC test tone.
 
int ad9088_set_loopback_mode (struct ad9088_phy *phy, uint8_t side, uint8_t mode)
 Select the datapath loopback mode for one side.
 

Detailed Description

Runtime control (NCO test tones, loopback) for AD9088.

Author
CHegbeli (cipri.nosp@m.an.h.nosp@m.egbel.nosp@m.i@an.nosp@m.alog..nosp@m.com)

Copyright 2026(c) Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Function Documentation

◆ ad9088_set_cnco_test_tone()

int ad9088_set_cnco_test_tone ( struct ad9088_phy * phy,
adi_apollo_terminal_e terminal,
uint8_t side,
uint8_t cddc_num,
bool enable,
uint16_t offset )

Enable or disable the coarse NCO DC test tone.

While the tone is enabled the mixer runs in test mode and emits a DC offset instead of mixing; disabling it restores the mixer mode the device profile asks for.

Parameters
phy- The device structure.
terminal- Selects the transmit or receive datapath.
side- Datapath side index.
cddc_num- Coarse datapath index within the side.
enable- True to emit the tone, false to restore normal mixing.
offset- Tone amplitude as a raw DC offset, clamped to the maximum the datapath accepts.
Returns
- 0 in case of success, negative error code otherwise.

◆ ad9088_set_fnco_test_tone()

int ad9088_set_fnco_test_tone ( struct ad9088_phy * phy,
adi_apollo_terminal_e terminal,
uint8_t side,
uint8_t fddc_num,
bool enable,
uint16_t offset )

Enable or disable the fine NCO DC test tone.

While the tone is enabled the mixer runs in test mode and emits a DC offset instead of mixing; disabling it restores the mixer mode the device profile asks for.

Parameters
phy- The device structure.
terminal- Selects the transmit or receive datapath.
side- Datapath side index.
fddc_num- Fine datapath index within the side.
enable- True to emit the tone, false to restore normal mixing.
offset- Tone amplitude as a raw DC offset, clamped to the maximum the datapath accepts.
Returns
- 0 in case of success, negative error code otherwise.

◆ ad9088_set_loopback_mode()

int ad9088_set_loopback_mode ( struct ad9088_phy * phy,
uint8_t side,
uint8_t mode )

Select the datapath loopback mode for one side.

Any active loopback is torn down first, so switching modes needs a single call. A loopback only makes sense when the two directions run at the same sample rate, which is checked here.

Parameters
phy- The device structure.
side- Datapath side index.
mode- One of the ADI_APOLLO_LOOPBACK_* modes.
Returns
- 0 in case of success, negative error code otherwise.