File: rotary_encoder.h

package info (click to toggle)
pigpio 1.78-1.1
  • links: PTS
  • area: main
  • in suites: sid, trixie
  • size: 7,088 kB
  • sloc: ansic: 17,891; python: 4,232; sh: 741; cpp: 281; makefile: 135
file content (25 lines) | stat: -rw-r--r-- 597 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef ROTARY_ENCODER_H
#define ROTARY_ENCODER_H

typedef void (*Pi_Renc_CB_t)(int);

struct _Pi_Renc_s;

typedef struct _Pi_Renc_s Pi_Renc_t;

Pi_Renc_t * Pi_Renc(int gpioA, int gpioB, Pi_Renc_CB_t callback);
/*
   This function establishes a rotary encoder on gpioA and gpioB.

   When the encoder is turned the callback function is called.

   A pointer to a private data type is returned.  This should be passed
   to Pi_Renc_cancel if the rotary encoder is to be cancelled.
*/

void Pi_Renc_cancel(Pi_Renc_t *renc);
/*
   This function releases the resources used by the decoder.
*/

#endif