Code: Select all
chan lcd_chan;
out port data_port = PORT_XS1_8A
port enable = PORT_XS1_1B
etc...
//Stuff happens in here that calls glcd_command
void glcd_thread(chanend c);
//Hardware Interface
void glcd_command(unsigned int cmd)
{
//Assuming data_port hasn't been declared
//out port data_port = PORT_XS1_8A <-------Is this ok at this level or does it need to be global?
data_port <: cmd;
//PORT_XS1_8A <: cmd <------Is this ok? I'm assuming not or ports would have no purpose.
enable <: 1;
//Some Delay Here
enable <: 0;
}
-Mark