Mcufriend_kbv.cpp - begin instruction - ST7793

I have some questions about the begin function in the file mcufriend_kbv.cpp for the ST7793 driver (line 2937 - #if defined(SUPPORT_B509_7793).

  1. What is the purpose of writing 0X000 four times in the register 0x0000. I don't understand, I thought this is the ID register and read only?
  2. The 'gamma' registers are labeled 0X0300 etc while in the data sheet of the diver, I find the addresses 0X0380 etc.
  3. When I write these values in these registers and read them again, I get different values. Also after a reset, I do not read the default values?
  4. Is the order that is used to initiate these registers important?

I would like to understand this better. I am using a different type of hardware set up (A basic xiao board for the RS, RD, WR, ... lines and a I2C pcf8574 expansion IC for the Data line.

Thanks for your help.

I forgot to mention that I can read the ID correctly 7793. So I suppose that my reading and writing function are correctly programmed.

Hi and welcome!

The Author of the library you use is no longer among us, unfortunately.
So you may not get a founded answer to your questions.

I suggest you look at the source of some other library, e.g.
Arduino_GFX/src/display/Arduino_ST7789.cpp at master · moononournation/Arduino_GFX · GitHub

Oops, this is for a different controller, doesn't support ST7793.

Then you might search for ST7793 in this forum / section.