Kommunikation hat funktioniert

This commit is contained in:
Bernhard
2025-12-06 19:20:49 +01:00
commit 9b3c4b3fd2
13 changed files with 1115 additions and 0 deletions

37
io/io.h Executable file
View File

@@ -0,0 +1,37 @@
#if !defined(__IO_H__)
#define __IO_H__
#include <wiringPi.h>
#include <stdio.h>
#define GPIO_LED_MOTRUN 17 // GPIO Pin fuer LED Motor läuft
#define GPIO_KEY_STOP 26 // GPIO Pin fuer Taster Stop
#define GPIO_KEY_PWRUP 5 // GPIO Pin fuer Taster Leistung-Erhöhen
#define GPIO_KEY_PWRDOWN 6 // GPIO Pin fuer Taster Leistung-Verringern
#define KEY_RISING_FILTERCYCLES 5 // Filterwert für Eingänge steigende Flanke
#define KEY_FALLING_FILTERCYCLES 15 // Filterwert für Eingänge (Zyklen-Zähler)
#define KEY_START_REPEAT_CYCLECOUNT 50 // Anzahl Zyklen, nach denen Wiederholungen beginnen
#define KEY_REPEAT_CYCLECOUNT 50 // Anzahl Zyklen, nach den wiederholt wird
// Datenstruktur für einen Taster
struct GPIO_KEY_DATA
{
int iKeyPin;
int iKeyValue;
int iKeyRisingEdge;
int iKeyFallingEdge;
unsigned int nHighCycleCounter;
unsigned int nLowCycleCounter;
int iKeyPressedCycleCounter;
int iKeyRepeatCycleCounter;
};
int IO_Init();
void IO_DoCyclic();
void SetupKeyPin(struct GPIO_KEY_DATA *pdata, int iKeyPin);
void SetupOutputPin(int iOutPin);
void WriteOutputPin(int iOutPin, int iValue);
#endif