#346 GPIO Character Device Userspace API V2 - compatibility to old interface

This commit is contained in:
mstroh76
2025-05-02 13:10:40 +02:00
parent 9c9f3c1663
commit 38274fe6e8
7 changed files with 437 additions and 125 deletions

View File

@@ -297,19 +297,21 @@ extern void digitalWriteByte (int value) ;
extern void digitalWriteByte2 (int value) ;
// Interrupts
// (Also Pi hardware specific)
// status returned from waitForInterrupt V3.16
// status returned from waitForInterruptV2 V3.16
struct WPIWfiStatus {
int id;
int status; // -1: error, 0: timeout, 1: valud values for edge and timeStamp_us
unsigned int gpioPin; // gpio as BCM pin
unsigned int pin; // gpio as BCM pin
int edge; // One of INT_EDGE_FALLING or INT_EDGE_RISING
long long int timeStamp_us; // time stamp in microseconds, when interrupt happened
};
extern struct WPIWfiStatus waitForInterrupt (int pin, int edgeMode, int mS, unsigned long debounce_period_us) ; // V3.16 phylax
extern int wiringPiISR (int pin, int mode, void (*function)(struct WPIWfiStatus wfiStatus), unsigned long debounce_period_us) ; // v3.16 phylax
extern int waitForInterrupt (int pin, int ms) ;
extern int wiringPiISR (int pin, int mode, void (*function)(void)) ;
extern struct WPIWfiStatus waitForInterrupt2(int pin, int edgeMode, int ms, unsigned long debounce_period_us) ; // V3.16 phylax
extern int wiringPiISR2 (int pin, int mode, void (*function)(struct WPIWfiStatus wfiStatus), unsigned long debounce_period_us) ; // v3.16 phylax
extern int wiringPiISRStop (int pin) ; //V3.2
extern int waitForInterruptClose(int pin) ; //V3.2 legacy use wiringPiISRStop
// Threads
@@ -323,8 +325,8 @@ extern int piHiPri (const int pri) ;
// Extras from arduino land
extern void delay (unsigned int howLong) ;
extern void delayMicroseconds (unsigned int howLong) ;
extern void delay (unsigned int ms) ;
extern void delayMicroseconds (unsigned int us) ;
extern unsigned int millis (void) ;
extern unsigned int micros (void) ;