Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How about to separate M5Display as a library #241

Closed
asukiaaa opened this issue Feb 13, 2021 · 4 comments
Closed

How about to separate M5Display as a library #241

asukiaaa opened this issue Feb 13, 2021 · 4 comments

Comments

@asukiaaa
Copy link
Contributor

asukiaaa commented Feb 13, 2021

Thank you for sharing useful library.
M5Display saves my time a lot.

I want to use the library for other lcd but it seems difficult. ( TFT_WIDTH and TFT_HEIGHT are embedded in code.)
How about to separate M5Display as a independent library and make it one of dependent library of this lib?
If it is separated, M5Core2 and M5StickC can depend on the library and we can redule amount of code.

Arduino framework supports depends option from Arduino IDE 1.8.10
arduino/Arduino#8600
https://arduino.github.io/arduino-cli/library-specification/

My idea of definitions.

M5Display.h as independent library

class M5Display
{
  public:
    M5Display(uint16_t width, uint16_t height, int pinLed = -1, uint16_t ledPWMChannel = 7);
};

library.properties of M5Stack

depends=M5Display

M5Stack.h

class M5Stack
{
  public:
    M5Stack();

    // LCD
    M5Display Lcd = M5Display(TFT_WIDTH, TFT_HEIGHT, TFT_BG, BLK_PWM_CHANNEL);
}; 
@EeeeBin
Copy link
Contributor

EeeeBin commented Feb 13, 2021

Hi, asukiaaa
m5stack tft is based on bobmer's tft library -> https://github.com/Bodmer/TFT_eSPI
This is easier to port to other lcd
Hope this helps you

@EeeeBin EeeeBin closed this as completed Feb 13, 2021
@asukiaaa
Copy link
Contributor Author

Thank you for replying.
I know that library but M5Display has its own functions so I think is is useful if it is separated as a library.

@lovyan03
Copy link
Contributor

hello @asukiaaa
If you want, you can try this library.

https://github.com/lovyan03/LovyanGFX

Most of the functions of M5Display can be used without modification, and it works faster.

@asukiaaa
Copy link
Contributor Author

@lovyan03
Thank you for the information.
I try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants