Moved I2CDevice and SPI to match python library

This commit is contained in:
gamblor21 2020-11-03 17:30:33 -06:00
parent 8bbbb2833a
commit 197539bd82
1 changed files with 23 additions and 3 deletions

View File

@ -35,6 +35,27 @@
#include "shared-bindings/busdevice/I2CDevice.h"
#include "shared-bindings/busdevice/SPIDevice.h"
STATIC const mp_rom_map_elem_t busdevice_i2c_device_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_i2c_device) },
{ MP_ROM_QSTR(MP_QSTR_I2CDevice), MP_ROM_PTR(&busdevice_i2cdevice_type) },
};
STATIC MP_DEFINE_CONST_DICT(busdevice_i2c_device_globals, busdevice_i2c_device_globals_table);
const mp_obj_module_t busdevice_i2c_device_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t*)&busdevice_i2c_device_globals,
};
STATIC const mp_rom_map_elem_t busdevice_spi_device_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_spi_device) },
{ MP_ROM_QSTR(MP_QSTR_SPIDevice), MP_ROM_PTR(&busdevice_spidevice_type) },
};
STATIC MP_DEFINE_CONST_DICT(busdevice_spi_device_globals, busdevice_spi_device_globals_table);
const mp_obj_module_t busdevice_spi_device_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t*)&busdevice_spi_device_globals,
};
//| """Hardware accelerated external bus access
//|
@ -43,11 +64,10 @@
//| devices, it manages the chip select and protocol changes such as mode. For I2C, it
//| manages the device address."""
//|
STATIC const mp_rom_map_elem_t busdevice_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_busdevice) },
{ MP_ROM_QSTR(MP_QSTR_I2CDevice), MP_ROM_PTR(&busdevice_i2cdevice_type) },
{ MP_ROM_QSTR(MP_QSTR_SPIDevice), MP_ROM_PTR(&busdevice_spidevice_type) },
{ MP_ROM_QSTR(MP_QSTR_i2c_device), MP_ROM_PTR(&busdevice_i2c_device_module) },
{ MP_ROM_QSTR(MP_QSTR_spi_device), MP_ROM_PTR(&busdevice_spi_device_module) },
};
STATIC MP_DEFINE_CONST_DICT(busdevice_module_globals, busdevice_module_globals_table);