Sure, here's some of the code I've been using on my MCU:
To draw two buttons:
//Draw first button with tag = 30
Send_CMD(TAG(30));
cmd_button(Display_Width()/4-40, Display_Height()*3/4-40, 80, 80, 30, OPT_FLAT, "30");
//Draw second button with tag = 31
Send_CMD(TAG(31));
cmd_button(Display_Width()*3/4-40, Display_Height()*3/4-40, 80, 80, 30, OPT_FLAT, "31");
To take the value from a slider object and display it as a number:
start_display_list(128,128,128);
uint32_t tracker = rd32(RAM_REG + REG_TRACKER);
val = tracker >> 16;
Send_CMD(TAG(31));
cmd_slider(0, Display_Height()/2, Display_Width(), Display_Height()/12, OPT_FLAT, val, 31);
cmd_track(0, Display_Height()/2, Display_Width(), Display_Height()/12, 31);
cmd_number(Display_Width()/2, Display_Height()/4 + 50, 30, OPT_CENTER, val);
finish_display_list();
HAL_Delay(30);
The Send_CMD function:
void Send_CMD(uint32_t data)
{
wr32(FifoWriteLocation + RAM_CMD, data); // write the command at the globally tracked "write pointer" for the FIFO
FifoWriteLocation += FT_CMD_SIZE; // Increment the Write Address by the size of a command - which we just sent
FifoWriteLocation %= FT_CMD_FIFO_SIZE; // Wrap the address to the FIFO space
}
So far the Send_CMD, cmd_xxxx functions have been working perfectly fine for drawing and registering touches, it's just the tag/tracker values are messed up like I've described.