|
| 1 | +class ILI9488 -- ILITEK ILI9488 abstract classes |
| 2 | +================================================= |
| 3 | + |
| 4 | +The ILI9488 class is the ILITEK ILI9488 hardware abstraction class, which implements some common interfaces of the ILI9488. |
| 5 | + |
| 6 | +Constructors |
| 7 | +------------ |
| 8 | + |
| 9 | +.. class:: ILI9488(bus: I8080, reset: Pin=None, backlight: Pin=None, reset_level: bool=false, color_space: int=RGB, bpp: int=16) |
| 10 | + |
| 11 | + Create an ILI9488 hardware abstraction class. |
| 12 | + |
| 13 | + These parameters are: |
| 14 | + |
| 15 | + - ``bus``: I8080 obj |
| 16 | + - ``reset``: Pin used to reset the LCD panel, set to None if it’s not used |
| 17 | + - ``backlight``: Pin used for backlight signal |
| 18 | + - ``reset_level``: Setting this if the panel reset is high level active |
| 19 | + - ``color_space``: Set the color space used by the LCD panel |
| 20 | + - ``bpp``: Color depth, in bpp |
| 21 | + |
| 22 | +Methods |
| 23 | +------- |
| 24 | + |
| 25 | +.. method:: ILI9488.reset() |
| 26 | + |
| 27 | + Reset LCD panel. |
| 28 | + |
| 29 | +.. method:: ILI9488.init() |
| 30 | + |
| 31 | + Initialize LCD panel. |
| 32 | + |
| 33 | + .. note:: |
| 34 | + |
| 35 | + Before calling this method, make sure the LCD panel has finished the reset stage by ILI9488.reset(). |
| 36 | + |
| 37 | +.. method:: ILI9488.bitmap(x_start: int, y_start: int, x_end: int, y_end: int, color_data: bytes=None) |
| 38 | + |
| 39 | + Draw bitmap on LCD panel. |
| 40 | + |
| 41 | + The arguments are: |
| 42 | + |
| 43 | + - ``x_start`` - Start index on x-axis (x_start included) |
| 44 | + - ``y_start`` - Start index on y-axis (y_start included) |
| 45 | + - ``x_end`` - End index on x-axis (x_end not included) |
| 46 | + - ``y_end`` - End index on y-axis (y_end not included) |
| 47 | + - ``color_data`` - RGB color data that will be dumped to the specific window range |
| 48 | + |
| 49 | +.. method:: ILI9488.mirror(mirror_x: bool, mirror_y: bool) |
| 50 | + |
| 51 | + Mirror the LCD panel on specific axis. |
| 52 | + |
| 53 | + The arguments are: |
| 54 | + |
| 55 | + - ``mirror_x`` - Whether the panel will be mirrored about the x axis |
| 56 | + - ``mirror_y`` - Whether the panel will be mirrored about the y axis |
| 57 | + |
| 58 | + .. note:: |
| 59 | + |
| 60 | + Combined with ILI9488.swap_xy(), one can realize screen rotation |
| 61 | + |
| 62 | +.. method:: ILI9488.swap_xy(swap_axes: bool) |
| 63 | + |
| 64 | + Swap/Exchange x and y axis. |
| 65 | + |
| 66 | + - ``swap_axes`` - Whether to swap the x and y axis |
| 67 | + |
| 68 | + .. note:: |
| 69 | + |
| 70 | + Combined with ILI9488.mirror(), one can realize screen rotation |
| 71 | + |
| 72 | +.. method:: ILI9488.set_gap(x_gap: int, y_gap: int) |
| 73 | + |
| 74 | + Set extra gap in x and y axis. |
| 75 | + |
| 76 | + The gap is the space (in pixels) between the left/top sides of the LCD panel and the first row/column respectively of the actual contents displayed. |
| 77 | + |
| 78 | + The arguments are: |
| 79 | + |
| 80 | + - ``x_gap`` - Extra gap on x axis, in pixels |
| 81 | + - ``y_gap`` - Extra gap on y axis, in pixels |
| 82 | + |
| 83 | + .. note:: |
| 84 | + |
| 85 | + Setting a gap is useful when positioning or centering a frame that is smaller than the LCD. |
| 86 | + |
| 87 | +.. method:: ILI9488.invert_color(invert_color_data: bool) |
| 88 | + |
| 89 | + Invert the color (bit-wise invert the color data line) |
| 90 | + |
| 91 | + - ``invert_color_data`` - Whether to invert the color data |
| 92 | + |
| 93 | +.. method:: ILI9488.disp_off(off: bool) |
| 94 | + |
| 95 | + Turn off the display. |
| 96 | + |
| 97 | + - ``off`` - Whether to turn off the screen |
| 98 | + |
| 99 | +.. method:: ILI9488.backlight_on() |
| 100 | + |
| 101 | + Turn on the backlight |
| 102 | + |
| 103 | +.. method:: ILI9488.backlight_off() |
| 104 | + |
| 105 | + turn off the backlight. |
| 106 | + |
| 107 | +.. method:: ILI9488.color565(red: int, green: int, blue: int) |
| 108 | + |
| 109 | + Convert RGB888 color data to RGB565. |
| 110 | + |
| 111 | +.. method:: ILI9488.deint() |
| 112 | + |
| 113 | + Deinitialize the LCD panel. |
| 114 | + |
| 115 | +.. method:: ILI9488.rotation(r: int) |
| 116 | + |
| 117 | + Set the rotates the logical display in a counter-clockwise direction. |
| 118 | + |
| 119 | + The ``r`` parameter accepts only the following values: |
| 120 | + |
| 121 | + - ``0``: Portrait (0 degrees) |
| 122 | + - ``1``: Landscape (90 degrees) |
| 123 | + - ``2``: Inverse Portrait (180 degrees) |
| 124 | + - ``3``: Inverse Landscape (270 degrees) |
| 125 | + |
| 126 | + ``rotations`` sets the orientation table. The orientation table is a list of |
| 127 | + tuples for each ``rotation`` used to set the MADCTL register, display width, |
| 128 | + display height, start_x, and start_y values. |
| 129 | + |
| 130 | + +---------+----------------------------------------------------------------------------------------------------------+ |
| 131 | + | Display | Default Orientation Tables | |
| 132 | + +=========+==========================================================================================================+ |
| 133 | + | 240x320 | ((0x00, 240, 320, 0, 0), (0x60, 320, 240, 0, 0), (0xc0, 240, 320, 0, 0), (0xa0, 320, 240, 0, 0)) | |
| 134 | + +---------+----------------------------------------------------------------------------------------------------------+ |
| 135 | + | 170x320 | ((0x00, 170, 320, 35, 0), (0x60, 320, 170, 0, 35), (0xc0, 170, 320, 35, 0), (0xa0, 320, 170, 0, 35)) | |
| 136 | + +---------+----------------------------------------------------------------------------------------------------------+ |
| 137 | + | 240x240 | ((0x00, 240, 240, 0, 0), (0x60, 240, 240, 0, 0), (0xc0, 240, 240, 0, 80), (0xa0, 240, 240, 80, 0)) | |
| 138 | + +---------+----------------------------------------------------------------------------------------------------------+ |
| 139 | + | 135x240 | ((0x00, 135, 240, 52, 40), (0x60, 240, 135, 40, 53), (0xc0, 135, 240, 53, 40), (0xa0, 240, 135, 40, 52)) | |
| 140 | + +---------+----------------------------------------------------------------------------------------------------------+ |
| 141 | + | 128x160 | ((0x00, 128, 160, 0, 0), (0x60, 160, 128, 0, 0), (0xc0, 128, 160, 0, 0), (0xa0, 160, 128, 0, 0)) | |
| 142 | + +---------+----------------------------------------------------------------------------------------------------------+ |
| 143 | + | 128x128 | ((0x00, 128, 128, 2, 1), (0x60, 128, 128, 1, 2), (0xc0, 128, 128, 2, 3), (0xa0, 128, 128, 3, 2)) | |
| 144 | + +---------+----------------------------------------------------------------------------------------------------------+ |
| 145 | + | other | ((0x00, 0, 0, 0, 0), (0x60, 0, 0, 0, 0), (0xc0, 0, 0, 0, 0), (0xa0, 0, 0, 0, 0)) | |
| 146 | + +---------+----------------------------------------------------------------------------------------------------------+ |
0 commit comments