File tree Expand file tree Collapse file tree 17 files changed +212
-23
lines changed Expand file tree Collapse file tree 17 files changed +212
-23
lines changed Original file line number Diff line number Diff line change
1
+ #-------------------------------------------------------------------------------
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ # Copyright (c) 2025 SparkFun Electronics
5
+ #-------------------------------------------------------------------------------
6
+ # cv2_drivers/touch_screens/__init__.py
7
+ #
8
+ # Imports all available drivers for MicroPython OpenCV.
9
+ #-------------------------------------------------------------------------------
10
+
1
11
from . import displays
2
12
from . import cameras
3
- from . import touch_screens
13
+ from . import touch_screens
Original file line number Diff line number Diff line change
1
+ #-------------------------------------------------------------------------------
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ # Copyright (c) 2025 SparkFun Electronics
5
+ #-------------------------------------------------------------------------------
6
+ # cv2_drivers/cameras/__init__.py
7
+ #
8
+ # Imports all available camera drivers for MicroPython OpenCV.
9
+ #-------------------------------------------------------------------------------
10
+
1
11
# Import sys module to check platform
2
12
import sys
3
13
Original file line number Diff line number Diff line change
1
+ #-------------------------------------------------------------------------------
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ # Copyright (c) 2025 SparkFun Electronics
5
+ #-------------------------------------------------------------------------------
6
+ # cv2_camera.py
7
+ #
8
+ # Base class for OpenCV camera drivers.
9
+ #-------------------------------------------------------------------------------
10
+
1
11
class CV2_Camera ():
2
12
"""
3
13
Base class for OpenCV camera drivers.
Original file line number Diff line number Diff line change
1
+ #-------------------------------------------------------------------------------
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ # Copyright (c) 2025 SparkFun Electronics
5
+ #-------------------------------------------------------------------------------
6
+ # dvp_camera.py
7
+ #
8
+ # Base class for OpenCV DVP (Digital Video Port) camera drivers.
9
+ #-------------------------------------------------------------------------------
10
+
1
11
from .cv2_camera import CV2_Camera
2
12
3
13
class DVP_Camera (CV2_Camera ):
Original file line number Diff line number Diff line change 1
- import rp2
2
- from machine import Pin , PWM
3
-
1
+ #-------------------------------------------------------------------------------
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ # Copyright (c) 2025 SparkFun Electronics
5
+ #-------------------------------------------------------------------------------
6
+ # dvp_rp2_pio.py
7
+ #
8
+ # This class implements a DVP (Digital Video Port) interface using the RP2 PIO
9
+ # (Programmable Input/Output) interface. This is only available on Raspberry Pi
10
+ # RP2 processors.
11
+ #
4
12
# This class is derived from:
5
13
# https://github.com/adafruit/Adafruit_ImageCapture/blob/main/src/arch/rp2040.cpp
6
14
# Released under the MIT license.
7
15
# Copyright (c) 2021 Adafruit Industries
16
+ #-------------------------------------------------------------------------------
17
+
18
+ import rp2
19
+ from machine import Pin , PWM
20
+
8
21
class DVP_RP2_PIO ():
9
22
"""
10
23
This class implements a DVP (Digital Video Port) interface using the RP2 PIO
Original file line number Diff line number Diff line change 1
- from .dvp_camera import DVP_Camera
2
- from time import sleep_us
3
- import cv2
4
-
1
+ #-------------------------------------------------------------------------------
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ # Copyright (c) 2025 SparkFun Electronics
5
+ #-------------------------------------------------------------------------------
6
+ # hm01b0.py
7
+ #
8
+ # Base class for OpenCV HM01B0 camera drivers.
9
+ #
5
10
# This class is derived from:
6
11
# https://github.com/openmv/openmv/blob/5acf5baf92b4314a549bdd068138e5df6cc0bac7/drivers/sensors/hm01b0.c
7
12
# Released under the MIT license.
8
13
# Copyright (C) 2013-2024 OpenMV, LLC.
14
+ #-------------------------------------------------------------------------------
15
+
16
+ from .dvp_camera import DVP_Camera
17
+ from time import sleep_us
18
+ import cv2
19
+
9
20
class HM01B0 (DVP_Camera ):
10
21
"""
11
22
Base class for OpenCV HM01B0 camera drivers.
Original file line number Diff line number Diff line change
1
+ #-------------------------------------------------------------------------------
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ # Copyright (c) 2025 SparkFun Electronics
5
+ #-------------------------------------------------------------------------------
6
+ # hm01b0_pio.py
7
+ #
8
+ # OpenCV HM01B0 camera driver using a PIO interface. Only available on
9
+ # Raspberry Pi RP2 processors.
10
+ #-------------------------------------------------------------------------------
11
+
1
12
from .hm01b0 import HM01B0
2
13
from .dvp_rp2_pio import DVP_RP2_PIO
3
14
from ulab import numpy as np
Original file line number Diff line number Diff line change 1
- from .dvp_camera import DVP_Camera
2
- from time import sleep_us
3
- import cv2
4
-
1
+ #-------------------------------------------------------------------------------
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ # Copyright (c) 2025 SparkFun Electronics
5
+ #-------------------------------------------------------------------------------
6
+ # ov5640.py
7
+ #
8
+ # Base class for OpenCV OV5640 camera drivers.
9
+ #
5
10
# This class is derived from:
6
11
# https://github.com/adafruit/Adafruit_CircuitPython_OV5640
7
12
# Released under the MIT license.
8
13
# Copyright (c) 2021 Jeff Epler for Adafruit Industries
14
+ #-------------------------------------------------------------------------------
15
+
16
+ from .dvp_camera import DVP_Camera
17
+ from time import sleep_us
18
+ import cv2
19
+
9
20
class OV5640 (DVP_Camera ):
10
21
"""
11
22
Base class for OpenCV OV5640 camera drivers.
Original file line number Diff line number Diff line change
1
+ #-------------------------------------------------------------------------------
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ # Copyright (c) 2025 SparkFun Electronics
5
+ #-------------------------------------------------------------------------------
6
+ # ov5640_pio.py
7
+ #
8
+ # OpenCV OV5640 camera driver using a PIO interface. Only available on
9
+ # Raspberry Pi RP2 processors.
10
+ #-------------------------------------------------------------------------------
11
+
1
12
from .ov5640 import OV5640
2
13
from .dvp_rp2_pio import DVP_RP2_PIO
3
14
from ulab import numpy as np
Original file line number Diff line number Diff line change
1
+ #-------------------------------------------------------------------------------
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ # Copyright (c) 2025 SparkFun Electronics
5
+ #-------------------------------------------------------------------------------
6
+ # cv2_drivers/displays/__init__.py
7
+ #
8
+ # Imports all available display drivers for MicroPython OpenCV.
9
+ #-------------------------------------------------------------------------------
10
+
1
11
# Import platform agnostic drivers
2
12
from . import st7789_spi
3
13
You can’t perform that action at this time.
0 commit comments