struct lcd_pin_map { // 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 pin B0.
} lcd;
#if defined use_portb_lcd
#locate lcd = getenv("sfr:PORTB") // This puts the entire structure over the port
#define set_tris_lcd(x) set_tris_b(x)
#else
#locate lcd = getenv("sfr:PORTD") // This puts the entire structure over the port
#define set_tris_lcd(x) set_tris_d(x)
#endif