summaryrefslogtreecommitdiff
path: root/shared-bindings/audiobusio/PDMIn.c
diff options
context:
space:
mode:
authorScott Shawcroft <scott@adafruit.com>2020-07-22 13:48:45 -0700
committerGitHub <noreply@github.com>2020-07-22 13:48:45 -0700
commit02b71e013adda29cd67172a3782fda8fa5da0bba (patch)
tree4a0230aa6e19e9392908e1b23e83f5e9a4d93128 /shared-bindings/audiobusio/PDMIn.c
parent05a10f7905bfb77f3d5dff2525c9d10375801329 (diff)
parent9e3fa863f1d0dcf8eae54554ffc7016eaa6de157 (diff)
Merge pull request #3107 from dherrada/type_hints
Adding type hints
Diffstat (limited to 'shared-bindings/audiobusio/PDMIn.c')
-rw-r--r--shared-bindings/audiobusio/PDMIn.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/shared-bindings/audiobusio/PDMIn.c b/shared-bindings/audiobusio/PDMIn.c
index 5b950297b..9a963bcfa 100644
--- a/shared-bindings/audiobusio/PDMIn.c
+++ b/shared-bindings/audiobusio/PDMIn.c
@@ -39,7 +39,7 @@
//| class PDMIn:
//| """Record an input PDM audio stream"""
//|
-//| def __init__(self, clock_pin: microcontroller.Pin, data_pin: microcontroller.Pin, *, sample_rate: int = 16000, bit_depth: int = 8, mono: bool = True, oversample: int = 64, startup_delay: float = 0.11):
+//| def __init__(self, clock_pin: microcontroller.Pin, data_pin: microcontroller.Pin, *, sample_rate: int = 16000, bit_depth: int = 8, mono: bool = True, oversample: int = 64, startup_delay: float = 0.11) -> None:
//| """Create a PDMIn object associated with the given pins. This allows you to
//| record audio signals from the given pins. Individual ports may put further
//| restrictions on the recording parameters. The overall sample rate is
@@ -134,7 +134,7 @@ STATIC mp_obj_t audiobusio_pdmin_make_new(const mp_obj_type_t *type, size_t n_ar
return MP_OBJ_FROM_PTR(self);
}
-//| def deinit(self, ) -> Any:
+//| def deinit(self) -> None:
//| """Deinitialises the PDMIn and releases any hardware resources for reuse."""
//| ...
//|
@@ -150,13 +150,13 @@ STATIC void check_for_deinit(audiobusio_pdmin_obj_t *self) {
raise_deinited_error();
}
}
-//| def __enter__(self, ) -> Any:
+//| def __enter__(self) -> PDMIn:
//| """No-op used by Context Managers."""
//| ...
//|
// Provided by context manager helper.
-//| def __exit__(self, ) -> Any:
+//| def __exit__(self) -> None:
//| """Automatically deinitializes the hardware when exiting a context."""
//| ...
//|
@@ -168,7 +168,7 @@ STATIC mp_obj_t audiobusio_pdmin_obj___exit__(size_t n_args, const mp_obj_t *arg
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_pdmin___exit___obj, 4, 4, audiobusio_pdmin_obj___exit__);
-//| def record(self, destination: Any, destination_length: Any) -> Any:
+//| def record(self, destination: WriteableBuffer, destination_length: int) -> None:
//| """Records destination_length bytes of samples to destination. This is
//| blocking.
//|
@@ -210,7 +210,7 @@ STATIC mp_obj_t audiobusio_pdmin_obj_record(mp_obj_t self_obj, mp_obj_t destinat
}
MP_DEFINE_CONST_FUN_OBJ_3(audiobusio_pdmin_record_obj, audiobusio_pdmin_obj_record);
-//| sample_rate: Any = ...
+//| sample_rate: int = ...
//| """The actual sample_rate of the recording. This may not match the constructed
//| sample rate due to internal clock limitations."""
//|