nspsck / RM67162_Micropython_QSPI

This is a C driver as a user module for the T-AMOLED-S3 using QSPI-protocol.
MIT License
7 stars 4 forks source link

Trying to implement JPG functions #10

Open dobodu opened 5 months ago

dobodu commented 5 months ago

Hi nspsck,

I tried to add the JPG function, making an adaptation of what russhughes/st7789_mpy did. I made it successfull to compile but... crashes when i use it. I think I got messed up with the different buffers but if you had a time to give a look, that would be great.

PS : I'm not friendly with C, I hope the mistakes I've done are not too big.

rm67162_jpg.zip

nspsck commented 5 months ago

Would you please do a PR so I can compare those more effeciently?

dobodu commented 5 months ago

I'll fork this week-end and upload my code. ;-)

dobodu commented 5 months ago

Fork done

There must be many errors... but I think I implemented correctly the main functions.

nspsck commented 5 months ago

Thank you very much, am going to look into it as soon as I found time to!

nspsck commented 4 months ago

Hi, so I finally had some time to look into the code briefly. I changed the following lines to:

    if ((self->width == 240 && self->height == 536) || \
        (self->width == 536 && self->height == 240)) {
        memcpy(&self->rotations, ORIENTATIONS_240x536, sizeof(ORIENTATIONS_240x536));
    } else if ((self->width == 450 && self->height == 600) || \
        (self->width == 600 && self->height == 450)) {
        memcpy(&self->rotations, ORIENTATIONS_450x600, sizeof(ORIENTATIONS_450x600));
    } else {
        mp_warning(NULL, "rotation parameter not detected");
        mp_warning(NULL, "use default rotation parameters");
        memcpy(&self->rotations, ORIENTATIONS_GENERAL, sizeof(ORIENTATIONS_GENERAL));
        self->rotations[0].width = self->width;
        self->rotations[0].height = self->height;
        self->rotations[1].width = self->height;
        self->rotations[1].height = self->width;
        self->rotations[2].width = self->width;
        self->rotations[2].height = self->height;
        self->rotations[3].width = self->height;
        self->rotations[3].height = self->width;
    }

Basically I added:

else if ((self->width == 450 && self->height == 600) || \
        (self->width == 600 && self->height == 450)) {
        memcpy(&self->rotations, ORIENTATIONS_450x600, sizeof(ORIENTATIONS_450x600));
    }

and it compiled. Hope this helps.

However the functionality of the jpg() wasn't tested.

nspsck commented 4 months ago

In case you want the firmware: firmware.zip

dobodu commented 4 months ago

Hi, Thanks, I was trying to add some lines in order to support T4-S3. The chips used RM690B0 seem to share the same functions than RM67162. The resolution is 600x450.

dobodu commented 4 months ago

By the way, as for the T-Display S3 Amoled wich requires Gpio38 to enlight the screen, T4-S3 requires Gpio09.

dobodu commented 4 months ago

JPG doesn't work for now...

nspsck commented 4 months ago

Oh, thanks for the info, I'll add it somewhere in the README.md.

JPG doesn't work for now...

I'll see what I can do in 2 weeks, have been busy recently.

dobodu commented 4 months ago

By the way,

I've been working the last week, in order to adapt you library for RM690B0 (the display driver for Lilygo T4 S3 amoled) since the display driver documentation clearly shows it's a RM67162 brother.

You can have a look [there](https://github.com/dobodu/RM69690_Micropython_QSPI)

I'm facing a strange behaviour when using the .text or .write functions, some lines appear correctly whereas some other are like "Italic". An idea where that might come from ?

nspsck commented 4 months ago

image Ugh.. this is all I see.

If it's italic, this means something is misaligned. Either the display's madctl values need to be adapted or the function has some problems. This part.

dobodu commented 4 months ago

I'm so sorry, my repo was in "Private mode" => I've made it public. Would you please have a look at the picture I published in the first issue ?