Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
17bc4ae
Change examples to import specific things instead of *
sfe-SparkFro Sep 12, 2025
65359b2
Change XRP example 1 to transpose arrow buttons
sfe-SparkFro Sep 12, 2025
ea793c7
Add initial RP2350 HSTX DVI driver
sfe-SparkFro Nov 13, 2025
33cd166
Improve RP2 DVP PIO driver
sfe-SparkFro Nov 19, 2025
5b74ddc
Change default OV5640 XCLK frequency
sfe-SparkFro Nov 19, 2025
d57e422
Fix typo in ST7789 PIO driver
sfe-SparkFro Nov 19, 2025
d70bb38
Update ulab to 6.11.0
sfe-SparkFro Nov 19, 2025
832b82c
Merge pull request #6 from sparkfun/transpose
sfe-SparkFro Nov 19, 2025
1378c52
Clean up RP2 DVI HSTX driver.
sfe-SparkFro Nov 20, 2025
e12c3b0
Set HSTX pin mode with `Pin.ALT_HSTX`
sfe-SparkFro Nov 24, 2025
088ef58
Fix typo
sfe-SparkFro Nov 24, 2025
5adfdfe
Update register names to better match datasheet
sfe-SparkFro Nov 24, 2025
173abce
Merge pull request #9 from sparkfun/rp2_hstx_dvi
sfe-SparkFro Nov 24, 2025
4c8b685
Add optional `continuous` paramter to RP2 DVP cameras
sfe-SparkFro Nov 25, 2025
988c317
Merge pull request #8 from sparkfun/rp2_dvp_pio
sfe-SparkFro Nov 25, 2025
c735df6
Update micropython-opencv to v1.0.1
sfe-SparkFro Dec 1, 2025
181b365
Update README with OV5640 and DVI
sfe-SparkFro Dec 1, 2025
cad8d17
Add DVI HSTX to rv_init display example
sfe-SparkFro Dec 2, 2025
9d48d63
Update DVI example 1
sfe-SparkFro Dec 2, 2025
34cd8ee
Add high FPS camera DVI example
sfe-SparkFro Dec 2, 2025
3e96de0
Update DVI examples
sfe-SparkFro Dec 2, 2025
f9762f6
Add optional buffer parameter to HSTX DVI driver
sfe-SparkFro Dec 2, 2025
c3226f5
Add missing parameters to OV5640 init docstring
sfe-SparkFro Dec 2, 2025
e2717b2
Refactor drivers to use encapsulation.
sfe-SparkFro Dec 6, 2025
8ea03ee
dvp_rp2_pio: Transfer 4 bytes at a time when there's only 1 byte per …
sfe-SparkFro Dec 8, 2025
6d66765
Increase HM01B0 pin drive strength when using 1-bit mode
sfe-SparkFro Dec 8, 2025
a6a06b9
Reduce HM01B0 PCLK drive strength
sfe-SparkFro Dec 9, 2025
9752efb
Reduce OV5640 drive strength
sfe-SparkFro Dec 9, 2025
217b473
Further reduce OV5640 drive strength
sfe-SparkFro Dec 9, 2025
12bf2b9
Add missing arguments to base video driver class
sfe-SparkFro Dec 10, 2025
59b6497
Add constants for ST7789 rotations
sfe-SparkFro Dec 12, 2025
982f3ea
Import memory and color modules with 'rv_' prefix
sfe-SparkFro Dec 12, 2025
f5f4f0a
Fix docstrings and comments
sfe-SparkFro Dec 13, 2025
90079d8
Add __init__() to VideoCaptureDriver and VideoDisplayDriver
sfe-SparkFro Dec 13, 2025
6c3477e
Merge pull request #10 from sparkfun/encapsulation
sfe-SparkFro Dec 13, 2025
58d55f0
dvp_rp2_pio: Create row buffer an NumPy array instead of Python array
sfe-SparkFro Dec 16, 2025
356342e
Change camera drivers to start continuous capture on open() instead o…
sfe-SparkFro Dec 16, 2025
57550c8
Fix typo
sfe-SparkFro Dec 16, 2025
553426f
Add isOpened() to VideoCapture
sfe-SparkFro Dec 16, 2025
3d73d2b
Make high_fps_camera example a generic example
sfe-SparkFro Dec 16, 2025
21452b8
Run GC at start of begin() in DVI_RP2_HSTX and DVP_RP2_PIO
sfe-SparkFro Dec 16, 2025
5a79d0c
Remove DVI examples
sfe-SparkFro Dec 16, 2025
240cd11
Enable drivers to accept either pin number or Pin objects
sfe-SparkFro Dec 18, 2025
d333824
Change default pins in examples to use named pins
sfe-SparkFro Dec 18, 2025
99f312d
Set PIO base pin based on board name
sfe-SparkFro Dec 18, 2025
7605aa5
Allow separate SD card SPI bus
sfe-SparkFro Dec 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,14 @@ Hardware support in this repository is mostly limited to SparkFun Red Vision pro
| Status | Device | Notes |
| --- | --- | --- |
| ✔️ | [HM01B0](https://www.sparkfun.com/sparkfun-red-vision-camera-board-hm01b0-color.html) | |
| ️ | [OV5640](https://www.sparkfun.com/ov5640-camera-board-5-megapixel-2592x1944-fisheye-lens.html) | See [#1](https://github.com/sparkfun/red_vision/issues/1) |
| ️ | [OV5640](https://www.sparkfun.com/ov5640-camera-board-5-megapixel-2592x1944-fisheye-lens.html) | |

## Display Drivers

| Status | Device | Notes |
| --- | --- | --- |
| ✔️ | [ST7789](https://www.sparkfun.com/sparkfun-red-vision-touch-display-for-pico.html) | |
| ✔️ | [DVI/HDMI](https://www.sparkfun.com/sparkfun-hstx-to-dvi-breakout.html) | RP2350 HSTX only |

## Touch Screen Drivers

Expand Down
2 changes: 1 addition & 1 deletion micropython-opencv
Submodule micropython-opencv updated 1 files
+1 −1 ulab
8 changes: 5 additions & 3 deletions red_vision/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
#
# Copyright (c) 2025 SparkFun Electronics
#-------------------------------------------------------------------------------
# cv2_drivers/touch_screens/__init__.py
# red_vision/__init__.py
#
# Imports all available drivers for MicroPython OpenCV.
# Imports all available Red Vision drivers, modules, and utilities.
#-------------------------------------------------------------------------------

from . import displays
from . import cameras
from . import displays
from . import touch_screens
from .utils import colors
from .utils import memory
18 changes: 11 additions & 7 deletions red_vision/cameras/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@
#
# Copyright (c) 2025 SparkFun Electronics
#-------------------------------------------------------------------------------
# cv2_drivers/cameras/__init__.py
# red_vision/cameras/__init__.py
#
# Imports all available camera drivers for MicroPython OpenCV.
# Imports all available Red Vision camera drivers.
#-------------------------------------------------------------------------------

# Import sys module to check platform
import sys
# Import the generic VideoCapture class.
from .video_capture import VideoCapture

# Import platform agnostic drivers.
from .hm01b0 import HM01B0
from .ov5640 import OV5640

# Import RP2 drivers
# Import platform specific drivers.
import sys
if 'rp2' in sys.platform:
from . import hm01b0_pio
from . import ov5640_pio
from .dvp_rp2_pio import DVP_RP2_PIO
45 changes: 0 additions & 45 deletions red_vision/cameras/cv2_camera.py

This file was deleted.

39 changes: 25 additions & 14 deletions red_vision/cameras/dvp_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,52 @@
#
# Copyright (c) 2025 SparkFun Electronics
#-------------------------------------------------------------------------------
# dvp_camera.py
# red_vision/cameras/dvp_camera.py
#
# Base class for OpenCV DVP (Digital Video Port) camera drivers.
# Red Vision abstract base class for DVP (Digital Video Port) camera drivers.
#-------------------------------------------------------------------------------

from .cv2_camera import CV2_Camera
from .video_capture_driver import VideoCaptureDriver

class DVP_Camera(CV2_Camera):
class DVP_Camera(VideoCaptureDriver):
"""
Base class for OpenCV DVP (Digital Video Port) camera drivers.
Red Vision abstract base class for DVP (Digital Video Port) camera drivers.
"""
def __init__(
self,
i2c,
i2c_address
i2c_address,
height = None,
width = None,
color_mode = None,
buffer = None,
):
"""
Initializes the DVP camera with I2C communication.

Args:
i2c (I2C): I2C object for communication
i2c_address (int): I2C address of the camera
height (int, optional): Image height in pixels
width (int, optional): Image width in pixels
color_mode (int, optional): Color mode to use
buffer (ndarray, optional): Pre-allocated image buffer
"""
super().__init__()

# Store I2C parameters.
self._i2c = i2c
self._i2c_address = i2c_address

# Initialize the base VideoCaptureDriver class
super().__init__(height, width, color_mode, buffer)

def _read_register(self, reg, nbytes=1):
"""
Reads a register from the camera over I2C.
Reads a register(s) from the camera over I2C.

Args:
reg (int): Register address to read
nbytes (int): Number of bytes to read from the register
reg (int): Start register address to read
nbytes (int, optional): Number of bytes to read from the register
(default: 1)

Returns:
bytes: Data read from the register
Expand All @@ -47,11 +58,11 @@ def _read_register(self, reg, nbytes=1):

def _write_register(self, reg, data):
"""
Writes data to a register on the camera over I2C.
Writes data to a register(s) on the camera over I2C.

Args:
reg (int): Register address to write
data (bytes, int, list, tuple): Data to write to the register
reg (int): Start register address to write
data (bytes, int, list, tuple): Data to write to the register(s)
"""
if isinstance(data, int):
data = bytes([data])
Expand Down
Loading