Skip to content

Commit 2adefa1

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 6e6679b + 3a8fb4e commit 2adefa1

File tree

24 files changed

+444
-10
lines changed

24 files changed

+444
-10
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@
196196
url = https://github.com/raspberrypi/rpi-firmware.git
197197
branch = master
198198
shallow = true
199+
[submodule "lib/adafruit_floppy"]
200+
path = lib/adafruit_floppy
201+
url = https://github.com/adafruit/Adafruit_Floppy
199202
[submodule "ports/stm/st_driver/cmsis_device_f4"]
200203
path = ports/stm/st_driver/cmsis_device_f4
201204
url = https://github.com/STMicroelectronics/cmsis_device_f4.git

lib/adafruit_floppy

Submodule adafruit_floppy added at e36a612

ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ CIRCUITPY_AUDIOMIXER = 0
1818
CIRCUITPY_AUDIOMP3 = 0
1919
CIRCUITPY_BLEIO_HCI = 0
2020
CIRCUITPY_DISPLAYIO = 0
21+
CIRCUITPY_FLOPPYIO = 0
2122
CIRCUITPY_FRAMEBUFFERIO = 0
2223
CIRCUITPY_GETPASS = 0
2324
CIRCUITPY_KEYPAD = 0

ports/atmel-samd/common-hal/digitalio/DigitalInOut.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,3 +187,30 @@ digitalio_pull_t common_hal_digitalio_digitalinout_get_pull(
187187
}
188188
}
189189
}
190+
191+
bool common_hal_digitalio_has_reg_op(digitalinout_reg_op_t op) {
192+
return true;
193+
}
194+
195+
volatile uint32_t *common_hal_digitalio_digitalinout_get_reg(digitalio_digitalinout_obj_t *self, digitalinout_reg_op_t op, uint32_t *mask) {
196+
const uint8_t pin = self->pin->number;
197+
int port = GPIO_PORT(pin);
198+
199+
*mask = 1u << GPIO_PIN(pin);
200+
201+
202+
switch (op) {
203+
case DIGITALINOUT_REG_READ:
204+
return (volatile uint32_t *)&PORT->Group[port].IN.reg;
205+
case DIGITALINOUT_REG_WRITE:
206+
return &PORT->Group[port].OUT.reg;
207+
case DIGITALINOUT_REG_SET:
208+
return &PORT->Group[port].OUTSET.reg;
209+
case DIGITALINOUT_REG_RESET:
210+
return &PORT->Group[port].OUTCLR.reg;
211+
case DIGITALINOUT_REG_TOGGLE:
212+
return &PORT->Group[port].OUTTGL.reg;
213+
default:
214+
return NULL;
215+
}
216+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* This file is part of the Micro Python project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2022 Jeff Epler for Adafruit Industries
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#pragma once
28+
29+
// empirical-ish from Arduino @ 120MHz
30+
#define FLOPPYIO_SAMPLERATE (14666667)

ports/atmel-samd/mpconfigport.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ CIRCUITPY_TOUCHIO_USE_NATIVE = 0
9898
CIRCUITPY_ALARM ?= 1
9999
CIRCUITPY_PS2IO ?= 1
100100
CIRCUITPY_SAMD ?= 1
101+
CIRCUITPY_FLOPPYIO ?= $(CIRCUITPY_FULL_BUILD)
101102
CIRCUITPY_FRAMEBUFFERIO ?= $(CIRCUITPY_FULL_BUILD)
102103
CIRCUITPY_RGBMATRIX ?= $(CIRCUITPY_FRAMEBUFFERIO)
103104
CIRCUITPY_WATCHDOG ?= 1
@@ -110,14 +111,15 @@ endif # samd51
110111

111112
ifeq ($(CHIP_FAMILY),same51)
112113

113-
# No native touchio on SAMD51.
114+
# No native touchio on SAME51.
114115
CIRCUITPY_TOUCHIO_USE_NATIVE = 0
115116

116117
# The ?='s allow overriding in mpconfigboard.mk.
117118

118119
CIRCUITPY_ALARM ?= 1
119120
CIRCUITPY_PS2IO ?= 1
120121
CIRCUITPY_SAMD ?= 1
122+
CIRCUITPY_FLOPPYIO ?= $(CIRCUITPY_FULL_BUILD)
121123
CIRCUITPY_FRAMEBUFFERIO ?= $(CIRCUITPY_FULL_BUILD)
122124
CIRCUITPY_RGBMATRIX ?= $(CIRCUITPY_FRAMEBUFFERIO)
123125

ports/raspberrypi/bindings/rp2pio/StateMachine.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@
7979
//| initial_sideset_pin_state: int = 0,
8080
//| initial_sideset_pin_direction: int = 0x1f,
8181
//| sideset_enable: bool = False,
82+
//| jmp_pin: Optional[microcontroller.Pin] = None,
83+
//| jmp_pin_pull: Optional[digitalio.Pull] = None,
8284
//| exclusive_pin_use: bool = True,
8385
//| auto_pull: bool = False,
8486
//| pull_threshold: int = 32,
@@ -116,6 +118,7 @@
116118
//| :param int initial_sideset_pin_direction: the initial output direction for sideset pins starting at first_sideset_pin
117119
//| :param bool sideset_enable: True when the top sideset bit is to enable. This should be used with the ".side_set # opt" directive
118120
//| :param ~microcontroller.Pin jmp_pin: the pin which determines the branch taken by JMP PIN instructions
121+
//| :param ~digitalio.Pull jmp_pin_pull: The pull value for the jmp pin, default is no pull.
119122
//| :param bool exclusive_pin_use: When True, do not share any pins with other state machines. Pins are never shared with other peripherals
120123
//| :param bool auto_pull: When True, automatically load data from the tx FIFO into the
121124
//| output shift register (OSR) when an OUT instruction shifts more than pull_threshold bits
@@ -157,7 +160,7 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n
157160
ARG_first_set_pin, ARG_set_pin_count, ARG_initial_set_pin_state, ARG_initial_set_pin_direction,
158161
ARG_first_sideset_pin, ARG_sideset_pin_count, ARG_initial_sideset_pin_state, ARG_initial_sideset_pin_direction,
159162
ARG_sideset_enable,
160-
ARG_jmp_pin,
163+
ARG_jmp_pin, ARG_jmp_pin_pull,
161164
ARG_exclusive_pin_use,
162165
ARG_auto_pull, ARG_pull_threshold, ARG_out_shift_right,
163166
ARG_wait_for_txstall,
@@ -193,6 +196,7 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n
193196
{ MP_QSTR_sideset_enable, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} },
194197

195198
{ MP_QSTR_jmp_pin, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },
199+
{ MP_QSTR_jmp_pin_pull, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },
196200

197201
{ MP_QSTR_exclusive_pin_use, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = true} },
198202
{ MP_QSTR_auto_pull, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} },
@@ -242,6 +246,7 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n
242246
}
243247

244248
const mcu_pin_obj_t *jmp_pin = validate_obj_is_pin_or_none(args[ARG_jmp_pin].u_obj);
249+
digitalio_pull_t jmp_pin_pull = validate_pull(args[ARG_jmp_pin_pull].u_rom_obj, MP_QSTR_jmp_pull);
245250

246251
mp_int_t pull_threshold = args[ARG_pull_threshold].u_int;
247252
mp_int_t push_threshold = args[ARG_push_threshold].u_int;
@@ -278,7 +283,7 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n
278283
first_set_pin, args[ARG_set_pin_count].u_int, args[ARG_initial_set_pin_state].u_int, args[ARG_initial_set_pin_direction].u_int,
279284
first_sideset_pin, args[ARG_sideset_pin_count].u_int, args[ARG_initial_sideset_pin_state].u_int, args[ARG_initial_sideset_pin_direction].u_int,
280285
args[ARG_sideset_enable].u_bool,
281-
jmp_pin,
286+
jmp_pin, jmp_pin_pull,
282287
0,
283288
args[ARG_exclusive_pin_use].u_bool,
284289
args[ARG_auto_pull].u_bool, pull_threshold, args[ARG_out_shift_right].u_bool,

ports/raspberrypi/bindings/rp2pio/StateMachine.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
#include "py/obj.h"
3131

32+
#include "shared-bindings/digitalio/Pull.h"
3233
#include "common-hal/microcontroller/Pin.h"
3334
#include "common-hal/rp2pio/StateMachine.h"
3435

@@ -45,7 +46,7 @@ void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self,
4546
const mcu_pin_obj_t *first_set_pin, uint8_t set_pin_count, uint32_t initial_set_pin_state, uint32_t initial_set_pin_direction,
4647
const mcu_pin_obj_t *first_sideset_pin, uint8_t sideset_pin_count, uint32_t initial_sideset_pin_state, uint32_t initial_sideset_pin_direction,
4748
bool sideset_enable,
48-
const mcu_pin_obj_t *jmp_pin,
49+
const mcu_pin_obj_t *jmp_pin, digitalio_pull_t jmp_pin_pull,
4950
uint32_t wait_gpio_mask,
5051
bool exclusive_pin_use,
5152
bool auto_pull, uint8_t pull_threshold, bool out_shift_right,

ports/raspberrypi/common-hal/audiobusio/I2SOut.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t *self,
128128
NULL, 0, 0, 0x1f, // set pins
129129
bit_clock, 2, 0, 0x1f, // sideset pins
130130
false, // No sideset enable
131-
NULL, // jump pin
131+
NULL, PULL_NONE, // jump pin
132132
0, // wait gpio pins
133133
true, // exclusive pin use
134134
false, 32, false, // shift out left to start with MSB

ports/raspberrypi/common-hal/audiobusio/PDMIn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t *self,
7272
NULL, 0, 0, 0x1f, // set pins
7373
clock_pin, 1, 0, 0x1f, // sideset pins
7474
false, // No sideset enable
75-
NULL, // jump pin
75+
NULL, PULL_NONE, // jump pin
7676
0, // wait gpio pins
7777
true, // exclusive pin use
7878
false, 32, false, // out settings

ports/raspberrypi/common-hal/digitalio/DigitalInOut.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,28 @@ digitalio_pull_t common_hal_digitalio_digitalinout_get_pull(
164164
}
165165
return PULL_NONE;
166166
}
167+
168+
bool common_hal_digitalio_has_reg_op(digitalinout_reg_op_t op) {
169+
return true;
170+
}
171+
172+
volatile uint32_t *common_hal_digitalio_digitalinout_get_reg(digitalio_digitalinout_obj_t *self, digitalinout_reg_op_t op, uint32_t *mask) {
173+
const uint8_t pin = self->pin->number;
174+
175+
*mask = 1u << pin;
176+
177+
switch (op) {
178+
case DIGITALINOUT_REG_READ:
179+
return (volatile uint32_t *)&sio_hw->gpio_in;
180+
case DIGITALINOUT_REG_WRITE:
181+
return &sio_hw->gpio_out;
182+
case DIGITALINOUT_REG_SET:
183+
return &sio_hw->gpio_set;
184+
case DIGITALINOUT_REG_RESET:
185+
return &sio_hw->gpio_clr;
186+
case DIGITALINOUT_REG_TOGGLE:
187+
return &sio_hw->gpio_togl;
188+
default:
189+
return NULL;
190+
}
191+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* This file is part of the Micro Python project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2022 Jeff Epler for Adafruit Industries
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#pragma once
28+
29+
// empirical-ish from RP2040 @ 125MHz for floppy_flux_readinto
30+
#define FLOPPYIO_SAMPLERATE (24000000)
31+
// empirical-ish from RP2040 @ 125MHz for floppy_mfm_readinto
32+
// my guess is these are slower because the more complex routine falls out of cache, but it's just
33+
// speculation because the loops are very similar. When looking at raw bins with a modified
34+
// version of adafruit_floppy, it can be seen that there are _two_ peaks for T2 and T3, rather
35+
// than a single one, around 36 (mostly) and 43 (rarer), compared to a single peak around 48.
36+
#define T2_5 (54)
37+
#define T3_5 (75)

ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void common_hal_imagecapture_parallelimagecapture_construct(imagecapture_paralle
112112
NULL, 0, 0, 0, // sideset pins
113113
#endif
114114
false, // No sideset enable
115-
NULL, // jump pin
115+
NULL, PULL_NONE, // jump pin
116116
(1 << vertical_sync->number) | (1 << horizontal_reference->number) | (1 << data_clock->number), // wait gpio pins
117117
true, // exclusive pin use
118118
false, 32, false, // out settings

ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ void common_hal_paralleldisplay_parallelbus_construct(paralleldisplay_parallelbu
103103
NULL, 0, 0, 0, // first set pin
104104
write, 1, 0, 1, // first sideset pin
105105
false, // No sideset enable
106-
NULL, // jump pin
106+
NULL, PULL_NONE, // jump pin
107107
0, // wait gpio pins
108108
true, // exclusive pin usage
109109
true, 8, true, // TX, auto pull every 8 bits. shift left to output msb first

ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencode
8686
NULL, 0, 0, 0x1f, // set pins
8787
NULL, 0, 0, 0x1f, // sideset pins
8888
false, // No sideset enable
89-
NULL, // jump pin
89+
NULL, PULL_NONE, // jump pin
9090
0, // wait gpio pins
9191
true, // exclusive pin use
9292
false, 32, false, // out settings

ports/raspberrypi/common-hal/rp2pio/StateMachine.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "bindings/rp2pio/StateMachine.h"
3030

3131
#include "common-hal/microcontroller/__init__.h"
32+
#include "shared-bindings/digitalio/Pull.h"
3233
#include "shared-bindings/microcontroller/__init__.h"
3334
#include "shared-bindings/microcontroller/Pin.h"
3435

@@ -383,7 +384,7 @@ void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self,
383384
const mcu_pin_obj_t *first_set_pin, uint8_t set_pin_count, uint32_t initial_set_pin_state, uint32_t initial_set_pin_direction,
384385
const mcu_pin_obj_t *first_sideset_pin, uint8_t sideset_pin_count, uint32_t initial_sideset_pin_state, uint32_t initial_sideset_pin_direction,
385386
bool sideset_enable,
386-
const mcu_pin_obj_t *jmp_pin,
387+
const mcu_pin_obj_t *jmp_pin, digitalio_pull_t jmp_pull,
387388
uint32_t wait_gpio_mask,
388389
bool exclusive_pin_use,
389390
bool auto_pull, uint8_t pull_threshold, bool out_shift_right,
@@ -531,6 +532,16 @@ void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self,
531532
// Deal with pull up/downs
532533
uint32_t pull_up = mask_and_rotate(first_in_pin, in_pin_count, pull_pin_up);
533534
uint32_t pull_down = mask_and_rotate(first_in_pin, in_pin_count, pull_pin_down);
535+
536+
if (jmp_pin) {
537+
uint32_t jmp_mask = mask_and_rotate(jmp_pin, 1, 0x1f);
538+
if (jmp_pull == PULL_UP) {
539+
pull_up |= jmp_mask;
540+
}
541+
if (jmp_pull == PULL_DOWN) {
542+
pull_up |= jmp_mask;
543+
}
544+
}
534545
if (initial_pin_direction & (pull_up | pull_down)) {
535546
mp_raise_ValueError(translate("pull masks conflict with direction masks"));
536547
}

ports/raspberrypi/mpconfigport.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CIRCUITPY_ALARM ?= 1
55

66
CIRCUITPY_RP2PIO ?= 1
77
CIRCUITPY_NEOPIXEL_WRITE ?= $(CIRCUITPY_RP2PIO)
8+
CIRCUITPY_FLOPPYIO ?= 1
89
CIRCUITPY_FRAMEBUFFERIO ?= $(CIRCUITPY_DISPLAYIO)
910
CIRCUITPY_FULL_BUILD ?= 1
1011
CIRCUITPY_AUDIOMP3 ?= 1

py/circuitpy_defns.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ endif
164164
ifeq ($(CIRCUITPY_VECTORIO),1)
165165
SRC_PATTERNS += vectorio/%
166166
endif
167+
ifeq ($(CIRCUITPY_FLOPPYIO),1)
168+
SRC_PATTERNS += floppyio/%
169+
endif
167170
ifeq ($(CIRCUITPY_FRAMEBUFFERIO),1)
168171
SRC_PATTERNS += framebufferio/%
169172
endif
@@ -545,6 +548,7 @@ SRC_SHARED_MODULE_ALL = \
545548
displayio/TileGrid.c \
546549
displayio/area.c \
547550
displayio/__init__.c \
551+
floppyio/__init__.c \
548552
fontio/BuiltinFont.c \
549553
fontio/__init__.c \
550554
framebufferio/FramebufferDisplay.c \

py/circuitpy_mpconfig.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ CFLAGS += -DCIRCUITPY_ESPIDF=$(CIRCUITPY_ESPIDF)
213213
CIRCUITPY__EVE ?= 0
214214
CFLAGS += -DCIRCUITPY__EVE=$(CIRCUITPY__EVE)
215215

216+
CIRCUITPY_FLOPPYIO ?= 0
217+
CFLAGS += -DCIRCUITPY_FLOPPYIO=$(CIRCUITPY_FLOPPYIO)
218+
216219
CIRCUITPY_FREQUENCYIO ?= $(CIRCUITPY_FULL_BUILD)
217220
CFLAGS += -DCIRCUITPY_FREQUENCYIO=$(CIRCUITPY_FREQUENCYIO)
218221

shared-bindings/digitalio/DigitalInOut.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ typedef enum {
4141
DIGITALINOUT_INPUT_ONLY
4242
} digitalinout_result_t;
4343

44+
typedef enum {
45+
DIGITALINOUT_REG_READ,
46+
DIGITALINOUT_REG_WRITE,
47+
DIGITALINOUT_REG_SET,
48+
DIGITALINOUT_REG_RESET,
49+
DIGITALINOUT_REG_TOGGLE,
50+
} digitalinout_reg_op_t;
51+
4452
digitalinout_result_t common_hal_digitalio_digitalinout_construct(digitalio_digitalinout_obj_t *self, const mcu_pin_obj_t *pin);
4553
void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self);
4654
bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self);
@@ -56,4 +64,7 @@ digitalio_pull_t common_hal_digitalio_digitalinout_get_pull(digitalio_digitalino
5664
void common_hal_digitalio_digitalinout_never_reset(digitalio_digitalinout_obj_t *self);
5765
digitalio_digitalinout_obj_t *assert_digitalinout(mp_obj_t obj);
5866

67+
volatile uint32_t *common_hal_digitalio_digitalinout_get_reg(digitalio_digitalinout_obj_t *self, digitalinout_reg_op_t op, uint32_t *mask);
68+
bool common_hal_digitalio_has_reg_op(digitalinout_reg_op_t op);
69+
5970
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_DIGITALIO_DIGITALINOUT_H

0 commit comments

Comments
 (0)