Skip to content

Commit 72887c7

Browse files
committed
Add header comments to files in cv2_drivers
1 parent 10eed92 commit 72887c7

17 files changed

+212
-23
lines changed

cv2_drivers/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
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+
111
from . import displays
212
from . import cameras
3-
from . import touch_screens
13+
from . import touch_screens

cv2_drivers/cameras/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
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+
111
# Import sys module to check platform
212
import sys
313

cv2_drivers/cameras/cv2_camera.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
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+
111
class CV2_Camera():
212
"""
313
Base class for OpenCV camera drivers.

cv2_drivers/cameras/dvp_camera.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
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+
111
from .cv2_camera import CV2_Camera
212

313
class DVP_Camera(CV2_Camera):

cv2_drivers/cameras/dvp_rp2_pio.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
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+
#
412
# This class is derived from:
513
# https://github.com/adafruit/Adafruit_ImageCapture/blob/main/src/arch/rp2040.cpp
614
# Released under the MIT license.
715
# Copyright (c) 2021 Adafruit Industries
16+
#-------------------------------------------------------------------------------
17+
18+
import rp2
19+
from machine import Pin, PWM
20+
821
class DVP_RP2_PIO():
922
"""
1023
This class implements a DVP (Digital Video Port) interface using the RP2 PIO

cv2_drivers/cameras/hm01b0.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
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+
#
510
# This class is derived from:
611
# https://github.com/openmv/openmv/blob/5acf5baf92b4314a549bdd068138e5df6cc0bac7/drivers/sensors/hm01b0.c
712
# Released under the MIT license.
813
# 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+
920
class HM01B0(DVP_Camera):
1021
"""
1122
Base class for OpenCV HM01B0 camera drivers.

cv2_drivers/cameras/hm01b0_pio.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
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+
112
from .hm01b0 import HM01B0
213
from .dvp_rp2_pio import DVP_RP2_PIO
314
from ulab import numpy as np

cv2_drivers/cameras/ov5640.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
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+
#
510
# This class is derived from:
611
# https://github.com/adafruit/Adafruit_CircuitPython_OV5640
712
# Released under the MIT license.
813
# 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+
920
class OV5640(DVP_Camera):
1021
"""
1122
Base class for OpenCV OV5640 camera drivers.

cv2_drivers/cameras/ov5640_pio.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
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+
112
from .ov5640 import OV5640
213
from .dvp_rp2_pio import DVP_RP2_PIO
314
from ulab import numpy as np

cv2_drivers/displays/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
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+
111
# Import platform agnostic drivers
212
from . import st7789_spi
313

0 commit comments

Comments
 (0)