Skip to content

Commit c7b721f

Browse files
committed
Fixed some more whitespace
1 parent aacca61 commit c7b721f

File tree

6 files changed

+354
-362
lines changed

6 files changed

+354
-362
lines changed

shared-bindings/audiobusio/I2SOut.c

Lines changed: 75 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -36,63 +36,63 @@
3636
#include "supervisor/shared/translate.h"
3737

3838
//|class I2SOut:
39-
//| """.. currentmodule:: audiobusio
39+
//|""".. currentmodule:: audiobusio
4040
//|
41-
//| :class:`I2SOut` -- Output an I2S audio signal
42-
//| ========================================================
41+
//|:class:`I2SOut` -- Output an I2S audio signal
42+
//|========================================================
4343
//|
44-
//| I2S is used to output an audio signal on an I2S bus."""
45-
//| def __init__(self, bit_clock: microcontroller.Pin, word_select: microcontroller.Pin, data: microcontroller.Pin, *, left_justified: bool):
46-
//| """Create a I2SOut object associated with the given pins.
44+
//|I2S is used to output an audio signal on an I2S bus."""
45+
//|def __init__(self, bit_clock: microcontroller.Pin, word_select: microcontroller.Pin, data: microcontroller.Pin, *, left_justified: bool):
46+
//|"""Create a I2SOut object associated with the given pins.
4747
//|
48-
//| :param ~microcontroller.Pin bit_clock: The bit clock (or serial clock) pin
49-
//| :param ~microcontroller.Pin word_select: The word select (or left/right clock) pin
50-
//| :param ~microcontroller.Pin data: The data pin
51-
//| :param bool left_justified: True when data bits are aligned with the word select clock. False
52-
//| when they are shifted by one to match classic I2S protocol.
48+
//|:param ~microcontroller.Pin bit_clock: The bit clock (or serial clock) pin
49+
//|:param ~microcontroller.Pin word_select: The word select (or left/right clock) pin
50+
//|:param ~microcontroller.Pin data: The data pin
51+
//|:param bool left_justified: True when data bits are aligned with the word select clock. False
52+
//|when they are shifted by one to match classic I2S protocol.
5353
//|
54-
//| Simple 8ksps 440 Hz sine wave on `Metro M0 Express <https://www.adafruit.com/product/3505>`_
55-
//| using `UDA1334 Breakout <https://www.adafruit.com/product/3678>`_::
54+
//|Simple 8ksps 440 Hz sine wave on `Metro M0 Express <https://www.adafruit.com/product/3505>`_
55+
//|using `UDA1334 Breakout <https://www.adafruit.com/product/3678>`_::
5656
//|
57-
//| import audiobusio
58-
//| import audiocore
59-
//| import board
60-
//| import array
61-
//| import time
62-
//| import math
57+
//|import audiobusio
58+
//|import audiocore
59+
//|import board
60+
//|import array
61+
//|import time
62+
//|import math
6363
//|
64-
//| # Generate one period of sine wave.
65-
//| length = 8000 // 440
66-
//| sine_wave = array.array("H", [0] * length)
67-
//| for i in range(length):
68-
//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15)
64+
//|# Generate one period of sine wave.
65+
//|length = 8000 // 440
66+
//|sine_wave = array.array("H", [0] * length)
67+
//|for i in range(length):
68+
//|sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15)
6969
//|
70-
//| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000)
71-
//| i2s = audiobusio.I2SOut(board.D1, board.D0, board.D9)
72-
//| i2s.play(sine_wave, loop=True)
73-
//| time.sleep(1)
74-
//| i2s.stop()
70+
//|sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000)
71+
//|i2s = audiobusio.I2SOut(board.D1, board.D0, board.D9)
72+
//|i2s.play(sine_wave, loop=True)
73+
//|time.sleep(1)
74+
//|i2s.stop()
7575
//|
76-
//| Playing a wave file from flash::
76+
//|Playing a wave file from flash::
7777
//|
78-
//| import board
79-
//| import audioio
80-
//| import audiocore
81-
//| import audiobusio
82-
//| import digitalio
78+
//|import board
79+
//|import audioio
80+
//|import audiocore
81+
//|import audiobusio
82+
//|import digitalio
8383
//|
8484
//|
85-
//| f = open("cplay-5.1-16bit-16khz.wav", "rb")
86-
//| wav = audiocore.WaveFile(f)
85+
//|f = open("cplay-5.1-16bit-16khz.wav", "rb")
86+
//|wav = audiocore.WaveFile(f)
8787
//|
88-
//| a = audiobusio.I2SOut(board.D1, board.D0, board.D9)
88+
//|a = audiobusio.I2SOut(board.D1, board.D0, board.D9)
8989
//|
90-
//| print("playing")
91-
//| a.play(wav)
92-
//| while a.playing:
93-
//| pass
94-
//| print("stopped")"""
95-
//| ...
90+
//|print("playing")
91+
//|a.play(wav)
92+
//|while a.playing:
93+
//|pass
94+
//|print("stopped")"""
95+
//|...
9696
STATIC mp_obj_t audiobusio_i2sout_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
9797
enum { ARG_bit_clock, ARG_word_select, ARG_data, ARG_left_justified };
9898
static const mp_arg_t allowed_args[] = {
@@ -115,9 +115,9 @@ STATIC mp_obj_t audiobusio_i2sout_make_new(const mp_obj_type_t *type, size_t n_a
115115
return MP_OBJ_FROM_PTR(self);
116116
}
117117

118-
//| def deinit(self, ) -> Any:
119-
//| """Deinitialises the I2SOut and releases any hardware resources for reuse."""
120-
//| ...
118+
//|def deinit(self, ) -> Any:
119+
//|"""Deinitialises the I2SOut and releases any hardware resources for reuse."""
120+
//|...
121121
STATIC mp_obj_t audiobusio_i2sout_deinit(mp_obj_t self_in) {
122122
audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in);
123123
common_hal_audiobusio_i2sout_deinit(self);
@@ -130,15 +130,15 @@ STATIC void check_for_deinit(audiobusio_i2sout_obj_t *self) {
130130
raise_deinited_error();
131131
}
132132
}
133-
//| def __enter__(self, ) -> Any:
134-
//| """No-op used by Context Managers."""
135-
//| ...
133+
//|def __enter__(self, ) -> Any:
134+
//|"""No-op used by Context Managers."""
135+
//|...
136136
// Provided by context manager helper.
137137

138-
//| def __exit__(self, ) -> Any:
139-
//| """Automatically deinitializes the hardware when exiting a context. See
140-
//| :ref:`lifetime-and-contextmanagers` for more info."""
141-
//| ...
138+
//|def __exit__(self, ) -> Any:
139+
//|"""Automatically deinitializes the hardware when exiting a context. See
140+
//|:ref:`lifetime-and-contextmanagers` for more info."""
141+
//|...
142142
STATIC mp_obj_t audiobusio_i2sout_obj___exit__(size_t n_args, const mp_obj_t *args) {
143143
(void)n_args;
144144
common_hal_audiobusio_i2sout_deinit(args[0]);
@@ -147,14 +147,14 @@ STATIC mp_obj_t audiobusio_i2sout_obj___exit__(size_t n_args, const mp_obj_t *ar
147147
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_i2sout___exit___obj, 4, 4, audiobusio_i2sout_obj___exit__);
148148

149149

150-
//| def play(self, sample: Any, *, loop: Any = False) -> Any:
151-
//| """Plays the sample once when loop=False and continuously when loop=True.
152-
//| Does not block. Use `playing` to block.
150+
//|def play(self, sample: Any, *, loop: Any = False) -> Any:
151+
//|"""Plays the sample once when loop=False and continuously when loop=True.
152+
//|Does not block. Use `playing` to block.
153153
//|
154-
//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`.
154+
//|Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`.
155155
//|
156-
//| The sample itself should consist of 8 bit or 16 bit samples."""
157-
//| ...
156+
//|The sample itself should consist of 8 bit or 16 bit samples."""
157+
//|...
158158
STATIC mp_obj_t audiobusio_i2sout_obj_play(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
159159
enum { ARG_sample, ARG_loop };
160160
static const mp_arg_t allowed_args[] = {
@@ -173,9 +173,9 @@ STATIC mp_obj_t audiobusio_i2sout_obj_play(size_t n_args, const mp_obj_t *pos_ar
173173
}
174174
MP_DEFINE_CONST_FUN_OBJ_KW(audiobusio_i2sout_play_obj, 1, audiobusio_i2sout_obj_play);
175175

176-
//| def stop(self, ) -> Any:
177-
//| """Stops playback."""
178-
//| ...
176+
//|def stop(self, ) -> Any:
177+
//|"""Stops playback."""
178+
//|...
179179
STATIC mp_obj_t audiobusio_i2sout_obj_stop(mp_obj_t self_in) {
180180
audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in);
181181
check_for_deinit(self);
@@ -184,9 +184,9 @@ STATIC mp_obj_t audiobusio_i2sout_obj_stop(mp_obj_t self_in) {
184184
}
185185
MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_stop_obj, audiobusio_i2sout_obj_stop);
186186

187-
//| playing: Any =
188-
//| """True when the audio sample is being output. (read-only)"""
189-
//| ...
187+
//|playing: Any =
188+
//|"""True when the audio sample is being output. (read-only)"""
189+
//|...
190190
STATIC mp_obj_t audiobusio_i2sout_obj_get_playing(mp_obj_t self_in) {
191191
audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in);
192192
check_for_deinit(self);
@@ -201,9 +201,9 @@ const mp_obj_property_t audiobusio_i2sout_playing_obj = {
201201
(mp_obj_t)&mp_const_none_obj},
202202
};
203203

204-
//| def pause(self, ) -> Any:
205-
//| """Stops playback temporarily while remembering the position. Use `resume` to resume playback."""
206-
//| ...
204+
//|def pause(self, ) -> Any:
205+
//|"""Stops playback temporarily while remembering the position. Use `resume` to resume playback."""
206+
//|...
207207
STATIC mp_obj_t audiobusio_i2sout_obj_pause(mp_obj_t self_in) {
208208
audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in);
209209
check_for_deinit(self);
@@ -216,9 +216,9 @@ STATIC mp_obj_t audiobusio_i2sout_obj_pause(mp_obj_t self_in) {
216216
}
217217
MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_pause_obj, audiobusio_i2sout_obj_pause);
218218

219-
//| def resume(self, ) -> Any:
220-
//| """Resumes sample playback after :py:func:`pause`."""
221-
//| ...
219+
//|def resume(self, ) -> Any:
220+
//|"""Resumes sample playback after :py:func:`pause`."""
221+
//|...
222222
STATIC mp_obj_t audiobusio_i2sout_obj_resume(mp_obj_t self_in) {
223223
audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in);
224224
check_for_deinit(self);
@@ -231,9 +231,9 @@ STATIC mp_obj_t audiobusio_i2sout_obj_resume(mp_obj_t self_in) {
231231
}
232232
MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_resume_obj, audiobusio_i2sout_obj_resume);
233233

234-
//| paused: Any =
235-
//| """True when playback is paused. (read-only)"""
236-
//| ...
234+
//|paused: Any =
235+
//|"""True when playback is paused. (read-only)"""
236+
//|...
237237
STATIC mp_obj_t audiobusio_i2sout_obj_get_paused(mp_obj_t self_in) {
238238
audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in);
239239
check_for_deinit(self);

0 commit comments

Comments
 (0)