summaryrefslogtreecommitdiff
path: root/shared-bindings
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2019-04-17 10:22:24 -0400
committerGitHub <noreply@github.com>2019-04-17 10:22:24 -0400
commit6684a3c72370772f0ab503d3410005ab7fd9d450 (patch)
treedd3fae8e55043de564d14e206154ae13fed4b49d /shared-bindings
parent608bf5076b7cd1564a634d7341f1444698907170 (diff)
parent2fa1bf4351dc93c76635482f94ab72beef1bfaf1 (diff)
Merge pull request #1778 from pewpew-game/gamepad-shift
Add GamePadShift for handling shift-register-based buttons
Diffstat (limited to 'shared-bindings')
-rw-r--r--shared-bindings/digitalio/DigitalInOut.c11
-rw-r--r--shared-bindings/digitalio/DigitalInOut.h1
-rw-r--r--shared-bindings/gamepad/GamePad.c38
-rw-r--r--shared-bindings/gamepad/GamePad.h5
-rw-r--r--shared-bindings/gamepad/__init__.c4
-rw-r--r--shared-bindings/gamepad/__init__.h31
-rw-r--r--shared-bindings/gamepadshift/GamePadShift.c123
-rw-r--r--shared-bindings/gamepadshift/GamePadShift.h42
-rw-r--r--shared-bindings/gamepadshift/__init__.c54
-rw-r--r--shared-bindings/gamepadshift/__init__.h31
10 files changed, 317 insertions, 23 deletions
diff --git a/shared-bindings/digitalio/DigitalInOut.c b/shared-bindings/digitalio/DigitalInOut.c
index 2fcbefe11..1ced15137 100644
--- a/shared-bindings/digitalio/DigitalInOut.c
+++ b/shared-bindings/digitalio/DigitalInOut.c
@@ -374,3 +374,14 @@ const mp_obj_type_t digitalio_digitalinout_type = {
.make_new = digitalio_digitalinout_make_new,
.locals_dict = (mp_obj_t)&digitalio_digitalinout_locals_dict,
};
+
+// Helper for validating digitalio.DigitalInOut arguments
+digitalio_digitalinout_obj_t *assert_digitalinout(mp_obj_t obj) {
+ if (!MP_OBJ_IS_TYPE(obj, &digitalio_digitalinout_type)) {
+ mp_raise_TypeError(translate("argument num/types mismatch"));
+ }
+ digitalio_digitalinout_obj_t *pin = MP_OBJ_TO_PTR(obj);
+ raise_error_if_deinited(
+ common_hal_digitalio_digitalinout_deinited(pin));
+ return pin;
+}
diff --git a/shared-bindings/digitalio/DigitalInOut.h b/shared-bindings/digitalio/DigitalInOut.h
index 037979098..eee0d5801 100644
--- a/shared-bindings/digitalio/DigitalInOut.h
+++ b/shared-bindings/digitalio/DigitalInOut.h
@@ -53,5 +53,6 @@ digitalio_drive_mode_t common_hal_digitalio_digitalinout_get_drive_mode(digitali
void common_hal_digitalio_digitalinout_set_pull(digitalio_digitalinout_obj_t* self, digitalio_pull_t pull);
digitalio_pull_t common_hal_digitalio_digitalinout_get_pull(digitalio_digitalinout_obj_t* self);
void common_hal_digitalio_digitalinout_never_reset(digitalio_digitalinout_obj_t *self);
+digitalio_digitalinout_obj_t *assert_digitalinout(mp_obj_t obj);
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_DIGITALIO_DIGITALINOUT_H
diff --git a/shared-bindings/gamepad/GamePad.c b/shared-bindings/gamepad/GamePad.c
index 4458c972f..c342cbbf9 100644
--- a/shared-bindings/gamepad/GamePad.c
+++ b/shared-bindings/gamepad/GamePad.c
@@ -23,17 +23,16 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+#include "shared-bindings/gamepad/GamePad.h"
+
#include "py/obj.h"
#include "py/runtime.h"
#include "py/mphal.h"
#include "py/gc.h"
#include "py/mpstate.h"
-#include "shared-module/gamepad/__init__.h"
-#include "shared-module/gamepad/GamePad.h"
+#include "shared-bindings/gamepad/__init__.h"
#include "shared-bindings/digitalio/DigitalInOut.h"
-#include "shared-bindings/util.h"
#include "supervisor/shared/translate.h"
-#include "GamePad.h"
//| .. currentmodule:: gamepad
@@ -96,27 +95,24 @@
//|
STATIC mp_obj_t gamepad_make_new(const mp_obj_type_t *type, size_t n_args,
const mp_obj_t *args, mp_map_t *kw_args) {
- if (n_args > 8) {
- mp_raise_TypeError(translate("too many arguments"));
+ if (n_args > 8 || n_args == 0) {
+ mp_raise_TypeError(translate("argument num/types mismatch"));
}
for (size_t i = 0; i < n_args; ++i) {
- if (!MP_OBJ_IS_TYPE(args[i], &digitalio_digitalinout_type)) {
- mp_raise_TypeError(translate("expected a DigitalInOut"));
- }
- digitalio_digitalinout_obj_t *pin = MP_OBJ_TO_PTR(args[i]);
- raise_error_if_deinited(
- common_hal_digitalio_digitalinout_deinited(pin));
+ assert_digitalinout(args[i]);
}
- if (!MP_STATE_VM(gamepad_singleton)) {
- gamepad_obj_t* gamepad_singleton = m_new_obj(gamepad_obj_t);
+ gamepad_obj_t* gamepad_singleton = MP_STATE_VM(gamepad_singleton);
+ if (!gamepad_singleton ||
+ !MP_OBJ_IS_TYPE(MP_OBJ_FROM_PTR(gamepad_singleton), &gamepad_type)) {
+ gamepad_singleton = m_new_obj(gamepad_obj_t);
gamepad_singleton->base.type = &gamepad_type;
- MP_STATE_VM(gamepad_singleton) = gc_make_long_lived(gamepad_singleton);
+ gamepad_singleton = gc_make_long_lived(gamepad_singleton);
+ MP_STATE_VM(gamepad_singleton) = gamepad_singleton;
}
- gamepad_init(n_args, args);
- return MP_OBJ_FROM_PTR(MP_STATE_VM(gamepad_singleton));
+ common_hal_gamepad_gamepad_init(gamepad_singleton, args, n_args);
+ return MP_OBJ_FROM_PTR(gamepad_singleton);
}
-
//| .. method:: get_pressed()
//|
//| Get the status of buttons pressed since the last call and clear it.
@@ -129,9 +125,9 @@ STATIC mp_obj_t gamepad_make_new(const mp_obj_type_t *type, size_t n_args,
//|
STATIC mp_obj_t gamepad_get_pressed(mp_obj_t self_in) {
gamepad_obj_t* gamepad_singleton = MP_STATE_VM(gamepad_singleton);
- mp_obj_t gamepad = MP_OBJ_NEW_SMALL_INT(gamepad_singleton->pressed);
+ mp_obj_t pressed = MP_OBJ_NEW_SMALL_INT(gamepad_singleton->pressed);
gamepad_singleton->pressed = 0;
- return gamepad;
+ return pressed;
}
MP_DEFINE_CONST_FUN_OBJ_1(gamepad_get_pressed_obj, gamepad_get_pressed);
@@ -141,7 +137,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(gamepad_get_pressed_obj, gamepad_get_pressed);
//| Disable button scanning.
//|
STATIC mp_obj_t gamepad_deinit(mp_obj_t self_in) {
- gamepad_reset();
+ common_hal_gamepad_gamepad_deinit(self_in);
return mp_const_none;
}
MP_DEFINE_CONST_FUN_OBJ_1(gamepad_deinit_obj, gamepad_deinit);
diff --git a/shared-bindings/gamepad/GamePad.h b/shared-bindings/gamepad/GamePad.h
index 172c95ace..3bbad4c97 100644
--- a/shared-bindings/gamepad/GamePad.h
+++ b/shared-bindings/gamepad/GamePad.h
@@ -28,6 +28,11 @@
#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPAD_GAMEPAD_H
#define MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPAD_GAMEPAD_H
+#include "shared-module/gamepad/GamePad.h"
+
extern const mp_obj_type_t gamepad_type;
+void common_hal_gamepad_gamepad_init(gamepad_obj_t *gamepad, const mp_obj_t pins[], size_t n_pins);
+void common_hal_gamepad_gamepad_deinit(gamepad_obj_t *gamepad);
+
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPAD_GAMEPAD_H
diff --git a/shared-bindings/gamepad/__init__.c b/shared-bindings/gamepad/__init__.c
index 0c99d0d52..cea0b4ee9 100644
--- a/shared-bindings/gamepad/__init__.c
+++ b/shared-bindings/gamepad/__init__.c
@@ -26,8 +26,8 @@
#include "py/obj.h"
#include "py/runtime.h"
#include "py/mphal.h"
-#include "GamePad.h"
-
+#include "shared-bindings/gamepad/GamePad.h"
+#include "shared-bindings/util.h"
//| :mod:`gamepad` --- Button handling
//| ==================================
diff --git a/shared-bindings/gamepad/__init__.h b/shared-bindings/gamepad/__init__.h
new file mode 100644
index 000000000..2ae5efb3a
--- /dev/null
+++ b/shared-bindings/gamepad/__init__.h
@@ -0,0 +1,31 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2016 Radomir Dopieralski for Adafruit Industries
+ *
+ * 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_SHARED_BINDINGS_GAMEPAD___INIT___H
+#define MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPAD___INIT___H
+
+#endif // MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPAD___INIT___H
diff --git a/shared-bindings/gamepadshift/GamePadShift.c b/shared-bindings/gamepadshift/GamePadShift.c
new file mode 100644
index 000000000..d6f365388
--- /dev/null
+++ b/shared-bindings/gamepadshift/GamePadShift.c
@@ -0,0 +1,123 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2016 Radomir Dopieralski for Adafruit Industries
+ *
+ * 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.
+ */
+#include "py/obj.h"
+#include "py/runtime.h"
+#include "py/mphal.h"
+#include "py/gc.h"
+#include "py/mpstate.h"
+#include "shared-bindings/gamepadshift/GamePadShift.h"
+#include "shared-bindings/gamepadshift/__init__.h"
+#include "supervisor/shared/translate.h"
+
+//| .. currentmodule:: gamepadshift
+//|
+//| :class:`GamePadShift` -- Scan buttons for presses through a shift register
+//| ===========================================================================
+//|
+//| .. class:: GamePadShift(clock, data, latch)
+//|
+//| Initializes button scanning routines.
+//|
+//| The ``clock``, ``data`` and ``latch`` parameters are ``DigitalInOut``
+//| objects connected to the shift register controlling the buttons.
+//|
+//| They button presses are accumulated, until the ``get_pressed`` method
+//| is called, at which point the button state is cleared, and the new
+//| button presses start to be recorded.
+//|
+//| Only one gamepad (`gamepad.GamePad` or `gamepadshift.GamePadShift`)
+//| may be used at a time.
+//|
+STATIC mp_obj_t gamepadshift_make_new(const mp_obj_type_t *type, size_t n_args,
+ const mp_obj_t *pos_args, mp_map_t *kw_args) {
+
+ enum { ARG_clock, ARG_data, ARG_latch };
+ static const mp_arg_t allowed_args[] = {
+ { MP_QSTR_clock, MP_ARG_REQUIRED | MP_ARG_OBJ},
+ { MP_QSTR_data, MP_ARG_REQUIRED | MP_ARG_OBJ },
+ { MP_QSTR_latch, MP_ARG_REQUIRED | MP_ARG_OBJ},
+ };
+ mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
+ mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args),
+ allowed_args, args);
+
+ digitalio_digitalinout_obj_t *clock_pin = assert_digitalinout(args[ARG_clock].u_obj);
+ digitalio_digitalinout_obj_t *data_pin = assert_digitalinout(args[ARG_data].u_obj);
+ digitalio_digitalinout_obj_t *latch_pin = assert_digitalinout(args[ARG_latch].u_obj);
+
+ gamepadshift_obj_t* gamepad_singleton = MP_STATE_VM(gamepad_singleton);
+ if (!gamepad_singleton ||
+ !MP_OBJ_IS_TYPE(MP_OBJ_FROM_PTR(gamepad_singleton),
+ &gamepadshift_type)) {
+ gamepad_singleton = m_new_obj(gamepadshift_obj_t);
+ gamepad_singleton->base.type = &gamepadshift_type;
+ gamepad_singleton = gc_make_long_lived(gamepad_singleton);
+ MP_STATE_VM(gamepad_singleton) = gamepad_singleton;
+ }
+ common_hal_gamepadshift_gamepadshift_init(gamepad_singleton, clock_pin, data_pin, latch_pin);
+ return MP_OBJ_FROM_PTR(gamepad_singleton);
+}
+
+//| .. method:: get_pressed()
+//|
+//| Get the status of buttons pressed since the last call and clear it.
+//|
+//| Returns an 8-bit number, with bits that correspond to buttons,
+//| which have been pressed (or held down) since the last call to this
+//| function set to 1, and the remaining bits set to 0. Then it clears
+//| the button state, so that new button presses (or buttons that are
+//| held down) can be recorded for the next call.
+//|
+STATIC mp_obj_t gamepadshift_get_pressed(mp_obj_t self_in) {
+ gamepadshift_obj_t* gamepad_singleton = MP_STATE_VM(gamepad_singleton);
+ mp_obj_t pressed = MP_OBJ_NEW_SMALL_INT(gamepad_singleton->pressed);
+ gamepad_singleton->pressed = 0;
+ return pressed;
+}
+MP_DEFINE_CONST_FUN_OBJ_1(gamepadshift_get_pressed_obj, gamepadshift_get_pressed);
+
+//| .. method:: deinit()
+//|
+//| Disable button scanning.
+//|
+STATIC mp_obj_t gamepadshift_deinit(mp_obj_t self_in) {
+ common_hal_gamepadshift_gamepadshift_deinit(self_in);
+ return mp_const_none;
+}
+MP_DEFINE_CONST_FUN_OBJ_1(gamepadshift_deinit_obj, gamepadshift_deinit);
+
+
+STATIC const mp_rom_map_elem_t gamepadshift_locals_dict_table[] = {
+ { MP_OBJ_NEW_QSTR(MP_QSTR_get_pressed), MP_ROM_PTR(&gamepadshift_get_pressed_obj)},
+ { MP_OBJ_NEW_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&gamepadshift_deinit_obj)},
+};
+STATIC MP_DEFINE_CONST_DICT(gamepadshift_locals_dict, gamepadshift_locals_dict_table);
+const mp_obj_type_t gamepadshift_type = {
+ { &mp_type_type },
+ .name = MP_QSTR_GamePadShift,
+ .make_new = gamepadshift_make_new,
+ .locals_dict = (mp_obj_dict_t*)&gamepadshift_locals_dict,
+};
diff --git a/shared-bindings/gamepadshift/GamePadShift.h b/shared-bindings/gamepadshift/GamePadShift.h
new file mode 100644
index 000000000..3e8ea9693
--- /dev/null
+++ b/shared-bindings/gamepadshift/GamePadShift.h
@@ -0,0 +1,42 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2016 Radomir Dopieralski for Adafruit Industries
+ *
+ * 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_SHARED_BINDINGS_GAMEPADSHIFT_GAMEPADSHIFT_H
+#define MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPADSHIFT_GAMEPADSHIFT_H
+
+#include "shared-module/gamepadshift/GamePadShift.h"
+
+extern const mp_obj_type_t gamepadshift_type;
+
+void common_hal_gamepadshift_gamepadshift_init(gamepadshift_obj_t *gamepadshift,
+ digitalio_digitalinout_obj_t *clock_pin,
+ digitalio_digitalinout_obj_t *data_pin,
+ digitalio_digitalinout_obj_t *latch_pin);
+
+void common_hal_gamepadshift_gamepadshift_deinit(gamepadshift_obj_t *gamepadshift);
+
+#endif // MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPADSHIFT_GAMEPADSHIFT_H
diff --git a/shared-bindings/gamepadshift/__init__.c b/shared-bindings/gamepadshift/__init__.c
new file mode 100644
index 000000000..2d3667726
--- /dev/null
+++ b/shared-bindings/gamepadshift/__init__.c
@@ -0,0 +1,54 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2016 Radomir Dopieralski for Adafruit Industries
+ *
+ * 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.
+ */
+#include "py/obj.h"
+#include "py/runtime.h"
+#include "py/mphal.h"
+#include "shared-bindings/gamepadshift/GamePadShift.h"
+#include "shared-bindings/digitalio/DigitalInOut.h"
+#include "shared-bindings/util.h"
+
+//| :mod:`gamepadshift` --- Tracks button presses read through a shift register
+//| ===========================================================================
+//|
+//| .. module:: gamepadshift
+//| :synopsis: Tracks button presses read through a shift register
+//| :platform: SAMD21, SAMD51
+//|
+//| .. toctree::
+//| :maxdepth: 3
+//|
+//| GamePadShift
+//|
+STATIC const mp_rom_map_elem_t gamepadshift_module_globals_table[] = {
+ { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_gamepadshift) },
+ { MP_OBJ_NEW_QSTR(MP_QSTR_GamePadShift), MP_ROM_PTR(&gamepadshift_type)},
+};
+STATIC MP_DEFINE_CONST_DICT(gamepadshift_module_globals, gamepadshift_module_globals_table);
+
+const mp_obj_module_t gamepadshift_module = {
+ .base = { &mp_type_module },
+ .globals = (mp_obj_dict_t*)&gamepadshift_module_globals,
+};
diff --git a/shared-bindings/gamepadshift/__init__.h b/shared-bindings/gamepadshift/__init__.h
new file mode 100644
index 000000000..4b4be756a
--- /dev/null
+++ b/shared-bindings/gamepadshift/__init__.h
@@ -0,0 +1,31 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2016 Radomir Dopieralski for Adafruit Industries
+ *
+ * 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_SHARED_BINDINGS_GAMEPADSHIFT___INIT___H
+#define MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPADSHIFT___INIT___H
+
+#endif // MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPADSHIFT___INIT___H