Hi,
I would like to use 2 separate GPIO pins to do other purposes. One is as an input pin and another one is as an output pin. How should I do it?
Hope to hear from you soon.
Hi,
I would like to use 2 separate GPIO pins to do other purposes. One is as an input pin and another one is as an output pin. How should I do it?
Hope to hear from you soon.
Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.
We have QCLI_demo with example of GPIO configuration demonstration.
Navigate to @QCLI_demo\build\gcc path and execute below instructions:
@QCLI_demo\build\gcc: setnev.bat periphenv.config \\This is will enable PERIPHERALS component or use " SET CFG_FEATURE_PERIPHERALS=true"
@QCLI_demo\build\gcc: build.bat t 4020 cdb \\Build the image
@QCLI_demo\build\gcc: flash_openocd.bat \\Flash the image on to device
Open Serial Terminal and Execute below instructions to Set example GPIO_12 as output and drive HIGH/LOW
> Peripherals GPIO gpio_tlmm
Peripherals\GPIO: USAGE: gpio_pin fun dir pull val
gpio_pin -> pin number
fun -> function value (0-15)
dir -> direction(input/ output) 0-input 1-output
pull -> gpio pull up/down/no-pull 0-No pull 1-Pull Down 2-Pull Up
val(value to drive if direction is output)
Example: Peripherals GPIO gpio_tlmm 12 0 1 0 1 //This will set GPIO_12 with function 0 set direction as output, No pull and drive HIGH
Example: Peripherals GPIO gpio_tlmm 12 0 1 1 0 //This will set GPIO_12 with function 0 set direction as input, No pull and drive LOW