Commit cd08eedc authored by lcgamboa's avatar lcgamboa

new: LCD hd44780 read support added

parent abc6da52
This diff is collapsed.
......@@ -5,13 +5,13 @@
<!-- #$-:GIMP Image Map plug-in by Maurits Rijk -->
<!-- #$-:Please do not edit lines starting with "#$" -->
<!-- #$VERSION:2.3 -->
<!-- #$AUTHOR:lcganmboa@yahoo.com -->
<!-- #$AUTHOR:lcganmboa@yahoo.com -->
<area shape="rect" coords="17,40,389,126" href="LCD" />
<area shape="rect" coords="6,229,25,278" href="F1" />
<area shape="rect" coords="35,229,54,278" href="F2" />
<area shape="rect" coords="65,229,84,278" href="F3" />
<area shape="rect" coords="95,229,114,278" href="P1" />
<area shape="rect" coords="125,229,144,278" href="F4" />
<area shape="rect" coords="125,229,144,278" href="P11" />
<area shape="rect" coords="155,229,174,278" href="P2" />
<area shape="rect" coords="185,229,204,278" href="P3" />
<area shape="rect" coords="217,229,236,278" href="P4" />
......
......@@ -47,11 +47,12 @@ static const char pinnames[3][40][10] = {
"", "", "", "", "", "", "", "", "", "", "", "", "", ""},
{
"P0.0", "P0.1", "P0.2", "P0.3", "P0.4", "P0.5", "P0.6", "P0.7",
"P1.0", "P1.1", "P1.2", "P1.3", "P1.4", "P1.5", "P1.6", "P1.7",
"P0.0", "P0.1", "P0.2", "P0.3", "P0.4", "P0.5", "P0.6", "P0.7",
"P1.0", "P1.1", "P1.2", "P1.3", "P1.4", "P1.5", "P1.6", "P1.7",
"P2.0", "P2.1", "P2.2", "P2.3", "P2.4", "P2.5", "P2.6", "P2.7",
"P3.0", "P3.1", "P3.2", "P3.3", "P3.4", "P3.5", "P3.6", "P3.7",
"RST","INT1","INT2", "INT3", "INT5","INT7", "GND", "VCC" }
"RST", "INT1", "INT2", "INT3", "INT5", "INT7", "GND", "VCC"
}
};
......@@ -191,10 +192,20 @@ board_ucsim::pins_reset(void)
pins[p].oavalue = 0;
}
//TODO
//VCC pins
//pins[6].value = 1;
//pins[19].value = 1;
if (procid == PID_C51)
{
pins[20 - 1].value = 0;
pins[20 - 1].dir = PD_OUT;
pins[40 - 1].value = 1;
pins[40 - 1].dir = PD_OUT;
}
else
{
pins[39 - 1].value = 0;
pins[39 - 1].dir = PD_OUT;
pins[40 - 1].value = 1;
pins[40 - 1].dir = PD_OUT;
}
}
else if (procid == PID_STM8S103)
{
......@@ -220,10 +231,10 @@ board_ucsim::pins_reset(void)
pins[p].oavalue = 0;
}
//TODO
//VCC pins
//pins[6].value = 1;
//pins[19].value = 1;
pins[7 - 1].value = 0;
pins[7 - 1].dir = PD_OUT;
pins[9 - 1].value = 1;
pins[9 - 1].dir = PD_OUT;
}
}
......@@ -265,7 +276,7 @@ board_ucsim::MGetPinsValues(void)
void
board_ucsim::MStep(void)
{
unsigned char p[4];
unsigned short p[4];
ucsim_step ();
......@@ -278,7 +289,8 @@ board_ucsim::MStep(void)
{
if (*pins[i].port < 4)
{
pins[i].value = (p[*pins[i].port] & (1 << pins[i].pord)) > 0;
pins[i].value = (p[*pins[i].port] & (0x0001 << pins[i].pord)) > 0;
pins[i].dir = (p[*pins[i].port] & (0x0100 << pins[i].pord)) > 0;
}
}
......
This diff is collapsed.
......@@ -61,18 +61,22 @@ F 0 = 5x7 dots 1 = 5x10 dots
BF 0 = Can accept instruction 1 = Internal operation in progress
*/
#define LCD_ADDR_CGRAM 0
#define LCD_ADDR_DDRAM 1
typedef struct
{
unsigned short int flags;
unsigned char ddram_ad;
unsigned char cgram_ad;
unsigned char addr_counter;
unsigned char addr_mode;
unsigned char update; //redraw
unsigned int blinkc; //blink count timer
unsigned char blink; //cursor state
char shift; //display shift
char ddram[DDRMAX][5];
char cgram[8][5];
char ddram[DDRMAX][5]; //ddram font mapped
char ddram_char[DDRMAX];//ddram
char cgram[8][5]; //cgram font mapped
char cgram_char[8]; //cgram
char bc;
char buff;
unsigned char cnum; //number of columns 16 or 20
......@@ -85,6 +89,10 @@ void lcd_cmd(lcd_t * lcd, char cmd);
void lcd_data(lcd_t * lcd, char data);
unsigned char lcd_read_busyf_acounter(lcd_t * lcd);
char lcd_read_data(lcd_t * lcd);
void lcd_rst(lcd_t * lcd);
void lcd_init(lcd_t * lcd, unsigned char cnum, unsigned char lnum);
......
This diff is collapsed.
......@@ -58,7 +58,7 @@ class cpart_LCD_hd44780:public part
unsigned short get_out_id(char * name);
private:
void Reset(void);
unsigned char input_pins[10];
unsigned char input_pins[11];
lcd_t lcd;
int lcde;
unsigned char model;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment