pinio.h

Ir a la documentación de este archivo.
00001 #ifndef __PINIO_H__
00002 #define __PINIO_H__
00003 
00004 /*
00005   This code is free software; you can redistribute it and/or modify
00006    it under the terms of the GNU General Public License as published by
00007    the Free Software Foundation; either version 2, or (at your option)
00008    any later version.
00009    
00010    This code is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014 */
00015 
00028 #include <tipos.h>
00029 
00034 
00035 #ifndef SLOW_IO
00036         #define SLOW_IO TRUE
00037 #endif
00038 
00039 #if SLOW_IO==TRUE
00040         #define output_high     output_high_slow        
00041         #define output_low      output_low_slow         
00042         #define input           input_slow              
00043         #define set_pin_to      set_pin_to_slow         
00044 #else
00045         #define output_high     output_high_fast        
00046         #define output_low      output_low_fast         
00047         #define input           input_fast              
00048         #define set_pin_to      set_pin_to_fast         
00049 #endif
00050 
00051 #define PIN_A0  PORTAdir,1
00052 #define PIN_A1  PORTAdir,2
00053 #define PIN_A2  PORTAdir,4
00054 #define PIN_A3  PORTAdir,8
00055 #define PIN_A4  PORTAdir,16
00056 #define PIN_A5  PORTAdir,32
00057 #define PIN_A6  PORTAdir,64
00058 #define PIN_A7  PORTAdir,128
00059 
00060 #define PIN_B0  PORTBdir,1
00061 #define PIN_B1  PORTBdir,2
00062 #define PIN_B2  PORTBdir,4
00063 #define PIN_B3  PORTBdir,8
00064 #define PIN_B4  PORTBdir,16
00065 #define PIN_B5  PORTBdir,32
00066 #define PIN_B6  PORTBdir,64
00067 #define PIN_B7  PORTBdir,128
00068 
00069 #define PIN_C0  PORTCdir,1
00070 #define PIN_C1  PORTCdir,2
00071 #define PIN_C2  PORTCdir,4
00072 #define PIN_C3  PORTCdir,8
00073 #define PIN_C4  PORTCdir,16
00074 #define PIN_C5  PORTCdir,32
00075 #define PIN_C6  PORTCdir,64
00076 #define PIN_C7  PORTCdir,128
00077 
00078 #define PIN_D0  PORTDdir,1
00079 #define PIN_D1  PORTDdir,2
00080 #define PIN_D2  PORTDdir,4
00081 #define PIN_D3  PORTDdir,8
00082 #define PIN_D4  PORTDdir,16
00083 #define PIN_D5  PORTDdir,32
00084 #define PIN_D6  PORTDdir,64
00085 #define PIN_D7  PORTDdir,128
00086 
00087 #define PIN_E0  PORTEdir,1
00088 #define PIN_E1  PORTEdir,2
00089 #define PIN_E2  PORTEdir,4
00090 #define PIN_E3  PORTEdir,8
00091 #define PIN_E4  PORTEdir,16
00092 #define PIN_E5  PORTEdir,32
00093 #define PIN_E6  PORTEdir,64
00094 #define PIN_E7  PORTEdir,128
00095 
00096 
00108 void output_high_slow(  BYTE puerto, 
00109                         BYTE pin);
00110 
00111 
00123 void output_high_fast(  BYTE puerto, 
00124                         BYTE pin);
00125 
00137 void output_low_slow(   BYTE puerto, 
00138                         BYTE pin);
00139 
00151 void output_low_fast(   BYTE puerto, 
00152                         BYTE pin);
00153 
00165 BYTE input_slow(        BYTE puerto, 
00166                         BYTE pin);
00167 
00179 BYTE input_fast(        BYTE puerto, 
00180                         BYTE pin);
00181 
00195 void set_pin_to_slow(   BYTE puerto, 
00196                         BYTE pin,
00197                         BYTE X);
00198 
00212 void set_pin_to_fast(   BYTE puerto, 
00213                         BYTE pin,
00214                         BYTE X);
00215 
00229 void set_pin_tris_to(   BYTE puerto, 
00230                         BYTE pin,
00231                         BYTE X);
00232 
00240 #define set_porta_as_digital() ADCON1=0x06
00241 
00251 void set_pullup_portb(  BYTE X);
00252 
00253 #endif

Generado el Thu Jan 8 00:55:37 2009 para pic-gcc-library por  doxygen 1.5.1