diff options
Diffstat (limited to 'host/docs/gpio_api.dox')
-rw-r--r-- | host/docs/gpio_api.dox | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/host/docs/gpio_api.dox b/host/docs/gpio_api.dox index 05a3ad8e3..bcea7c5c8 100644 --- a/host/docs/gpio_api.dox +++ b/host/docs/gpio_api.dox @@ -96,7 +96,7 @@ GPIO pins you intend to use. To set up the ATR, you use uhd::usrp::multi_usrp::s The counterpart to setting the ATR (the "getter"), is called uhd::usrp::multi_usrp::get_gpio_attr(). -t has the exact same attributes as above, and has +It has the exact same attributes as above, and has one more: - **READBACK**: Readback the GPIOs marked as inputs. @@ -125,10 +125,10 @@ up with the following code: #define ATR_MASKS (AMP_GPIO_MASK | MAN_GPIO_MASK) // set up our values for ATR control: 1 for ATR, 0 for manual - #define ATR_CONTROL (AMP_GPIO_MASK & ~MAN_GPIO_MASK) + #define ATR_CONTROL (AMP_GPIO_MASK) // set up the GPIO directions: 1 for output, 0 for input - #define GPIO_DDR (AMP_GPIO_MASK & ~MAN_GPIO_MASK) + #define GPIO_DDR (AMP_GPIO_MASK | MAN_GPIO_MASK) // assume an existing USRP device handle, called "usrp_x300" @@ -142,7 +142,7 @@ up with the following code: // finally, let's set up GPIO6 as we described above usrp_x300->set_gpio_attr("FP0", "ATR_0X", 0, AMP_GPIO_MASK); usrp_x300->set_gpio_attr("FP0", "ATR_RX", 0, AMP_GPIO_MASK); - usrp_x300->set_gpio_attr("FP0", "ATR_TX", 1, AMP_GPIO_MASK); + usrp_x300->set_gpio_attr("FP0", "ATR_TX", (1 << 3), AMP_GPIO_MASK); usrp_x300->set_gpio_attr("FP0", "ATR_XX", 0, AMP_GPIO_MASK); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -178,7 +178,7 @@ GPIO bank, where the controlled GPIO is now GPIO3 instead of GPIO6. // finally, let's set up GPIO3 as we described above usrp_e300->set_gpio_attr("INT0", "ATR_0X", 0, AMP_GPIO_MASK); usrp_e300->set_gpio_attr("INT0", "ATR_RX", 0, AMP_GPIO_MASK); - usrp_e300->set_gpio_attr("INT0", "ATR_TX", 1, AMP_GPIO_MASK); + usrp_e300->set_gpio_attr("INT0", "ATR_TX", (1 << 3), AMP_GPIO_MASK); usrp_e300->set_gpio_attr("INT0", "ATR_XX", 0, AMP_GPIO_MASK); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |