move esp32_camera
to espcamera
This commit is contained in:
parent
d9589daf46
commit
cda5689263
@ -663,6 +663,7 @@ msgstr ""
|
||||
|
||||
#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h
|
||||
#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h
|
||||
#: ports/espressif/boards/m5stack_stick_c/mpconfigboard.h
|
||||
msgid "Button A was pressed at start up.\n"
|
||||
msgstr ""
|
||||
|
||||
@ -2947,9 +2948,9 @@ msgstr ""
|
||||
msgid "error = 0x%08lX"
|
||||
msgstr ""
|
||||
|
||||
#: ports/espressif/common-hal/esp32_camera/Camera.c
|
||||
#: ports/espressif/common-hal/espcamera/Camera.c
|
||||
msgid ""
|
||||
"esp32_camera.Camera requires reserved PSRAM to be configured. See the "
|
||||
"espcamera.Camera requires reserved PSRAM to be configured. See the "
|
||||
"documentation for instructions."
|
||||
msgstr ""
|
||||
|
||||
@ -3326,7 +3327,7 @@ msgstr ""
|
||||
msgid "invalid micropython decorator"
|
||||
msgstr ""
|
||||
|
||||
#: ports/espressif/common-hal/esp32_camera/Camera.c
|
||||
#: ports/espressif/common-hal/espcamera/Camera.c
|
||||
msgid "invalid setting"
|
||||
msgstr ""
|
||||
|
||||
@ -3583,7 +3584,7 @@ msgstr ""
|
||||
msgid "no response from SD card"
|
||||
msgstr ""
|
||||
|
||||
#: ports/espressif/common-hal/esp32_camera/Camera.c py/objobject.c py/runtime.c
|
||||
#: ports/espressif/common-hal/espcamera/Camera.c py/objobject.c py/runtime.c
|
||||
msgid "no such attribute"
|
||||
msgstr ""
|
||||
|
||||
|
@ -8,7 +8,7 @@ set(ENV{IDF_PATH} ${CMAKE_SOURCE_DIR}/esp-idf)
|
||||
# can build.
|
||||
set(COMPONENTS esptool_py soc driver log main esp-tls mbedtls mdns esp_event esp_adc_cal esp_netif esp_wifi lwip ulp wpa_supplicant freertos bt usb)
|
||||
|
||||
if("${CIRCUITPY_ESP32_CAMERA}")
|
||||
if("${CIRCUITPY_ESPCAMERA}")
|
||||
message("Including esp32-camera")
|
||||
set(EXTRA_COMPONENT_DIRS "esp32-camera")
|
||||
list(APPEND COMPONENTS "esp32-camera")
|
||||
|
@ -250,10 +250,10 @@ endif
|
||||
|
||||
SRC_C += $(wildcard common-hal/espidf/*.c)
|
||||
|
||||
ifneq ($(CIRCUITPY_ESP32_CAMERA),0)
|
||||
ifneq ($(CIRCUITPY_ESPCAMERA),0)
|
||||
SRC_CAMERA := \
|
||||
$(wildcard common-hal/esp32_camera/*.c) \
|
||||
$(wildcard bindings/esp32_camera/*.c)
|
||||
$(wildcard common-hal/espcamera/*.c) \
|
||||
$(wildcard bindings/espcamera/*.c)
|
||||
SRC_C += $(SRC_CAMERA)
|
||||
CFLAGS += -isystem esp32-camera/driver/include
|
||||
CFLAGS += -isystem esp32-camera/conversions/include
|
||||
@ -333,7 +333,7 @@ endif
|
||||
.PHONY: do-sdkconfig
|
||||
do-sdkconfig: $(BUILD)/esp-idf/config/sdkconfig.h
|
||||
$(BUILD)/esp-idf/config/sdkconfig.h: boards/$(BOARD)/sdkconfig CMakeLists.txt | $(BUILD)/esp-idf
|
||||
IDF_PATH=$(IDF_PATH) cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="$(SDKCONFIGS)" -DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-$(IDF_TARGET).cmake -DIDF_TARGET=$(IDF_TARGET) -GNinja -DCIRCUITPY_ESP32_CAMERA=$(CIRCUITPY_ESP32_CAMERA)
|
||||
IDF_PATH=$(IDF_PATH) cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="$(SDKCONFIGS)" -DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-$(IDF_TARGET).cmake -DIDF_TARGET=$(IDF_TARGET) -GNinja -DCIRCUITPY_ESPCAMERA=$(CIRCUITPY_ESPCAMERA)
|
||||
|
||||
# build a lib
|
||||
# Adding -d explain -j 1 -v to the ninja line will output debug info
|
||||
@ -385,7 +385,7 @@ BINARY_BLOBS += esp-idf/components/xtensa/$(IDF_TARGET)/libxt_hal.a
|
||||
ESP_IDF_COMPONENTS_EXPANDED += esp-idf/components/xtensa/$(IDF_TARGET)/libxt_hal.a
|
||||
endif
|
||||
|
||||
ifneq ($(CIRCUITPY_ESP32_CAMERA),0)
|
||||
ifneq ($(CIRCUITPY_ESPCAMERA),0)
|
||||
ESP_IDF_COMPONENTS_EXPANDED += $(BUILD)/esp-idf/esp-idf/esp32-camera/libesp32-camera.a
|
||||
#$(error $(ESP_IDF_COMPONENTS_EXPANDED))
|
||||
endif
|
||||
|
File diff suppressed because it is too large
Load Diff
1001
ports/espressif/bindings/espcamera/Camera.c
Normal file
1001
ports/espressif/bindings/espcamera/Camera.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -33,11 +33,11 @@
|
||||
|
||||
#include "shared-bindings/busio/I2C.h"
|
||||
|
||||
extern const mp_obj_type_t esp32_camera_camera_type;
|
||||
typedef struct esp32_camera_camera_obj esp32_camera_camera_obj_t;
|
||||
extern const mp_obj_type_t espcamera_camera_type;
|
||||
typedef struct espcamera_camera_obj espcamera_camera_obj_t;
|
||||
|
||||
extern void common_hal_esp32_camera_camera_construct(
|
||||
esp32_camera_camera_obj_t *self,
|
||||
extern void common_hal_espcamera_camera_construct(
|
||||
espcamera_camera_obj_t *self,
|
||||
uint8_t data_pins[8],
|
||||
const mcu_pin_obj_t *external_clock_pin,
|
||||
const mcu_pin_obj_t *pixel_clock_pin,
|
||||
@ -53,11 +53,11 @@ extern void common_hal_esp32_camera_camera_construct(
|
||||
mp_int_t framebuffer_count,
|
||||
camera_grab_mode_t grab_mode);
|
||||
|
||||
extern void common_hal_esp32_camera_camera_deinit(esp32_camera_camera_obj_t *self);
|
||||
extern bool common_hal_esp32_camera_camera_deinited(esp32_camera_camera_obj_t *self);
|
||||
extern bool common_hal_esp32_camera_camera_available(esp32_camera_camera_obj_t *self);
|
||||
extern camera_fb_t *common_hal_esp32_camera_camera_take(esp32_camera_camera_obj_t *self, int timeout_ms);
|
||||
extern void common_hal_esp32_camera_camera_reconfigure(esp32_camera_camera_obj_t *self, framesize_t frame_size, pixformat_t pixel_format, camera_grab_mode_t grab_mode, mp_int_t framebuffer_count);
|
||||
extern void common_hal_espcamera_camera_deinit(espcamera_camera_obj_t *self);
|
||||
extern bool common_hal_espcamera_camera_deinited(espcamera_camera_obj_t *self);
|
||||
extern bool common_hal_espcamera_camera_available(espcamera_camera_obj_t *self);
|
||||
extern camera_fb_t *common_hal_espcamera_camera_take(espcamera_camera_obj_t *self, int timeout_ms);
|
||||
extern void common_hal_espcamera_camera_reconfigure(espcamera_camera_obj_t *self, framesize_t frame_size, pixformat_t pixel_format, camera_grab_mode_t grab_mode, mp_int_t framebuffer_count);
|
||||
|
||||
#define DECLARE_SENSOR_GETSET(type, name, field_name, setter_function_name) \
|
||||
DECLARE_SENSOR_GET(type, name, field_name, setter_function_name) \
|
||||
@ -70,10 +70,10 @@ extern void common_hal_esp32_camera_camera_reconfigure(esp32_camera_camera_obj_t
|
||||
DECLARE_SENSOR_GET(type, name, status.status_field_name, setter_function_name)
|
||||
|
||||
#define DECLARE_SENSOR_GET(type, name, status_field_name, setter_function_name) \
|
||||
extern type common_hal_esp32_camera_camera_get_##name(esp32_camera_camera_obj_t * self);
|
||||
extern type common_hal_espcamera_camera_get_##name(espcamera_camera_obj_t * self);
|
||||
|
||||
#define DECLARE_SENSOR_SET(type, name, setter_function_name) \
|
||||
extern void common_hal_esp32_camera_camera_set_##name(esp32_camera_camera_obj_t * self, type value);
|
||||
extern void common_hal_espcamera_camera_set_##name(espcamera_camera_obj_t * self, type value);
|
||||
|
||||
DECLARE_SENSOR_GET(pixformat_t, pixel_format, pixformat, set_pixformat)
|
||||
DECLARE_SENSOR_STATUS_GET(framesize_t, frame_size, framesize, set_framesize)
|
||||
@ -104,13 +104,13 @@ DECLARE_SENSOR_STATUS_GETSET(bool, raw_gma, raw_gma, set_raw_gma);
|
||||
DECLARE_SENSOR_STATUS_GETSET(bool, lenc, lenc, set_lenc);
|
||||
|
||||
// From settings
|
||||
extern camera_grab_mode_t common_hal_esp32_camera_camera_get_grab_mode(esp32_camera_camera_obj_t *self);
|
||||
extern int common_hal_esp32_camera_camera_get_framebuffer_count(esp32_camera_camera_obj_t *self);
|
||||
extern camera_grab_mode_t common_hal_espcamera_camera_get_grab_mode(espcamera_camera_obj_t *self);
|
||||
extern int common_hal_espcamera_camera_get_framebuffer_count(espcamera_camera_obj_t *self);
|
||||
|
||||
// From camera_sensor_info_t
|
||||
extern int common_hal_esp32_camera_camera_get_address(esp32_camera_camera_obj_t *self);
|
||||
extern const char *common_hal_esp32_camera_camera_get_sensor_name(esp32_camera_camera_obj_t *self);
|
||||
extern const bool common_hal_esp32_camera_camera_get_supports_jpeg(esp32_camera_camera_obj_t *self);
|
||||
extern framesize_t common_hal_esp32_camera_camera_get_max_frame_size(esp32_camera_camera_obj_t *self);
|
||||
extern int common_hal_esp32_camera_camera_get_width(esp32_camera_camera_obj_t *self);
|
||||
extern int common_hal_esp32_camera_camera_get_height(esp32_camera_camera_obj_t *self);
|
||||
extern int common_hal_espcamera_camera_get_address(espcamera_camera_obj_t *self);
|
||||
extern const char *common_hal_espcamera_camera_get_sensor_name(espcamera_camera_obj_t *self);
|
||||
extern const bool common_hal_espcamera_camera_get_supports_jpeg(espcamera_camera_obj_t *self);
|
||||
extern framesize_t common_hal_espcamera_camera_get_max_frame_size(espcamera_camera_obj_t *self);
|
||||
extern int common_hal_espcamera_camera_get_width(espcamera_camera_obj_t *self);
|
||||
extern int common_hal_espcamera_camera_get_height(espcamera_camera_obj_t *self);
|
@ -29,13 +29,13 @@
|
||||
#include "py/mphal.h"
|
||||
|
||||
#include "bindings/espidf/__init__.h"
|
||||
#include "bindings/esp32_camera/__init__.h"
|
||||
#include "bindings/esp32_camera/Camera.h"
|
||||
#include "bindings/espcamera/__init__.h"
|
||||
#include "bindings/espcamera/Camera.h"
|
||||
|
||||
#include "esp_camera.h"
|
||||
#include "sensor.h"
|
||||
|
||||
//| """Wrapper for the esp32_camera library
|
||||
//| """Wrapper for the espcamera library
|
||||
//|
|
||||
//| This library enables access to any camera sensor supported by the library,
|
||||
//| including OV5640 and OV2640.
|
||||
@ -56,20 +56,20 @@
|
||||
//| """Except when 1 frame buffer is used, queue will always contain the last ``fb_count`` frames"""
|
||||
//|
|
||||
|
||||
MAKE_ENUM_VALUE(esp32_camera_grab_mode_type, grab_mode, WHEN_EMPTY, CAMERA_GRAB_WHEN_EMPTY);
|
||||
MAKE_ENUM_VALUE(esp32_camera_grab_mode_type, grab_mode, LATEST, CAMERA_GRAB_LATEST);
|
||||
MAKE_ENUM_VALUE(espcamera_grab_mode_type, grab_mode, WHEN_EMPTY, CAMERA_GRAB_WHEN_EMPTY);
|
||||
MAKE_ENUM_VALUE(espcamera_grab_mode_type, grab_mode, LATEST, CAMERA_GRAB_LATEST);
|
||||
|
||||
MAKE_ENUM_MAP(esp32_camera_grab_mode) {
|
||||
MAKE_ENUM_MAP(espcamera_grab_mode) {
|
||||
MAKE_ENUM_MAP_ENTRY(grab_mode, WHEN_EMPTY),
|
||||
MAKE_ENUM_MAP_ENTRY(grab_mode, LATEST),
|
||||
};
|
||||
|
||||
STATIC MP_DEFINE_CONST_DICT(esp32_camera_grab_mode_locals_dict, esp32_camera_grab_mode_locals_table);
|
||||
MAKE_PRINTER(esp32_camera, esp32_camera_grab_mode);
|
||||
MAKE_ENUM_TYPE(esp32_camera, GrabMode, esp32_camera_grab_mode);
|
||||
STATIC MP_DEFINE_CONST_DICT(espcamera_grab_mode_locals_dict, espcamera_grab_mode_locals_table);
|
||||
MAKE_PRINTER(espcamera, espcamera_grab_mode);
|
||||
MAKE_ENUM_TYPE(espcamera, GrabMode, espcamera_grab_mode);
|
||||
|
||||
camera_grab_mode_t validate_grab_mode(mp_obj_t obj, qstr arg_name) {
|
||||
return cp_enum_value(&esp32_camera_grab_mode_type, obj, arg_name);
|
||||
return cp_enum_value(&espcamera_grab_mode_type, obj, arg_name);
|
||||
}
|
||||
|
||||
//| class PixelFormat:
|
||||
@ -85,22 +85,22 @@ camera_grab_mode_t validate_grab_mode(mp_obj_t obj, qstr arg_name) {
|
||||
//| """A compressed format"""
|
||||
//|
|
||||
|
||||
MAKE_ENUM_VALUE(esp32_camera_pixel_format_type, pixel_format, RGB565, PIXFORMAT_RGB565);
|
||||
MAKE_ENUM_VALUE(esp32_camera_pixel_format_type, pixel_format, GRAYSCALE, PIXFORMAT_GRAYSCALE);
|
||||
MAKE_ENUM_VALUE(esp32_camera_pixel_format_type, pixel_format, JPEG, PIXFORMAT_JPEG);
|
||||
MAKE_ENUM_VALUE(espcamera_pixel_format_type, pixel_format, RGB565, PIXFORMAT_RGB565);
|
||||
MAKE_ENUM_VALUE(espcamera_pixel_format_type, pixel_format, GRAYSCALE, PIXFORMAT_GRAYSCALE);
|
||||
MAKE_ENUM_VALUE(espcamera_pixel_format_type, pixel_format, JPEG, PIXFORMAT_JPEG);
|
||||
|
||||
MAKE_ENUM_MAP(esp32_camera_pixel_format) {
|
||||
MAKE_ENUM_MAP(espcamera_pixel_format) {
|
||||
MAKE_ENUM_MAP_ENTRY(pixel_format, RGB565),
|
||||
MAKE_ENUM_MAP_ENTRY(pixel_format, GRAYSCALE),
|
||||
MAKE_ENUM_MAP_ENTRY(pixel_format, JPEG),
|
||||
};
|
||||
|
||||
STATIC MP_DEFINE_CONST_DICT(esp32_camera_pixel_format_locals_dict, esp32_camera_pixel_format_locals_table);
|
||||
MAKE_PRINTER(esp32_camera, esp32_camera_pixel_format);
|
||||
MAKE_ENUM_TYPE(esp32_camera, PixelFormat, esp32_camera_pixel_format);
|
||||
STATIC MP_DEFINE_CONST_DICT(espcamera_pixel_format_locals_dict, espcamera_pixel_format_locals_table);
|
||||
MAKE_PRINTER(espcamera, espcamera_pixel_format);
|
||||
MAKE_ENUM_TYPE(espcamera, PixelFormat, espcamera_pixel_format);
|
||||
|
||||
pixformat_t validate_pixel_format(mp_obj_t obj, qstr arg_name) {
|
||||
return cp_enum_value(&esp32_camera_pixel_format_type, obj, arg_name);
|
||||
return cp_enum_value(&espcamera_pixel_format_type, obj, arg_name);
|
||||
}
|
||||
|
||||
//| class FrameSize:
|
||||
@ -173,29 +173,29 @@ pixformat_t validate_pixel_format(mp_obj_t obj, qstr arg_name) {
|
||||
//| """2560x1920"""
|
||||
//|
|
||||
|
||||
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, R96X96, FRAMESIZE_96X96);
|
||||
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, R240X240, FRAMESIZE_240X240);
|
||||
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, QQVGA, FRAMESIZE_QQVGA);
|
||||
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, QCIF, FRAMESIZE_QCIF);
|
||||
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, HQVGA, FRAMESIZE_HQVGA);
|
||||
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, QVGA, FRAMESIZE_QVGA);
|
||||
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, CIF, FRAMESIZE_CIF);
|
||||
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, HVGA, FRAMESIZE_HVGA);
|
||||
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, VGA, FRAMESIZE_VGA);
|
||||
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, SVGA, FRAMESIZE_SVGA);
|
||||
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, XGA, FRAMESIZE_XGA);
|
||||
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, HD, FRAMESIZE_HD);
|
||||
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, SXGA, FRAMESIZE_SXGA);
|
||||
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, UXGA, FRAMESIZE_UXGA);
|
||||
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, FHD, FRAMESIZE_FHD);
|
||||
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, P_HD, FRAMESIZE_P_HD);
|
||||
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, P_3MP, FRAMESIZE_P_3MP);
|
||||
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, QXGA, FRAMESIZE_QXGA);
|
||||
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, QHD, FRAMESIZE_QHD);
|
||||
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, WQXGA, FRAMESIZE_WQXGA);
|
||||
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, P_FHD, FRAMESIZE_P_FHD);
|
||||
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, QSXGA, FRAMESIZE_QSXGA);
|
||||
MAKE_ENUM_MAP(esp32_camera_frame_size) {
|
||||
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, R96X96, FRAMESIZE_96X96);
|
||||
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, R240X240, FRAMESIZE_240X240);
|
||||
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, QQVGA, FRAMESIZE_QQVGA);
|
||||
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, QCIF, FRAMESIZE_QCIF);
|
||||
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, HQVGA, FRAMESIZE_HQVGA);
|
||||
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, QVGA, FRAMESIZE_QVGA);
|
||||
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, CIF, FRAMESIZE_CIF);
|
||||
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, HVGA, FRAMESIZE_HVGA);
|
||||
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, VGA, FRAMESIZE_VGA);
|
||||
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, SVGA, FRAMESIZE_SVGA);
|
||||
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, XGA, FRAMESIZE_XGA);
|
||||
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, HD, FRAMESIZE_HD);
|
||||
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, SXGA, FRAMESIZE_SXGA);
|
||||
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, UXGA, FRAMESIZE_UXGA);
|
||||
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, FHD, FRAMESIZE_FHD);
|
||||
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, P_HD, FRAMESIZE_P_HD);
|
||||
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, P_3MP, FRAMESIZE_P_3MP);
|
||||
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, QXGA, FRAMESIZE_QXGA);
|
||||
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, QHD, FRAMESIZE_QHD);
|
||||
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, WQXGA, FRAMESIZE_WQXGA);
|
||||
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, P_FHD, FRAMESIZE_P_FHD);
|
||||
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, QSXGA, FRAMESIZE_QSXGA);
|
||||
MAKE_ENUM_MAP(espcamera_frame_size) {
|
||||
MAKE_ENUM_MAP_ENTRY(frame_size, R96X96),
|
||||
MAKE_ENUM_MAP_ENTRY(frame_size, R240X240),
|
||||
MAKE_ENUM_MAP_ENTRY(frame_size, QQVGA),
|
||||
@ -220,12 +220,12 @@ MAKE_ENUM_MAP(esp32_camera_frame_size) {
|
||||
MAKE_ENUM_MAP_ENTRY(frame_size, QSXGA),
|
||||
};
|
||||
|
||||
STATIC MP_DEFINE_CONST_DICT(esp32_camera_frame_size_locals_dict, esp32_camera_frame_size_locals_table);
|
||||
MAKE_PRINTER(esp32_camera, esp32_camera_frame_size);
|
||||
MAKE_ENUM_TYPE(esp32_camera, FrameSize, esp32_camera_frame_size);
|
||||
STATIC MP_DEFINE_CONST_DICT(espcamera_frame_size_locals_dict, espcamera_frame_size_locals_table);
|
||||
MAKE_PRINTER(espcamera, espcamera_frame_size);
|
||||
MAKE_ENUM_TYPE(espcamera, FrameSize, espcamera_frame_size);
|
||||
|
||||
framesize_t validate_frame_size(mp_obj_t obj, qstr arg_name) {
|
||||
return cp_enum_value(&esp32_camera_frame_size_type, obj, arg_name);
|
||||
return cp_enum_value(&espcamera_frame_size_type, obj, arg_name);
|
||||
}
|
||||
|
||||
//| class GainCeiling:
|
||||
@ -242,15 +242,15 @@ framesize_t validate_frame_size(mp_obj_t obj, qstr arg_name) {
|
||||
//| GAIN_128X: GainCeiling
|
||||
//|
|
||||
|
||||
MAKE_ENUM_VALUE(esp32_camera_gain_ceiling_type, gain_ceiling, GAIN_2X, GAINCEILING_2X);
|
||||
MAKE_ENUM_VALUE(esp32_camera_gain_ceiling_type, gain_ceiling, GAIN_4X, GAINCEILING_4X);
|
||||
MAKE_ENUM_VALUE(esp32_camera_gain_ceiling_type, gain_ceiling, GAIN_8X, GAINCEILING_8X);
|
||||
MAKE_ENUM_VALUE(esp32_camera_gain_ceiling_type, gain_ceiling, GAIN_16X, GAINCEILING_16X);
|
||||
MAKE_ENUM_VALUE(esp32_camera_gain_ceiling_type, gain_ceiling, GAIN_32X, GAINCEILING_32X);
|
||||
MAKE_ENUM_VALUE(esp32_camera_gain_ceiling_type, gain_ceiling, GAIN_64X, GAINCEILING_64X);
|
||||
MAKE_ENUM_VALUE(esp32_camera_gain_ceiling_type, gain_ceiling, GAIN_128X, GAINCEILING_128X);
|
||||
MAKE_ENUM_VALUE(espcamera_gain_ceiling_type, gain_ceiling, GAIN_2X, GAINCEILING_2X);
|
||||
MAKE_ENUM_VALUE(espcamera_gain_ceiling_type, gain_ceiling, GAIN_4X, GAINCEILING_4X);
|
||||
MAKE_ENUM_VALUE(espcamera_gain_ceiling_type, gain_ceiling, GAIN_8X, GAINCEILING_8X);
|
||||
MAKE_ENUM_VALUE(espcamera_gain_ceiling_type, gain_ceiling, GAIN_16X, GAINCEILING_16X);
|
||||
MAKE_ENUM_VALUE(espcamera_gain_ceiling_type, gain_ceiling, GAIN_32X, GAINCEILING_32X);
|
||||
MAKE_ENUM_VALUE(espcamera_gain_ceiling_type, gain_ceiling, GAIN_64X, GAINCEILING_64X);
|
||||
MAKE_ENUM_VALUE(espcamera_gain_ceiling_type, gain_ceiling, GAIN_128X, GAINCEILING_128X);
|
||||
|
||||
MAKE_ENUM_MAP(esp32_camera_gain_ceiling) {
|
||||
MAKE_ENUM_MAP(espcamera_gain_ceiling) {
|
||||
MAKE_ENUM_MAP_ENTRY(gain_ceiling, GAIN_2X),
|
||||
MAKE_ENUM_MAP_ENTRY(gain_ceiling, GAIN_4X),
|
||||
MAKE_ENUM_MAP_ENTRY(gain_ceiling, GAIN_8X),
|
||||
@ -260,28 +260,28 @@ MAKE_ENUM_MAP(esp32_camera_gain_ceiling) {
|
||||
MAKE_ENUM_MAP_ENTRY(gain_ceiling, GAIN_128X)
|
||||
};
|
||||
|
||||
STATIC MP_DEFINE_CONST_DICT(esp32_camera_gain_ceiling_locals_dict, esp32_camera_gain_ceiling_locals_table);
|
||||
MAKE_PRINTER(esp32_camera, esp32_camera_gain_ceiling);
|
||||
MAKE_ENUM_TYPE(esp32_camera, GainCeiling, esp32_camera_gain_ceiling);
|
||||
STATIC MP_DEFINE_CONST_DICT(espcamera_gain_ceiling_locals_dict, espcamera_gain_ceiling_locals_table);
|
||||
MAKE_PRINTER(espcamera, espcamera_gain_ceiling);
|
||||
MAKE_ENUM_TYPE(espcamera, GainCeiling, espcamera_gain_ceiling);
|
||||
|
||||
gainceiling_t validate_gain_ceiling(mp_obj_t obj, qstr arg_name) {
|
||||
return cp_enum_value(&esp32_camera_gain_ceiling_type, obj, arg_name);
|
||||
return cp_enum_value(&espcamera_gain_ceiling_type, obj, arg_name);
|
||||
}
|
||||
|
||||
STATIC const mp_rom_map_elem_t esp32_camera_module_globals_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_esp32_camera) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_Camera), MP_ROM_PTR(&esp32_camera_camera_type), },
|
||||
{ MP_ROM_QSTR(MP_QSTR_FrameSize), &esp32_camera_frame_size_type },
|
||||
{ MP_ROM_QSTR(MP_QSTR_GainCeiling), &esp32_camera_gain_ceiling_type },
|
||||
{ MP_ROM_QSTR(MP_QSTR_GrabMode), &esp32_camera_grab_mode_type },
|
||||
{ MP_ROM_QSTR(MP_QSTR_PixelFormat), &esp32_camera_pixel_format_type },
|
||||
STATIC const mp_rom_map_elem_t espcamera_module_globals_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_espcamera) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_Camera), MP_ROM_PTR(&espcamera_camera_type), },
|
||||
{ MP_ROM_QSTR(MP_QSTR_FrameSize), &espcamera_frame_size_type },
|
||||
{ MP_ROM_QSTR(MP_QSTR_GainCeiling), &espcamera_gain_ceiling_type },
|
||||
{ MP_ROM_QSTR(MP_QSTR_GrabMode), &espcamera_grab_mode_type },
|
||||
{ MP_ROM_QSTR(MP_QSTR_PixelFormat), &espcamera_pixel_format_type },
|
||||
};
|
||||
|
||||
STATIC MP_DEFINE_CONST_DICT(esp32_camera_module_globals, esp32_camera_module_globals_table);
|
||||
STATIC MP_DEFINE_CONST_DICT(espcamera_module_globals, espcamera_module_globals_table);
|
||||
|
||||
const mp_obj_module_t esp32_camera_module = {
|
||||
const mp_obj_module_t espcamera_module = {
|
||||
.base = { &mp_type_module },
|
||||
.globals = (mp_obj_dict_t *)&esp32_camera_module_globals,
|
||||
.globals = (mp_obj_dict_t *)&espcamera_module_globals,
|
||||
};
|
||||
|
||||
MP_REGISTER_MODULE(MP_QSTR_esp32_camera, esp32_camera_module, CIRCUITPY_ESP32_CAMERA);
|
||||
MP_REGISTER_MODULE(MP_QSTR_espcamera, espcamera_module, CIRCUITPY_ESPCAMERA);
|
@ -31,13 +31,13 @@
|
||||
|
||||
#include "esp_camera.h"
|
||||
|
||||
extern const mp_obj_type_t esp32_camera_grab_mode_type;
|
||||
extern const mp_obj_type_t espcamera_grab_mode_type;
|
||||
extern const cp_enum_obj_t grab_mode_WHEN_EMPTY_obj;
|
||||
extern const mp_obj_type_t esp32_camera_pixel_format_type;
|
||||
extern const mp_obj_type_t espcamera_pixel_format_type;
|
||||
extern const cp_enum_obj_t pixel_format_RGB565_obj;
|
||||
extern const mp_obj_type_t esp32_camera_frame_size_type;
|
||||
extern const mp_obj_type_t espcamera_frame_size_type;
|
||||
extern const cp_enum_obj_t frame_size_QQVGA_obj;
|
||||
extern const mp_obj_type_t esp32_camera_gain_ceiling_type;
|
||||
extern const mp_obj_type_t espcamera_gain_ceiling_type;
|
||||
|
||||
extern camera_grab_mode_t validate_grab_mode(mp_obj_t obj, qstr arg_name);
|
||||
extern pixformat_t validate_pixel_format(mp_obj_t obj, qstr arg_name);
|
@ -10,4 +10,4 @@ CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
OPTIMIZATION_FLAGS = -Os
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -8,4 +8,4 @@ IDF_TARGET = esp32s3
|
||||
CIRCUITPY_ESP_FLASH_MODE = qio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 80m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 8MB
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -11,4 +11,4 @@ CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
OPTIMIZATION_FLAGS = -Os
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -6,4 +6,4 @@ IDF_TARGET = esp32
|
||||
CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -9,7 +9,7 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
||||
# Include these Python libraries in firmware.
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_PortalBase
|
||||
|
@ -9,7 +9,7 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
||||
# Include these Python libraries in firmware.
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_PortalBase
|
||||
|
@ -13,4 +13,4 @@ CIRCUITPY_ESP_FLASH_SIZE = 8MB
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -6,7 +6,7 @@ IDF_TARGET = esp32
|
||||
CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 8MB
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
||||
# Include these Python libraries in firmware
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests
|
||||
|
@ -6,4 +6,4 @@ IDF_TARGET = esp32
|
||||
CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -10,4 +10,4 @@ CIRCUITPY_NEOPIXEL_WRITE = 0
|
||||
CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -8,4 +8,4 @@ IDF_TARGET = esp32s2
|
||||
CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -9,4 +9,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 16MB
|
||||
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -9,4 +9,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 16MB
|
||||
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -8,4 +8,4 @@ IDF_TARGET = esp32s3
|
||||
CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 80m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 8MB
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -8,4 +8,4 @@ IDF_TARGET = esp32s3
|
||||
CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 80m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 8MB
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -8,4 +8,4 @@ IDF_TARGET = esp32s3
|
||||
CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 80m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 8MB
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -8,4 +8,4 @@ IDF_TARGET = esp32s2
|
||||
CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -8,4 +8,4 @@ IDF_TARGET = esp32s2
|
||||
CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -8,4 +8,4 @@ IDF_TARGET = esp32s2
|
||||
CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -8,4 +8,4 @@ IDF_TARGET = esp32s2
|
||||
CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -8,4 +8,4 @@ IDF_TARGET = esp32s2
|
||||
CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -10,4 +10,4 @@ CIRCUITPY_ESP_FLASH_FREQ = 80m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 16MB
|
||||
|
||||
OPTIMIZATION_FLAGS = -Os
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -7,4 +7,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -7,4 +7,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -7,4 +7,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -7,4 +7,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -6,4 +6,4 @@ IDF_TARGET = esp32
|
||||
CIRCUITPY_ESP_FLASH_MODE = qio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 80m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 16MB
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -6,4 +6,4 @@ IDF_TARGET = esp32
|
||||
CIRCUITPY_ESP_FLASH_MODE = qio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 80m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 16MB
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -6,4 +6,4 @@ IDF_TARGET = esp32
|
||||
CIRCUITPY_ESP_FLASH_MODE = qio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 80m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -3,7 +3,7 @@ USB_PID = 0x2030
|
||||
USB_PRODUCT = "Maker badge"
|
||||
USB_MANUFACTURER = "Czech maker"
|
||||
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
||||
CIRCUITPY_ESP_FLASH_MODE=dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ=40m
|
||||
|
@ -9,9 +9,9 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/mixgo_cp_lib/mixgoce_lib
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -9,9 +9,9 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/mixgo_cp_lib/mixgoce_lib
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -8,4 +8,4 @@ IDF_TARGET = esp32s2
|
||||
CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -8,4 +8,4 @@ IDF_TARGET = esp32s2
|
||||
CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -11,4 +11,4 @@ CIRCUITPY_ESP_FLASH_SIZE = 8MB
|
||||
|
||||
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -11,4 +11,4 @@ CIRCUITPY_ESP_FLASH_SIZE = 8MB
|
||||
|
||||
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -8,4 +8,4 @@ IDF_TARGET = esp32s2
|
||||
CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
|
@ -27,9 +27,9 @@
|
||||
#include "py/mperrno.h"
|
||||
#include "py/runtime.h"
|
||||
|
||||
#include "bindings/esp32_camera/Camera.h"
|
||||
#include "bindings/espcamera/Camera.h"
|
||||
#include "bindings/espidf/__init__.h"
|
||||
#include "common-hal/esp32_camera/Camera.h"
|
||||
#include "common-hal/espcamera/Camera.h"
|
||||
#include "shared-bindings/busio/I2C.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "shared-bindings/util.h"
|
||||
@ -38,10 +38,10 @@
|
||||
#include "esp32-camera/driver/private_include/cam_hal.h"
|
||||
|
||||
#if !CONFIG_SPIRAM
|
||||
#error esp32_camera only works on boards configured with spiram, disable it in mpconfigboard.mk
|
||||
#error espcamera only works on boards configured with spiram, disable it in mpconfigboard.mk
|
||||
#endif
|
||||
|
||||
static void i2c_lock(esp32_camera_camera_obj_t *self) {
|
||||
static void i2c_lock(espcamera_camera_obj_t *self) {
|
||||
if (common_hal_busio_i2c_deinited(self->i2c)) {
|
||||
raise_deinited_error();
|
||||
}
|
||||
@ -50,7 +50,7 @@ static void i2c_lock(esp32_camera_camera_obj_t *self) {
|
||||
}
|
||||
}
|
||||
|
||||
static void i2c_unlock(esp32_camera_camera_obj_t *self) {
|
||||
static void i2c_unlock(espcamera_camera_obj_t *self) {
|
||||
common_hal_busio_i2c_unlock(self->i2c);
|
||||
}
|
||||
|
||||
@ -60,8 +60,8 @@ static void maybe_claim_pin(const mcu_pin_obj_t *pin) {
|
||||
}
|
||||
}
|
||||
|
||||
void common_hal_esp32_camera_camera_construct(
|
||||
esp32_camera_camera_obj_t *self,
|
||||
void common_hal_espcamera_camera_construct(
|
||||
espcamera_camera_obj_t *self,
|
||||
uint8_t data_pins[8],
|
||||
const mcu_pin_obj_t *external_clock_pin,
|
||||
const mcu_pin_obj_t *pixel_clock_pin,
|
||||
@ -79,7 +79,7 @@ void common_hal_esp32_camera_camera_construct(
|
||||
|
||||
if (common_hal_espidf_get_reserved_psram() == 0) {
|
||||
mp_raise_msg(&mp_type_MemoryError, translate(
|
||||
"esp32_camera.Camera requires reserved PSRAM to be configured. "
|
||||
"espcamera.Camera requires reserved PSRAM to be configured. "
|
||||
"See the documentation for instructions."));
|
||||
}
|
||||
for (int i = 0; i < 8; i++) {
|
||||
@ -140,8 +140,8 @@ void common_hal_esp32_camera_camera_construct(
|
||||
CHECK_ESP_RESULT(result);
|
||||
}
|
||||
|
||||
extern void common_hal_esp32_camera_camera_deinit(esp32_camera_camera_obj_t *self) {
|
||||
if (common_hal_esp32_camera_camera_deinited(self)) {
|
||||
extern void common_hal_espcamera_camera_deinit(espcamera_camera_obj_t *self) {
|
||||
if (common_hal_espcamera_camera_deinited(self)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -165,15 +165,15 @@ extern void common_hal_esp32_camera_camera_deinit(esp32_camera_camera_obj_t *sel
|
||||
self->camera_config.xclk_freq_hz = 0;
|
||||
}
|
||||
|
||||
bool common_hal_esp32_camera_camera_deinited(esp32_camera_camera_obj_t *self) {
|
||||
bool common_hal_espcamera_camera_deinited(espcamera_camera_obj_t *self) {
|
||||
return !self->camera_config.xclk_freq_hz;
|
||||
}
|
||||
|
||||
bool common_hal_esp32_camera_camera_available(esp32_camera_camera_obj_t *self) {
|
||||
bool common_hal_espcamera_camera_available(espcamera_camera_obj_t *self) {
|
||||
return esp_camera_fb_available();
|
||||
}
|
||||
|
||||
camera_fb_t *common_hal_esp32_camera_camera_take(esp32_camera_camera_obj_t *self, int timeout_ms) {
|
||||
camera_fb_t *common_hal_espcamera_camera_take(espcamera_camera_obj_t *self, int timeout_ms) {
|
||||
if (self->buffer_to_return) {
|
||||
esp_camera_fb_return(self->buffer_to_return);
|
||||
self->buffer_to_return = NULL;
|
||||
@ -189,7 +189,7 @@ camera_fb_t *common_hal_esp32_camera_camera_take(esp32_camera_camera_obj_t *self
|
||||
SENSOR_GETSET(type, name, status.status_field_name, setter_function_name)
|
||||
|
||||
#define SENSOR_GET(type, name, status_field_name, setter_function_name) \
|
||||
type common_hal_esp32_camera_camera_get_##name(esp32_camera_camera_obj_t * self) { \
|
||||
type common_hal_espcamera_camera_get_##name(espcamera_camera_obj_t * self) { \
|
||||
i2c_lock(self); \
|
||||
sensor_t *sensor = esp_camera_sensor_get(); \
|
||||
i2c_unlock(self); \
|
||||
@ -200,7 +200,7 @@ camera_fb_t *common_hal_esp32_camera_camera_take(esp32_camera_camera_obj_t *self
|
||||
}
|
||||
|
||||
#define SENSOR_SET(type, name, setter_function_name) \
|
||||
void common_hal_esp32_camera_camera_set_##name(esp32_camera_camera_obj_t * self, type value) { \
|
||||
void common_hal_espcamera_camera_set_##name(espcamera_camera_obj_t * self, type value) { \
|
||||
i2c_lock(self); \
|
||||
sensor_t *sensor = esp_camera_sensor_get(); \
|
||||
i2c_unlock(self); \
|
||||
@ -212,15 +212,15 @@ camera_fb_t *common_hal_esp32_camera_camera_take(esp32_camera_camera_obj_t *self
|
||||
} \
|
||||
}
|
||||
|
||||
pixformat_t common_hal_esp32_camera_camera_get_pixel_format(esp32_camera_camera_obj_t *self) {
|
||||
pixformat_t common_hal_espcamera_camera_get_pixel_format(espcamera_camera_obj_t *self) {
|
||||
return self->camera_config.pixel_format;
|
||||
}
|
||||
|
||||
framesize_t common_hal_esp32_camera_camera_get_frame_size(esp32_camera_camera_obj_t *self) {
|
||||
framesize_t common_hal_espcamera_camera_get_frame_size(espcamera_camera_obj_t *self) {
|
||||
return self->camera_config.frame_size;
|
||||
}
|
||||
|
||||
void common_hal_esp32_camera_camera_reconfigure(esp32_camera_camera_obj_t *self, framesize_t frame_size, pixformat_t pixel_format, camera_grab_mode_t grab_mode, mp_int_t framebuffer_count) {
|
||||
void common_hal_espcamera_camera_reconfigure(espcamera_camera_obj_t *self, framesize_t frame_size, pixformat_t pixel_format, camera_grab_mode_t grab_mode, mp_int_t framebuffer_count) {
|
||||
sensor_t *sensor = esp_camera_sensor_get();
|
||||
camera_sensor_info_t *sensor_info = esp_camera_sensor_get_info(&sensor->id);
|
||||
|
||||
@ -272,46 +272,46 @@ SENSOR_STATUS_GETSET(bool, wpc, wpc, set_wpc);
|
||||
SENSOR_STATUS_GETSET(bool, raw_gma, raw_gma, set_raw_gma);
|
||||
SENSOR_STATUS_GETSET(bool, lenc, lenc, set_lenc);
|
||||
|
||||
const char *common_hal_esp32_camera_camera_get_sensor_name(esp32_camera_camera_obj_t *self) {
|
||||
const char *common_hal_espcamera_camera_get_sensor_name(espcamera_camera_obj_t *self) {
|
||||
sensor_t *sensor = esp_camera_sensor_get();
|
||||
camera_sensor_info_t *sensor_info = esp_camera_sensor_get_info(&sensor->id);
|
||||
return sensor_info->name;
|
||||
}
|
||||
|
||||
const bool common_hal_esp32_camera_camera_get_supports_jpeg(esp32_camera_camera_obj_t *self) {
|
||||
const bool common_hal_espcamera_camera_get_supports_jpeg(espcamera_camera_obj_t *self) {
|
||||
sensor_t *sensor = esp_camera_sensor_get();
|
||||
camera_sensor_info_t *sensor_info = esp_camera_sensor_get_info(&sensor->id);
|
||||
return sensor_info->support_jpeg;
|
||||
}
|
||||
|
||||
const framesize_t common_hal_esp32_camera_camera_get_max_frame_size(esp32_camera_camera_obj_t *self) {
|
||||
const framesize_t common_hal_espcamera_camera_get_max_frame_size(espcamera_camera_obj_t *self) {
|
||||
sensor_t *sensor = esp_camera_sensor_get();
|
||||
camera_sensor_info_t *sensor_info = esp_camera_sensor_get_info(&sensor->id);
|
||||
return sensor_info->max_size;
|
||||
}
|
||||
|
||||
const int common_hal_esp32_camera_camera_get_address(esp32_camera_camera_obj_t *self) {
|
||||
const int common_hal_espcamera_camera_get_address(espcamera_camera_obj_t *self) {
|
||||
sensor_t *sensor = esp_camera_sensor_get();
|
||||
camera_sensor_info_t *sensor_info = esp_camera_sensor_get_info(&sensor->id);
|
||||
return sensor_info->sccb_addr;
|
||||
}
|
||||
|
||||
const int common_hal_esp32_camera_camera_get_width(esp32_camera_camera_obj_t *self) {
|
||||
const int common_hal_espcamera_camera_get_width(espcamera_camera_obj_t *self) {
|
||||
sensor_t *sensor = esp_camera_sensor_get();
|
||||
framesize_t framesize = sensor->status.framesize;
|
||||
return resolution[framesize].width;
|
||||
}
|
||||
|
||||
const int common_hal_esp32_camera_camera_get_height(esp32_camera_camera_obj_t *self) {
|
||||
const int common_hal_espcamera_camera_get_height(espcamera_camera_obj_t *self) {
|
||||
sensor_t *sensor = esp_camera_sensor_get();
|
||||
framesize_t framesize = sensor->status.framesize;
|
||||
return resolution[framesize].height;
|
||||
}
|
||||
|
||||
const camera_grab_mode_t common_hal_esp32_camera_camera_get_grab_mode(esp32_camera_camera_obj_t *self) {
|
||||
const camera_grab_mode_t common_hal_espcamera_camera_get_grab_mode(espcamera_camera_obj_t *self) {
|
||||
return self->camera_config.grab_mode;
|
||||
}
|
||||
|
||||
const int common_hal_esp32_camera_camera_get_framebuffer_count(esp32_camera_camera_obj_t *self) {
|
||||
const int common_hal_espcamera_camera_get_framebuffer_count(espcamera_camera_obj_t *self) {
|
||||
return self->camera_config.fb_count;
|
||||
}
|
@ -31,10 +31,10 @@
|
||||
#include "shared-bindings/pwmio/PWMOut.h"
|
||||
#include "common-hal/busio/I2C.h"
|
||||
|
||||
typedef struct esp32_camera_camera_obj {
|
||||
typedef struct espcamera_camera_obj {
|
||||
mp_obj_base_t base;
|
||||
camera_config_t camera_config;
|
||||
camera_fb_t *buffer_to_return;
|
||||
pwmio_pwmout_obj_t pwm;
|
||||
busio_i2c_obj_t *i2c;
|
||||
} esp32_camera_obj_t;
|
||||
} espcamera_obj_t;
|
@ -24,7 +24,7 @@ CIRCUITPY_BLEIO_HCI = 0
|
||||
CIRCUITPY_CANIO ?= 1
|
||||
CIRCUITPY_COUNTIO ?= 1
|
||||
CIRCUITPY_DUALBANK ?= 1
|
||||
CIRCUITPY_ESP32_CAMERA ?= 1
|
||||
CIRCUITPY_ESPCAMERA ?= 1
|
||||
CIRCUITPY_ESPIDF ?= 1
|
||||
CIRCUITPY_ESPULP ?= 1
|
||||
CIRCUITPY_FRAMEBUFFERIO ?= 1
|
||||
@ -55,7 +55,7 @@ else ifeq ($(IDF_TARGET),esp32c3)
|
||||
CIRCUITPY_ALARM = 0
|
||||
CIRCUITPY_AUDIOBUSIO = 0
|
||||
CIRCUITPY_COUNTIO = 0
|
||||
CIRCUITPY_ESP32_CAMERA = 0
|
||||
CIRCUITPY_ESPCAMERA = 0
|
||||
CIRCUITPY_ESPULP = 0
|
||||
CIRCUITPY_FREQUENCYIO = 0
|
||||
CIRCUITPY_MEMORYMAP = 0
|
||||
@ -81,8 +81,8 @@ CIRCUITPY_DUALBANK = 0
|
||||
endif
|
||||
|
||||
# Modules dependent on other modules
|
||||
CIRCUITPY_GIFIO ?= $(CIRCUITPY_ESP32_CAMERA)
|
||||
CIRCUITPY_QRIO ?= $(CIRCUITPY_ESP32_CAMERA)
|
||||
CIRCUITPY_GIFIO ?= $(CIRCUITPY_ESPCAMERA)
|
||||
CIRCUITPY_QRIO ?= $(CIRCUITPY_ESPCAMERA)
|
||||
|
||||
# Features dependent on other features
|
||||
ifneq ($(CIRCUITPY_USB),0)
|
||||
|
@ -78,7 +78,7 @@
|
||||
#include "shared-bindings/_bleio/__init__.h"
|
||||
#endif
|
||||
|
||||
#if CIRCUITPY_ESP32_CAMERA
|
||||
#if CIRCUITPY_ESPCAMERA
|
||||
#include "esp_camera.h"
|
||||
#endif
|
||||
|
||||
@ -341,7 +341,7 @@ safe_mode_t port_init(void) {
|
||||
|
||||
void reset_port(void) {
|
||||
// TODO deinit for esp32-camera
|
||||
#if CIRCUITPY_ESP32_CAMERA
|
||||
#if CIRCUITPY_ESPCAMERA
|
||||
esp_camera_deinit();
|
||||
#endif
|
||||
|
||||
|
@ -221,17 +221,16 @@ CFLAGS += -DCIRCUITPY_OS_GETENV=$(CIRCUITPY_OS_GETENV)
|
||||
CIRCUITPY_ERRNO ?= $(CIRCUITPY_FULL_BUILD)
|
||||
CFLAGS += -DCIRCUITPY_ERRNO=$(CIRCUITPY_ERRNO)
|
||||
|
||||
# CIRCUITPY_ESPIDF and CIRCUITPY_ESPULP is handled in the espressif tree.
|
||||
# Only for ESP32S chips.
|
||||
# Assume not a ESP build.
|
||||
# Espressif specific modules.
|
||||
# Assume not an Espressif build.
|
||||
CIRCUITPY_ESPIDF ?= 0
|
||||
CFLAGS += -DCIRCUITPY_ESPIDF=$(CIRCUITPY_ESPIDF)
|
||||
|
||||
CIRCUITPY_ESPULP ?= 0
|
||||
CFLAGS += -DCIRCUITPY_ESPULP=$(CIRCUITPY_ESPULP)
|
||||
|
||||
CIRCUITPY_ESP32_CAMERA ?= 0
|
||||
CFLAGS += -DCIRCUITPY_ESP32_CAMERA=$(CIRCUITPY_ESP32_CAMERA)
|
||||
CIRCUITPY_ESPCAMERA ?= 0
|
||||
CFLAGS += -DCIRCUITPY_ESPCAMERA=$(CIRCUITPY_ESPCAMERA)
|
||||
|
||||
CIRCUITPY__EVE ?= 0
|
||||
CFLAGS += -DCIRCUITPY__EVE=$(CIRCUITPY__EVE)
|
||||
|
@ -35,7 +35,7 @@
|
||||
//|
|
||||
//| .. seealso::
|
||||
//|
|
||||
//| Espressif microcontrollers use the `esp32_camera` module together.
|
||||
//| Espressif microcontrollers use the `espcamera` module together.
|
||||
//|
|
||||
//| """
|
||||
STATIC const mp_rom_map_elem_t imagecapture_module_globals_table[] = {
|
||||
|
Loading…
Reference in New Issue
Block a user