Forum: Projekte & Code Speicheroptimierung Library zur Ansteuerung eines ST7735 SPI Displays


von Tim  . (cpldcpu)


Angehängte Dateien:

Lesenswert?

Ich habe eine ANSI-C Library zur Ansteuerung von ST7735 Display 
entwickelt, welche nur einen sehr geringen Speicherbedarf hat. Dadurch 
kann sie auch auf ATtiny85 u.Ä. eingesetzt werden.

Die aktuelle Version gibt es hier:

https://github.com/cpldcpu/uTFT-ST7735

1
uTFT-ST7735
2
3
This is a size and speed optimized ANSI-C library to control 1.8" ST7735
4
TFTs. This library is based on the "china_lcd" library by Tobias Weis,
5
which is in turn based on the Adafruit ST7735 Arduino Library. Compared 
6
to the original, the memory requirement has been drastically reduced and
7
the speed has been improved. Allowing it to be used on smaller devices
8
such as the ATtiny85. It includes a speed-optimzed software-SPI
9
implementation that is more than twice as fast as the original implementation.
10
11
The library works with my display, which may be a "red" flag one.
12
Modifications are possibly required for other versions.
13
14
Modifications to the original library
15
-------------------------------------
16
17
 *  Removal of all circle functions.
18
 *  Only text size 1 is available.
19
 *  Only ASCII characters 32-128 are available. These are sufficient for normal english text and data display.
20
 *  Removal of bitmap functions. These can be easily implemented in the user program.
21
 *  Added speed optimized software SPI.
22
 *  Colour conversion is now done by macro.
23
 *  Reordered and speed optimized text printing function.
24
 *  Minor size optimizations to all functions.
25
26
The example compiles to only 2842 bytes, leaving ample space for additional functionality on the ATtiny85.

: Bearbeitet durch User
von Davis (Gast)


Lesenswert?

> Compared to the original, the memory requirement has been drastically
> reduced and the speed has been improved.

Kannst du konkrete Zahlen nennen?

von Tim  . (cpldcpu)


Lesenswert?

Davis schrieb:
>> Compared to the original, the memory requirement has been drastically
>> reduced and the speed has been improved.
>
> Kannst du konkrete Zahlen nennen?

Das Beispiel benötigt 2842 Bytes Flash und 47 Bytes SRAM. Die Library 
wird davon ca. 2400 bytes benötigen.

von Waldemar P. (waldi_p)


Lesenswert?

Mit welchem Program hast Du das Compiliert ?
mit welchen Einstellungen ?

Gruß

Waldemar

von Tim  . (cpldcpu)


Lesenswert?

AVR-GCC

-O1

von Harrie Bouwens (Gast)


Lesenswert?

I love the approach to get a smaller memory usage, but....
I'm using Arduino. I tried to convert the files to an Arduino variant, 
but wasn't succesfull. Could you make a Arduino library for this, 
please?

von Tim  . (cpldcpu)


Lesenswert?

Harrie, unfortunately I am not really into Arduino. But It should be 
fairly easy to port my changes back. Just start with the original 
Adafruit Arduino lib and work your way down from there. The function 
names are still the same.

von Harrie Bouwens (Gast)


Lesenswert?

I give it a try :)

von Christian K. (Gast)


Lesenswert?

Harrie,

for Arduino try this:

Beitrag "Grafik Library für 1.8' TFT"

I am using this lib with arduino. It supports the arduino GLCD fonts.

von echo (Gast)


Lesenswert?

Hallo,

ist es irgendwie möglich, bei der oben genannten Bibliothek  die 
Ausrichtung des Display zu ändern? Im Moment zeigt es die Schrift 
Horizontal an, ich hätte es aber gerne Vertikal, habe schon etwas 
probiert, allerdings zeigt es die Schrift jetzt untereinander an und 
nicht Vertikal Grade

Gruß, echo

von User (Gast)


Lesenswert?

Hallo zusammen,

kennt jemand eine aktuelle Bezugsquelle der kompletten Library?
Leider ist die Website von Tobias Weis nicht mehr verfügbar.

Gruß
Martin

von Dumpfbacke (Gast)


Lesenswert?

User schrieb:
> kennt jemand eine aktuelle Bezugsquelle der kompletten Library?

Tim  . schrieb:
> Die aktuelle Version gibt es hier:
> https://github.com/cpldcpu/uTFT-ST7735

... und da gibt es sie immer noch.

von User (Gast)


Lesenswert?

Dumpfbacke schrieb:
> Tim  . schrieb:
>> Die aktuelle Version gibt es hier:
>> https://github.com/cpldcpu/uTFT-ST7735
>
> ... und da gibt es sie immer noch.

Vielen Dank!

von User (Gast)


Lesenswert?

Moment das ist die gekürzte lib.

ich war auf der suche nach der originalen Version... Finde sie leider 
nicht mehr.

von Dumpfbacke (Gast)


Lesenswert?

User schrieb:
> Finde sie leider nicht mehr.

Übersetzt heisst das: ich kann nicht suchen.

https://github.com/adafruit/Adafruit-ST7735-Library

von User (Gast)


Lesenswert?

Suchen kann ich schon nur ist die lib in cpp geschrieben für die Arduino 
Software.

Ich war auf der Suche nach der reinen C Variante. Da komme ich wohl 
nicht drum herum die lib selbst anzupassen...

von Dumpfbacke (Gast)


Lesenswert?

User schrieb:
> Ich war auf der Suche nach der reinen C Variante.

Salamitaktik:

Erst mal sagen "ich brauch was", und dann später die
Spec hinterherschieben

von User (Gast)


Lesenswert?

Naja bin davon ausgegangen, dass der Thread sich auf eine lib in reinem 
C konzentriert. Aber tzd. Danke.

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.