Difference between revisions of "Unit HX8357D"

From Ultibo.org
Jump to: navigation, search
Line 12: Line 12:
 
----
 
----
  
''To be documented''
+
 
 +
<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 constants''' <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 constants''' <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"|&nbsp;
 +
|-
 +
| <code>HX8357D_CMD_NOP = $00;</code>
 +
| 6.2.1 NOP: No Operation
 +
|-
 +
| <code>HX8357D_CMD_SWRESET = $01;</code>
 +
| 6.2.2 SWRESET: Software reset
 +
|-
 +
| <code>|colspan="2"|&nbsp;</code>
 +
| &nbsp;
 +
|-
 +
| <code>HX8357D_CMD_RDDIDIF = $04;</code>
 +
| 6.2.3 Read display identification information
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <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"|&nbsp;
 +
|-
 +
| <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"|&nbsp;
 +
|-
 +
| <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"|&nbsp;
 +
|-
 +
| <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"|&nbsp;
 +
|-
 +
| <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"|&nbsp;
 +
|-
 +
| <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"|&nbsp;
 +
|-
 +
| <code>HX8357D_CMD_TEON = $35;</code>
 +
| 6.2.32 TEON: Tearing effect line on
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <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"|&nbsp;
 +
|-
 +
| <code>HX8357D_CMD_TESL = $44;</code>
 +
| 6.2.40 TESL: Set tear scan line
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <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"|&nbsp;
 +
|-
 +
| <code>HX8357D_CMD_SETEXTC = $B9;</code>
 +
| 6.2.81 SETEXTC: enable extension command (Enable: FFh,83h,57h / Disable: xxh,xxh,xxh)
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>HX8357D_CMD_SETSTBA = $C0;</code>
 +
| 6.2.82 SETSTBA: Set Source Option
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>HX8357D_CMD_SETPANEL = $CC;</code>
 +
| 6.2.87 SETPanel: set panel characteristic
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <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 constants''' <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"|&nbsp;
 +
|-
 +
| <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>
 +
| &nbsp;
 +
|-
 +
| <code>HX8357D_CMD_MADCTL_SS = $04;</code>
 +
| Horizontal Order
 +
|-
 +
| <code>HX8357D_CMD_MADCTL_MH = HX8357D_CMD_MADCTL_SS;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
=== Type definitions ===
 
=== Type definitions ===

Revision as of 02:53, 13 December 2016

Return to Unit Reference


Description


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



[Expand]
HX8357D specific constants HX8357D_*


[Expand]
HX8357D SPI constants HX8357D_SPI_*


[Expand]
HX8357D command constants HX8357D_CMD_*


[Expand]
HX8357D memory access control constants HX8357D_CMD_MADCTL_*


Type definitions


To be documented

Public variables


To be documented

Function declarations



HX8357D functions

[Expand]
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


[Expand]
function HX8357DFramebufferDestroy(Framebuffer:PFramebufferDevice):LongWord;
Description: Release, deregister and destroy an HX8357D Framebuffer device created by this driver


HX8357D framebuffer functions

[Expand]
function HX8357DFramebufferBlank(Framebuffer:PFramebufferDevice; Blank:Boolean):LongWord;
Description: Implementation of FramebufferDeviceBlank API for HX8357D


[Expand]
function HX8357DFramebufferSetBacklight(Framebuffer:PFramebufferDevice; Brightness:LongWord):LongWord;
Description: Implementation of FramebufferDeviceSetBacklight API for HX8357D


HX8357D TFT framebuffer functions

[Expand]
function HX8357DTFTFramebufferInitialize(Framebuffer:PTFTFramebuffer; Defaults:PFramebufferProperties):LongWord;
Description: Implementation of TFTFramebufferInitialize API for HX8357D


[Expand]
function HX8357DTFTFramebufferDeinitialize(Framebuffer:PTFTFramebuffer):LongWord;
Description: Implementation of TFTFramebufferDeinitialize API for HX8357D


[Expand]
function HX8357DTFTFramebufferGetDefaults(Framebuffer:PTFTFramebuffer; Properties,Defaults:PFramebufferProperties):LongWord;
Description: Implementation of TFTFramebufferGetDefaults API for HX8357D


[Expand]
function HX8357DTFTFramebufferSetWriteAddress(Framebuffer:PTFTFramebuffer; X1,Y1,X2,Y2:LongWord):LongWord;
Description: Implementation of TFTFramebufferSetWriteAddress API for HX8357D


[Expand]
function HX8357DTFTFramebufferWriteMemory(Framebuffer:PTFTFramebuffer; Address,Size:LongWord):LongWord;
Description: Implementation of TFTFramebufferWriteMemory API for HX8357D


HX8357D helper functions

[Expand]
function HX8357DWriteCommand(Framebuffer:PTFTFramebuffer; Value:Byte):LongWord;
Description: Write a single command value to the HX8357D


[Expand]
function HX8357DWriteCommandEx(Framebuffer:PTFTFramebuffer; const Values:array of Byte):LongWord;
Description: Write multiple command values to the HX8357D


[Expand]
function HX8357DWriteData(Framebuffer:PTFTFramebuffer; Value:Byte):LongWord;
Description: Write a single data value to the HX8357D


[Expand]
function HX8357DWriteDataEx(Framebuffer:PTFTFramebuffer; const Values:array of Byte):LongWord;
Description: Write multiple data values to the HX8357D


Return to Unit Reference