summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266/modmachinespi.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-09-04 20:33:11 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-09-04 20:33:11 +0300
commitdba40afa706a1ac4b102dceba217844dc1540ce7 (patch)
tree5f423c2d7a4a1c3245a8d0654d26f61babd5238e /esp8266/modmachinespi.c
parent7ddd1a58f6ec90a35e2ca815f62358acfb801c52 (diff)
downloadmicropython-dba40afa706a1ac4b102dceba217844dc1540ce7.tar.gz
micropython-dba40afa706a1ac4b102dceba217844dc1540ce7.zip
esp8266/modmachine: Simplify SPI class implementation multiplexing.
modpybhspi now does the needed multiplexing, calling out to modpybspi (bitbanging SPI) for suitable peripheral ID's. modmachinespi (previous multiplexer class) thus not needed and removed. modpybhspi also updated to following standard SPI peripheral naming: SPI0 is used for FlashROM and thus not supported so far. SPI1 is available for users, and thus needs to be instantiated as: spi = machine.SPI(1, ...)
Diffstat (limited to 'esp8266/modmachinespi.c')
-rw-r--r--esp8266/modmachinespi.c71
1 files changed, 0 insertions, 71 deletions
diff --git a/esp8266/modmachinespi.c b/esp8266/modmachinespi.c
deleted file mode 100644
index 1c6a373698..0000000000
--- a/esp8266/modmachinespi.c
+++ /dev/null
@@ -1,71 +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.
- */
-
-#include <stdio.h>
-#include <stdint.h>
-#include <string.h>
-
-#include "ets_sys.h"
-#include "etshal.h"
-#include "ets_alt_task.h"
-
-#include "py/runtime.h"
-#include "py/stream.h"
-#include "py/mphal.h"
-
-
-mp_obj_t pyb_spi_make_new(const mp_obj_type_t *type, size_t n_args,
- size_t n_kw, const mp_obj_t *args);
-mp_obj_t pyb_hspi_make_new(const mp_obj_type_t *type, size_t n_args,
- size_t n_kw, const mp_obj_t *args);
-
-
-STATIC mp_obj_t machine_spi_make_new(const mp_obj_type_t *type, size_t n_args,
- size_t n_kw, const mp_obj_t *args) {
- mp_arg_check_num(n_args, n_kw, 1, MP_OBJ_FUN_ARGS_MAX, true);
- switch (mp_obj_get_int(args[0])) {
- case -1:
- return pyb_spi_make_new(type, n_args - 1, n_kw, args + 1);
- case 0:
- return pyb_hspi_make_new(type, n_args - 1, n_kw, args + 1);
- default:
- nlr_raise(mp_obj_new_exception_msg_varg(
- &mp_type_ValueError, "no such SPI peripheral"));
- }
-}
-
-
-STATIC const mp_rom_map_elem_t machine_spi_locals_dict_table[] = {};
-
-STATIC MP_DEFINE_CONST_DICT(machine_spi_locals_dict,
- machine_spi_locals_dict_table);
-
-const mp_obj_type_t machine_spi_type = {
- { &mp_type_type },
- .name = MP_QSTR_SPI,
- .make_new = machine_spi_make_new,
- .locals_dict = (mp_obj_dict_t*)&machine_spi_locals_dict,
-};