Skip to content

Generic GPIO impulse counter driver. Counts impulses using GPIO interrupts.

Notifications You must be signed in to change notification settings

pawelkn/gpio-counter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gpio-counter

Generic GPIO impulse counter. Counts impulses using GPIO interrupts. Can be activated on low or high level. If needed, a debounce procedure can be performed.

Cross-compile build

export PATH=<path to toolchain executables>
export KERNEL_DIR=<path to kernel build directory>
export CROSS_COMPILE=<cross compilation prefix>
export ARCH=<architecture eg.: arm>
make

Device tree bindings

Required properties:

  • gpios: a spec for a GPIO to be used

Optional properties:

  • debounce-delay-us: pulse debounce duration

Example:

        counter {
                compatible = "gpio-counter";
                gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
                debounce-delay-us = <2>;
        };

About

Generic GPIO impulse counter driver. Counts impulses using GPIO interrupts.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published