samd/modmachine: Enable SoftSPI and SoftI2C.

This commit is contained in:
robert-hh 2022-06-04 21:26:45 +02:00 committed by Damien George
parent e8615f5813
commit 4013577af2
3 changed files with 7 additions and 0 deletions

View file

@ -110,6 +110,7 @@ SRC_C = \
lib/tinyusb/src/device/usbd_control.c \
lib/tinyusb/src/portable/microchip/samd/dcd_samd.c \
lib/tinyusb/src/tusb.c \
drivers/bus/softspi.c \
shared/libc/printf.c \
shared/libc/string0.c \
shared/readline/readline.c \

View file

@ -28,6 +28,8 @@
#include "extmod/machine_mem.h"
#include "samd_soc.h"
#include "modmachine.h"
#include "extmod/machine_i2c.h"
#include "extmod/machine_spi.h"
// ASF 4
#include "hal_flash.h"
@ -129,6 +131,8 @@ STATIC const mp_rom_map_elem_t machine_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_unique_id), MP_ROM_PTR(&machine_unique_id_obj) },
{ MP_ROM_QSTR(MP_QSTR_Pin), MP_ROM_PTR(&machine_pin_type) },
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&machine_led_type) },
{ MP_ROM_QSTR(MP_QSTR_SoftI2C), MP_ROM_PTR(&mp_machine_soft_i2c_type) },
{ MP_ROM_QSTR(MP_QSTR_SoftSPI), MP_ROM_PTR(&mp_machine_soft_spi_type) },
};
STATIC MP_DEFINE_CONST_DICT(machine_module_globals, machine_module_globals_table);

View file

@ -97,6 +97,8 @@
#define MICROPY_PY_URANDOM (1)
#define MICROPY_PY_UZLIB (1)
#define MICROPY_PY_UASYNCIO (1)
#define MICROPY_PY_MACHINE_SOFTI2C (1)
#define MICROPY_PY_MACHINE_SOFTSPI (1)
#define MP_STATE_PORT MP_STATE_VM