diff options
author | Lane Kolbly <lane.kolbly@ni.com> | 2021-10-15 12:43:06 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-10-20 12:45:48 -0700 |
commit | be8da4e7b795ed6e974844a7c2ff3ccb7faa00e5 (patch) | |
tree | 188a04252ef36ffe54f5517ab37398d690e92500 /host/docs | |
parent | f31edb56ae3f44f7fadf6a0e6f813db7ebd5f3c0 (diff) | |
download | uhd-be8da4e7b795ed6e974844a7c2ff3ccb7faa00e5.tar.gz uhd-be8da4e7b795ed6e974844a7c2ff3ccb7faa00e5.tar.bz2 uhd-be8da4e7b795ed6e974844a7c2ff3ccb7faa00e5.zip |
docs: Fix GPIO documentation example
Diffstat (limited to 'host/docs')
-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); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |