Compare commits
2 Commits
e2f55b4284
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c530411395 | ||
|
|
545e7f380d |
4348
io-helper.c
4348
io-helper.c
File diff suppressed because it is too large
Load Diff
16
io-helper.h
16
io-helper.h
@@ -1,21 +1,23 @@
|
||||
#ifndef _IO_HELPER_
|
||||
#define _IO_HELPER_
|
||||
|
||||
#include <avr/io.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define nrOfOutputs 32 //must be multiple of 8
|
||||
#define nrOfInputs 32 //must be multiple of 8
|
||||
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];
|
||||
|
||||
extern volatile uint8_t outStates[nrOfOutputs/8];
|
||||
extern volatile uint8_t inStates[nrOfInputs/8];
|
||||
extern volatile uint8_t ioHelperDebounceTable[nrOfInputs];
|
||||
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
|
||||
//Pin | Bit in outStates
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
import string
|
||||
|
||||
ddr="""#ifdef DDRA
|
||||
DDRA|=0
|
||||
DDRA|=0
|
||||
#ifdef BitPA0
|
||||
|(1<<0)
|
||||
#endif
|
||||
|(1<<0)
|
||||
#endif
|
||||
#ifdef BitPA1
|
||||
|(1<<1)
|
||||
#endif
|
||||
|(1<<1)
|
||||
#endif
|
||||
#ifdef BitPA2
|
||||
|(1<<2)
|
||||
#endif
|
||||
|(1<<2)
|
||||
#endif
|
||||
#ifdef BitPA3
|
||||
|(1<<3)
|
||||
#endif
|
||||
|(1<<3)
|
||||
#endif
|
||||
#ifdef BitPA4
|
||||
|(1<<4)
|
||||
#endif
|
||||
|(1<<4)
|
||||
#endif
|
||||
#ifdef BitPA5
|
||||
|(1<<5)
|
||||
#endif
|
||||
|(1<<5)
|
||||
#endif
|
||||
#ifdef BitPA6
|
||||
|(1<<6)
|
||||
#endif
|
||||
|(1<<6)
|
||||
#endif
|
||||
#ifdef BitPA7
|
||||
|(1<<7)
|
||||
#endif
|
||||
|0;
|
||||
|
||||
|(1<<7)
|
||||
#endif
|
||||
|0;
|
||||
|
||||
#endif
|
||||
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user