|
54 | 54 | //|
|
55 | 55 | //| :param framebuffer: The framebuffer that the display is connected to
|
56 | 56 | //| :type framebuffer: any core object implementing the framebuffer protocol
|
57 |
| -//| :param callback: Function or bound method to call when the framebuffer has been updated. The callback receives one argument, the framebuffer object. |
58 | 57 | //| :param int width: Width in pixels
|
59 | 58 | //| :param int height: Height in pixels
|
60 |
| -//| :param int colstart: The index if the first visible column |
61 |
| -//| :param int rowstart: The index if the first visible row |
62 | 59 | //| :param int rotation: The rotation of the display in degrees clockwise. Must be in 90 degree increments (0, 90, 180, 270)
|
63 | 60 | //| :param int color_depth: The number of bits of color per pixel transmitted. (Some displays
|
64 | 61 | //| support 18 bit but 16 is easier to transmit. The last bit is extrapolated.)
|
65 |
| -//| :param bool grayscale: True if the display only shows a single color. |
66 |
| -//| :param bool pixels_in_byte_share_row: True when pixels are less than a byte and a byte includes pixels from the same row of the display. When False, pixels share a column. |
67 | 62 | //| :param int bytes_per_cell: Number of bytes per addressable memory location when color_depth < 8. When greater than one, bytes share a row or column according to pixels_in_byte_share_row.
|
68 |
| -//| :param bool reverse_pixels_in_byte: Reverses the pixel order within each byte when color_depth < 8. Does not apply across multiple bytes even if there is more than one byte per cell (bytes_per_cell.) |
69 |
| -//| :param bool reverse_pixels_in_byte: Reverses the pixel order within each byte when color_depth < 8. Does not apply across multiple bytes even if there is more than one byte per cell (bytes_per_cell.) |
70 |
| -//| :param bool reverse_bytes_in_word: Reverses the order of bytes within a word when color_depth == 16 |
71 | 63 | //| :param microcontroller.Pin backlight_pin: Pin connected to the display's backlight
|
72 | 64 | //| :param bool brightness: Initial display brightness. This value is ignored if auto_brightness is True.
|
73 | 65 | //| :param bool auto_brightness: If True, brightness is controlled via an ambient light sensor or other mechanism.
|
74 | 66 | //| :param bool auto_refresh: Automatically refresh the screen
|
75 | 67 | //| :param int native_frames_per_second: Number of display refreshes per second
|
76 | 68 | //|
|
77 | 69 | STATIC mp_obj_t framebufferio_framebufferdisplay_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
78 |
| - enum { ARG_framebuffer, ARG_width, ARG_height, ARG_colstart, ARG_rowstart, ARG_rotation, ARG_color_depth, ARG_grayscale, ARG_pixels_in_byte_share_row, ARG_bytes_per_cell, ARG_reverse_pixels_in_byte, ARG_reverse_bytes_in_word, ARG_backlight_pin, ARG_brightness, ARG_auto_brightness, ARG_auto_refresh, ARG_native_frames_per_second, NUM_ARGS }; |
| 70 | + enum { ARG_framebuffer, ARG_width, ARG_height, ARG_rotation, ARG_color_depth, ARG_bytes_per_cell, ARG_backlight_pin, ARG_brightness, ARG_auto_brightness, ARG_auto_refresh, ARG_native_frames_per_second, NUM_ARGS }; |
79 | 71 | static const mp_arg_t allowed_args[] = {
|
80 | 72 | { MP_QSTR_framebuffer, MP_ARG_REQUIRED | MP_ARG_OBJ },
|
81 | 73 | { MP_QSTR_width, MP_ARG_INT | MP_ARG_KW_ONLY | MP_ARG_REQUIRED, },
|
82 | 74 | { MP_QSTR_height, MP_ARG_INT | MP_ARG_KW_ONLY | MP_ARG_REQUIRED, },
|
83 |
| - { MP_QSTR_colstart, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, |
84 |
| - { MP_QSTR_rowstart, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, |
85 | 75 | { MP_QSTR_rotation, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} },
|
86 | 76 | { MP_QSTR_color_depth, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 16} },
|
87 |
| - { MP_QSTR_grayscale, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, |
88 |
| - { MP_QSTR_pixels_in_byte_share_row, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, |
89 | 77 | { MP_QSTR_bytes_per_cell, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 1} },
|
90 |
| - { MP_QSTR_reverse_pixels_in_byte, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, |
91 |
| - { MP_QSTR_reverse_bytes_in_word, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, |
92 | 78 | { MP_QSTR_backlight_pin, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = mp_const_none} },
|
93 | 79 | { MP_QSTR_brightness, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_OBJ_NEW_SMALL_INT(1)} },
|
94 | 80 | { MP_QSTR_auto_brightness, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} },
|
@@ -117,12 +103,9 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_make_new(const mp_obj_type_t *t
|
117 | 103 | self,
|
118 | 104 | framebuffer,
|
119 | 105 | args[ARG_width].u_int, args[ARG_height].u_int,
|
120 |
| - args[ARG_colstart].u_int, args[ARG_rowstart].u_int, rotation, |
121 |
| - args[ARG_color_depth].u_int, args[ARG_grayscale].u_bool, |
122 |
| - args[ARG_pixels_in_byte_share_row].u_bool, |
123 |
| - args[ARG_bytes_per_cell].u_bool, |
124 |
| - args[ARG_reverse_pixels_in_byte].u_bool, |
125 |
| - args[ARG_reverse_bytes_in_word].u_bool, |
| 106 | + rotation, |
| 107 | + args[ARG_color_depth].u_int, |
| 108 | + args[ARG_bytes_per_cell].u_int, |
126 | 109 | MP_OBJ_TO_PTR(backlight_pin),
|
127 | 110 | brightness,
|
128 | 111 | args[ARG_auto_brightness].u_bool,
|
|
0 commit comments