29
29
#include "shared-bindings/microcontroller/Pin.h"
30
30
#include "shared-module/displayio/__init__.h"
31
31
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
+ //|...
78
78
static 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 ) {
79
79
enum { ARG_spi_bus , ARG_chip_select , ARG_reset , ARG_busy , ARG_discharge , ARG_width , ARG_height , ARG_power , ARG_free_bus , NUM_ARGS };
80
80
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
117
117
return 0 ;
118
118
}
119
119
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
+ //| ...
125
125
static mp_obj_t aurora_epaper_framebuffer_deinit (mp_obj_t self_in ) {
126
126
aurora_epaper_framebuffer_obj_t * self = (aurora_epaper_framebuffer_obj_t * )self_in ;
127
127
common_hal_aurora_epaper_framebuffer_deinit (self );
@@ -130,13 +130,13 @@ static mp_obj_t aurora_epaper_framebuffer_deinit(mp_obj_t self_in) {
130
130
}
131
131
static MP_DEFINE_CONST_FUN_OBJ_1 (aurora_epaper_framebuffer_deinit_obj , aurora_epaper_framebuffer_deinit ) ;
132
132
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
+ //| ...
140
140
static mp_obj_t aurora_epaper_frambuffer_set_temperature (mp_obj_t self_in , mp_obj_t temperature ) {
141
141
aurora_epaper_framebuffer_obj_t * self = (aurora_epaper_framebuffer_obj_t * )self_in ;
142
142
@@ -146,10 +146,10 @@ static mp_obj_t aurora_epaper_frambuffer_set_temperature(mp_obj_t self_in, mp_ob
146
146
}
147
147
static MP_DEFINE_CONST_FUN_OBJ_2 (aurora_epaper_frambuffer_set_temperature_obj , aurora_epaper_frambuffer_set_temperature ) ;
148
148
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
+ //| ...
153
153
static mp_obj_t aurora_epaper_framebuffer_get_free_bus (mp_obj_t self_in ) {
154
154
aurora_epaper_framebuffer_obj_t * self = (aurora_epaper_framebuffer_obj_t * )self_in ;
155
155
return mp_obj_new_bool (self -> free_bus );
0 commit comments