37
37
from typing import Optional , Sequence , List , Union
38
38
from busio import I2C
39
39
from microcontroller import Pin
40
+ from digitalio import DigitalInOut
40
41
except ImportError :
41
42
pass
42
43
@@ -822,8 +823,8 @@ def __init__(
822
823
clock : Pin ,
823
824
vsync : Pin ,
824
825
href : Pin ,
825
- shutdown : Optional [Pin ] = None ,
826
- reset : Optional [Pin ] = None ,
826
+ shutdown : Optional [DigitalInOut ] = None ,
827
+ reset : Optional [DigitalInOut ] = None ,
827
828
mclk : Optional [Pin ] = None ,
828
829
mclk_frequency : int = 20_000_000 ,
829
830
i2c_address : int = 0x3C ,
@@ -837,9 +838,9 @@ def __init__(
837
838
vsync (microcontroller.Pin): The vsync signal from the OV5640.
838
839
href (microcontroller.Pin): The href signal from the OV5640, \
839
840
sometimes inaccurately called hsync.
840
- shutdown (Optional[microcontroller.Pin ]): If not None, the shutdown
841
+ shutdown (Optional[digitalio.DigitalInOut ]): If not None, the shutdown
841
842
signal to the camera, also called the powerdown or enable pin.
842
- reset (Optional[microcontroller.Pin ]): If not None, the reset signal
843
+ reset (Optional[digitalio.DigitalInOut ]): If not None, the reset signal
843
844
to the camera.
844
845
mclk (Optional[microcontroller.Pin]): The pin on which to create a
845
846
master clock signal, or None if the master clock signal is
@@ -862,7 +863,7 @@ def __init__(
862
863
self ._mclk_pwm = None
863
864
864
865
if shutdown :
865
- self ._shutdown = digitalio . DigitalInOut ( shutdown )
866
+ self ._shutdown = shutdown
866
867
self ._shutdown .switch_to_output (True )
867
868
time .sleep (0.1 )
868
869
self ._shutdown .switch_to_output (False )
@@ -871,7 +872,7 @@ def __init__(
871
872
self ._shutdown = None
872
873
873
874
if reset :
874
- self ._reset = digitalio . DigitalInOut ( reset )
875
+ self ._reset = reset
875
876
self ._reset .switch_to_output (False )
876
877
time .sleep (0.1 )
877
878
self ._reset .switch_to_output (True )
0 commit comments