move dirs
This commit is contained in:
96
avrIOhelper/io-helper.h
Normal file
96
avrIOhelper/io-helper.h
Normal file
@@ -0,0 +1,96 @@
|
||||
#ifndef _IO_HELPER_
|
||||
#define _IO_HELPER_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define LEVEL 0
|
||||
#define EDGE 1
|
||||
#define RISING 2
|
||||
#define FALLING 3
|
||||
|
||||
#define OFF 0
|
||||
#define ON 1
|
||||
#define BLINK 2
|
||||
#define TOGGLE 3
|
||||
|
||||
|
||||
#define NUMBER_OF_INPUT_BYTES 2
|
||||
|
||||
extern volatile uint8_t outStates[NUMBER_OF_INPUT_BYTES];
|
||||
extern volatile uint8_t outStatesBlinking[NUMBER_OF_INPUT_BYTES];
|
||||
extern volatile uint8_t inStates[NUMBER_OF_INPUT_BYTES];
|
||||
extern volatile uint8_t inStatesRaw[NUMBER_OF_INPUT_BYTES];
|
||||
extern volatile uint8_t ioHelperDebounceTable[NUMBER_OF_INPUT_BYTES*8];
|
||||
extern volatile uint8_t oldInstates[NUMBER_OF_INPUT_BYTES];
|
||||
extern volatile uint8_t inStatesBothEdges[NUMBER_OF_INPUT_BYTES];
|
||||
extern volatile uint8_t inStatesRisingEdge[NUMBER_OF_INPUT_BYTES];
|
||||
extern volatile uint8_t inStatesFallingEdge[NUMBER_OF_INPUT_BYTES];
|
||||
|
||||
|
||||
uint8_t read_Input(uint8_t nr, uint8_t type);
|
||||
void set_Output(uint8_t nr, uint8_t state);
|
||||
|
||||
void ioHelperInitBuffer(void);
|
||||
void ioHelperSetOuts(void);
|
||||
void ioHelperReadPins(void);
|
||||
void ioHelperIoConf(void);
|
||||
void ioHelperSetBit(volatile uint8_t *list, uint8_t nr, uint8_t state);
|
||||
unsigned char ioHelperReadBit(volatile uint8_t *list, uint8_t nr);
|
||||
void ioHelperDebounce(void);
|
||||
void ioHelperEdgeDetector(void);
|
||||
|
||||
//Outputs
|
||||
//Verknüpfen von Pin | Bit mit Bitposition (0...n) outStates[0...n/8].
|
||||
#define BitPE4 0 //D0
|
||||
#define BitPE5 1 //D1
|
||||
#define BitPG5 2 //D2
|
||||
#define BitPE3 3 //D3
|
||||
#define BitPH3 4 //D4
|
||||
#define BitPH4 5 //D5
|
||||
#define BitPH5 6 //D6
|
||||
#define BitPH6 7 //D7
|
||||
|
||||
#define BitPB4 8 //D8
|
||||
#define BitPB5 9 //D9
|
||||
#define BitPB6 10 //D10
|
||||
#define BitPB7 11 //D11
|
||||
|
||||
#define LED_ROT_NOTAUS_SCHRANK BitPG5
|
||||
#define LED_GRN_NOTAUS_SCHRANK BitPE3
|
||||
#define LED_ROT_NOTAUS_ANLAGE BitPH3
|
||||
#define LED_GRN_NOTAUS_ANLAGE BitPH4
|
||||
#define LED_PLC_OK BitPB5
|
||||
#define LED_BUS_OK BitPB6
|
||||
#define LED_ZUMBACH BitPH5
|
||||
#define LED_LUEFTER BitPH6
|
||||
#define SCHUETZ_ZUMBACH BitPE5
|
||||
|
||||
|
||||
//Inputs
|
||||
//Verknüpfen von Pin | Bit mit Bitposition (0...n) inStates[0...n/8].
|
||||
#define BitPinF0 0 //A0
|
||||
#define BitPinF1 1 //A1
|
||||
#define BitPinF2 2 //A2
|
||||
#define BitPinF3 3 //A3
|
||||
#define BitPinF4 4 //A4
|
||||
#define BitPinF5 5 //A5
|
||||
#define BitPinF6 6 //A6
|
||||
#define BitPinF7 7 //A7
|
||||
|
||||
#define BitPinK0 8 //A8
|
||||
#define BitPinK1 9 //A9
|
||||
#define BitPinD3 10 //INO
|
||||
#define BitPinD2 11 //IN1
|
||||
|
||||
#define BTN_ZUMBACH_EIN BitPinF2
|
||||
#define BTN_ZUMBACH_AUS BitPinF3
|
||||
#define BTN_LUEFTER_EIN BitPinF4
|
||||
#define BTN_LUEFTER_AUS BitPinF5
|
||||
#define BTN_LUEFTER_PLUS BitPinF6
|
||||
#define BTN_LUEFTER_MINUS BitPinF7
|
||||
#define BTN_ANLAGE_EIN BitPinD3
|
||||
#define IN_ANLAGE_EIN BitPinD2
|
||||
#define IN_NOTAUS_ANLAGE BitPinF0
|
||||
#define IN_NOTAUS_SCHRANK BitPinF1
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user