Contenuto principale

getGPIOSource

R2026b

Query radio source that controls each GPIO signal

Since R2026b

Description

source = getGPIOSource(radio,bank) returns the radio source source that currently controls each GPIO signal in the GPIO bank bank on the radio associated with the radio object radio.

Use this function to query the current GPIO source mapping for a GPIO bank and verify which radio paths drive individual GPIO signals before modifying the mapping or configuring automatic transmit/receive (ATR) attributes. To assign a new source mapping, use the setGPIOSource function.

The behavior of GPIO source and attribute settings can vary between radio models depending on the hardware implementation. For details on source-to-pin routing for your device, consult the manufacturer documentation.

example

Examples

collapse all

Query which radio source currently controls each GPIO signal in a GPIO bank.

Create a radio object and select a GPIO bank.

radio = radioConfigurations("MyRadio");
banks = getGPIOBanks(radio);
gpioBank = banks(1);

Query the configured GPIO source for each signal in the selected bank. The source mapping depends on your radio model and the GPIO bank. This example shows results for a USRP N310 radio.

gpioSource = getGPIOSource(radio,gpioBank)
gpioSource = 12×1 string array
    "RF0"
    "RF2"
    "RF0"
    "RF0"
    "RF0"
    "RF0"
    "RF0"
    "RF0"
    "RF0"
    "RF0"

Input Arguments

collapse all

Radio object, specified as a radio object that corresponds to a radio setup configuration you saved using the Radio Setup wizard.

To create a radio object, call the radioConfigurations function with the name of your radio setup configuration. For example, for a radio setup configuration named MyRadio, call radio = radioConfigurations("MyRadio").

GPIO bank identifier, specified as a string scalar that identifies a GPIO bank on the radio.

To query the available GPIO bank identifiers on the radio, use the getGPIOBanks function.

Data Types: string

Output Arguments

collapse all

Configured GPIO source mapping for the specified bank, returned as a string column vector. Each element corresponds to one GPIO signal in the bank, in signal order. Each value identifies the radio source that controls the corresponding GPIO signal.

The number of GPIO signals represented in the returned mapping depends on the radio model and GPIO bank.

Data Types: string

Version History

Introduced in R2026b