Commit cd08eedc authored by lcgamboa's avatar lcgamboa

new: LCD hd44780 read support added

parent abc6da52
This diff is collapsed.
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
<!-- #$-:GIMP Image Map plug-in by Maurits Rijk --> <!-- #$-:GIMP Image Map plug-in by Maurits Rijk -->
<!-- #$-:Please do not edit lines starting with "#$" --> <!-- #$-:Please do not edit lines starting with "#$" -->
<!-- #$VERSION:2.3 --> <!-- #$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="17,40,389,126" href="LCD" />
<area shape="rect" coords="6,229,25,278" href="F1" /> <area shape="rect" coords="6,229,25,278" href="F1" />
<area shape="rect" coords="35,229,54,278" href="F2" /> <area shape="rect" coords="35,229,54,278" href="F2" />
<area shape="rect" coords="65,229,84,278" href="F3" /> <area shape="rect" coords="65,229,84,278" href="F3" />
<area shape="rect" coords="95,229,114,278" href="P1" /> <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="155,229,174,278" href="P2" />
<area shape="rect" coords="185,229,204,278" href="P3" /> <area shape="rect" coords="185,229,204,278" href="P3" />
<area shape="rect" coords="217,229,236,278" href="P4" /> <area shape="rect" coords="217,229,236,278" href="P4" />
......
...@@ -47,11 +47,12 @@ static const char pinnames[3][40][10] = { ...@@ -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", "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", "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", "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", "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) ...@@ -191,10 +192,20 @@ board_ucsim::pins_reset(void)
pins[p].oavalue = 0; pins[p].oavalue = 0;
} }
//TODO if (procid == PID_C51)
//VCC pins {
//pins[6].value = 1; pins[20 - 1].value = 0;
//pins[19].value = 1; 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) else if (procid == PID_STM8S103)
{ {
...@@ -220,10 +231,10 @@ board_ucsim::pins_reset(void) ...@@ -220,10 +231,10 @@ board_ucsim::pins_reset(void)
pins[p].oavalue = 0; pins[p].oavalue = 0;
} }
//TODO pins[7 - 1].value = 0;
//VCC pins pins[7 - 1].dir = PD_OUT;
//pins[6].value = 1; pins[9 - 1].value = 1;
//pins[19].value = 1; pins[9 - 1].dir = PD_OUT;
} }
} }
...@@ -265,7 +276,7 @@ board_ucsim::MGetPinsValues(void) ...@@ -265,7 +276,7 @@ board_ucsim::MGetPinsValues(void)
void void
board_ucsim::MStep(void) board_ucsim::MStep(void)
{ {
unsigned char p[4]; unsigned short p[4];
ucsim_step (); ucsim_step ();
...@@ -278,7 +289,8 @@ board_ucsim::MStep(void) ...@@ -278,7 +289,8 @@ board_ucsim::MStep(void)
{ {
if (*pins[i].port < 4) 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 ...@@ -61,18 +61,22 @@ F 0 = 5x7 dots 1 = 5x10 dots
BF 0 = Can accept instruction 1 = Internal operation in progress BF 0 = Can accept instruction 1 = Internal operation in progress
*/ */
#define LCD_ADDR_CGRAM 0
#define LCD_ADDR_DDRAM 1
typedef struct typedef struct
{ {
unsigned short int flags; unsigned short int flags;
unsigned char ddram_ad; unsigned char addr_counter;
unsigned char cgram_ad; unsigned char addr_mode;
unsigned char update; //redraw unsigned char update; //redraw
unsigned int blinkc; //blink count timer unsigned int blinkc; //blink count timer
unsigned char blink; //cursor state unsigned char blink; //cursor state
char shift; //display shift char shift; //display shift
char ddram[DDRMAX][5]; char ddram[DDRMAX][5]; //ddram font mapped
char cgram[8][5]; char ddram_char[DDRMAX];//ddram
char cgram[8][5]; //cgram font mapped
char cgram_char[8]; //cgram
char bc; char bc;
char buff; char buff;
unsigned char cnum; //number of columns 16 or 20 unsigned char cnum; //number of columns 16 or 20
...@@ -85,6 +89,10 @@ void lcd_cmd(lcd_t * lcd, char cmd); ...@@ -85,6 +89,10 @@ void lcd_cmd(lcd_t * lcd, char cmd);
void lcd_data(lcd_t * lcd, char data); 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_rst(lcd_t * lcd);
void lcd_init(lcd_t * lcd, unsigned char cnum, unsigned char lnum); 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 ...@@ -58,7 +58,7 @@ class cpart_LCD_hd44780:public part
unsigned short get_out_id(char * name); unsigned short get_out_id(char * name);
private: private:
void Reset(void); void Reset(void);
unsigned char input_pins[10]; unsigned char input_pins[11];
lcd_t lcd; lcd_t lcd;
int lcde; int lcde;
unsigned char model; 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