![]() |
no-OS
|
#include <stdint.h>#include <stdlib.h>#include <string.h>#include <errno.h>#include <inttypes.h>#include "ad9361.h"#include "ad9361_util.h"#include "ad9361_ext_band_ctrl.h"#include "no_os_gpio.h"#include "no_os_delay.h"#include "no_os_alloc.h"#include "no_os_spi.h"Functions | |
| struct ad9361_band_setting * | ad9361_band_setting_alloc (const char *name, uint64_t freq_min, uint64_t freq_max, uint32_t ngpios) |
| Allocate a band setting descriptor. | |
| void | ad9361_band_setting_free (struct ad9361_band_setting *s) |
| Release a band setting and its sub-sequences. | |
| int | ad9361_band_setting_set_gpio (struct ad9361_band_setting *s, uint32_t gpio_idx, uint32_t op) |
| Set the operation for one GPIO pin. | |
| void | ad9361_band_setting_set_rx_port (struct ad9361_band_setting *s, uint32_t port) |
| Set the RX RF port for this band. | |
| void | ad9361_band_setting_set_tx_port (struct ad9361_band_setting *s, uint32_t port) |
| Set the TX RF port for this band. | |
| void | ad9361_band_setting_set_delay (struct ad9361_band_setting *s, uint32_t delay_us) |
| Set the post-step delay (microseconds). | |
| struct ad9361_ext_band_ctl * | ad9361_ext_band_ctl_alloc (void) |
| Allocate an external band controller. | |
| void | ad9361_ext_band_ctl_free (struct ad9361_ext_band_ctl *ctl) |
| Release a controller and all registered settings. GPIO descriptors are NOT freed – the caller owns them. | |
| int | ad9361_ext_band_ctl_add_gpio (struct ad9361_ext_band_ctl *ctl, struct no_os_gpio_desc *gpio) |
| Register a GPIO with the controller. GPIOs are referenced by add order (0 = first added). | |
| int | ad9361_ext_band_ctl_add_rx_setting (struct ad9361_ext_band_ctl *ctl, struct ad9361_band_setting *s) |
| Append an RX band setting. Settings are matched first-to-last; the first frequency match wins. | |
| int | ad9361_ext_band_ctl_add_tx_setting (struct ad9361_ext_band_ctl *ctl, struct ad9361_band_setting *s) |
| Append a TX band setting. Settings are matched first-to-last; the first frequency match wins. | |
| int32_t | ad9361_register_ext_band_control (struct ad9361_rf_phy *phy, struct ad9361_ext_band_ctl *ctl) |
| Attach a controller to a PHY. | |
| void | ad9361_unregister_ext_band_control (struct ad9361_rf_phy *phy) |
| Detach the controller from a PHY. Does not free anything. | |
| int32_t | ad9361_adjust_rx_ext_band_settings (struct ad9361_rf_phy *phy, uint64_t freq) |
| Switch RX band for a new LO frequency. Called automatically from ad9361_rfpll_set_rate() on every RX LO change. Applications may also call this directly. | |
| int32_t | ad9361_adjust_tx_ext_band_settings (struct ad9361_rf_phy *phy, uint64_t freq) |
| Switch TX band for a new LO frequency. | |
| int32_t ad9361_adjust_rx_ext_band_settings | ( | struct ad9361_rf_phy * | phy, |
| uint64_t | freq ) |
Switch RX band for a new LO frequency. Called automatically from ad9361_rfpll_set_rate() on every RX LO change. Applications may also call this directly.
| phy | - AD9361 PHY state. |
| freq | - New RX LO frequency in Hz. |
| int32_t ad9361_adjust_tx_ext_band_settings | ( | struct ad9361_rf_phy * | phy, |
| uint64_t | freq ) |
Switch TX band for a new LO frequency.
| phy | - AD9361 PHY state. |
| freq | - New TX LO frequency in Hz. |
| struct ad9361_band_setting * ad9361_band_setting_alloc | ( | const char * | name, |
| uint64_t | freq_min, | ||
| uint64_t | freq_max, | ||
| uint32_t | ngpios ) |
Allocate a band setting descriptor.
| name | - Human-readable name (copied; may be NULL). |
| freq_min | - Inclusive lower bound of the frequency range (Hz). |
| freq_max | - Exclusive upper bound of the frequency range (Hz). |
| ngpios | - Number of GPIO lines this setting may drive (0 is valid). |
| void ad9361_band_setting_free | ( | struct ad9361_band_setting * | s | ) |
Release a band setting and its sub-sequences.
| s | - Band setting to free (may be NULL). |
| void ad9361_band_setting_set_delay | ( | struct ad9361_band_setting * | s, |
| uint32_t | delay_us ) |
Set the post-step delay (microseconds).
| s | - The band setting. |
| delay_us | - Delay in microseconds (0 = no delay). |
| int ad9361_band_setting_set_gpio | ( | struct ad9361_band_setting * | s, |
| uint32_t | gpio_idx, | ||
| uint32_t | op ) |
Set the operation for one GPIO pin.
| s | - The band setting. |
| gpio_idx | - Index in the controller's gpios[] array (0-based). |
| op | - AD9361_EXT_BAND_CTL_OP_LOW/HIGH/INPUT/NOP. |
| void ad9361_band_setting_set_rx_port | ( | struct ad9361_band_setting * | s, |
| uint32_t | port ) |
Set the RX RF port for this band.
| s | - The band setting. |
| port | - RX RF input port index. |
| void ad9361_band_setting_set_tx_port | ( | struct ad9361_band_setting * | s, |
| uint32_t | port ) |
Set the TX RF port for this band.
| s | - The band setting. |
| port | - TX RF output port index. |
| int ad9361_ext_band_ctl_add_gpio | ( | struct ad9361_ext_band_ctl * | ctl, |
| struct no_os_gpio_desc * | gpio ) |
Register a GPIO with the controller. GPIOs are referenced by add order (0 = first added).
| ctl | - The controller. |
| gpio | - A configured GPIO descriptor. |
| int ad9361_ext_band_ctl_add_rx_setting | ( | struct ad9361_ext_band_ctl * | ctl, |
| struct ad9361_band_setting * | s ) |
Append an RX band setting. Settings are matched first-to-last; the first frequency match wins.
| ctl | - The controller. |
| s | - Band setting to add. |
| int ad9361_ext_band_ctl_add_tx_setting | ( | struct ad9361_ext_band_ctl * | ctl, |
| struct ad9361_band_setting * | s ) |
Append a TX band setting. Settings are matched first-to-last; the first frequency match wins.
| ctl | - The controller. |
| s | - Band setting to add. |
| struct ad9361_ext_band_ctl * ad9361_ext_band_ctl_alloc | ( | void | ) |
Allocate an external band controller.
| void ad9361_ext_band_ctl_free | ( | struct ad9361_ext_band_ctl * | ctl | ) |
Release a controller and all registered settings. GPIO descriptors are NOT freed – the caller owns them.
| ctl | - Controller to free (may be NULL). |
| int32_t ad9361_register_ext_band_control | ( | struct ad9361_rf_phy * | phy, |
| struct ad9361_ext_band_ctl * | ctl ) |
Attach a controller to a PHY.
| phy | - AD9361 PHY state. |
| ctl | - External band controller to register. |
| void ad9361_unregister_ext_band_control | ( | struct ad9361_rf_phy * | phy | ) |
Detach the controller from a PHY. Does not free anything.
| phy | - AD9361 PHY state. |