Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
picsimlab
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
picsimlab
Commits
cd08eedc
Commit
cd08eedc
authored
Aug 14, 2020
by
lcgamboa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new: LCD hd44780 read support added
parent
abc6da52
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
1109 additions
and
989 deletions
+1109
-989
share/parts/LCD_hd44780/LCD_hd44780.lxrad
share/parts/LCD_hd44780/LCD_hd44780.lxrad
+42
-43
share/parts/LCD_hd44780/LCD_hd44780_o.map
share/parts/LCD_hd44780/LCD_hd44780_o.map
+2
-2
src/boards/board_ucsim.cc
src/boards/board_ucsim.cc
+25
-13
src/devices/lcd_hd44780.cc
src/devices/lcd_hd44780.cc
+644
-574
src/devices/lcd_hd44780.h
src/devices/lcd_hd44780.h
+12
-4
src/parts/part_LCD_hd44780.cc
src/parts/part_LCD_hd44780.cc
+383
-352
src/parts/part_LCD_hd44780.h
src/parts/part_LCD_hd44780.h
+1
-1
No files found.
share/parts/LCD_hd44780/LCD_hd44780.lxrad
View file @
cd08eedc
This diff is collapsed.
Click to expand it.
share/parts/LCD_hd44780/LCD_hd44780_o.map
View file @
cd08eedc
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<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" />
...
...
src/boards/board_ucsim.cc
View file @
cd08eedc
...
@@ -51,7 +51,8 @@ static const char pinnames[3][40][10] = {
...
@@ -51,7 +51,8 @@ static const char pinnames[3][40][10] = {
"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
;
}
}
}
}
...
...
src/devices/lcd_hd44780.cc
View file @
cd08eedc
This diff is collapsed.
Click to expand it.
src/devices/lcd_hd44780.h
View file @
cd08eedc
...
@@ -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
);
...
...
src/parts/part_LCD_hd44780.cc
View file @
cd08eedc
This diff is collapsed.
Click to expand it.
src/parts/part_LCD_hd44780.h
View file @
cd08eedc
...
@@ -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
[
1
0
];
unsigned
char
input_pins
[
1
1
];
lcd_t
lcd
;
lcd_t
lcd
;
int
lcde
;
int
lcde
;
unsigned
char
model
;
unsigned
char
model
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment