I'm back to EVE programming after a few months. This time, I'm trying to write my own library
in true C++ (i.e. not a wrapper around an existing lib, but something that fully uses C++ capability.
I'm starting from the programming manual, and I could initialize the display exactly as explained.
It looks like the initialization works. I could also write some widgets, but sometimes the contents of the
screen disappears, so I'm back to simple actions, just to check if it works. Right now I'm debugging
step by step the following code:
Code: Select all
#define RED 0x00FF0000
#define GREEN 0x0000FF00
#define BLUE 0x000000FF
#define CLEAR_CMD 0x26000000
#define CLEAR_COL_CMD 0x02000000
#define CLEAR_COL_INIT BLUE
#define DISPLAY_CMD 0
#define SWAP_CMD 0xFFFFFF01
#define CLEAR_ALL 0x00000007
// Instance of the display
EveDisplay SysDisplay;
Initialization: SysDisplay.Init();
I have defined a clear function like this:
Code: Select all
EveDisplay::Clear(uint32 color) {
color &= 0x00FFFFFF; // Ensure it will not interfere with the command.
wr32(REG_CMDB_WRITE, CLEAR_COL_CMD + color);
wr32(REG_CMDB_WRITE, CLEAR_CMD + CLEAR_ALL);
wr32(REG_CMDB_WRITE, DISPLAY_CMD);
wr32(REG_CMDB_WRITE, SWAP_CMD);
}
Code: Select all
EveDisplay::Test() {
Clear(RED);
Clear(GREEN);
Clear(BLUE);
}
which is what I expected. After stepping over Clear(RED), instead of getting a red screen,
I get the screen that I used before setting it to blue. It was a darker blue, like 0x00000080.
And stepping again goes back to bright blue instead of green, and finally to darker blue.
The conclusion of this is that it swaps fine but the color setting commands don't work.
The funny thing is that do the exact same action in the initialization.
NB: I'm aware this code might not work when not running step by step because I guess
clearing the screen takes time and I don't check if it's busy. But I'm using it step by step
only for the time being, and this function will be removed.
By the way, I have just noticed that the programming guide says (point 8 of paragraph
2.3 initialization sequence) that the clock should be less than 30 MHz, and in the code
snippet it says it should be less than 11 MHz. Which one is it?
Well, that said, I'm running at 6.75 MHz, so it shouldn't be the reason.
The only difference with the documentation is that it is using the RAM_DL location and
I'm writing to REG_CMDB_WRITE.
Thanks for any hint!