|
| 1 | +# Based on the work by straga (https://github.com/straga) |
| 2 | +# https://github.com/straga/micropython_lcd/blob/master/device/JC3248W535/driver/axs15231b/axs15231b.py |
| 3 | +# Copyright (c) 2024 - 2025 Kevin G. Schlosser |
| 4 | + |
| 5 | + |
| 6 | +from typing import Final, Union, TYPE_CHECKING |
| 7 | + |
| 8 | +import display_driver_framework |
| 9 | + |
| 10 | +import lcd_bus |
| 11 | + |
| 12 | +if TYPE_CHECKING: |
| 13 | + import machine |
| 14 | + import io_expander_framework |
| 15 | + |
| 16 | + |
| 17 | +STATE_HIGH: Final[int] |
| 18 | +STATE_LOW: Final[int] |
| 19 | +STATE_PWM: Final[int] |
| 20 | + |
| 21 | +BYTE_ORDER_RGB: Final[int] |
| 22 | +BYTE_ORDER_BGR: Final[int] |
| 23 | + |
| 24 | +_pin_type = Union[io_expander_framework.Pin, machine.Pin, int, str, None] |
| 25 | +_bus_type = Union[lcd_bus.RGBBus | lcd_bus.I80Bus | lcd_bus.I2CBus | lcd_bus.SPIBus] |
| 26 | + |
| 27 | + |
| 28 | +class AXS15231B(display_driver_framework.DisplayDriver): |
| 29 | + _brightness: int |
| 30 | + __qspi: bool |
| 31 | + |
| 32 | + def __init__( |
| 33 | + self, |
| 34 | + data_bus: _bus_type, |
| 35 | + display_width: int, |
| 36 | + display_height: int, |
| 37 | + frame_buffer1: memoryview | None = None, |
| 38 | + frame_buffer2: memoryview | None = None, |
| 39 | + reset_pin: _pin_type = None, |
| 40 | + reset_state: int = STATE_HIGH, |
| 41 | + power_pin: _pin_type = None, |
| 42 | + power_on_state: int = STATE_HIGH, |
| 43 | + backlight_pin: _pin_type = None, |
| 44 | + backlight_on_state: int = STATE_HIGH, |
| 45 | + offset_x: int = 0, |
| 46 | + offset_y: int = 0, |
| 47 | + color_byte_order: int = BYTE_ORDER_RGB, |
| 48 | + color_space: int = lv.COLOR_FORMAT.RGB888, # NOQA |
| 49 | + rgb565_byte_swap: bool = False |
| 50 | + ): |
| 51 | + ... |
| 52 | + |
| 53 | + def reset(self) -> None: |
| 54 | + ... |
| 55 | + |
| 56 | + def init(self, type: int | None = None) -> None: # NOQA |
| 57 | + ... |
| 58 | + |
| 59 | + def set_brightness(self, value: int | float) -> None: |
| 60 | + ... |
| 61 | + |
| 62 | + def get_brightness(self) -> float: |
| 63 | + ... |
| 64 | + |
| 65 | + def set_params(self, cmd: int, params: memoryview | None = None): |
| 66 | + ... |
| 67 | + |
| 68 | + def _set_memory_location(self, x1: int, y1: int, x2: int, y2: int) -> int: |
| 69 | + ... |
0 commit comments