| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| akokyaw 
 
 
 Joined: 11 Feb 2005
 Posts: 24
 
 
 
			    
 
 | 
			
				| How to convert the code in PBP "shiftout" into C? |  
				|  Posted: Wed Oct 12, 2005 9:58 am |   |  
				| 
 |  
				| Hi everybody, I would like to know how to convert the code in PBP as "shiftout SI,SCK,1,[%1100\4]" into C. I have read some topic about converting "shiftout" command as follow:
 
 
 
  	  | Code: |  	  | void ShiftOut (int8 data) {
 output_low(OUT_CLOCK);
 
 if((data&0x80)==0)
 output_low(OUT_DO);
 else
 output_high(OUT_DO);
 data <<= 1;
 output_high(OUT_CLOCK);
 output_low(OUT_CLOCK);
 }
 | 
 
 I want to add the variable like "OUT_CLOCK", "OUT_DO" as follow:
 
  	  | Code: |  	  | void ShiftOut(int16 OUT_CLOCK, int16 OUT_DO, int8 data) | 
 
 Is it possible to do this code? Any idea? or suggestion?
   
 Thanks,
 ako
 |  | 
	
		|  | 
	
		| Mark 
 
 
 Joined: 07 Sep 2003
 Posts: 2838
 Location: Atlanta, GA
 
 
			      
 
 |  | 
	
		|  | 
	
		| akokyaw 
 
 
 Joined: 11 Feb 2005
 Posts: 24
 
 
 
			    
 
 |  | 
	
		|  | 
	
		| Mark 
 
 
 Joined: 07 Sep 2003
 Posts: 2838
 Location: Atlanta, GA
 
 
			      
 
 | 
			
				|  |  
				|  Posted: Wed Oct 12, 2005 8:53 pm |   |  
				| 
 |  
				| The pin numbers are CCS specific but do have some meaning.  Basically the port address multiplied by 8 then the bit number added to it.  If you read PCM's response in the link I posted, he shows you how to do what you want with port pins. |  | 
	
		|  | 
	
		|  |