schau dir mal das Beispiel von dem OLED in Software an. Das ist parallel angeschlossen. Wenn die Initialisierung paßt mußt du nur den Grafikspeicher (eben nicht parallel sondern) via I²C ins Display schieben. Defines an dein Display anpassen (128x64).
..... oder ein anderes Display das mit I²C arbeitet.
Code
LCDGraphic = 128, 64, 8; { x-pix, y-pix, accesswidth }
LCDgraphMode = column, iData; // linear, column, readonly
DefCharSet = 'Graphchars.pchr'; { FileName }
GViewports = 1, iData; { logical ViewPorts, scalings }
TGraphStr = 12; { Graphic Text String Length }
Const
LCDaddr : byte = $3C; // TWI address ANPASSEN !
LCDctrl : byte = $00; // control type command byte
LCDdata : byte = $40; // data type command Byte
STiniParms : Array[0..6] of Byte = // ANPASSEN !
($21, // FunctionSet register, ext reg on
// v = 0 horizontal addressing
// pd = 0 set active
// mx = 0 normal x addressing
// my = 0 normal y addressing
$09, // Display config, MSB top,
$12, // Bias system register
// bs[2:0] = 010 1:65 mux rate
$E0, // VOP register set Vlcd to ?.?V
// Contrast max. $FF
$20, // FunctionSet register, ext reg off
// v = 0 horizontal addressing
// pd = 0 set active
// mx = 0 normal x addressing
// my = 0 normal y addressing
$0C, // Display control register, normal mode, on
$05); // Vlcd range = high
Procedure GraphInit;
Begin
TWIoutC(LCDaddr, LCDctrl, STiniParms);
TWIoutC(LCDaddr, LCDctrl, $80);
TWIoutC(LCDaddr, LCDctrl, $40);
For i:= 0 to (128*8) do
TWIoutC(LCDaddr, LCDdata, 0);
EndFor;
gClrScr(0);
gDispRefresh;
End;
{$D-}
UserDevice GraphIOS(cmd : byte; arg : byte);
begin
if cmd=0
then
// set row addr
TWIoutC(LCDaddr, LCDctrl, $80); // x-addr <- 0
// set column address, $40 is the y-addr command
arg:= 7-arg+$40; // row addr 7 -> 0
TWIoutC(LCDaddr, LCDctrl, arg); // y-addr <- arg
ii:=0; // reset Y-counter
else
If ii<128 // Ausgabe auf <128 notwendig !
then //
// data out //
TWIoutC(LCDaddr, LCDdata, arg);
Inc(ii);
EndIf;
EndIf;
end;
{$D+}