FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Show Posts

You can view here all posts made by this member. Note that you can only see posts made in areas to which you currently have access.

Messages - rascalito

Pages: [1]
1
Discussion - Software / Re: Compressing to ASTC on Linux.
« on: July 14, 2022, 08:14:04 AM »
Hello!

Sorry, just replying to a part of my own post.
Compressing in ASTC format on Ubuntu:
1. Install by
sudo apt install astcenc
2. Run astcenc.
-> This will list a couple of examples which will be good to start before learning how
to tune the bitmaps for a given purpose.

Now the other questions remain: how to choose the right ASTC format.

Regards,

R


2
Discussion - Software / Compressing to ASTC on Linux.
« on: July 14, 2022, 07:20:48 AM »
Hello!

I'm using Ubuntu 22.04.
I'm using a lot of bitmaps, and the easiest way to use bitmaps seems to be to compress
them to ASTC, and store them directly in flash.
As the process of adding a new bitmap is quite time consuming, I have made a php script
that takes one raw image and its associated json. It then creates a pair of .h / .c files
and adds a record in a bitmaplist.h / .cp. files.
Now the next step I would like is a way to directly compress my images on Linux.
It also creats in each .h / .cpp file a structure which contains the file name, data pointer, position
in flash, etc... and also spits out the percentage of flash that has been used. And beside this,
drawing a single image is done with a single command with 2 parameters, one being a rectangle,
and the other is this structure.
Example:
Rect R(x, y, w, h);
BitmapInfo * bmi = BitmapList->FindBMI("MyLogo");
if(bmi) SysLCD->DrawBitmap(R, bmi);
Is there a command-line tool that I can run from the terminal (and therefore from a php script)?

Next question:
How do I choose an encoding method?
I choosed ASTC8x8 at random and it works, but is there logical way to choose an encoding scheme?

Last one:
I have chosen ASTC8x8. When the bitmap dimensions are mutliple of 8, it's just fine. When not,
the size is rounded up to the next multiple of 8. In this case, what will the added image border
look like?

Thanks!

R

3
Discussion - Software / Overlapping widgets
« on: July 23, 2020, 09:40:05 AM »
Hello!
I'm using a FT813 7-inch display. I would like to make a keyboard object with entry field.
Ideally, this would be an opaque object that would come on top of all the other objects
when I tap a value to be edited.
Is there a problem overlapping objects? I mean, writing many widgets, and then displaying
a bigger object that hides other widgets previously drawn in the same session (between command start
and display swap).

Beside this, other than hiding other widgets, I would like to first draw a very large button which covers
a bit more than the area of the keyboard itself. This would solve the problem of spaces between the
buttons.

Thanks for any hint!
R

4
Discussion - Software / Using touch panel
« on: May 15, 2020, 07:50:45 AM »
Hello!

I would like to get touch panel events. Ideally, I would like to receive an interrupt
when the screen has been touched. I could live with polling for test, but anyway for
the moment, I can't get touch coordinates. So one problem at a time, let's start with
polling.

What I did:
I have set up the address of the touch panel chip which is a Goodix. The documentation
says that the address should be 5D.
So the first thing I did is to fill in the REG_TOUCH_CONFIG register for capacitive setup
Bit 15: 0 for capacitive.
14,13: reserved
12: ignore short circuit. I suppose it's for resistive.
Bit11: enable low power mode. Not crucial for test, I will leave it as 0.
10~4 is the I2C address, 5D
Bit 3: vendor. I tried both. Is Goodix a FocalTech or AzoTech device?
Bit2: suppress 300 ms startup. Leave as 0.
Bits 1 and 0, same.

Summary:
Bits 15 to 12 = 0
Bit 11 = 0
Bits 10~4 = 5D
Bit 3 only may have an influence.
Therefore the possible codes are 0x05D8 or 0x05D0

As for the touch mode, there are only 2 bits, apparently. I tried 10 (frame mode) and 11
(continuous mode), but without success so fare.

After setting these 2 registers, I access the coordinate registers, but they are always
at 0, touch or not.

Am I missing something?


Best regards,

R

5
Discussion - Software / Re: Using coprocessor (FT813)
« on: May 15, 2020, 07:09:35 AM »
Hello!

Thanks for your reply, and sorry for the delay, I was dealing with real work (i.e.
the one I get paid for)...
It works with 0xffffff2e, thanks. That said, I don't know how this definition came here,
I didn't invent it and I didn't make the file myself. I downloaded it from GitHub, most likely.
The only thing I did is to define all the commands as absolute, not as an offset from RAM start.

Thanks anyway.

Best regards,

R.

6
Discussion - Software / Re: Using coprocessor (FT813)
« on: May 10, 2020, 09:54:53 AM »
Hello!

Thanks for your reply. I managed to use the widgets.
I wrote my own code, and I could test all the widgets listed page 152 of the documentation... except the CMD_NUMBER.
I spent quite some time on it, I checked what exactly I send with the oscilloscope, and what I wrote seems to be coherent
with what should be sent.
The documentation says:
Code: [Select]
void cmd_number( int16_t x,
    int16_t y,
    int16_t font,
    uint16_t options,
    int32_t n );

I have attached the part of the command itself. One is for CMD_TOGGLE (which works and displays fine),
the other is for CMD_NUMBER (which doesn't work and screws up everything. If I use CMD_NUMBER, even
other commands don't display anymore).
As I don't see my attachments in preview, here is the contents:
CMD_TOGGLE:
Code: [Select]
B0 80 18 12 FF FF FF    // 0xFFFFFF12 is CMD_TOGGLE. The address is 0x308000 + write bit + current offset (0x18)
B0 80 1C 64 00 64 00    // X and Y parameters are passed, both of them 100 (0x64), at updated offset (0x1C)
B0 80 20 1E 00 14 00    // width = 30 (1E), font = 20 (14)
B0 80 24 00 00 00 00    // Option and state both 0
B0 80 28 4F 46 46 00    // String "OFF"

This works fine. Now if I replace the above at the same place in my code with CMD_NUMBER, x, y, font, options, number,
the scope reports:
CMD_NUMBER:
Code: [Select]
B0 80 18 38 FF FF FF    // CMD_NUMBER is 0xFFFFFF38, written at the same offset as before (0x18)
B0 80 1C 14 00 3C 00    // 20, 60 for the coordinates (14, 3C). The same code line works for all other widgets and has been copied.
B0 80 20 1F 00 00 00    // Font = 1F (31). This font works for other widgets. Options = 0 as in some documentation examples.
B0 80 24 2A 00 00 00    // Value = 42 (not original, it's the same as the documentation).

The code preceding this sequence and also the code following are strictly identical.

Can anybody explain me why CMD_NUMBER doesn't work?
Well, I have a workaround with CMD_TEXT, by sending a formatted string instead of using CMD_NUMBER,
but it would be good to know why it doesn't work.
Thanks.


7
Discussion - Software / Re: Using coprocessor (FT813)
« on: May 06, 2020, 09:40:21 AM »
Hello!

Thanks for your reply.
Yes, that's right, I just want to know how to use the coprocessor to write a single slider.
When I set to COP_SLIDER = 0, it works fine, I get a blue screen with a white rectangle.
I can also draw sliders myself, and that's what I did in the first version of my current software.
It was working well, but it's always difficult to get fancy effects, so I would like to upgrade
my software so that it now uses the coprocessor widgets (for instance in the present case,
a single slider).

Quote
CMD_DL_START // Tells co-pro to begin writing DL at RAM_DL+0

OK, I have added wr32(RAM_DL, CMD_DLSTART);, exactly as if I was writing direcly to the
non-coprocessor area.

Quote
CLEAR_COLOR_RGB // Co-processor writes this instruction to the DL
CLEAR(1,1,1) // Co-processor writes this instruction to the DL

So you mean I don't have to write anything myself? If the coprocessor writes these 2 instructions,
then I have to leave room for these instructions, and then at the end I will write the instructions at offset 8
(4 for clear_color + 4 for clerar(1,1,1)?

Quote
#co-pro commands
Color_RGB(0,0,255)
Point_Size(20)
Begin(Points)
Vertex2F(0,0)

I don't understand this part. What does it do? Do I need it to draw a slider? It looks like it will draw a point.
Is it written in RAM_CMD or RAM_DL? I can write RGB(0,0,255) directly to RAM_DL, so it doesn't look like a
coprocessor command. In my snippet below I

Code: [Select]
#end procedure
End()

Is this End() to be written to the DL memory? If yes, at which offset? Last time I wrote was at offset 8, is it 12 now?

Similarily as before:
Code: [Select]
DISPLAY // Co-processor writes this instruction to the DL
CMD_SWAP // Co-processor writes REG_DL_SWAP

Do I have to do anything here?

Quote
[update REG_CMD_WRITE to point to end of new commands]

How do I do that? I can read where the REG_CMD_WRITE is by rd16(REG_CMD_WRITE + RAM_REG);
but what should I do with the value?

I replaced the DL part with the code found at 2.5.1 in FT81X documentation. I get the FTDI logo on black background.
Same as before, it works with COP_SLIDER = 0, not yet with 1. I guess the missing part is the REG_CMD_WRITE
stuff, but I'm stuck...

Thanks for any hint!

R

Code: [Select]
#define COP_SLIDER 1

void FT813::Test(void) {
#if COP_SLIDER
// Offsets come from BridgeTek's programmers guide, version 1.2, page 204.
// Start procedure
wr32(RAM_DL, CMD_DLSTART);
wr32(RAM_DL + 4, CLEAR_COLOR_RGB(0x30, 0x60, 0x90));
wr32(RAM_DL + 8, CLEAR(1, 1, 1));
// Coprocessor commands
wr32(RAM_CMD, CMD_SLIDER); // Command offset is 0
wr16(RAM_CMD + 4, 32); // X
wr16(RAM_CMD + 6, 32); // Y
wr16(RAM_CMD + 8, 320); // W
wr16(RAM_CMD + 10, 32); // H
wr16(RAM_CMD + 12, 0); // Options (default is 0)
wr16(RAM_CMD + 14, 100); // Val
wr16(RAM_CMD + 16, 40); // Size (width of the knob??)
wr16(RAM_CMD + 18, 300); // Range
// End procedure
wr32(RAM_DL+12, END());
wr32(RAM_DL+16, DISPLAY());
wr8(REG_DLSWAP, DLSWAP_FRAME); // Display list swap
#else
wr32(RAM_DL, CLEAR_COLOR_RGB(0, 0, 0));
wr32(RAM_DL + 4, CLEAR(1, 1, 1)); // clear screen
wr32(RAM_DL + 8, BEGIN(BITMAPS)); // start drawing bitmaps
wr32(RAM_DL + 12, VERTEX2II(220, 110, 31, 'F')); // ascii F in font 31
wr32(RAM_DL + 16, VERTEX2II(244, 110, 31, 'T')); // ascii T
wr32(RAM_DL + 20, VERTEX2II(270, 110, 31, 'D')); // ascii D
wr32(RAM_DL + 24, VERTEX2II(299, 110, 31, 'I')); // ascii I
wr32(RAM_DL + 28, END());
wr32(RAM_DL + 32, COLOR_RGB(160, 22, 22)); // change colour to red
wr32(RAM_DL + 36, POINT_SIZE(320)); // set point size to 20 pixels in radius
wr32(RAM_DL + 40, BEGIN(POINTS)); // start drawing points
wr32(RAM_DL + 44, VERTEX2II(192, 133, 0, 0)); // red point
wr32(RAM_DL + 48, END());
wr32(RAM_DL + 52, DISPLAY()); // display the image
wr8(REG_DLSWAP, DLSWAP_FRAME);

#endif
}





8
Discussion - Software / Using coprocessor (FT813)
« on: May 04, 2020, 02:27:00 AM »
Hello!

Absolute beginner here. I could initialize the display and draw some basic shapes using the DL
RAM (set COP_SLIDER to 0).
Now I would like to draw a slider (set COP_SLIDER to 1). I read the documentation related to slider,
and found a description of the command layout. That's what I tried to do below.
NB: I'm aware it's shitty code, everything is hardcoded and it shouldn't but it's a test. I will clean
everything once I know how to do.
So my question: what is wrong in this code? I just unwrapped sample code's Send_Cmd which is
basically a wr32 command with some offset management. And the Cmd_slider is a sequence of
Send_cmd, so unrolling everything should look as below...

Thanks for any hint.

Code: [Select]
#define COP_SLIDER 1

void FT813::Test(void) {
#if COP_SLIDER
// Offsets come from BridgeTek's programmers guide, version 1.2, page 204.
wr32(RAM_CMD, CMD_SLIDER); // Command offset is 0
wr16(RAM_CMD + 4, 32); // X
wr16(RAM_CMD + 6, 32); // Y
wr16(RAM_CMD + 8, 320); // W
wr16(RAM_CMD + 10, 32); // H
wr16(RAM_CMD + 12, 0); // Options (default is 0)
wr16(RAM_CMD + 14, 100); // Val
wr16(RAM_CMD + 16, 40); // Size (width of the knob??)
wr16(RAM_CMD + 18, 300); // Range
wr32(RAM_CMD + 20, CMD_SWAP);
#else
wr32(RAM_DL, CLEAR_COLOR_RGB(0x30, 0x60, 0x90)); // Blue
wr32(RAM_DL+4, CLEAR(1,0,0));
wr32(RAM_DL+8, COLOR_RGB(255, 255, 255));
wr32(RAM_DL+12, BEGIN(RECTS));
wr32(RAM_DL+16, VERTEX2F(300, 300));
wr32(RAM_DL+20, VERTEX2F(3000, 600));
wr32(RAM_DL+24, END());
wr32(RAM_DL+28, DISPLAY());
wr8(REG_DLSWAP, DLSWAP_FRAME); // Display list swap
#endif
}

Pages: [1]