Compare commits
4 Commits
master
...
e2f55b4284
| Author | SHA1 | Date | |
|---|---|---|---|
| e2f55b4284 | |||
| e9dae2fdee | |||
|
|
f473da9c3f | ||
|
|
3828826957 |
4335
io-helper.c
4335
io-helper.c
File diff suppressed because it is too large
Load Diff
15
io-helper.h
15
io-helper.h
@@ -1,5 +1,14 @@
|
|||||||
extern volatile uint8_t outStates[4];
|
#ifndef _IO_HELPER_
|
||||||
extern volatile uint8_t inStates[4];
|
#define _IO_HELPER_
|
||||||
|
|
||||||
|
#include <avr/io.h>
|
||||||
|
|
||||||
|
#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];
|
||||||
void ioHelperSetOuts(void);
|
void ioHelperSetOuts(void);
|
||||||
void ioHelperReadPins(void);
|
void ioHelperReadPins(void);
|
||||||
void ioHelperIoConf(void);
|
void ioHelperIoConf(void);
|
||||||
@@ -17,3 +26,5 @@ void ioHelperDebounce(void);
|
|||||||
//Pin | Bit in inStates
|
//Pin | Bit in inStates
|
||||||
#define BitPinC1 0
|
#define BitPinC1 0
|
||||||
#define BitPinC5 1
|
#define BitPinC5 1
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -1,33 +1,33 @@
|
|||||||
import string
|
import string
|
||||||
|
|
||||||
ddr="""#ifdef DDRA
|
ddr="""#ifdef DDRA
|
||||||
DDRA|=0
|
DDRA|=0
|
||||||
#ifdef BitPA0
|
#ifdef BitPA0
|
||||||
|(1<<0)
|
|(1<<0)
|
||||||
#endif
|
#endif
|
||||||
#ifdef BitPA1
|
#ifdef BitPA1
|
||||||
|(1<<1)
|
|(1<<1)
|
||||||
#endif
|
#endif
|
||||||
#ifdef BitPA2
|
#ifdef BitPA2
|
||||||
|(1<<2)
|
|(1<<2)
|
||||||
#endif
|
#endif
|
||||||
#ifdef BitPA3
|
#ifdef BitPA3
|
||||||
|(1<<3)
|
|(1<<3)
|
||||||
#endif
|
#endif
|
||||||
#ifdef BitPA4
|
#ifdef BitPA4
|
||||||
|(1<<4)
|
|(1<<4)
|
||||||
#endif
|
#endif
|
||||||
#ifdef BitPA5
|
#ifdef BitPA5
|
||||||
|(1<<5)
|
|(1<<5)
|
||||||
#endif
|
#endif
|
||||||
#ifdef BitPA6
|
#ifdef BitPA6
|
||||||
|(1<<6)
|
|(1<<6)
|
||||||
#endif
|
#endif
|
||||||
#ifdef BitPA7
|
#ifdef BitPA7
|
||||||
|(1<<7)
|
|(1<<7)
|
||||||
#endif
|
#endif
|
||||||
|0;
|
|0;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user