Changes between Version 38 and Version 39 of gpio


Ignore:
Timestamp:
07/09/2024 05:27:48 PM (2 months ago)
Author:
Tim Harvey
Comment:

added another gpioset example showing how to pulse a gpio

Legend:

Unmodified
Added
Removed
Modified
  • gpio

    v38 v39  
    280280
    281281Examples (Venice):
    282  - Use gpiofind/gpioget/gpioset on the GPIO named 'pci_wdis#'
    283 {{{#!bash
    284 # gpiofind pci_wdis#
    285 gpiochip3 7
    286 # gpioget gpiochip3 7
    287 1
    288 # gpioset --mode=signal --background gpiochip3 7=0
    289 }}}
    290  
    291  - Finding DIO1 and setting it to output 1
     282 - Finding DIO1 and setting it to output 1 until process is killed (no background)
    292283{{{#!bash
    293284# gpioinfo | grep dio
     
    298289# gpioset --mode signal gpiochip0 9=1
    299290}}}
    300 
    301 - Note that once gpioset exits its process the GPIO's it changed will revert back to their prior state (by design) therefore we run it above with {{{--mode=signal}}} telling it to continue to run into it receives a signal and (optinally) {{{--background}}} telling it to detach from the controlling terminal to give our shell back. Another process cannot take control of the GPIO if it is being controlled already.
     291  - Note that once gpioset exits its process the GPIO's it changed will revert back to their prior state (by design) therefore we run it above with {{{--mode=signal}}} telling it to continue to run into it receives a signal and (optinally) {{{--background}}} telling it to detach from the controlling terminal to give our shell back. Another process cannot take control of the GPIO if it is being controlled already.
     292 - Use gpiofind/gpioget/gpioset on the GPIO named 'pci_wdis#' to drive it low indefinitely (background mode)
     293{{{#!bash
     294# gpiofind pci_wdis#
     295gpiochip3 7
     296# gpioget gpiochip3 7
     2971
     298# gpioset --mode=signal --background gpiochip3 7=0
     299}}}
     300  - in background mode the {{{gpioset}}} command continues to run in the background but can be killed via a SIGKILL or SIGTERM which will restore the GPIO to its original state and exit the process
     301 - Finding M2_OFF# and driving it low (asserting it) momentarily for 10ms then releasing it (de-asserting it)
     302{{{#!bash
     303# gpiofind m2_off#
     304gpiochip3 2
     305# gpioget gpiochip3 2
     3061
     307# gpioset --mode=time --usec 10000 gpiochip3 2=0
     308}}}
     309}}}
    302310
    303311References: