2929#include "shared-bindings/microcontroller/Pin.h"
3030#include "shared-module/displayio/__init__.h"
3131
32- // | class AuroraMemoryFramebuffer:
33- // | """A framebuffer for Pervasive Displays Aurora E-paper displays. These displays are 2 color only.
34- // |
35- // | This initializes a display and connects it to CircuitPython.
36- // |
37- // | For Example::
38- // |
39- // | import busio
40- // | import framebufferio
41- // | from aurora_epaper import AuroraMemoryFramebuffer
42- // | spi = busio.SPI(EINK_CLKS, EINK_MOSI, EINK_MISO)
43- // | aurora = AuroraMemoryFramebuffer(spi, EINK_CS, EINK_RST, EINK_BUSY, EINK_DISCHARGE, HEIGHT, WIDTH)
44- // | display = framebufferio.FramebufferDisplay(t, auto_refresh=False)
45- // | display.refresh()
46- // |
47- // | For more information on how these displays are driven see:
48- // | <https://www.pervasivedisplays.com/wp-content/uploads/2023/02/4P018-00_04_G2_Aurora-Mb_COG_Driver_Interface_Timing_for_small-size_20231107.pdf>
49- // | """
50- // |
51- // | def __init__(
52- // | self,
53- // | spi_bus: busio.SPI,
54- // | chip_select: microcontroller.Pin,
55- // | reset: microcontroller.Pin,
56- // | busy: microcontroller.Pin,
57- // | discharge: microcontroller.Pin,
58- // | width: int,
59- // | height: int,
60- // | power: Optional[microcontroller.Pin] = None,
61- // | free_bus: Optional[bool] = True,
62- // | ) -> None:
63- // | """Create a framebuffer for the Aurora CoG display.
64- // |
65- // | .. note:: Displays of size 1.9" and 2.6" are not tested, and may exibit unexpected behavior.
66- // |
67- // | :param busio.SPI spi_bus: The SPI bus that the display is connected to
68- // | :param microcontroller.Pin chip_select: The pin connected to the displays chip select input
69- // | :param microcontroller.Pin reset: The pin connected to the displays reset input
70- // | :param microcontroller.Pin busy: The pin connected to the displays busy output
71- // | :param microcontroller.Pin discharge: The pin connected to the displays discharge input
72- // | :param int width: The width of the display in pixels
73- // | :param int height: The height of the display in pixels
74- // | :param microcontroller.Pin power: The pin that controls power to the display (optional).
75- // | :param bool free_bus: Determines whether the SPI bus passed in will be freed when the frame buffer is freed.
76- // | """
77- // |...
32+ //| class AuroraMemoryFramebuffer:
33+ //| """A framebuffer for Pervasive Displays Aurora E-paper displays. These displays are 2 color only.
34+ //|
35+ //| This initializes a display and connects it to CircuitPython.
36+ //|
37+ //| For Example::
38+ //|
39+ //| import busio
40+ //| import framebufferio
41+ //| from aurora_epaper import AuroraMemoryFramebuffer
42+ //| spi = busio.SPI(EINK_CLKS, EINK_MOSI, EINK_MISO)
43+ //| aurora = AuroraMemoryFramebuffer(spi, EINK_CS, EINK_RST, EINK_BUSY, EINK_DISCHARGE, HEIGHT, WIDTH)
44+ //| display = framebufferio.FramebufferDisplay(t, auto_refresh=False)
45+ //| display.refresh()
46+ //|
47+ //| For more information on how these displays are driven see:
48+ //| <https://www.pervasivedisplays.com/wp-content/uploads/2023/02/4P018-00_04_G2_Aurora-Mb_COG_Driver_Interface_Timing_for_small-size_20231107.pdf>
49+ //| """
50+ //|
51+ //| def __init__(
52+ //| self,
53+ //| spi_bus: busio.SPI,
54+ //| chip_select: microcontroller.Pin,
55+ //| reset: microcontroller.Pin,
56+ //| busy: microcontroller.Pin,
57+ //| discharge: microcontroller.Pin,
58+ //| width: int,
59+ //| height: int,
60+ //| power: Optional[microcontroller.Pin] = None,
61+ //| free_bus: Optional[bool] = True,
62+ //| ) -> None:
63+ //| """Create a framebuffer for the Aurora CoG display.
64+ //|
65+ //| .. note:: Displays of size 1.9" and 2.6" are not tested, and may exibit unexpected behavior.
66+ //|
67+ //| :param busio.SPI spi_bus: The SPI bus that the display is connected to
68+ //| :param microcontroller.Pin chip_select: The pin connected to the displays chip select input
69+ //| :param microcontroller.Pin reset: The pin connected to the displays reset input
70+ //| :param microcontroller.Pin busy: The pin connected to the displays busy output
71+ //| :param microcontroller.Pin discharge: The pin connected to the displays discharge input
72+ //| :param int width: The width of the display in pixels
73+ //| :param int height: The height of the display in pixels
74+ //| :param microcontroller.Pin power: The pin that controls power to the display (optional).
75+ //| :param bool free_bus: Determines whether the SPI bus passed in will be freed when the frame buffer is freed.
76+ //| """
77+ //|...
7878static mp_obj_t aurora_epaper_framebuffer_make_new (const mp_obj_type_t * type , size_t n_args , size_t n_kw , const mp_obj_t * all_args ) {
7979 enum { ARG_spi_bus , ARG_chip_select , ARG_reset , ARG_busy , ARG_discharge , ARG_width , ARG_height , ARG_power , ARG_free_bus , NUM_ARGS };
8080 static const mp_arg_t allowed_args [] = {
@@ -117,11 +117,11 @@ static mp_int_t aurora_epaper_framebuffer_get_buffer(mp_obj_t self_in, mp_buffer
117117 return 0 ;
118118}
119119
120- // | def deinit(self) -> None:
121- // | """Free the resources (pins, timers, etc.) associated with this
122- // | AuroraMemoryFramebuffer instance. After deinitialization, no further operations
123- // | may be performed."""
124- // | ...
120+ //| def deinit(self) -> None:
121+ //| """Free the resources (pins, timers, etc.) associated with this
122+ //| AuroraMemoryFramebuffer instance. After deinitialization, no further operations
123+ //| may be performed."""
124+ //| ...
125125static mp_obj_t aurora_epaper_framebuffer_deinit (mp_obj_t self_in ) {
126126 aurora_epaper_framebuffer_obj_t * self = (aurora_epaper_framebuffer_obj_t * )self_in ;
127127 common_hal_aurora_epaper_framebuffer_deinit (self );
@@ -130,13 +130,13 @@ static mp_obj_t aurora_epaper_framebuffer_deinit(mp_obj_t self_in) {
130130}
131131static MP_DEFINE_CONST_FUN_OBJ_1 (aurora_epaper_framebuffer_deinit_obj , aurora_epaper_framebuffer_deinit ) ;
132132
133- // | def set_temperature(
134- // | self, celsius: int
135- // | ) -> None:
136- // | """Set the ambient temperature (in celsius) for the display driver.
137- // | Higher temperature means faster update speed.
138- // | """
139- // | ...
133+ //| def set_temperature(
134+ //| self, celsius: int
135+ //| ) -> None:
136+ //| """Set the ambient temperature (in celsius) for the display driver.
137+ //| Higher temperature means faster update speed.
138+ //| """
139+ //| ...
140140static mp_obj_t aurora_epaper_frambuffer_set_temperature (mp_obj_t self_in , mp_obj_t temperature ) {
141141 aurora_epaper_framebuffer_obj_t * self = (aurora_epaper_framebuffer_obj_t * )self_in ;
142142
@@ -146,10 +146,10 @@ static mp_obj_t aurora_epaper_frambuffer_set_temperature(mp_obj_t self_in, mp_ob
146146}
147147static MP_DEFINE_CONST_FUN_OBJ_2 (aurora_epaper_frambuffer_set_temperature_obj , aurora_epaper_frambuffer_set_temperature ) ;
148148
149- // | free_bus: bool
150- // | """When True the spi bus passed into the device will be freed on deinit.
151- // | If you have multiple displays this could be used to keep the other active on soft reset."""
152- // | ...
149+ //| free_bus: bool
150+ //| """When True the spi bus passed into the device will be freed on deinit.
151+ //| If you have multiple displays this could be used to keep the other active on soft reset."""
152+ //| ...
153153static mp_obj_t aurora_epaper_framebuffer_get_free_bus (mp_obj_t self_in ) {
154154 aurora_epaper_framebuffer_obj_t * self = (aurora_epaper_framebuffer_obj_t * )self_in ;
155155 return mp_obj_new_bool (self -> free_bus );
0 commit comments