tinygo.org/x/drivers@v0.27.1-0.20240509133757-7dbca2a54349/ili9341/registers.go (about)

     1  package ili9341
     2  
     3  import "tinygo.org/x/drivers"
     4  
     5  type Rotation uint8
     6  
     7  const (
     8  
     9  	// register constants based on source:
    10  	// https://github.com/adafruit/Adafruit_ILI9341/blob/master/Adafruit_ILI9341.h
    11  
    12  	TFTWIDTH  = 240 ///< ILI9341 max TFT width
    13  	TFTHEIGHT = 320 ///< ILI9341 max TFT height
    14  
    15  	NOP     = 0x00 ///< No-op register
    16  	SWRESET = 0x01 ///< Software reset register
    17  	RDDID   = 0x04 ///< Read display identification information
    18  	RDDST   = 0x09 ///< Read Display Status
    19  
    20  	SLPIN  = 0x10 ///< Enter Sleep Mode
    21  	SLPOUT = 0x11 ///< Sleep Out
    22  	PTLON  = 0x12 ///< Partial Mode ON
    23  	NORON  = 0x13 ///< Normal Display Mode ON
    24  
    25  	RDMODE     = 0x0A ///< Read Display Power Mode
    26  	RDMADCTL   = 0x0B ///< Read Display MADCTL
    27  	RDPIXFMT   = 0x0C ///< Read Display Pixel Format
    28  	RDIMGFMT   = 0x0D ///< Read Display Image Format
    29  	RDSELFDIAG = 0x0F ///< Read Display Self-Diagnostic Result
    30  
    31  	INVOFF   = 0x20 ///< Display Inversion OFF
    32  	INVON    = 0x21 ///< Display Inversion ON
    33  	GAMMASET = 0x26 ///< Gamma Set
    34  	DISPOFF  = 0x28 ///< Display OFF
    35  	DISPON   = 0x29 ///< Display ON
    36  
    37  	CASET = 0x2A ///< Column Address Set
    38  	PASET = 0x2B ///< Page Address Set
    39  	RAMWR = 0x2C ///< Memory Write
    40  	RAMRD = 0x2E ///< Memory Read
    41  
    42  	PTLAR    = 0x30 ///< Partial Area
    43  	VSCRDEF  = 0x33 ///< Vertical Scrolling Definition
    44  	TEOFF    = 0x34 ///< TEOFF: Tearing Effect Line OFF
    45  	TEON     = 0x35 ///< TEON: Tearing Effect Line ON
    46  	MADCTL   = 0x36 ///< Memory Access Control
    47  	VSCRSADD = 0x37 ///< Vertical Scrolling Start Address
    48  	PIXFMT   = 0x3A ///< COLMOD: Pixel Format Set
    49  
    50  	FRMCTR1 = 0xB1 ///< Frame Rate Control (In Normal Mode/Full Colors)
    51  	FRMCTR2 = 0xB2 ///< Frame Rate Control (In Idle Mode/8 colors)
    52  	FRMCTR3 = 0xB3 ///< Frame Rate control (In Partial Mode/Full Colors)
    53  	INVCTR  = 0xB4 ///< Display Inversion Control
    54  	DFUNCTR = 0xB6 ///< Display Function Control
    55  
    56  	PWCTR1 = 0xC0 ///< Power Control 1
    57  	PWCTR2 = 0xC1 ///< Power Control 2
    58  	PWCTR3 = 0xC2 ///< Power Control 3
    59  	PWCTR4 = 0xC3 ///< Power Control 4
    60  	PWCTR5 = 0xC4 ///< Power Control 5
    61  	VMCTR1 = 0xC5 ///< VCOM Control 1
    62  	VMCTR2 = 0xC7 ///< VCOM Control 2
    63  
    64  	RDID1 = 0xDA ///< Read ID 1
    65  	RDID2 = 0xDB ///< Read ID 2
    66  	RDID3 = 0xDC ///< Read ID 3
    67  	RDID4 = 0xDD ///< Read ID 4
    68  
    69  	GMCTRP1 = 0xE0 ///< Positive Gamma Correction
    70  	GMCTRN1 = 0xE1 ///< Negative Gamma Correction
    71  	//PWCTR6     0xFC
    72  
    73  	MADCTL_MY  = 0x80 ///< Bottom to top
    74  	MADCTL_MX  = 0x40 ///< Right to left
    75  	MADCTL_MV  = 0x20 ///< Reverse Mode
    76  	MADCTL_ML  = 0x10 ///< LCD refresh Bottom to top
    77  	MADCTL_RGB = 0x00 ///< Red-Green-Blue pixel order
    78  	MADCTL_BGR = 0x08 ///< Blue-Green-Red pixel order
    79  	MADCTL_MH  = 0x04 ///< LCD refresh right to left
    80  
    81  )
    82  
    83  const (
    84  	Rotation0   = drivers.Rotation0
    85  	Rotation90  = drivers.Rotation90 // 90 degrees clock-wise rotation
    86  	Rotation180 = drivers.Rotation180
    87  	Rotation270 = drivers.Rotation270
    88  
    89  	Rotation0Mirror   = drivers.Rotation0Mirror
    90  	Rotation90Mirror  = drivers.Rotation90Mirror
    91  	Rotation180Mirror = drivers.Rotation180Mirror
    92  	Rotation270Mirror = drivers.Rotation270Mirror
    93  )