Compare commits
2 Commits
7a288faddb
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c530411395 | ||
|
|
545e7f380d |
270
io-helper.c
270
io-helper.c
File diff suppressed because it is too large
Load Diff
27
io-helper.h
27
io-helper.h
@@ -3,22 +3,13 @@
|
||||
|
||||
#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 nrOfOutputs 32 //must be multiple of 8
|
||||
#define nrOfInputs 32 //must be multiple of 8
|
||||
|
||||
extern volatile uint8_t outStates[nrOfOutputs/8];
|
||||
extern volatile uint8_t inStates[nrOfInputs/8];
|
||||
extern volatile uint8_t ioHelperDebounceTable[nrOfInputs];
|
||||
extern volatile uint8_t outStates[4];
|
||||
extern volatile uint8_t inStates[4];
|
||||
extern volatile uint8_t ioHelperDebounceTable[32];
|
||||
extern volatile uint8_t oldInstates[4];
|
||||
extern volatile uint8_t inStatesBothEdges[4];
|
||||
extern volatile uint8_t inStatesRisingEdge[4];
|
||||
extern volatile uint8_t inStatesFallingEdge[4];
|
||||
|
||||
void ioHelperSetOuts(void);
|
||||
void ioHelperReadPins(void);
|
||||
@@ -27,10 +18,6 @@ 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);
|
||||
void ioHelperBlinkOuts(void);
|
||||
|
||||
uint8_t read_Input(uint8_t nr, uint8_t type);
|
||||
void set_Output(uint8_t nr, uint8_t state);
|
||||
|
||||
//Outputs
|
||||
//Pin | Bit in outStates
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import string
|
||||
|
||||
ddr="""#ifdef DDRA
|
||||
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
|
||||
DDRA|=0
|
||||
#ifdef BitPA0
|
||||
|(1<<0)
|
||||
@@ -28,14 +27,13 @@ ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
|
||||
|(1<<7)
|
||||
#endif
|
||||
|0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
"""
|
||||
|
||||
port="""
|
||||
#ifdef PORTA
|
||||
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
|
||||
PORTA|=0
|
||||
#ifdef BitPA0
|
||||
|(getBit1(BitPA0)<<0)
|
||||
@@ -62,9 +60,7 @@ ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
|
||||
|(getBit1(BitPA7)<<7)
|
||||
#endif
|
||||
|0;
|
||||
}
|
||||
|
||||
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
|
||||
PORTA&=~(0
|
||||
#ifdef BitPA0
|
||||
|(getBit0(BitPA0)<<0)
|
||||
@@ -91,7 +87,6 @@ ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
|
||||
|(getBit0(BitPA7)<<7)
|
||||
#endif
|
||||
|0);
|
||||
}
|
||||
#endif
|
||||
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user