initial commit
This commit is contained in:
		
						commit
						6ce1979727
					
				
					 8 changed files with 795 additions and 0 deletions
				
			
		
							
								
								
									
										13
									
								
								writepin.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								writepin.h
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,13 @@
 | 
			
		|||
#ifndef WRITEPIN_H
 | 
			
		||||
#define WRITEPIN_H
 | 
			
		||||
#include <avr/io.h>
 | 
			
		||||
 | 
			
		||||
inline void writePin(volatile unsigned char *port, const unsigned char pin, const bool state) //waste 2 cycles
 | 
			
		||||
{
 | 
			
		||||
    *port  &= ~(1 << pin);
 | 
			
		||||
    if(state) *port |= (1 << pin);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
inline bool readPin( volatile unsigned char *inPort, const unsigned char pin){ return (bool) (*inPort & (1 << pin));}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue