|
24 | 24 | * THE SOFTWARE. |
25 | 25 | */ |
26 | 26 |
|
27 | | -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYBUSIO_EPAPERDISPLAY_H |
28 | | -#define MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYBUSIO_EPAPERDISPLAY_H |
| 27 | +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_EPAPERDISPLAY_H |
| 28 | +#define MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_EPAPERDISPLAY_H |
29 | 29 |
|
30 | 30 | #include "common-hal/microcontroller/Pin.h" |
31 | 31 |
|
32 | | -#include "shared-module/displayio/Display.h" |
| 32 | +#include "shared-module/displayio/EPaperDisplay.h" |
33 | 33 | #include "shared-module/displayio/Group.h" |
34 | 34 |
|
35 | 35 | extern const mp_obj_type_t displayio_epaperdisplay_type; |
36 | 36 |
|
37 | 37 | #define DELAY 0x80 |
38 | 38 |
|
39 | | -void common_hal_displayio_display_construct(displayio_display_obj_t* self, |
40 | | - mp_obj_t bus, uint16_t width, uint16_t height, uint16_t seconds_per_frame, |
41 | | - uint16_t rotation, uint16_t color_depth, bool grayscale, |
42 | | - uint8_t* init_sequence, uint16_t init_sequence_len, const mcu_pin_obj_t* busy_pin, uint16_t partial_command); |
| 39 | +#define NO_COMMAND 0x100 |
43 | 40 |
|
44 | | -int32_t common_hal_displayio_display_wait_for_frame(displayio_display_obj_t* self); |
| 41 | +void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t* self, |
| 42 | + mp_obj_t bus, uint8_t* start_sequence, uint16_t start_sequence_len, uint8_t* stop_sequence, uint16_t stop_sequence_len, |
| 43 | + uint16_t width, uint16_t height, uint16_t ram_width, uint16_t ram_height, int16_t colstart, int16_t rowstart, uint16_t rotation, |
| 44 | + uint16_t set_column_window_command, uint16_t set_row_window_command, |
| 45 | + uint16_t set_current_column_command, uint16_t set_current_row_command, |
| 46 | + uint16_t write_black_ram_command, bool black_bits_inverted, uint16_t write_color_ram_command, bool color_bits_inverted, uint32_t third_color, uint16_t refresh_display_command, |
| 47 | + const mcu_pin_obj_t* busy_pin, bool busy_state, mp_float_t seconds_per_frame, bool always_toggle_chip_select); |
45 | 48 |
|
46 | | -void common_hal_displayio_display_show(displayio_display_obj_t* self, displayio_group_t* root_group); |
| 49 | +int32_t common_hal_displayio_epaperdisplay_wait_for_frame(displayio_epaperdisplay_obj_t* self); |
47 | 50 |
|
48 | | -void common_hal_displayio_display_refresh_soon(displayio_display_obj_t* self); |
| 51 | +bool common_hal_displayio_epaperdisplay_show(displayio_epaperdisplay_obj_t* self, displayio_group_t* root_group); |
49 | 52 |
|
50 | | -bool displayio_display_begin_transaction(displayio_display_obj_t* self); |
51 | | -void displayio_display_end_transaction(displayio_display_obj_t* self); |
| 53 | +void common_hal_displayio_epaperdisplay_refresh_soon(displayio_epaperdisplay_obj_t* self); |
| 54 | + |
| 55 | +bool displayio_epaperdisplay_begin_transaction(displayio_epaperdisplay_obj_t* self); |
| 56 | +void displayio_epaperdisplay_end_transaction(displayio_epaperdisplay_obj_t* self); |
52 | 57 |
|
53 | 58 | // The second point of the region is exclusive. |
54 | | -void displayio_display_set_region_to_update(displayio_display_obj_t* self, displayio_area_t* area); |
55 | | -bool displayio_display_frame_queued(displayio_display_obj_t* self); |
| 59 | +void displayio_epaperdisplay_set_region_to_update(displayio_epaperdisplay_obj_t* self, displayio_area_t* area); |
| 60 | +bool displayio_epaperdisplay_frame_queued(displayio_epaperdisplay_obj_t* self); |
56 | 61 |
|
57 | | -bool displayio_display_refresh_queued(displayio_display_obj_t* self); |
58 | | -void displayio_display_finish_refresh(displayio_display_obj_t* self); |
59 | | -void displayio_display_send_pixels(displayio_display_obj_t* self, uint8_t* pixels, uint32_t length); |
| 62 | +bool displayio_epaperdisplay_refresh_queued(displayio_epaperdisplay_obj_t* self); |
| 63 | +void displayio_epaperdisplay_finish_refresh(displayio_epaperdisplay_obj_t* self); |
| 64 | +void displayio_epaperdisplay_send_pixels(displayio_epaperdisplay_obj_t* self, uint8_t* pixels, uint32_t length); |
60 | 65 |
|
61 | | -bool common_hal_displayio_display_get_auto_brightness(displayio_display_obj_t* self); |
62 | | -void common_hal_displayio_display_set_auto_brightness(displayio_display_obj_t* self, bool auto_brightness); |
| 66 | +bool common_hal_displayio_epaperdisplay_get_auto_brightness(displayio_epaperdisplay_obj_t* self); |
| 67 | +void common_hal_displayio_epaperdisplay_set_auto_brightness(displayio_epaperdisplay_obj_t* self, bool auto_brightness); |
63 | 68 |
|
64 | | -uint16_t common_hal_displayio_display_get_width(displayio_display_obj_t* self); |
65 | | -uint16_t common_hal_displayio_display_get_height(displayio_display_obj_t* self); |
| 69 | +uint16_t common_hal_displayio_epaperdisplay_get_width(displayio_epaperdisplay_obj_t* self); |
| 70 | +uint16_t common_hal_displayio_epaperdisplay_get_height(displayio_epaperdisplay_obj_t* self); |
66 | 71 |
|
67 | | -mp_float_t common_hal_displayio_display_get_brightness(displayio_display_obj_t* self); |
68 | | -bool common_hal_displayio_display_set_brightness(displayio_display_obj_t* self, mp_float_t brightness); |
| 72 | +mp_float_t common_hal_displayio_epaperdisplay_get_brightness(displayio_epaperdisplay_obj_t* self); |
| 73 | +bool common_hal_displayio_epaperdisplay_set_brightness(displayio_epaperdisplay_obj_t* self, mp_float_t brightness); |
69 | 74 |
|
70 | | -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYBUSIO_EPAPERDISPLAY_H |
| 75 | +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_EPAPERDISPLAY_H |
0 commit comments