Reading current configuration

I have a 5" LCD I am working on and because the ChipworkX module I have is configured for 4.3" with 480x272 display, I need to change the timing via code and do a reboot.

I am trying to see if I can do this as part of the main system software so that once a board is programmed with the software, it checks to see if set to the correct screen resolution and if not, makes and the changes and does a reboot. After this the main application runs.

I am trying to avoid having to install a configuration app and then the main app after this.

I already have the following to set the LCD parameters.


                lcdConfig.Width = 800;
                lcdConfig.Height = 480;

                lcdConfig.PriorityEnable = false;

                lcdConfig.OutputEnableIsFixed = false;
                lcdConfig.OutputEnablePolarity = true;

                lcdConfig.HorizontalSyncPolarity = true;
                lcdConfig.VerticalSyncPolarity = true;
                lcdConfig.PixelPolarity = false;

                lcdConfig.HorizontalSyncPulseWidth = 1;
                lcdConfig.HorizontalBackPorch = 92;
                lcdConfig.HorizontalFrontPorch = 16;
                lcdConfig.VerticalSyncPulseWidth = 4;
                lcdConfig.VerticalBackPorch = 26;
                lcdConfig.VerticalFrontPorch = 7;

                lcdConfig.PixelClockDivider = 2;

Is there some way during startup I can read the current LCD settings?

I believe, set LCD config returns true/false telling you if the config were set or were nto because they matched.

Thanks Gus,

That seems to worksort of like you described. I seem to get 2 reboots before it returns false.

Every time it restarts it seems to do the same thing.

Another option is to read the LCD config registers directly using Register class.

Thanks. I only need to check the width as I just need to know if still on 480 or changed to 800.

I’ll dig around.

Reading register 0x600810 yelds the HORIX width -1 (after masking and shifting) so that works.

:slight_smile: