News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Muhammad

#1
The update on the fly is a very important feature.
In my application for example , there are multiple RTOS threads that updates their own corresponding fields on the screen.
Each thread is not aware of anything but its own section of the screen.
So if that feature is not enabled, it means the threads need to redraw the whole frame!!!
#2
You are right, I thought I can draw each list independently !
But now thats a problem.
Assume I have a frame already drawn and then I wanted to add a new object to the existing frame,
Is that possible ?
Or I have to redraw the whole frame from scratch ??!!
#3
Hello all,

This is my API to draw a button.
As per the picture on the attachement , the button is rendered as expected but the background is not correct !!
In this example I cleared the screen to red, and then sent the CMD_BUTTON, so any idea about whats behind the button ??
int16_t bt81x_draw_button (uint16_t u16_Xpos,
                           uint16_t u16_Ypos,
                           uint16_t u16_width,
                           uint16_t u16_height,
                           uint16_t u16_font,
                           uint16_t u16_opt,
                           const char * pachr_name)
{
  int16_t s16_ret;
  uint8_t u8_name_len;
  uint16_t u16_cmd_offset = 0;
  uint8_t u8_byte_idx = 0;
  uint32_t u32_word;
  do
  {
     s16_ret = wait_for_coproc_engine(&u16_cmd_offset);
    _ERROR_BREAK(s16_ret);
    s16_ret = bt81x_write_32bit_reg(RAM_CMD + u16_cmd_offset, CMD_DLSTART);
    _ERROR_BREAK(s16_ret);                                                                                 
    inc_offset(&u16_cmd_offset, 4);
    s16_ret = bt81x_write_32bit_reg(RAM_CMD + u16_cmd_offset, CMD_BUTTON);
    _ERROR_BREAK(s16_ret);
    inc_offset(&u16_cmd_offset, 4);
    s16_ret = bt81x_write_32bit_reg(RAM_CMD + u16_cmd_offset, ((uint32_t)(u16_Ypos << 16) | (uint32_t)(u16_Xpos)));
    _ERROR_BREAK(s16_ret);
    inc_offset(&u16_cmd_offset, 4); 
    s16_ret = bt81x_write_32bit_reg(RAM_CMD + u16_cmd_offset, ((uint32_t)(u16_height << 16) | (uint32_t)(u16_width)));
    _ERROR_BREAK(s16_ret);
    inc_offset(&u16_cmd_offset, 4);
    s16_ret = bt81x_write_32bit_reg(RAM_CMD + u16_cmd_offset, ((uint32_t)(u16_opt << 16) | (uint32_t)(u16_font)));
    _ERROR_BREAK(s16_ret);
    inc_offset(&u16_cmd_offset, 4);
    u8_name_len = strlen(pachr_name);
    for(uint8_t u8_word_idx = 0; u8_word_idx < (u8_name_len/4); u8_word_idx++, u8_byte_idx += 4)
    {
      u32_word = (uint32_t)(pachr_name[u8_byte_idx+3] << 24) | (uint32_t)(pachr_name[u8_byte_idx+2] << 16)
                    | (uint32_t)(pachr_name[u8_byte_idx+1] << 8) | (uint32_t)(pachr_name[u8_byte_idx]);
      s16_ret = bt81x_write_32bit_reg(RAM_CMD + u16_cmd_offset, u32_word);
      _ERROR_BREAK(s16_ret);
      inc_offset(&u16_cmd_offset, 4);
    }
    _ERROR_BREAK(s16_ret);
    u32_word = 0;
    for(uint8_t u8_remaining = 0; u8_remaining < (u8_name_len%4); u8_remaining++,u8_byte_idx++)
    {
      u32_word |= (uint32_t)pachr_name[u8_byte_idx] << (u8_remaining * 8);
    }
    if(u8_name_len%4)
    {
      s16_ret = bt81x_write_32bit_reg(RAM_CMD + u16_cmd_offset, u32_word);
      _ERROR_BREAK(s16_ret);
      inc_offset(&u16_cmd_offset, 4);
    }
    s16_ret = bt81x_write_32bit_reg(RAM_CMD + u16_cmd_offset, (DISPLAY << 24));
    _ERROR_BREAK(s16_ret);
    inc_offset(&u16_cmd_offset, 4);
    s16_ret = bt81x_write_32bit_reg(RAM_CMD + u16_cmd_offset, CMD_SWAP);
    _ERROR_BREAK(s16_ret);
    inc_offset(&u16_cmd_offset, 4);
    s16_ret = bt81x_write_32bit_reg(REG_CMD_WRITE, u16_cmd_offset);
  }while(0);
  return s16_ret;
}