This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

define LCD pins in function for 8051 interface with LCD

hi everyone

I am working on LCD interface with the C8051f120 controller and i did it well, but im working with different hardware so LCD pin rs, rw, en and data port can be varies with hardware.

i just want to make a function in embedded c which can defines this pins and compatible with all hardware........btw i am using it as a library.....

now im using this...(rs, rw, en and data port can be varies with hardware)

sbit rs=P5^0;
sbit rw=P5^1;
sbit en=P5^2;
#define data_port P4

but i want to make it function like this..(dont know what to do)

void LCD_pins(rs,rw,en,data_port)
{
.
.
.
.
.
}

please help to get rid of this problem.....