|  |  | @ -1,17 +1,7 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  | #ifndef _IO_HELPER_ |  |  |  | #ifndef _IO_HELPER_ | 
			
		
	
		
		
			
				
					
					|  |  |  | #define _IO_HELPER_ |  |  |  | #define _IO_HELPER_ | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | #include <stdint.h> |  |  |  | #include <avr/io.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 nrOfOutputs 32 //must be multiple of 8
 | 
			
		
	
		
		
			
				
					
					|  |  |  | #define nrOfInputs 32 //must be multiple of 8
 |  |  |  | #define nrOfInputs 32 //must be multiple of 8
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -19,18 +9,13 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  | extern volatile uint8_t outStates[nrOfOutputs/8];  |  |  |  | extern volatile uint8_t outStates[nrOfOutputs/8];  | 
			
		
	
		
		
			
				
					
					|  |  |  | extern volatile uint8_t inStates[nrOfInputs/8]; |  |  |  | extern volatile uint8_t inStates[nrOfInputs/8]; | 
			
		
	
		
		
			
				
					
					|  |  |  | extern volatile uint8_t ioHelperDebounceTable[nrOfInputs]; |  |  |  | extern volatile uint8_t ioHelperDebounceTable[nrOfInputs]; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | void ioHelperSetOuts(void); |  |  |  | void ioHelperSetOuts(void); | 
			
		
	
		
		
			
				
					
					|  |  |  | void ioHelperReadPins(void); |  |  |  | void ioHelperReadPins(void); | 
			
		
	
		
		
			
				
					
					|  |  |  | void ioHelperIoConf(void); |  |  |  | void ioHelperIoConf(void); | 
			
		
	
		
		
			
				
					
					|  |  |  | void ioHelperSetBit(volatile uint8_t *list, uint8_t nr, uint8_t state); |  |  |  | void ioHelperSetBit(volatile uint8_t *list, uint8_t nr, uint8_t state); | 
			
		
	
		
		
			
				
					
					|  |  |  | unsigned char ioHelperReadBit(volatile uint8_t *list, uint8_t nr); |  |  |  | unsigned char ioHelperReadBit(volatile uint8_t *list, uint8_t nr); | 
			
		
	
		
		
			
				
					
					|  |  |  | void ioHelperDebounce(void); |  |  |  | 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
 |  |  |  | //Outputs
 | 
			
		
	
		
		
			
				
					
					|  |  |  | //Pin | Bit in outStates
 |  |  |  | //Pin | Bit in outStates
 | 
			
		
	
	
		
		
			
				
					|  |  | 
 |