struct PB_pin_mapa{
boolean unusedRB0; // poner el puerto RB0 a cero?
boolean unusedRB1; // poner el puerto RB1 a cero
boolean rx; // aqui usamos rx como variable? Pero ten cuidado con su uso porque no forma parte del Ansi C y sólo es soportado por determinados compiladores.
Pero ten cuidado con su uso porque no forma parte del Ansi C y sólo es soportado por determinados compiladores.
una preguntilla :oops: , siendo INT1 una variable de un 1bit, como se traduce esa variable en el ASM generado por CCS, utiliza un registro de 8bits de los cuales solo afecta el estado de 1?
typedef struct
{ // This structure is overlayed
BOOLEAN enable; // on to an I/O port to gain
BOOLEAN rs; // access to the LCD pins.
BOOLEAN rw; // The bits are allocated from
BOOLEAN unused; // low order up. ENABLE will
int data : 4; // be LSB pin of that port.
} LCD_PIN_MAP;
// these definitions only need to be modified for baseline PICs.
// all other PICs use LCD_PIN_MAP or individual LCD_xxx pin definitions.
/* EN, RS, RW, UNUSED, DATA */
const LCD_PIN_MAP LCD_OUTPUT_MAP = {0, 0, 0, 0, 0};
const LCD_PIN_MAP LCD_INPUT_MAP = {0, 0, 0, 0, 0xF};
if ((n & 0b00000001)!=0)LCD_PIN_DATA0=1; else LCD_PIN_DATA0=0;
if ((n & 0b00000010)!=0)LCD_PIN_DATA1=1; else LCD_PIN_DATA1=0;
if ((n & 0b00000100)!=0)LCD_PIN_DATA2=1; else LCD_PIN_DATA2=0;
if ((n & 0b00001000)!=0)LCD_PIN_DATA3=1; else LCD_PIN_DATA3=0;
if ((n & 0b00010000)!=0)LCD_PIN_DATA4=1; else LCD_PIN_DATA4=0;
if ((n & 0b00100000)!=0)LCD_PIN_DATA5=1; else LCD_PIN_DATA5=0;
if ((n & 0b01000000)!=0)LCD_PIN_DATA6=1; else LCD_PIN_DATA6=0;
if ((n & 0b10000000)!=0)LCD_PIN_DATA7=1; else LCD_PIN_DATA7=0;