2
\$\begingroup\$

I am searching for an explanation for the coding idiom for changing TFT display resolution that is used in the PORT from mcufriend’s Arduino code.

init_table16(R61509V_regValues, sizeof(R61509V_regValues));

  1. p16 = (int16_t *) & _height;
  2. *p16 = 400;

Statements 1 and 2 are to adjust the vertical resolution. I do understand this.

  1. p16 int16_t* 0x2000000c<_height> To allocate memory for _height in STM32F103 SRAM (64 KB aliased by bit-banding)

  2. To assign value (400) to the location.

Now the magic has happened and the resolution of the ST7793 has been adjusted over the parallel interface.

\$\endgroup\$
7
  • 1
    \$\begingroup\$ the URL is broken \$\endgroup\$ Commented Aug 13, 2022 at 17:00
  • \$\begingroup\$ what is your specific question? ... I am searching for... is not a question \$\endgroup\$ Commented Aug 13, 2022 at 17:12
  • \$\begingroup\$ whether you are asking for a place where the information can be found or you are asking for an explanation, your post is about programming and belongs at stackoverflow.com/questions \$\endgroup\$ Commented Aug 13, 2022 at 17:18
  • \$\begingroup\$ Your line #1 does not allocate any memory to anything. It assigns the value of the address of the _height variable to the pointer variable p16. Without more context it's not clear to me why both line couldn't have been simple combined into _height = 400;. \$\endgroup\$ Commented Aug 13, 2022 at 18:03
  • \$\begingroup\$ The _height variable does not directly involve to sending a command over 8080 parallel port to the ST7793 chip. How does variable _height affect the resolution? This is a question. \$\endgroup\$ Commented Aug 13, 2022 at 21:11

1 Answer 1

1
\$\begingroup\$

The statement p16 = (int16_t *) & _height; is giving access to bit-banding memory. *p16 = 400; is setting individual bits to peripheral registers mapping to a bit-banding region of M3 memory. This is how a miracle is created. I will spend the rest of my life learning the black magic of computing and sharing my experience. Thank you for your support.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.