Difference between revisions of "Unit HX8357D"
From Ultibo.org
(Created page with "Return to Unit Reference === Description === ---- ''To be documented'' === Constants === ---- ''To be documented'' === Type definitions === ---- ''To...") |
|||
(10 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
---- | ---- | ||
− | '' | + | '''Himax HX8357D TFT LCD Driver unit''' |
+ | |||
+ | The Himax HX8357D is a 320 x 480 RGB, 16M color TFT LCD Single Chip Driver that supports color depths of 16, 18 or 24bit. This driver supports the chip in both 16 and 24 bit depths using RGB888 or RGB565 formats. | ||
+ | |||
+ | The chip provides an SPI interface at up to 32MHz and supports rotations of 0, 90, 180 and 270 degrees. | ||
=== Constants === | === Constants === | ||
---- | ---- | ||
− | '' | + | |
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''HX8357D specific constants''' <code> HX8357D_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>HX8357D_FRAMEBUFFER_DESCRIPTION = 'Himax HX8357D TFT LCD';</code> | ||
+ | | Description of HX8357D device | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''HX8357D SPI''' <code> HX8357D_SPI_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>HX8357D_SPI_RATE = 32000000;</code> | ||
+ | | Default SPI clock rate | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''HX8357D command''' <code> HX8357D_CMD_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|See HX8357-D datasheet | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_NOP = $00;</code> | ||
+ | | 6.2.1 NOP: No Operation | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_SWRESET = $01;</code> | ||
+ | | 6.2.2 SWRESET: Software reset | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_RDDIDIF = $04;</code> | ||
+ | | 6.2.3 Read display identification information | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_SLPIN = $10;</code> | ||
+ | | 6.2.14 SLPIN: Sleep in (Enter the minimum power consumption mode) (Wait 120ms) | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_SLPOUT = $11;</code> | ||
+ | | 6.2.15 SLPOUT: Sleep out (Wait 5ms) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_PTLON = $12;</code> | ||
+ | | 6.2.16 PTLON: Partial mode on (This command turns on partial mode. The partial mode window is described by the Partial Area command (30H)) | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_NORON = $13;</code> | ||
+ | | 6.2.17 NORON: Normal display mode on (This command returns the display to normal mode) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_INVOFF = $20;</code> | ||
+ | | 6.2.18 INVOFF: Display inversion off (This command is used to recover from display inversion mode) | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_INVON = $21;</code> | ||
+ | | 6.2.19 INVON: Display inversion on (This command is used to enter into display inversion mode) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_ALLPOFF = $22;</code> | ||
+ | | 6.2.20 All pixel off (This command turns the display panel black in ‘Sleep Out’ mode) | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_ALLPON = $23;</code> | ||
+ | | 6.2.21 All pixel on (This command turns the display panel white in ‘Sleep Out‘ mode) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_DISPOFF = $28;</code> | ||
+ | | 6.2.23 DISPOFF: Display off (This command is used to enter into DISPLAY OFF mode. In this mode, the output from Frame Memory is disabled and blank page inserted) | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_DISPON = $29;</code> | ||
+ | | 6.2.24 DISPON: Display on (This command is used to recover from DISPLAY OFF mode. Output from the Frame Memory is enabled) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_CASET = $2A;</code> | ||
+ | | 6.2.25 CASET: Column address set (This command is used to define area of frame memory where MCU can access) | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_PASET = $2B;</code> | ||
+ | | 6.2.26 PASET: Page address set (This command is used to define area of frame memory where MCU can access) | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_RAMWR = $2C;</code> | ||
+ | | 6.2.27 RAMWR: Memory write (This command is used to transfer data from MCU to frame memory) | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_RAMRD = $2E;</code> | ||
+ | | 6.2.28 RAMRD: Memory read (This command is used to transfer data from frame memory to MCU) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_TEON = $35;</code> | ||
+ | | 6.2.32 TEON: Tearing effect line on | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_MADCTL = $36;</code> | ||
+ | | 6.2.33 MADCTL: Memory access control | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_COLMOD = $3A;</code> | ||
+ | | 6.2.37 COLMOD: Interface pixel format | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_TESL = $44;</code> | ||
+ | | 6.2.40 TESL: Set tear scan line | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_SETOSC = $B0;</code> | ||
+ | | 6.2.73 SETOSC: set internal oscillator | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_SETPOWER = $B1;</code> | ||
+ | | 6.2.74 SETPOWER: set power control | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_SETRGB = $B3;</code> | ||
+ | | 6.2.76 SETRGB: set RGB interface | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_SETCYC = $B4;</code> | ||
+ | | 6.2.77 SETCYC: set display cycle register | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_SETCOM = $B6;</code> | ||
+ | | 6.2.79 SETCOM: set VCOM voltage related register | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_SETEXTC = $B9;</code> | ||
+ | | 6.2.81 SETEXTC: enable extension command (Enable: FFh,83h,57h / Disable: xxh,xxh,xxh) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_SETSTBA = $C0;</code> | ||
+ | | 6.2.82 SETSTBA: Set Source Option | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_SETPANEL = $CC;</code> | ||
+ | | 6.2.87 SETPanel: set panel characteristic | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_SETGAMMA = $E0;</code> | ||
+ | | 6.2.88 SETGamma: set gamma curve | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''HX8357D memory access control''' <code> HX8357D_CMD_MADCTL_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|See HX8357-D datasheet 6.2.33 Memory access control | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_MADCTL_MY = $80;</code> | ||
+ | | Page Address Order | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_MADCTL_MX = $40;</code> | ||
+ | | Column Address Order | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_MADCTL_MV = $20;</code> | ||
+ | | Page / Column Selection | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_MADCTL_ML = $10;</code> | ||
+ | | Vertical Order | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_MADCTL_RGB = $00;</code> | ||
+ | | Colour selector switch control(0=RGB colour filter panel, 1=BGR colour filter panel) | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_MADCTL_BGR = $08;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_MADCTL_SS = $04;</code> | ||
+ | | Horizontal Order | ||
+ | |- | ||
+ | | <code>HX8357D_CMD_MADCTL_MH = HX8357D_CMD_MADCTL_SS;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Type definitions === | === Type definitions === | ||
---- | ---- | ||
− | '' | + | |
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PHX8357DFramebuffer = ^THX8357DFramebuffer;</code> | ||
+ | |||
+ | <code>THX8357DFramebuffer = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''TFT Properties'' | ||
+ | |- | ||
+ | | <code>TFT:TTFTFramebuffer;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |colspan="2"|''HX8357D Properties'' | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Public variables === | === Public variables === | ||
---- | ---- | ||
− | '' | + | ''None defined'' |
=== Function declarations === | === Function declarations === | ||
---- | ---- | ||
− | |||
+ | '''HX8357D functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function HX8357DFramebufferCreate(SPI:PSPIDevice; ChipSelect:Word; const Name:String; Rotation,Width,Height:LongWord; RST,DC,BL:PGPIOInfo):PFramebufferDevice;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create, register and allocate a new HX8357D Framebuffer device which can be accessed using the framebuffer API</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''SPI''' | ||
+ | | The SPI device that this HX8357D is connected to | ||
+ | |- | ||
+ | ! '''ChipSelect''' | ||
+ | | The SPI chip select to use when communicating with this device | ||
+ | |- | ||
+ | ! '''Name''' | ||
+ | | The text description of this device which will should in the device list (Optional) | ||
+ | |- | ||
+ | ! '''Rotaion''' | ||
+ | | The rotation value for the framebuffer device (eg FRAMEBUFFER_ROTATION_180) | ||
+ | |- | ||
+ | ! '''Width''' | ||
+ | | The width of the framebuffer in pixels | ||
+ | |- | ||
+ | ! '''Height''' | ||
+ | | The height of the framebuffer in pixels | ||
+ | |- | ||
+ | ! '''RST''' | ||
+ | | GPIO pin information for the Reset pin (Optional) | ||
+ | |- | ||
+ | ! '''DC''' | ||
+ | | GPIO pin information for the Data/Command pin | ||
+ | |- | ||
+ | ! '''BL''' | ||
+ | | GPIO pin information for the Backlight pin (Optional) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | Pointer to the new Framebuffer device or nil if the framebuffer device could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function HX8357DFramebufferDestroy(Framebuffer:PFramebufferDevice):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Release, deregister and destroy an HX8357D Framebuffer device created by this driver</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Framebuffer''' | ||
+ | | The Framebuffer device to destroy | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''HX8357D framebuffer functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function HX8357DFramebufferBlank(Framebuffer:PFramebufferDevice; Blank:Boolean):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of FramebufferDeviceBlank API for HX8357D</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | Not intended to be called directly by applications, use FramebufferDeviceBlank instead | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function HX8357DFramebufferSetBacklight(Framebuffer:PFramebufferDevice; Brightness:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of FramebufferDeviceSetBacklight API for HX8357D</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | Not intended to be called directly by applications, use FramebufferDeviceSetBacklight instead | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''HX8357D TFT framebuffer functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function HX8357DTFTFramebufferInitialize(Framebuffer:PTFTFramebuffer; Defaults:PFramebufferProperties):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of TFTFramebufferInitialize API for HX8357D</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | Not intended to be called directly by applications | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function HX8357DTFTFramebufferDeinitialize(Framebuffer:PTFTFramebuffer):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of TFTFramebufferDeinitialize API for HX8357D</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | Not intended to be called directly by applications | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function HX8357DTFTFramebufferGetDefaults(Framebuffer:PTFTFramebuffer; Properties,Defaults:PFramebufferProperties):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of TFTFramebufferGetDefaults API for HX8357D</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | Not intended to be called directly by applications | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function HX8357DTFTFramebufferSetWriteAddress(Framebuffer:PTFTFramebuffer; X1,Y1,X2,Y2:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of TFTFramebufferSetWriteAddress API for HX8357D</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | Not intended to be called directly by applications | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function HX8357DTFTFramebufferWriteMemory(Framebuffer:PTFTFramebuffer; Address:PtrUInt; Size:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of TFTFramebufferWriteMemory API for HX8357D</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | Not intended to be called directly by applications | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''HX8357D helper functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function HX8357DWriteCommand(Framebuffer:PTFTFramebuffer; Value:Byte):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Write a single command value to the HX8357D</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function HX8357DWriteCommandEx(Framebuffer:PTFTFramebuffer; const Values:array of Byte):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Write multiple command values to the HX8357D</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function HX8357DWriteData(Framebuffer:PTFTFramebuffer; Value:Byte):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Write a single data value to the HX8357D</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function HX8357DWriteDataEx(Framebuffer:PTFTFramebuffer; const Values:array of Byte):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Write multiple data values to the HX8357D</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
Return to [[Unit_Reference|Unit Reference]] | Return to [[Unit_Reference|Unit Reference]] |
Latest revision as of 04:50, 17 June 2021
Return to Unit Reference
Description
Himax HX8357D TFT LCD Driver unit
The Himax HX8357D is a 320 x 480 RGB, 16M color TFT LCD Single Chip Driver that supports color depths of 16, 18 or 24bit. This driver supports the chip in both 16 and 24 bit depths using RGB888 or RGB565 formats.
The chip provides an SPI interface at up to 32MHz and supports rotations of 0, 90, 180 and 270 degrees.
Constants
HX8357D specific constants
HX8357D_*
HX8357D_FRAMEBUFFER_DESCRIPTION = 'Himax HX8357D TFT LCD';
|
Description of HX8357D device |
HX8357D SPI
HX8357D_SPI_*
HX8357D_SPI_RATE = 32000000;
|
Default SPI clock rate |
HX8357D command
HX8357D_CMD_*
See HX8357-D datasheet | |
HX8357D_CMD_NOP = $00;
|
6.2.1 NOP: No Operation |
HX8357D_CMD_SWRESET = $01;
|
6.2.2 SWRESET: Software reset |
HX8357D_CMD_RDDIDIF = $04;
|
6.2.3 Read display identification information |
HX8357D_CMD_SLPIN = $10;
|
6.2.14 SLPIN: Sleep in (Enter the minimum power consumption mode) (Wait 120ms) |
HX8357D_CMD_SLPOUT = $11;
|
6.2.15 SLPOUT: Sleep out (Wait 5ms) |
HX8357D_CMD_PTLON = $12;
|
6.2.16 PTLON: Partial mode on (This command turns on partial mode. The partial mode window is described by the Partial Area command (30H)) |
HX8357D_CMD_NORON = $13;
|
6.2.17 NORON: Normal display mode on (This command returns the display to normal mode) |
HX8357D_CMD_INVOFF = $20;
|
6.2.18 INVOFF: Display inversion off (This command is used to recover from display inversion mode) |
HX8357D_CMD_INVON = $21;
|
6.2.19 INVON: Display inversion on (This command is used to enter into display inversion mode) |
HX8357D_CMD_ALLPOFF = $22;
|
6.2.20 All pixel off (This command turns the display panel black in ‘Sleep Out’ mode) |
HX8357D_CMD_ALLPON = $23;
|
6.2.21 All pixel on (This command turns the display panel white in ‘Sleep Out‘ mode) |
HX8357D_CMD_DISPOFF = $28;
|
6.2.23 DISPOFF: Display off (This command is used to enter into DISPLAY OFF mode. In this mode, the output from Frame Memory is disabled and blank page inserted) |
HX8357D_CMD_DISPON = $29;
|
6.2.24 DISPON: Display on (This command is used to recover from DISPLAY OFF mode. Output from the Frame Memory is enabled) |
HX8357D_CMD_CASET = $2A;
|
6.2.25 CASET: Column address set (This command is used to define area of frame memory where MCU can access) |
HX8357D_CMD_PASET = $2B;
|
6.2.26 PASET: Page address set (This command is used to define area of frame memory where MCU can access) |
HX8357D_CMD_RAMWR = $2C;
|
6.2.27 RAMWR: Memory write (This command is used to transfer data from MCU to frame memory) |
HX8357D_CMD_RAMRD = $2E;
|
6.2.28 RAMRD: Memory read (This command is used to transfer data from frame memory to MCU) |
HX8357D_CMD_TEON = $35;
|
6.2.32 TEON: Tearing effect line on |
HX8357D_CMD_MADCTL = $36;
|
6.2.33 MADCTL: Memory access control |
HX8357D_CMD_COLMOD = $3A;
|
6.2.37 COLMOD: Interface pixel format |
HX8357D_CMD_TESL = $44;
|
6.2.40 TESL: Set tear scan line |
HX8357D_CMD_SETOSC = $B0;
|
6.2.73 SETOSC: set internal oscillator |
HX8357D_CMD_SETPOWER = $B1;
|
6.2.74 SETPOWER: set power control |
HX8357D_CMD_SETRGB = $B3;
|
6.2.76 SETRGB: set RGB interface |
HX8357D_CMD_SETCYC = $B4;
|
6.2.77 SETCYC: set display cycle register |
HX8357D_CMD_SETCOM = $B6;
|
6.2.79 SETCOM: set VCOM voltage related register |
HX8357D_CMD_SETEXTC = $B9;
|
6.2.81 SETEXTC: enable extension command (Enable: FFh,83h,57h / Disable: xxh,xxh,xxh) |
HX8357D_CMD_SETSTBA = $C0;
|
6.2.82 SETSTBA: Set Source Option |
HX8357D_CMD_SETPANEL = $CC;
|
6.2.87 SETPanel: set panel characteristic |
HX8357D_CMD_SETGAMMA = $E0;
|
6.2.88 SETGamma: set gamma curve |
HX8357D memory access control
HX8357D_CMD_MADCTL_*
See HX8357-D datasheet 6.2.33 Memory access control | |
HX8357D_CMD_MADCTL_MY = $80;
|
Page Address Order |
HX8357D_CMD_MADCTL_MX = $40;
|
Column Address Order |
HX8357D_CMD_MADCTL_MV = $20;
|
Page / Column Selection |
HX8357D_CMD_MADCTL_ML = $10;
|
Vertical Order |
HX8357D_CMD_MADCTL_RGB = $00;
|
Colour selector switch control(0=RGB colour filter panel, 1=BGR colour filter panel) |
HX8357D_CMD_MADCTL_BGR = $08;
|
|
HX8357D_CMD_MADCTL_SS = $04;
|
Horizontal Order |
HX8357D_CMD_MADCTL_MH = HX8357D_CMD_MADCTL_SS;
|
Type definitions
PHX8357DFramebuffer = ^THX8357DFramebuffer;
THX8357DFramebuffer = record
TFT Properties | |
TFT:TTFTFramebuffer;
|
|
HX8357D Properties | |
Public variables
None defined
Function declarations
HX8357D functions
function HX8357DFramebufferCreate(SPI:PSPIDevice; ChipSelect:Word; const Name:String; Rotation,Width,Height:LongWord; RST,DC,BL:PGPIOInfo):PFramebufferDevice;
Description: Create, register and allocate a new HX8357D Framebuffer device which can be accessed using the framebuffer API
SPI | The SPI device that this HX8357D is connected to |
---|---|
ChipSelect | The SPI chip select to use when communicating with this device |
Name | The text description of this device which will should in the device list (Optional) |
Rotaion | The rotation value for the framebuffer device (eg FRAMEBUFFER_ROTATION_180) |
Width | The width of the framebuffer in pixels |
Height | The height of the framebuffer in pixels |
RST | GPIO pin information for the Reset pin (Optional) |
DC | GPIO pin information for the Data/Command pin |
BL | GPIO pin information for the Backlight pin (Optional) |
Return | Pointer to the new Framebuffer device or nil if the framebuffer device could not be created |
function HX8357DFramebufferDestroy(Framebuffer:PFramebufferDevice):LongWord;
Description: Release, deregister and destroy an HX8357D Framebuffer device created by this driver
Framebuffer | The Framebuffer device to destroy |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
HX8357D framebuffer functions
function HX8357DFramebufferBlank(Framebuffer:PFramebufferDevice; Blank:Boolean):LongWord;
Description: Implementation of FramebufferDeviceBlank API for HX8357D
Note | Not intended to be called directly by applications, use FramebufferDeviceBlank instead |
---|
function HX8357DFramebufferSetBacklight(Framebuffer:PFramebufferDevice; Brightness:LongWord):LongWord;
Description: Implementation of FramebufferDeviceSetBacklight API for HX8357D
Note | Not intended to be called directly by applications, use FramebufferDeviceSetBacklight instead |
---|
HX8357D TFT framebuffer functions
function HX8357DTFTFramebufferInitialize(Framebuffer:PTFTFramebuffer; Defaults:PFramebufferProperties):LongWord;
Description: Implementation of TFTFramebufferInitialize API for HX8357D
Note | Not intended to be called directly by applications |
---|
function HX8357DTFTFramebufferDeinitialize(Framebuffer:PTFTFramebuffer):LongWord;
Description: Implementation of TFTFramebufferDeinitialize API for HX8357D
Note | Not intended to be called directly by applications |
---|
function HX8357DTFTFramebufferGetDefaults(Framebuffer:PTFTFramebuffer; Properties,Defaults:PFramebufferProperties):LongWord;
Description: Implementation of TFTFramebufferGetDefaults API for HX8357D
Note | Not intended to be called directly by applications |
---|
function HX8357DTFTFramebufferSetWriteAddress(Framebuffer:PTFTFramebuffer; X1,Y1,X2,Y2:LongWord):LongWord;
Description: Implementation of TFTFramebufferSetWriteAddress API for HX8357D
Note | Not intended to be called directly by applications |
---|
function HX8357DTFTFramebufferWriteMemory(Framebuffer:PTFTFramebuffer; Address:PtrUInt; Size:LongWord):LongWord;
Description: Implementation of TFTFramebufferWriteMemory API for HX8357D
Note | Not intended to be called directly by applications |
---|
HX8357D helper functions
function HX8357DWriteCommand(Framebuffer:PTFTFramebuffer; Value:Byte):LongWord;
Description: Write a single command value to the HX8357D
Note | None documented |
---|
function HX8357DWriteCommandEx(Framebuffer:PTFTFramebuffer; const Values:array of Byte):LongWord;
Description: Write multiple command values to the HX8357D
Note | None documented |
---|
function HX8357DWriteData(Framebuffer:PTFTFramebuffer; Value:Byte):LongWord;
Description: Write a single data value to the HX8357D
Note | None documented |
---|
function HX8357DWriteDataEx(Framebuffer:PTFTFramebuffer; const Values:array of Byte):LongWord;
Description: Write multiple data values to the HX8357D
Note | None documented |
---|
Return to Unit Reference