Skip to content

nordic: hardware pulse counting #90907

Open
@jodzik

Description

@jodzik

Is your feature request related to a problem? Please describe.
I need several simple pulse counter, but signals has a high frequency(up to 1Mhz), therefore interrupt-based implementation may be too demanding on CPU.
nRF52832(in may case) and similar hardware are capable of hardware pulse counting, implementation of this can solve the problem.

Describe the solution you'd like
A sensor driver like /drivers/sensor/espressif/pcnt_esp32/
DTS may look like:

&pulse_counter {
    compatible = "nordic,pcnt"
    status = "okay";
    gpios = <&gpio0 26 GPIO_ACTIVE_LOW>;
    timer = <&timer4>;
    mode = "...";
}

OR


&timer4 {
    status = "okay";
    pulse_counter0: pulse_counter0 {
        compatible = "nordic,pcnt"
        status = "okay";
        mode = "...";
        gpios = <&gpio0 26 GPIO_ACTIVE_LOW>;
    }
}

Maybe it's better to use pinctl node to select GPIOTE/pin.

Describe alternatives you've considered
Use nrfx directly or use external driver(e.g.).

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions