70
70
//| :param framebuffer_count: The number of framebuffers (1 for single-buffered and 2 for double-buffered)
71
71
//| :param grab_mode: When to grab a new frame
72
72
//| """
73
+ //|
73
74
static mp_obj_t espcamera_camera_make_new (const mp_obj_type_t * type , size_t n_args , size_t n_kw , const mp_obj_t * all_args ) {
74
75
enum { ARG_data_pins , ARG_pixel_clock_pin , ARG_vsync_pin , ARG_href_pin , ARG_i2c , ARG_external_clock_pin , ARG_external_clock_frequency , ARG_powerdown_pin , ARG_reset_pin , ARG_pixel_format , ARG_frame_size , ARG_jpeg_quality , ARG_framebuffer_count , ARG_grab_mode , NUM_ARGS };
75
76
static const mp_arg_t allowed_args [] = {
@@ -143,6 +144,7 @@ static mp_obj_t espcamera_camera_make_new(const mp_obj_type_t *type, size_t n_ar
143
144
//| def deinit(self) -> None:
144
145
//| """Deinitialises the camera and releases all memory resources for reuse."""
145
146
//| ...
147
+ //|
146
148
static mp_obj_t espcamera_camera_deinit (mp_obj_t self_in ) {
147
149
espcamera_camera_obj_t * self = MP_OBJ_TO_PTR (self_in );
148
150
common_hal_espcamera_camera_deinit (self );
@@ -159,12 +161,14 @@ static void check_for_deinit(espcamera_camera_obj_t *self) {
159
161
//| def __enter__(self) -> Camera:
160
162
//| """No-op used by Context Managers."""
161
163
//| ...
164
+ //|
162
165
// Provided by context manager helper.
163
166
164
167
//| def __exit__(self) -> None:
165
168
//| """Automatically deinitializes the hardware when exiting a context. See
166
169
//| :ref:`lifetime-and-contextmanagers` for more info."""
167
170
//| ...
171
+ //|
168
172
static mp_obj_t espcamera_camera_obj___exit__ (size_t n_args , const mp_obj_t * args ) {
169
173
(void )n_args ;
170
174
return espcamera_camera_deinit (args [0 ]);
@@ -173,6 +177,7 @@ static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(espcamera_camera___exit___obj, 4, 4,
173
177
174
178
//| frame_available: bool
175
179
//| """True if a frame is available, False otherwise"""
180
+ //|
176
181
177
182
static mp_obj_t espcamera_camera_frame_available_get (const mp_obj_t self_in ) {
178
183
espcamera_camera_obj_t * self = MP_OBJ_TO_PTR (self_in );
@@ -193,6 +198,7 @@ MP_PROPERTY_GETTER(espcamera_camera_frame_available_obj,
193
198
//| If `pixel_format` is `PixelFormat.JPEG`, the returned value is a read-only `memoryview`.
194
199
//| Otherwise, the returned value is a read-only `displayio.Bitmap`.
195
200
//| """
201
+ //|
196
202
static mp_obj_t espcamera_camera_take (size_t n_args , const mp_obj_t * args ) {
197
203
espcamera_camera_obj_t * self = MP_OBJ_TO_PTR (args [0 ]);
198
204
mp_float_t timeout = n_args < 2 ? MICROPY_FLOAT_CONST (0.25 ) : mp_obj_get_float (args [1 ]);
@@ -229,6 +235,7 @@ static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(espcamera_camera_take_obj, 1, 2, espc
229
235
//| the other properties to set, they are set together in a single function call.
230
236
//|
231
237
//| If an argument is unspecified or None, then the setting is unchanged."""
238
+ //|
232
239
233
240
static mp_obj_t espcamera_camera_reconfigure (mp_uint_t n_args , const mp_obj_t * pos_args , mp_map_t * kw_args ) {
234
241
espcamera_camera_obj_t * self = MP_OBJ_TO_PTR (pos_args [0 ]);
@@ -912,6 +919,7 @@ MP_PROPERTY_GETTER(espcamera_camera_grab_mode_obj,
912
919
//| framebuffer_count: int
913
920
//| """True if double buffering is used"""
914
921
//|
922
+ //|
915
923
static mp_obj_t espcamera_camera_get_framebuffer_count (const mp_obj_t self_in ) {
916
924
espcamera_camera_obj_t * self = MP_OBJ_TO_PTR (self_in );
917
925
check_for_deinit (self );
0 commit comments