summaryrefslogtreecommitdiff
path: root/extmod
diff options
context:
space:
mode:
Diffstat (limited to 'extmod')
-rw-r--r--extmod/machine_bitstream.c2
-rw-r--r--extmod/machine_bitstream.h37
-rw-r--r--extmod/machine_pinbase.c3
-rw-r--r--extmod/machine_pinbase.h33
-rw-r--r--extmod/machine_pulse.c2
-rw-r--r--extmod/machine_pulse.h36
-rw-r--r--extmod/machine_signal.c3
-rw-r--r--extmod/machine_signal.h33
-rw-r--r--extmod/modmachine.h9
9 files changed, 13 insertions, 145 deletions
diff --git a/extmod/machine_bitstream.c b/extmod/machine_bitstream.c
index 30f1ff1ea..af093a4b5 100644
--- a/extmod/machine_bitstream.c
+++ b/extmod/machine_bitstream.c
@@ -27,7 +27,7 @@
#include "py/runtime.h"
#include "py/mphal.h"
-#include "extmod/machine_bitstream.h"
+#include "extmod/modmachine.h"
#if MICROPY_PY_MACHINE_BITSTREAM
diff --git a/extmod/machine_bitstream.h b/extmod/machine_bitstream.h
deleted file mode 100644
index 2e759aedd..000000000
--- a/extmod/machine_bitstream.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * This file is part of the MicroPython project, http://micropython.org/
- *
- * The MIT License (MIT)
- *
- * Copyright (c) 2021 Jim Mussared
- * Copyright (c) 2021 Damien P. George
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_BITSTREAM_H
-#define MICROPY_INCLUDED_EXTMOD_MACHINE_BITSTREAM_H
-
-#include "py/obj.h"
-#include "py/mphal.h"
-
-void machine_bitstream_high_low(mp_hal_pin_obj_t pin, uint32_t *timing_ns, const uint8_t *buf, size_t len);
-
-MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(machine_bitstream_obj);
-
-#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_BITSTREAM_H
diff --git a/extmod/machine_pinbase.c b/extmod/machine_pinbase.c
index 8607e6ed3..90c17d7ab 100644
--- a/extmod/machine_pinbase.c
+++ b/extmod/machine_pinbase.c
@@ -27,10 +27,9 @@
#include "py/mpconfig.h"
#if MICROPY_PY_MACHINE
-#include "py/obj.h"
#include "py/runtime.h"
+#include "extmod/modmachine.h"
#include "extmod/virtpin.h"
-#include "extmod/machine_pinbase.h"
// PinBase class
diff --git a/extmod/machine_pinbase.h b/extmod/machine_pinbase.h
deleted file mode 100644
index c96abbc46..000000000
--- a/extmod/machine_pinbase.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * This file is part of the MicroPython project, http://micropython.org/
- *
- * The MIT License (MIT)
- *
- * Copyright (c) 2016 Paul Sokolovsky
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_PINBASE_H
-#define MICROPY_INCLUDED_EXTMOD_MACHINE_PINBASE_H
-
-#include "py/obj.h"
-
-extern const mp_obj_type_t machine_pinbase_type;
-
-#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_PINBASE_H
diff --git a/extmod/machine_pulse.c b/extmod/machine_pulse.c
index 7178b22d7..157566d98 100644
--- a/extmod/machine_pulse.c
+++ b/extmod/machine_pulse.c
@@ -26,7 +26,7 @@
#include "py/runtime.h"
#include "py/mperrno.h"
-#include "extmod/machine_pulse.h"
+#include "extmod/modmachine.h"
#if MICROPY_PY_MACHINE_PULSE
diff --git a/extmod/machine_pulse.h b/extmod/machine_pulse.h
deleted file mode 100644
index e303dca02..000000000
--- a/extmod/machine_pulse.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * This file is part of the MicroPython project, http://micropython.org/
- *
- * The MIT License (MIT)
- *
- * Copyright (c) 2016 Damien P. George
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_PULSE_H
-#define MICROPY_INCLUDED_EXTMOD_MACHINE_PULSE_H
-
-#include "py/obj.h"
-#include "py/mphal.h"
-
-mp_uint_t machine_time_pulse_us(mp_hal_pin_obj_t pin, int pulse_level, mp_uint_t timeout_us);
-
-MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(machine_time_pulse_us_obj);
-
-#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_PULSE_H
diff --git a/extmod/machine_signal.c b/extmod/machine_signal.c
index 7922ed707..63fd0fe47 100644
--- a/extmod/machine_signal.c
+++ b/extmod/machine_signal.c
@@ -29,10 +29,9 @@
#include <string.h>
-#include "py/obj.h"
#include "py/runtime.h"
+#include "extmod/modmachine.h"
#include "extmod/virtpin.h"
-#include "extmod/machine_signal.h"
// Signal class
diff --git a/extmod/machine_signal.h b/extmod/machine_signal.h
deleted file mode 100644
index df1c3e2e9..000000000
--- a/extmod/machine_signal.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * This file is part of the MicroPython project, http://micropython.org/
- *
- * The MIT License (MIT)
- *
- * Copyright (c) 2017 Paul Sokolovsky
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_SIGNAL_H
-#define MICROPY_INCLUDED_EXTMOD_MACHINE_SIGNAL_H
-
-#include "py/obj.h"
-
-extern const mp_obj_type_t machine_signal_type;
-
-#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_SIGNAL_H
diff --git a/extmod/modmachine.h b/extmod/modmachine.h
index 2a7ce336e..4ef2bb3ad 100644
--- a/extmod/modmachine.h
+++ b/extmod/modmachine.h
@@ -27,6 +27,7 @@
#ifndef MICROPY_INCLUDED_EXTMOD_MODMACHINE_H
#define MICROPY_INCLUDED_EXTMOD_MODMACHINE_H
+#include "py/mphal.h"
#include "py/obj.h"
// Whether to enable the ADC.init() method.
@@ -97,11 +98,19 @@ extern const mp_obj_type_t machine_adc_type;
extern const mp_obj_type_t machine_i2c_type;
extern const mp_obj_type_t machine_i2s_type;
extern const mp_obj_type_t machine_pin_type;
+extern const mp_obj_type_t machine_pinbase_type;
extern const mp_obj_type_t machine_pwm_type;
extern const mp_obj_type_t machine_rtc_type;
+extern const mp_obj_type_t machine_signal_type;
extern const mp_obj_type_t machine_spi_type;
extern const mp_obj_type_t machine_timer_type;
extern const mp_obj_type_t machine_uart_type;
extern const mp_obj_type_t machine_wdt_type;
+void machine_bitstream_high_low(mp_hal_pin_obj_t pin, uint32_t *timing_ns, const uint8_t *buf, size_t len);
+mp_uint_t machine_time_pulse_us(mp_hal_pin_obj_t pin, int pulse_level, mp_uint_t timeout_us);
+
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(machine_bitstream_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(machine_time_pulse_us_obj);
+
#endif // MICROPY_INCLUDED_EXTMOD_MODMACHINE_H