API references
CharDisplay.DisplayP4
— Typefunction DisplayP4(
RS::Int,
RW::Union{Int,Nothing},
E::Int,
D7::Int,
D6::Int,
D5::Int,
D4::Int
)
Initialize object representing character display with parallel bus in 4 bit mode and prepare it for writing characters. Cursor will be set to the first line and first symbol: (0,0) pisition.
Arguments
RS
-D4
: GPIO numer connected to corresponding pins. You have not to connectRW
pin,RW
is allowed to benothing
.
CharDisplay.DisplayP8
— Typefunction DisplayP8(
RS::Int,
RW::Union{Int,Nothing},
E::Int,
D7::Int,
D6::Int,
D5::Int,
D4::Int
D3::Int,
D2::Int,
D1::Int,
D0::Int
)
Initialize object representing character display with parallel bus in 8 bit mode and prepare it for writing characters. Cursor will be set to the first line and first symbol: (0,0) pisition.
Arguments
RS
-D0
: GPIO numer connected to corresponding pins. You have not to connectRW
pin,RW
is allowed to benothing
.
Base.write
— Methodfunction write(display::DisplayP, symbol::Char)
Write character to the current position and shift cursor to the next position.
Arguments
display
: DisplayP object.symbol
: character to print. The symbol code must be convertable toUInt8
. Full list of available characters can be found in datasheet for the display. If some of symbol cannot be converted, "?" sign will be printed.
Base.write
— Methodfunction write(display::DisplayP, string::String)
Write character string starting from the current position.
Arguments
display
: DisplayP object.string
: string to print. Each symbol code must be convertable toUInt8
. Full list of available characters can be found in datasheet for the display.
Base.write
— Methodwrite(display::DisplayP, byte::UInt8)
Write data to CG or DDRAM
DB7 DB6 DB5 DB4 DB4 DB3 DB2 DB1 DB0
Arguments
byte
: Byte representing symbol.
CharDisplay.clear_display
— Methodclear_display(display::DisplayP)
Clears entire display and sets DDRAM address 0 in address counter.
0 0 0 0 0 0 0 1
CharDisplay.cursor_shift
— Methodcursor_shift(display::DisplayP; right::Bool = false)
Moves cursor without changing DDRAM contents.
0 0 0 1 0 R/L - -
CharDisplay.display_on_off_control
— Methoddisplay_on_off_control(
display::DisplayP;
display_on::Bool = true,
cursor_on::Bool = true,
blinking::Bool = false
)
Sets entire display (D) on/off, cursor on/off (C), and blinking of cursor position character (B).
0 0 0 0 1 D C B
Arguments
display_on
:true
means display on,false
is off.cursor_on
:true
means cursor on,false
is off.blinking
:true
means blinking cursor character.
CharDisplay.display_shift
— Methoddisplay_shift(display::DisplayP; right::Bool = false)
Shifts display without changing DDRAM contents.
# 0 0 0 1 1 R/L - -
CharDisplay.entry_mode_set
— Methodentry_mode_set(display::DisplayP; increment::Bool = true, shift::Bool = false)
Sets cursor move direction and specifies display shift. These operations are performed during data write and read.
0 0 0 0 0 1 I/D S
Arguments
increment
:true
means increment,false
decrementshift
:true
accompanies display shift
CharDisplay.function_set
— Methodfunction_set(
display::DisplayP;
_8bits::Bool = false,
_2lines::Bool = true,
_10pixels::Bool = false,
second_set::Bool = false
)
Sets interface data length (DL), number of display lines (N), and character font (F)
0 0 1 DL N F P —
Arguments
_8bits
: set 8 bit mode (true
) or 4 bit model (false
)_2lines
:true
means 2 lines,false
means one line._10pixels
:true
for 5x10 pixel symbols modules. Default (false
) is 5x8.second_set
: Some modules supports 2 symbols fonts. See the datasheet.
CharDisplay.return_home
— Methodreturn_home(display::DisplayP)
Sets DDRAM address 0 in address counter. Also returns display from being shifted to original position. DDRAM contents remain unchanged.
0 0 0 0 0 0 1 -
CharDisplay.set_CGRAM_address
— Methodset_CGRAM_address(display::DisplayP, byte::UInt8)
Sets CGRAM address. CGRAM data is sent and received after this setting
0 1 ACG ACG ACG ACG ACG ACG
CharDisplay.set_DDRAM_address
— Methodset_DDRAM_address(display::DisplayP, byte::UInt8)
Sets DDRAM address. DDRAM data is sent and received after this setting.
1 ADD ADD ADD ADD ADD ADD ADD
CharDisplay.set_cursor
— Functionset_cursor(display::DisplayP, col::Int = 0, row::Int = 0)
Set cursor position. __
Arguments
col
: number of position: integer from0
to15
row
: number of string: integer0
or1