2020-06-03 18:40:05 -04:00
|
|
|
// SPDX-FileCopyrightText: Sony Semiconductor Solutions Corporation
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: MIT
|
2020-06-16 14:39:56 -04:00
|
|
|
|
|
|
|
#include "py/obj.h"
|
|
|
|
#include "py/runtime.h"
|
|
|
|
#include "py/mphal.h"
|
|
|
|
#include "shared-bindings/gnss/GNSS.h"
|
|
|
|
#include "shared-bindings/gnss/SatelliteSystem.h"
|
|
|
|
#include "shared-bindings/gnss/PositionFix.h"
|
|
|
|
#include "shared-bindings/util.h"
|
|
|
|
|
|
|
|
//| """Global Navigation Satellite System
|
|
|
|
//|
|
|
|
|
//| The `gnss` module contains classes to control the GNSS and acquire positioning information."""
|
|
|
|
STATIC const mp_rom_map_elem_t gnss_module_globals_table[] = {
|
|
|
|
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_gnss) },
|
|
|
|
{ MP_ROM_QSTR(MP_QSTR_GNSS), MP_ROM_PTR(&gnss_type) },
|
|
|
|
|
|
|
|
// Enum-like Classes.
|
|
|
|
{ MP_ROM_QSTR(MP_QSTR_SatelliteSystem), MP_ROM_PTR(&gnss_satellitesystem_type) },
|
|
|
|
{ MP_ROM_QSTR(MP_QSTR_PositionFix), MP_ROM_PTR(&gnss_positionfix_type) },
|
|
|
|
};
|
|
|
|
|
|
|
|
STATIC MP_DEFINE_CONST_DICT(gnss_module_globals, gnss_module_globals_table);
|
|
|
|
|
|
|
|
const mp_obj_module_t gnss_module = {
|
|
|
|
.base = { &mp_type_module },
|
2021-03-15 09:57:36 -04:00
|
|
|
.globals = (mp_obj_dict_t *)&gnss_module_globals,
|
2020-06-16 14:39:56 -04:00
|
|
|
};
|
Convert more modules to use MP_REGISTER_MODULE
Convert _eve, _pew, aesio, alarm, audiopwmio, bitops, camera, canio, dualbank, gnss, i2cperipheral, imagecapture, ipaddress, memorymonitor, sdioio, socketpool, ssl, uheap, ustack, watchdog, and wifi modules to use MP_REGISTER_MODULE.
Related to #5183.
2021-09-01 00:12:00 -04:00
|
|
|
|
|
|
|
MP_REGISTER_MODULE(MP_QSTR_gnss, gnss_module, CIRCUITPY_GNSS);
|