diff --git a/LICENSE.md b/LICENSE.md index 461fc2f..8df1491 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -11,13 +11,14 @@ All the sources related to **MicroPython** are under **MIT** license. All the sources created/modified by the repository owner are released under **MIT** license and contains the following copyright notice:
*Copyright (c) 2018 LoBo (https://github.com/loboris)* -Most of the source files contains license and copyright notice, please check the individual files for more information. +Most of the source files contains license and copyright notice, please check the individual files for more information.
+Also check the license information in individual components directories. --- The only exception to the MIT/Apache licensing is the **quickmail** library (*MicroPython_BUILD/components/quickmail*) which is licensed under **GNU GPL** v3.0+ license. -In case you don't want to use GPL licensed code, thit library (it's directory) can be **removed** (deleted) from the repository clone/fork, leaving the project only **MIT/Apache** licensed. +In case you don't want to use GPL licensed code, the library (it's directory) can be **removed** (deleted) from the repository clone/fork, leaving the project only **MIT/Apache** licensed. To build the project without quickmail support disable
`→ MicroPython → Modules → MAIL support in Curl module` in **menuconfig** diff --git a/MicroPython_BUILD/components/micropython/component.mk b/MicroPython_BUILD/components/micropython/component.mk index 4f44f29..9881fbb 100644 --- a/MicroPython_BUILD/components/micropython/component.mk +++ b/MicroPython_BUILD/components/micropython/component.mk @@ -258,7 +258,6 @@ LIBS_SRC_C = $(addprefix esp32/libs/,\ ifdef CONFIG_MICROPY_USE_DISPLAY LIBS_SRC_C += \ - esp32/libs/tft/spi_master_lobo.c \ esp32/libs/tft/tftspi.c \ esp32/libs/tft/tft.c \ esp32/libs/tft/comic24.c \ diff --git a/MicroPython_BUILD/components/micropython/esp32/libs/tft/spi_master_lobo.c b/MicroPython_BUILD/components/micropython/esp32/libs/tft/spi_master_lobo.c deleted file mode 100644 index f530adc..0000000 --- a/MicroPython_BUILD/components/micropython/esp32/libs/tft/spi_master_lobo.c +++ /dev/null @@ -1,1153 +0,0 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -/* ----------------------------------------- -Non DMA version of the spi_master driver ----------------------------------------- ------------------------------------------------------------------------------------- -Based on esp-idf 'spi_master', modified by LoBo (https://github.com/loboris) 03/2017 ------------------------------------------------------------------------------------- - -* Transfers data to SPI device in direct mode, not using DMA -* All configuration options (bus, device, transaction) are the same as in spi_master driver -* Transfers uses the semaphore (taken in select function & given in deselect function) to protect the transfer -* Number of the devices attached to the bus which uses hardware CS can be 3 ('NO_CS') -* Additional devices which uses software CS can be attached to the bus, up to 'NO_DEV' -* 'spi_bus_initialize' & 'spi_bus_remove' functions are removed, spi bus is initiated/removed in spi_lobo_bus_add_device/spi_lobo_bus_remove_device when needed -* 'spi_lobo_bus_add_device' function has added parameter 'bus_config' and automatically initializes spi bus device if not already initialized -* 'spi_lobo_bus_remove_device' automatically removes spi bus device if no other devices are attached to it. -* Devices can have individual bus_configs, so different mosi, miso, sck pins can be configured for each device - Reconfiguring the bus is done automaticaly in 'spi_lobo_device_select' function -* 'spi_lobo_device_select' & 'spi_lobo_device_deselect' functions handles devices configuration changes and software CS -* Some helper functions are added ('spi_lobo_get_speed', 'spi_lobo_set_speed', ...) -* All structures are available in header file for easy creation of user low level spi functions. See **tftfunc.c** source for examples. -* Transimt and receive lenghts are limited only by available memory - - -Main driver's function is 'spi_lobo_transfer_data()' - - * TRANSMIT 8-bit data to spi device from 'trans->tx_buffer' or 'trans->tx_data' (trans->lenght/8 bytes) - * and RECEIVE data to 'trans->rx_buffer' or 'trans->rx_data' (trans->rx_length/8 bytes) - * Lengths must be 8-bit multiples! - * If trans->rx_buffer is NULL or trans->rx_length is 0, only transmits data - * If trans->tx_buffer is NULL or trans->length is 0, only receives data - * If the device is in duplex mode (LB_SPI_DEVICE_HALFDUPLEX flag NOT set), data are transmitted and received simultaneously. - * If the device is in half duplex mode (LB_SPI_DEVICE_HALFDUPLEX flag IS set), data are received after transmission - * 'address', 'command' and 'dummy bits' are transmitted before data phase IF set in device's configuration - * and IF 'trans->length' and 'trans->rx_length' are NOT both 0 - * If configured, devices 'pre_cb' callback is called before and 'post_cb' after the transmission - * If device was not previously selected, it will be selected before transmission and deselected after transmission. - -*/ - -/* - Replace this include with - #include "driver/spi_master_lobo.h" - if the driver is located in esp-isf/components -*/ -#include "freertos/FreeRTOS.h" -#include -#include -#include "soc/gpio_sig_map.h" -#include "soc/spi_reg.h" -#include "soc/dport_reg.h" -#include "soc/rtc_cntl_reg.h" -#include "rom/ets_sys.h" -#include "esp_types.h" -#include "esp_attr.h" -#include "esp_log.h" -#include "esp_err.h" -#include "freertos/semphr.h" -#include "freertos/xtensa_api.h" -#include "freertos/task.h" -#include "freertos/ringbuf.h" -#include "soc/soc.h" -#include "soc/dport_reg.h" -#include "soc/uart_struct.h" -#include "driver/uart.h" -#include "driver/gpio.h" -#include "driver/periph_ctrl.h" -#include "esp_heap_caps.h" -#include "driver/periph_ctrl.h" -#include "spi_master_lobo.h" - - -static spi_lobo_host_t *spihost[3] = {NULL}; - - -static const char *SPI_TAG = "spi_lobo_master"; -#define SPI_CHECK(a, str, ret_val) \ - if (!(a)) { \ - ESP_LOGE(SPI_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \ - return (ret_val); \ - } - -/* - Stores a bunch of per-spi-peripheral data. -*/ -typedef struct { - const uint8_t spiclk_out; //GPIO mux output signals - const uint8_t spid_out; - const uint8_t spiq_out; - const uint8_t spiwp_out; - const uint8_t spihd_out; - const uint8_t spid_in; //GPIO mux input signals - const uint8_t spiq_in; - const uint8_t spiwp_in; - const uint8_t spihd_in; - const uint8_t spics_out[3]; // /CS GPIO output mux signals - const uint8_t spiclk_native; //IO pins of IO_MUX muxed signals - const uint8_t spid_native; - const uint8_t spiq_native; - const uint8_t spiwp_native; - const uint8_t spihd_native; - const uint8_t spics0_native; - const uint8_t irq; //irq source for interrupt mux - const uint8_t irq_dma; //dma irq source for interrupt mux - const periph_module_t module; //peripheral module, for enabling clock etc - spi_dev_t *hw; //Pointer to the hardware registers -} spi_signal_conn_t; - -/* - Bunch of constants for every SPI peripheral: GPIO signals, irqs, hw addr of registers etc -*/ -static const spi_signal_conn_t io_signal[3]={ - { - .spiclk_out=SPICLK_OUT_IDX, - .spid_out=SPID_OUT_IDX, - .spiq_out=SPIQ_OUT_IDX, - .spiwp_out=SPIWP_OUT_IDX, - .spihd_out=SPIHD_OUT_IDX, - .spid_in=SPID_IN_IDX, - .spiq_in=SPIQ_IN_IDX, - .spiwp_in=SPIWP_IN_IDX, - .spihd_in=SPIHD_IN_IDX, - .spics_out={SPICS0_OUT_IDX, SPICS1_OUT_IDX, SPICS2_OUT_IDX}, - .spiclk_native=6, - .spid_native=8, - .spiq_native=7, - .spiwp_native=10, - .spihd_native=9, - .spics0_native=11, - .irq=ETS_SPI1_INTR_SOURCE, - .irq_dma=ETS_SPI1_DMA_INTR_SOURCE, - .module=PERIPH_SPI_MODULE, - .hw=&SPI1 - }, { - .spiclk_out=HSPICLK_OUT_IDX, - .spid_out=HSPID_OUT_IDX, - .spiq_out=HSPIQ_OUT_IDX, - .spiwp_out=HSPIWP_OUT_IDX, - .spihd_out=HSPIHD_OUT_IDX, - .spid_in=HSPID_IN_IDX, - .spiq_in=HSPIQ_IN_IDX, - .spiwp_in=HSPIWP_IN_IDX, - .spihd_in=HSPIHD_IN_IDX, - .spics_out={HSPICS0_OUT_IDX, HSPICS1_OUT_IDX, HSPICS2_OUT_IDX}, - .spiclk_native=14, - .spid_native=13, - .spiq_native=12, - .spiwp_native=2, - .spihd_native=4, - .spics0_native=15, - .irq=ETS_SPI2_INTR_SOURCE, - .irq_dma=ETS_SPI2_DMA_INTR_SOURCE, - .module=PERIPH_HSPI_MODULE, - .hw=&SPI2 - }, { - .spiclk_out=VSPICLK_OUT_IDX, - .spid_out=VSPID_OUT_IDX, - .spiq_out=VSPIQ_OUT_IDX, - .spiwp_out=VSPIWP_OUT_IDX, - .spihd_out=VSPIHD_OUT_IDX, - .spid_in=VSPID_IN_IDX, - .spiq_in=VSPIQ_IN_IDX, - .spiwp_in=VSPIWP_IN_IDX, - .spihd_in=VSPIHD_IN_IDX, - .spics_out={VSPICS0_OUT_IDX, VSPICS1_OUT_IDX, VSPICS2_OUT_IDX}, - .spiclk_native=18, - .spid_native=23, - .spiq_native=19, - .spiwp_native=22, - .spihd_native=21, - .spics0_native=5, - .irq=ETS_SPI3_INTR_SOURCE, - .irq_dma=ETS_SPI3_DMA_INTR_SOURCE, - .module=PERIPH_VSPI_MODULE, - .hw=&SPI3 - } -}; - - -//====================================================================================================== - -#define DMA_CHANNEL_ENABLED(dma_chan) (BIT(dma_chan-1)) - -typedef void(*dmaworkaround_cb_t)(void *arg); - -//Set up a list of dma descriptors. dmadesc is an array of descriptors. Data is the buffer to point to. -//-------------------------------------------------------------------------------------------- -void spi_lobo_setup_dma_desc_links(lldesc_t *dmadesc, int len, const uint8_t *data, bool isrx) -{ - int n = 0; - while (len) { - int dmachunklen = len; - if (dmachunklen > SPI_MAX_DMA_LEN) dmachunklen = SPI_MAX_DMA_LEN; - if (isrx) { - //Receive needs DMA length rounded to next 32-bit boundary - dmadesc[n].size = (dmachunklen + 3) & (~3); - dmadesc[n].length = (dmachunklen + 3) & (~3); - } else { - dmadesc[n].size = dmachunklen; - dmadesc[n].length = dmachunklen; - } - dmadesc[n].buf = (uint8_t *)data; - dmadesc[n].eof = 0; - dmadesc[n].sosf = 0; - dmadesc[n].owner = 1; - dmadesc[n].qe.stqe_next = &dmadesc[n + 1]; - len -= dmachunklen; - data += dmachunklen; - n++; - } - dmadesc[n - 1].eof = 1; //Mark last DMA desc as end of stream. - dmadesc[n - 1].qe.stqe_next = NULL; -} - - -/* -Code for workaround for DMA issue in ESP32 v0/v1 silicon -*/ - - -static volatile int dmaworkaround_channels_busy[2] = {0, 0}; -static dmaworkaround_cb_t dmaworkaround_cb; -static void *dmaworkaround_cb_arg; -static portMUX_TYPE dmaworkaround_mux = portMUX_INITIALIZER_UNLOCKED; -static int dmaworkaround_waiting_for_chan = 0; -static bool spi_periph_claimed[3] = {true, false, false}; -static uint8_t spi_dma_chan_enabled = 0; -static portMUX_TYPE spi_dma_spinlock = portMUX_INITIALIZER_UNLOCKED; - -//-------------------------------------------------------------------------------------------- -bool IRAM_ATTR spi_lobo_dmaworkaround_req_reset(int dmachan, dmaworkaround_cb_t cb, void *arg) -{ - int otherchan = (dmachan == 1) ? 2 : 1; - bool ret; - portENTER_CRITICAL(&dmaworkaround_mux); - if (dmaworkaround_channels_busy[otherchan-1]) { - //Other channel is busy. Call back when it's done. - dmaworkaround_cb = cb; - dmaworkaround_cb_arg = arg; - dmaworkaround_waiting_for_chan = otherchan; - ret = false; - } else { - //Reset DMA - DPORT_SET_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_DMA_RST); - DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_DMA_RST); - ret = true; - } - portEXIT_CRITICAL(&dmaworkaround_mux); - return ret; -} - -//------------------------------------------------------- -bool IRAM_ATTR spi_lobo_dmaworkaround_reset_in_progress() -{ - return (dmaworkaround_waiting_for_chan != 0); -} - -//----------------------------------------------------- -void IRAM_ATTR spi_lobo_dmaworkaround_idle(int dmachan) -{ - portENTER_CRITICAL(&dmaworkaround_mux); - dmaworkaround_channels_busy[dmachan-1] = 0; - if (dmaworkaround_waiting_for_chan == dmachan) { - //Reset DMA - DPORT_SET_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_DMA_RST); - DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_DMA_RST); - dmaworkaround_waiting_for_chan = 0; - //Call callback - dmaworkaround_cb(dmaworkaround_cb_arg); - - } - portEXIT_CRITICAL(&dmaworkaround_mux); -} - -//---------------------------------------------------------------- -void IRAM_ATTR spi_lobo_dmaworkaround_transfer_active(int dmachan) -{ - portENTER_CRITICAL(&dmaworkaround_mux); - dmaworkaround_channels_busy[dmachan-1] = 1; - portEXIT_CRITICAL(&dmaworkaround_mux); -} - -//Returns true if this peripheral is successfully claimed, false if otherwise. -//----------------------------------------------------- -bool spi_lobo_periph_claim(spi_lobo_host_device_t host) -{ - bool ret = __sync_bool_compare_and_swap(&spi_periph_claimed[host], false, true); - if (ret) periph_module_enable(io_signal[host].module); - return ret; -} - -//Returns true if this peripheral is successfully freed, false if otherwise. -//----------------------------------------------- -bool spi_lobo_periph_free(spi_lobo_host_device_t host) -{ - bool ret = __sync_bool_compare_and_swap(&spi_periph_claimed[host], true, false); - if (ret) periph_module_disable(io_signal[host].module); - return ret; -} - -//----------------------------------------- -bool spi_lobo_dma_chan_claim (int dma_chan) -{ - bool ret = false; - assert( dma_chan == 1 || dma_chan == 2 ); - - portENTER_CRITICAL(&spi_dma_spinlock); - if ( !(spi_dma_chan_enabled & DMA_CHANNEL_ENABLED(dma_chan)) ) { - // get the channel only when it's not claimed yet. - spi_dma_chan_enabled |= DMA_CHANNEL_ENABLED(dma_chan); - ret = true; - } - periph_module_enable( PERIPH_SPI_DMA_MODULE ); - portEXIT_CRITICAL(&spi_dma_spinlock); - - return ret; -} - -//--------------------------------------- -bool spi_lobo_dma_chan_free(int dma_chan) -{ - assert( dma_chan == 1 || dma_chan == 2 ); - assert( spi_dma_chan_enabled & DMA_CHANNEL_ENABLED(dma_chan) ); - - portENTER_CRITICAL(&spi_dma_spinlock); - spi_dma_chan_enabled &= ~DMA_CHANNEL_ENABLED(dma_chan); - if ( spi_dma_chan_enabled == 0 ) { - //disable the DMA only when all the channels are freed. - periph_module_disable( PERIPH_SPI_DMA_MODULE ); - } - portEXIT_CRITICAL(&spi_dma_spinlock); - - return true; -} - - -//====================================================================================================== - - -//---------------------------------------------------------------------------------------------------------------- -static esp_err_t spi_lobo_bus_initialize(spi_lobo_host_device_t host, spi_lobo_bus_config_t *bus_config, int init) -{ - bool native=true, spi_chan_claimed, dma_chan_claimed; - - if (init > 0) { - /* ToDo: remove this when we have flash operations cooperating with this */ - SPI_CHECK(host!=LOBO_SPI_HOST, "SPI1 is not supported", ESP_ERR_NOT_SUPPORTED); - - SPI_CHECK(host>=LOBO_SPI_HOST && host<=LOBO_VSPI_HOST, "invalid host", ESP_ERR_INVALID_ARG); - SPI_CHECK(spihost[host]==NULL, "host already in use", ESP_ERR_INVALID_STATE); - } - else { - SPI_CHECK(spihost[host]!=NULL, "host not in use", ESP_ERR_INVALID_STATE); - } - - SPI_CHECK(bus_config->mosi_io_num<0 || GPIO_IS_VALID_OUTPUT_GPIO(bus_config->mosi_io_num), "spid pin invalid", ESP_ERR_INVALID_ARG); - SPI_CHECK(bus_config->sclk_io_num<0 || GPIO_IS_VALID_OUTPUT_GPIO(bus_config->sclk_io_num), "spiclk pin invalid", ESP_ERR_INVALID_ARG); - SPI_CHECK(bus_config->miso_io_num<0 || GPIO_IS_VALID_GPIO(bus_config->miso_io_num), "spiq pin invalid", ESP_ERR_INVALID_ARG); - SPI_CHECK(bus_config->quadwp_io_num<0 || GPIO_IS_VALID_OUTPUT_GPIO(bus_config->quadwp_io_num), "spiwp pin invalid", ESP_ERR_INVALID_ARG); - SPI_CHECK(bus_config->quadhd_io_num<0 || GPIO_IS_VALID_OUTPUT_GPIO(bus_config->quadhd_io_num), "spihd pin invalid", ESP_ERR_INVALID_ARG); - - if (init > 0) { - spi_chan_claimed=spi_lobo_periph_claim(host); - SPI_CHECK(spi_chan_claimed, "host already in use", ESP_ERR_INVALID_STATE); - - //spihost[host]=malloc(sizeof(spi_lobo_host_t)); - spihost[host]=heap_caps_malloc(sizeof(spi_lobo_host_t), MALLOC_CAP_DMA); - if (spihost[host]==NULL) return ESP_ERR_NO_MEM; - memset(spihost[host], 0, sizeof(spi_lobo_host_t)); - // Create semaphore - spihost[host]->spi_lobo_bus_mutex = xSemaphoreCreateMutex(); - if (!spihost[host]->spi_lobo_bus_mutex) return ESP_ERR_NO_MEM; - } - - spihost[host]->cur_device = -1; - memcpy(&spihost[host]->cur_bus_config, bus_config, sizeof(spi_lobo_bus_config_t)); - - //Check if the selected pins correspond to the native pins of the peripheral - if (bus_config->mosi_io_num >= 0 && bus_config->mosi_io_num!=io_signal[host].spid_native) native=false; - if (bus_config->miso_io_num >= 0 && bus_config->miso_io_num!=io_signal[host].spiq_native) native=false; - if (bus_config->sclk_io_num >= 0 && bus_config->sclk_io_num!=io_signal[host].spiclk_native) native=false; - if (bus_config->quadwp_io_num >= 0 && bus_config->quadwp_io_num!=io_signal[host].spiwp_native) native=false; - if (bus_config->quadhd_io_num >= 0 && bus_config->quadhd_io_num!=io_signal[host].spihd_native) native=false; - - spihost[host]->no_gpio_matrix=native; - if (native) { - //All SPI native pin selections resolve to 1, so we put that here instead of trying to figure - //out which FUNC_GPIOx_xSPIxx to grab; they all are defined to 1 anyway. - if (bus_config->mosi_io_num > 0) PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[bus_config->mosi_io_num], 1); - if (bus_config->miso_io_num > 0) PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[bus_config->miso_io_num], 1); - if (bus_config->quadwp_io_num > 0) PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[bus_config->quadwp_io_num], 1); - if (bus_config->quadhd_io_num > 0) PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[bus_config->quadhd_io_num], 1); - if (bus_config->sclk_io_num > 0) PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[bus_config->sclk_io_num], 1); - } else { - //Use GPIO - if (bus_config->mosi_io_num>0) { - PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[bus_config->mosi_io_num], PIN_FUNC_GPIO); - gpio_set_direction(bus_config->mosi_io_num, GPIO_MODE_OUTPUT); - gpio_matrix_out(bus_config->mosi_io_num, io_signal[host].spid_out, false, false); - gpio_matrix_in(bus_config->mosi_io_num, io_signal[host].spid_in, false); - } - if (bus_config->miso_io_num>0) { - PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[bus_config->miso_io_num], PIN_FUNC_GPIO); - gpio_set_direction(bus_config->miso_io_num, GPIO_MODE_INPUT); - gpio_matrix_out(bus_config->miso_io_num, io_signal[host].spiq_out, false, false); - gpio_matrix_in(bus_config->miso_io_num, io_signal[host].spiq_in, false); - } - if (bus_config->quadwp_io_num>0) { - PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[bus_config->quadwp_io_num], PIN_FUNC_GPIO); - gpio_set_direction(bus_config->quadwp_io_num, GPIO_MODE_OUTPUT); - gpio_matrix_out(bus_config->quadwp_io_num, io_signal[host].spiwp_out, false, false); - gpio_matrix_in(bus_config->quadwp_io_num, io_signal[host].spiwp_in, false); - } - if (bus_config->quadhd_io_num>0) { - PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[bus_config->quadhd_io_num], PIN_FUNC_GPIO); - gpio_set_direction(bus_config->quadhd_io_num, GPIO_MODE_OUTPUT); - gpio_matrix_out(bus_config->quadhd_io_num, io_signal[host].spihd_out, false, false); - gpio_matrix_in(bus_config->quadhd_io_num, io_signal[host].spihd_in, false); - } - if (bus_config->sclk_io_num>0) { - PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[bus_config->sclk_io_num], PIN_FUNC_GPIO); - gpio_set_direction(bus_config->sclk_io_num, GPIO_MODE_OUTPUT); - gpio_matrix_out(bus_config->sclk_io_num, io_signal[host].spiclk_out, false, false); - } - } - periph_module_enable(io_signal[host].module); - spihost[host]->hw=io_signal[host].hw; - - if (init > 0) { - dma_chan_claimed=spi_lobo_dma_chan_claim(init); - if ( !dma_chan_claimed ) { - spi_lobo_periph_free( host ); - SPI_CHECK(dma_chan_claimed, "dma channel already in use", ESP_ERR_INVALID_STATE); - } - spihost[host]->dma_chan = init; - //See how many dma descriptors we need and allocate them - int dma_desc_ct=(bus_config->max_transfer_sz+SPI_MAX_DMA_LEN-1)/SPI_MAX_DMA_LEN; - if (dma_desc_ct==0) dma_desc_ct=1; //default to 4k when max is not given - spihost[host]->max_transfer_sz = dma_desc_ct*SPI_MAX_DMA_LEN; - - spihost[host]->dmadesc_tx=heap_caps_malloc(sizeof(lldesc_t)*dma_desc_ct, MALLOC_CAP_DMA); - spihost[host]->dmadesc_rx=heap_caps_malloc(sizeof(lldesc_t)*dma_desc_ct, MALLOC_CAP_DMA); - if (!spihost[host]->dmadesc_tx || !spihost[host]->dmadesc_rx) goto nomem; - - //Tell common code DMA workaround that our DMA channel is idle. If needed, the code will do a DMA reset. - spi_lobo_dmaworkaround_idle(spihost[host]->dma_chan); - - // Reset DMA - spihost[host]->hw->dma_conf.val |= SPI_OUT_RST|SPI_IN_RST|SPI_AHBM_RST|SPI_AHBM_FIFO_RST; - spihost[host]->hw->dma_out_link.start=0; - spihost[host]->hw->dma_in_link.start=0; - spihost[host]->hw->dma_conf.val &= ~(SPI_OUT_RST|SPI_IN_RST|SPI_AHBM_RST|SPI_AHBM_FIFO_RST); - spihost[host]->hw->dma_conf.out_data_burst_en=1; - - //Reset timing - spihost[host]->hw->ctrl2.val=0; - - //Disable unneeded ints - spihost[host]->hw->slave.rd_buf_done=0; - spihost[host]->hw->slave.wr_buf_done=0; - spihost[host]->hw->slave.rd_sta_done=0; - spihost[host]->hw->slave.wr_sta_done=0; - spihost[host]->hw->slave.rd_buf_inten=0; - spihost[host]->hw->slave.wr_buf_inten=0; - spihost[host]->hw->slave.rd_sta_inten=0; - spihost[host]->hw->slave.wr_sta_inten=0; - - //Force a transaction done interrupt. This interrupt won't fire yet because we initialized the SPI interrupt as - //disabled. This way, we can just enable the SPI interrupt and the interrupt handler will kick in, handling - //any transactions that are queued. - spihost[host]->hw->slave.trans_inten=1; - spihost[host]->hw->slave.trans_done=1; - - //Select DMA channel. - DPORT_SET_PERI_REG_BITS(DPORT_SPI_DMA_CHAN_SEL_REG, 3, init, (host * 2)); - } - return ESP_OK; - -nomem: - if (spihost[host]) { - free(spihost[host]->dmadesc_tx); - free(spihost[host]->dmadesc_rx); - } - free(spihost[host]); - spi_lobo_periph_free(host); - return ESP_ERR_NO_MEM; -} - -//--------------------------------------------------------------------------- -static esp_err_t spi_lobo_bus_free(spi_lobo_host_device_t host, int dofree) -{ - if ((host == LOBO_SPI_HOST) || (host > LOBO_VSPI_HOST)) return ESP_ERR_NOT_SUPPORTED; // invalid host - - if (spihost[host] == NULL) return ESP_ERR_INVALID_STATE; // host not in use - - if (dofree) { - for (int x=0; xdevice[x] != NULL) return ESP_ERR_INVALID_STATE; // not all devices freed - } - } - if ( spihost[host]->dma_chan > 0 ) { - spi_lobo_dma_chan_free ( spihost[host]->dma_chan ); - } - spihost[host]->hw->slave.trans_inten=0; - spihost[host]->hw->slave.trans_done=0; - spi_lobo_periph_free(host); - - if (dofree) { - vSemaphoreDelete(spihost[host]->spi_lobo_bus_mutex); - free(spihost[host]->dmadesc_tx); - free(spihost[host]->dmadesc_rx); - free(spihost[host]); - spihost[host] = NULL; - } - return ESP_OK; -} - -//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -esp_err_t spi_lobo_bus_add_device(spi_lobo_host_device_t host, spi_lobo_bus_config_t *bus_config, spi_lobo_device_interface_config_t *dev_config, spi_lobo_device_handle_t *handle) -{ - if ((host == LOBO_SPI_HOST) || (host > LOBO_VSPI_HOST)) return ESP_ERR_NOT_SUPPORTED; // invalid host - - if (spihost[host] == NULL) { - esp_err_t ret = spi_lobo_bus_initialize(host, bus_config, 1); - if (ret) return ret; - } - - int freecs, maxdev; - int apbclk=APB_CLK_FREQ; - - if (spihost[host] == NULL) return ESP_ERR_INVALID_STATE; - - if (dev_config->spics_io_num >= 0) { - if (!GPIO_IS_VALID_OUTPUT_GPIO(dev_config->spics_io_num)) return ESP_ERR_INVALID_ARG; - if (dev_config->spics_ext_io_num > 0) dev_config->spics_ext_io_num = -1; - } - else { - //if ((dev_config->spics_ext_io_num <= 0) || (!GPIO_IS_VALID_OUTPUT_GPIO(dev_config->spics_ext_io_num))) return ESP_ERR_INVALID_ARG; - } - - //ToDo: Check if some other device uses the same 'spics_ext_io_num' - - if (dev_config->clock_speed_hz == 0) return ESP_ERR_INVALID_ARG; - if (dev_config->spics_io_num > 0) maxdev = NO_CS; - else maxdev = NO_DEV; - - for (freecs=0; freecsdevice[freecs], NULL, (spi_lobo_device_t *)1)) break; - } - if (freecs == maxdev) return ESP_ERR_NOT_FOUND; - - // The hardware looks like it would support this, but actually setting cs_ena_pretrans when transferring in full - // duplex mode does absolutely nothing on the ESP32. - if ((dev_config->cs_ena_pretrans != 0) && (dev_config->flags & LB_SPI_DEVICE_HALFDUPLEX)) return ESP_ERR_INVALID_ARG; - - // Speeds >=40MHz over GPIO matrix needs a dummy cycle, but these don't work for full-duplex connections. - if (((dev_config->flags & LB_SPI_DEVICE_HALFDUPLEX)==0) && (dev_config->clock_speed_hz > ((apbclk*2)/5)) && (!spihost[host]->no_gpio_matrix)) return ESP_ERR_INVALID_ARG; - - //Allocate memory for device - spi_lobo_device_t *dev=malloc(sizeof(spi_lobo_device_t)); - if (dev==NULL) return ESP_ERR_NO_MEM; - - memset(dev, 0, sizeof(spi_lobo_device_t)); - spihost[host]->device[freecs]=dev; - - if (dev_config->duty_cycle_pos==0) dev_config->duty_cycle_pos=128; - dev->host=spihost[host]; - dev->host_dev = host; - - //We want to save a copy of the dev config in the dev struct. - memcpy(&dev->cfg, dev_config, sizeof(spi_lobo_device_interface_config_t)); - //We want to save a copy of the bus config in the dev struct. - memcpy(&dev->bus_config, bus_config, sizeof(spi_lobo_bus_config_t)); - - //Set CS pin, CS options - if (dev_config->spics_io_num > 0) { - if (spihost[host]->no_gpio_matrix &&dev_config->spics_io_num == io_signal[host].spics0_native && freecs==0) { - //Again, the cs0s for all SPI peripherals map to pin mux source 1, so we use that instead of a define. - PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[dev_config->spics_io_num], 1); - } else { - //Use GPIO matrix - PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[dev_config->spics_io_num], PIN_FUNC_GPIO); - gpio_set_direction(dev_config->spics_io_num, GPIO_MODE_OUTPUT); - gpio_matrix_out(dev_config->spics_io_num, io_signal[host].spics_out[freecs], false, false); - } - } - else if (dev_config->spics_ext_io_num >= 0) { - gpio_set_direction(dev_config->spics_ext_io_num, GPIO_MODE_OUTPUT); - gpio_set_level(dev_config->spics_ext_io_num, 1); - } - if (dev_config->flags & LB_SPI_DEVICE_CLK_AS_CS) { - spihost[host]->hw->pin.master_ck_sel |= (1<hw->pin.master_ck_sel &= (1<flags & LB_SPI_DEVICE_POSITIVE_CS) { - spihost[host]->hw->pin.master_cs_pol |= (1<hw->pin.master_cs_pol &= (1<host->device[x] == handle) handle->host->device[x]=NULL; - } - - // Check if all devices are removed from this host and free the bus if yes - for (x=0; xhost_dev]->device[x] !=NULL) break; - } - if (x == NO_DEV) { - free(handle); - spi_lobo_bus_free(handle->host_dev, 1); - } - else free(handle); - - return ESP_OK; -} - -//----------------------------------------------------------------- -static int IRAM_ATTR spi_freq_for_pre_n(int fapb, int pre, int n) { - return (fapb / (pre * n)); -} - -/* - * Set the SPI clock to a certain frequency. Returns the effective frequency set, which may be slightly - * different from the requested frequency. - */ -//----------------------------------------------------------------------------------- -static int IRAM_ATTR spi_set_clock(spi_dev_t *hw, int fapb, int hz, int duty_cycle) { - int pre, n, h, l, eff_clk; - - //In hw, n, h and l are 1-64, pre is 1-8K. Value written to register is one lower than used value. - if (hz>((fapb/4)*3)) { - //Using Fapb directly will give us the best result here. - hw->clock.clkcnt_l=0; - hw->clock.clkcnt_h=0; - hw->clock.clkcnt_n=0; - hw->clock.clkdiv_pre=0; - hw->clock.clk_equ_sysclk=1; - eff_clk=fapb; - } else { - //For best duty cycle resolution, we want n to be as close to 32 as possible, but - //we also need a pre/n combo that gets us as close as possible to the intended freq. - //To do this, we bruteforce n and calculate the best pre to go along with that. - //If there's a choice between pre/n combos that give the same result, use the one - //with the higher n. - int bestn=-1; - int bestpre=-1; - int besterr=0; - int errval; - for (n=1; n<=64; n++) { - //Effectively, this does pre=round((fapb/n)/hz). - pre=((fapb/n)+(hz/2))/hz; - if (pre<=0) pre=1; - if (pre>8192) pre=8192; - errval=abs(spi_freq_for_pre_n(fapb, pre, n)-hz); - if (bestn==-1 || errval<=besterr) { - besterr=errval; - bestn=n; - bestpre=pre; - } - } - - n=bestn; - pre=bestpre; - l=n; - //This effectively does round((duty_cycle*n)/256) - h=(duty_cycle*n+127)/256; - if (h<=0) h=1; - - hw->clock.clk_equ_sysclk=0; - hw->clock.clkcnt_n=n-1; - hw->clock.clkdiv_pre=pre-1; - hw->clock.clkcnt_h=h-1; - hw->clock.clkcnt_l=l-1; - eff_clk=spi_freq_for_pre_n(fapb, pre, n); - } - return eff_clk; -} - - - -//------------------------------------------------------------------------------------ -esp_err_t IRAM_ATTR spi_lobo_device_select(spi_lobo_device_handle_t handle, int force) -{ - if (handle == NULL) return ESP_ERR_INVALID_ARG; - - if ((handle->cfg.selected == 1) && (!force)) return ESP_OK; // already selected - - int i; - spi_lobo_host_t *host=(spi_lobo_host_t*)handle->host; - - // find device's host bus - for (i=0; idevice[i] == handle) break; - } - if (i == NO_DEV) return ESP_ERR_INVALID_ARG; - - if (!(xSemaphoreTake(host->spi_lobo_bus_mutex, SPI_SEMAPHORE_WAIT))) return ESP_ERR_INVALID_STATE; - - // Check if previously used device's bus device is the same - if (memcmp(&host->cur_bus_config, &handle->bus_config, sizeof(spi_lobo_bus_config_t)) != 0) { - // device has different bus configuration, we need to reconfigure the bus - esp_err_t err = spi_lobo_bus_free(1, 0); - if (err) { - xSemaphoreGive(host->spi_lobo_bus_mutex); - return err; - } - err = spi_lobo_bus_initialize(i, &handle->bus_config, -1); - if (err) { - xSemaphoreGive(host->spi_lobo_bus_mutex); - return err; - } - } - - //Reconfigure according to device settings, but only if the device changed or forced. - if ((force) || (host->device[host->cur_device] != handle)) { - //Assumes a hardcoded 80MHz Fapb for now. ToDo: figure out something better once we have clock scaling working. - int apbclk=APB_CLK_FREQ; - - //Speeds >=40MHz over GPIO matrix needs a dummy cycle, but these don't work for full-duplex connections. - if (((handle->cfg.flags & LB_SPI_DEVICE_HALFDUPLEX) == 0) && (handle->cfg.clock_speed_hz > ((apbclk*2)/5)) && (!host->no_gpio_matrix)) { - // set speed to 32 MHz - handle->cfg.clock_speed_hz = (apbclk*2)/5; - } - - int effclk=spi_set_clock(host->hw, apbclk, handle->cfg.clock_speed_hz, handle->cfg.duty_cycle_pos); - //Configure bit order - host->hw->ctrl.rd_bit_order=(handle->cfg.flags & LB_SPI_DEVICE_RXBIT_LSBFIRST)?1:0; - host->hw->ctrl.wr_bit_order=(handle->cfg.flags & LB_SPI_DEVICE_TXBIT_LSBFIRST)?1:0; - - //Configure polarity - //SPI iface needs to be configured for a delay in some cases. - int nodelay=0; - int extra_dummy=0; - if (host->no_gpio_matrix) { - if (effclk >= apbclk/2) { - nodelay=1; - } - } else { - if (effclk >= apbclk/2) { - nodelay=1; - extra_dummy=1; //Note: This only works on half-duplex connections. spi_lobo_bus_add_device checks for this. - } else if (effclk >= apbclk/4) { - nodelay=1; - } - } - if (handle->cfg.mode==0) { - host->hw->pin.ck_idle_edge=0; - host->hw->user.ck_out_edge=0; - host->hw->ctrl2.miso_delay_mode=nodelay?0:2; - } else if (handle->cfg.mode==1) { - host->hw->pin.ck_idle_edge=0; - host->hw->user.ck_out_edge=1; - host->hw->ctrl2.miso_delay_mode=nodelay?0:1; - } else if (handle->cfg.mode==2) { - host->hw->pin.ck_idle_edge=1; - host->hw->user.ck_out_edge=1; - host->hw->ctrl2.miso_delay_mode=nodelay?0:1; - } else if (handle->cfg.mode==3) { - host->hw->pin.ck_idle_edge=1; - host->hw->user.ck_out_edge=0; - host->hw->ctrl2.miso_delay_mode=nodelay?0:2; - } - - //Configure bit sizes, load addr and command - host->hw->user.usr_dummy=(handle->cfg.dummy_bits+extra_dummy)?1:0; - host->hw->user.usr_addr=(handle->cfg.address_bits)?1:0; - host->hw->user.usr_command=(handle->cfg.command_bits)?1:0; - host->hw->user1.usr_addr_bitlen=handle->cfg.address_bits-1; - host->hw->user1.usr_dummy_cyclelen=handle->cfg.dummy_bits+extra_dummy-1; - host->hw->user2.usr_command_bitlen=handle->cfg.command_bits-1; - //Configure misc stuff - host->hw->user.doutdin=(handle->cfg.flags & LB_SPI_DEVICE_HALFDUPLEX)?0:1; - host->hw->user.sio=(handle->cfg.flags & LB_SPI_DEVICE_3WIRE)?1:0; - - host->hw->ctrl2.setup_time=handle->cfg.cs_ena_pretrans-1; - host->hw->user.cs_setup=handle->cfg.cs_ena_pretrans?1:0; - host->hw->ctrl2.hold_time=handle->cfg.cs_ena_posttrans-1; - host->hw->user.cs_hold=(handle->cfg.cs_ena_posttrans)?1:0; - - //Configure CS pin - host->hw->pin.cs0_dis=(i==0)?0:1; - host->hw->pin.cs1_dis=(i==1)?0:1; - host->hw->pin.cs2_dis=(i==2)?0:1; - - host->cur_device = i; - } - - if ((handle->cfg.spics_io_num < 0) && (handle->cfg.spics_ext_io_num > 0)) { - gpio_set_level(handle->cfg.spics_ext_io_num, 0); - } - - handle->cfg.selected = 1; - - return ESP_OK; -} - -//--------------------------------------------------------------------------- -esp_err_t IRAM_ATTR spi_lobo_device_deselect(spi_lobo_device_handle_t handle) -{ - if (handle == NULL) return ESP_ERR_INVALID_ARG; - - if (handle->cfg.selected == 0) return ESP_OK; // already deselected - - int i; - spi_lobo_host_t *host=(spi_lobo_host_t*)handle->host; - - for (i=0; idevice[i] == handle) break; - } - if (i == NO_DEV) return ESP_ERR_INVALID_ARG; - - if (host->device[host->cur_device] == handle) { - if ((handle->cfg.spics_io_num < 0) && (handle->cfg.spics_ext_io_num > 0)) { - gpio_set_level(handle->cfg.spics_ext_io_num, 1); - } - } - - handle->cfg.selected = 0; - xSemaphoreGive(host->spi_lobo_bus_mutex); - - return ESP_OK; -} - -//-------------------------------------------------------------------------------- -esp_err_t IRAM_ATTR spi_lobo_device_TakeSemaphore(spi_lobo_device_handle_t handle) -{ - if (!(xSemaphoreTake(handle->host->spi_lobo_bus_mutex, SPI_SEMAPHORE_WAIT))) return ESP_ERR_INVALID_STATE; - else return ESP_OK; -} - -//--------------------------------------------------------------------------- -void IRAM_ATTR spi_lobo_device_GiveSemaphore(spi_lobo_device_handle_t handle) -{ - xSemaphoreTake(handle->host->spi_lobo_bus_mutex, portMAX_DELAY); -} - -//---------------------------------------------------------- -uint32_t spi_lobo_get_speed(spi_lobo_device_handle_t handle) -{ - spi_lobo_host_t *host=(spi_lobo_host_t*)handle->host; - uint32_t speed = 0; - if (spi_lobo_device_select(handle, 0) == ESP_OK) { - if (host->hw->clock.clk_equ_sysclk == 1) speed = 80000000; - else speed = 80000000/(host->hw->clock.clkdiv_pre+1)/(host->hw->clock.clkcnt_n+1); - } - spi_lobo_device_deselect(handle); - return speed; -} - -//-------------------------------------------------------------------------- -uint32_t spi_lobo_set_speed(spi_lobo_device_handle_t handle, uint32_t speed) -{ - spi_lobo_host_t *host=(spi_lobo_host_t*)handle->host; - uint32_t newspeed = 0; - if (spi_lobo_device_select(handle, 0) == ESP_OK) { - spi_lobo_device_deselect(handle); - handle->cfg.clock_speed_hz = speed; - if (spi_lobo_device_select(handle, 1) == ESP_OK) { - if (host->hw->clock.clk_equ_sysclk == 1) newspeed = 80000000; - else newspeed = 80000000/(host->hw->clock.clkdiv_pre+1)/(host->hw->clock.clkcnt_n+1); - } - } - spi_lobo_device_deselect(handle); - - return newspeed; -} - -//------------------------------------------------------------- -bool spi_lobo_uses_native_pins(spi_lobo_device_handle_t handle) -{ - return handle->host->no_gpio_matrix; -} - -//------------------------------------------------------------------- -void spi_lobo_get_native_pins(int host, int *sdi, int *sdo, int *sck) -{ - *sdo = io_signal[host].spid_native; - *sdi = io_signal[host].spiq_native; - *sck = io_signal[host].spiclk_native; -} - -/* -When using 'spi_lobo_transfer_data' function we can have several scenarios: - -A: Send only (trans->rxlength = 0) -B: Receive only (trans->txlength = 0) -C: Send & receive (trans->txlength > 0 & trans->rxlength > 0) -D: No operation (trans->txlength = 0 & trans->rxlength = 0) - -*/ -//---------------------------------------------------------------------------------------------------------- -esp_err_t IRAM_ATTR spi_lobo_transfer_data(spi_lobo_device_handle_t handle, spi_lobo_transaction_t *trans) { - if (!handle) return ESP_ERR_INVALID_ARG; - - // *** For now we can only handle 8-bit bytes transmission - if (((trans->length % 8) != 0) || ((trans->rxlength % 8) != 0)) return ESP_ERR_INVALID_ARG; - - spi_lobo_host_t *host=(spi_lobo_host_t*)handle->host; - esp_err_t ret; - uint8_t do_deselect = 0; - const uint8_t *txbuffer = NULL; - uint8_t *rxbuffer = NULL; - - if (trans->flags & LB_SPI_TRANS_USE_TXDATA) { - // Send data from 'trans->tx_data' - txbuffer=(uint8_t*)&trans->tx_data[0]; - } else { - // Send data from 'trans->tx_buffer' - txbuffer=(uint8_t*)trans->tx_buffer; - } - if (trans->flags & LB_SPI_TRANS_USE_RXDATA) { - // Receive data to 'trans->rx_data' - rxbuffer=(uint8_t*)&trans->rx_data[0]; - } else { - // Receive data to 'trans->rx_buffer' - rxbuffer=(uint8_t*)trans->rx_buffer; - } - - // ** Set transmit & receive length in bytes - uint32_t txlen = trans->length / 8; - uint32_t rxlen = trans->rxlength / 8; - - if (txbuffer == NULL) txlen = 0; - if (rxbuffer == NULL) rxlen = 0; - if ((rxlen == 0) && (txlen == 0)) { - // ** NOTHING TO SEND or RECEIVE, return - return ESP_ERR_INVALID_ARG; - } - - // If using 'trans->tx_data' and/or 'trans->rx_data', maximum 4 bytes can be sent/received - if ((txbuffer == &trans->tx_data[0]) && (txlen > 4)) return ESP_ERR_INVALID_ARG; - if ((rxbuffer == &trans->rx_data[0]) && (rxlen > 4)) return ESP_ERR_INVALID_ARG; - - // --- Wait for SPI bus ready --- - while (host->hw->cmd.usr); - - // ** If the device was not selected, select it - if (handle->cfg.selected == 0) { - ret = spi_lobo_device_select(handle, 0); - if (ret) return ret; - do_deselect = 1; // We will deselect the device after the operation ! - } - - // ** Call pre-transmission callback, if any - if (handle->cfg.pre_cb) handle->cfg.pre_cb(trans); - - // Test if operating in full duplex mode - uint8_t duplex = 1; - if (handle->cfg.flags & LB_SPI_DEVICE_HALFDUPLEX) duplex = 0; // Half duplex mode ! - - uint32_t bits, rdbits; - uint32_t wd; - uint8_t bc, rdidx; - uint32_t rdcount = rxlen; // Total number of bytes to read - uint32_t count = 0; // number of bytes transmitted - uint32_t rd_read = 0; // Number of bytes read so far - - host->hw->user.usr_mosi_highpart = 0; // use the whole spi buffer - - // ** Check if address phase will be used - host->hw->user2.usr_command_value=trans->command; - if (handle->cfg.address_bits>32) { - host->hw->addr=trans->address >> 32; - host->hw->slv_wr_status=trans->address & 0xffffffff; - } else { - host->hw->addr=trans->address & 0xffffffff; - } - - // Check if we have to transmit some data - if (txlen > 0) { - host->hw->user.usr_mosi = 1; - uint8_t idx; - bits = 0; // remaining bits to send - idx = 0; // index to spi hw data_buf (16 32-bit words, 64 bytes, 512 bits) - - // ** Transmit 'txlen' bytes - while (count < txlen) { - wd = 0; - for (bc=0;bc<32;bc+=8) { - wd |= (uint32_t)txbuffer[count] << bc; - count++; // Increment sent data count - bits += 8; // Increment bits count - if (count == txlen) break; // If all transmit data pushed to hw spi buffer break from the loop - } - host->hw->data_buf[idx] = wd; - idx++; - if (idx == 16) { - // hw SPI buffer full (all 64 bytes filled, START THE TRANSSACTION - host->hw->mosi_dlen.usr_mosi_dbitlen=bits-1; // Set mosi dbitlen - - if ((duplex) && (rdcount > 0)) { - // In full duplex mode we are receiving while sending ! - host->hw->miso_dlen.usr_miso_dbitlen = bits-1; // Set miso dbitlen - host->hw->user.usr_miso = 1; - } - else { - host->hw->miso_dlen.usr_miso_dbitlen = 0; // In half duplex mode nothing will be received - host->hw->user.usr_miso = 0; - } - - // ** Start the transaction *** - host->hw->cmd.usr=1; - // Wait the transaction to finish - while (host->hw->cmd.usr); - - if ((duplex) && (rdcount > 0)) { - // *** in full duplex mode transfer received data to input buffer *** - rdidx = 0; - while (bits > 0) { - wd = host->hw->data_buf[rdidx]; - rdidx++; - for (bc=0;bc<32;bc+=8) { // get max 4 bytes - rxbuffer[rd_read++] = (uint8_t)((wd >> bc) & 0xFF); - rdcount--; - bits -= 8; - if (rdcount == 0) { - bits = 0; - break; // Finished reading data - } - } - } - } - bits = 0; // nothing in hw spi buffer yet - idx = 0; // start from the beginning of the hw spi buffer - } - } - // *** All transmit data are sent or pushed to hw spi buffer - // bits > 0 IF THERE ARE SOME DATA STILL WAITING IN THE HW SPI TRANSMIT BUFFER - if (bits > 0) { - // ** WE HAVE SOME DATA IN THE HW SPI TRANSMIT BUFFER - host->hw->mosi_dlen.usr_mosi_dbitlen = bits-1; // Set mosi dbitlen - - if ((duplex) && (rdcount > 0)) { - // In full duplex mode we are receiving while sending ! - host->hw->miso_dlen.usr_miso_dbitlen = bits-1; // Set miso dbitlen - host->hw->user.usr_miso = 1; - } - else { - host->hw->miso_dlen.usr_miso_dbitlen = 0; // In half duplex mode nothing will be received - host->hw->user.usr_miso = 0; - } - - // ** Start the transaction *** - host->hw->cmd.usr=1; - // Wait the transaction to finish - while (host->hw->cmd.usr); - - if ((duplex) && (rdcount > 0)) { - // *** in full duplex mode transfer received data to input buffer *** - rdidx = 0; - while (bits > 0) { - wd = host->hw->data_buf[rdidx]; - rdidx++; - for (bc=0;bc<32;bc+=8) { // get max 4 bytes - rxbuffer[rd_read++] = (uint8_t)((wd >> bc) & 0xFF); - rdcount--; - bits -= 8; - if (bits == 0) break; - if (rdcount == 0) { - bits = 0; - break; // Finished reading data - } - } - } - } - } - //if (duplex) rdcount = 0; // In duplex mode receive only as many bytes as was transmitted - } - - // ------------------------------------------------------------------------ - // *** If rdcount = 0 we have nothing to receive and we exit the function - // This is true if no data receive was requested, - // or all the data was received in Full duplex mode during the transmission - // ------------------------------------------------------------------------ - if (rdcount > 0) { - // ---------------------------------------------------------------------------------------------------------------- - // *** rdcount > 0, we have to receive some data - // This is true if we operate in Half duplex mode when receiving after transmission is done, - // or not all data was received in Full duplex mode during the transmission (trans->rxlength > trans->txlength) - // ---------------------------------------------------------------------------------------------------------------- - host->hw->user.usr_mosi = 0; // do not send - host->hw->user.usr_miso = 1; // do receive - while (rdcount > 0) { - if (rdcount <= 64) rdbits = rdcount * 8; - else rdbits = 64 * 8; - - // Load receive buffer - host->hw->mosi_dlen.usr_mosi_dbitlen=0; - host->hw->miso_dlen.usr_miso_dbitlen=rdbits-1; - - // ** Start the transaction *** - host->hw->cmd.usr=1; - // Wait the transaction to finish - while (host->hw->cmd.usr); - - // *** transfer received data to input buffer *** - rdidx = 0; - while (rdbits > 0) { - wd = host->hw->data_buf[rdidx]; - rdidx++; - for (bc=0;bc<32;bc+=8) { - rxbuffer[rd_read++] = (uint8_t)((wd >> bc) & 0xFF); - rdcount--; - rdbits -= 8; - if (rdcount == 0) { - rdbits = 0; - break; - } - } - } - } - } - - // ** Call post-transmission callback, if any - if (handle->cfg.post_cb) handle->cfg.post_cb(trans); - - if (do_deselect) { - // Spi device was selected in this function, we have to deselect it now - ret = spi_lobo_device_deselect(handle); - if (ret) return ret; - } - - return ESP_OK; -} diff --git a/MicroPython_BUILD/components/micropython/esp32/libs/tft/spi_master_lobo.h b/MicroPython_BUILD/components/micropython/esp32/libs/tft/spi_master_lobo.h deleted file mode 100644 index 2e458f7..0000000 --- a/MicroPython_BUILD/components/micropython/esp32/libs/tft/spi_master_lobo.h +++ /dev/null @@ -1,355 +0,0 @@ -// Copyright 2010-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -#ifndef _DRIVER_SPI_MASTER_LOBO_H_ -#define _DRIVER_SPI_MASTER_LOBO_H_ - -#include "esp_err.h" -#include "freertos/FreeRTOS.h" -#include "freertos/semphr.h" -#include "soc/spi_struct.h" - -#include "esp_intr.h" -#include "esp_intr_alloc.h" -#include "rom/lldesc.h" - - -#ifdef __cplusplus -extern "C" -{ -#endif - - -//Maximum amount of bytes that can be put in one DMA descriptor -#define SPI_MAX_DMA_LEN (4096-4) - -/** - * @brief Enum with the three SPI peripherals that are software-accessible in it - */ -typedef enum { - LOBO_SPI_HOST=0, ///< SPI1, SPI; Cannot be used in this driver! - LOBO_HSPI_HOST=1, ///< SPI2, HSPI - LOBO_VSPI_HOST=2 ///< SPI3, VSPI -} spi_lobo_host_device_t; - - -/** - * @brief This is a configuration structure for a SPI bus. - * - * You can use this structure to specify the GPIO pins of the bus. Normally, the driver will use the - * GPIO matrix to route the signals. An exception is made when all signals either can be routed through - * the IO_MUX or are -1. In that case, the IO_MUX is used, allowing for >40MHz speeds. - */ -typedef struct { - int mosi_io_num; ///< GPIO pin for Master Out Slave In (=spi_d) signal, or -1 if not used. - int miso_io_num; ///< GPIO pin for Master In Slave Out (=spi_q) signal, or -1 if not used. - int sclk_io_num; ///< GPIO pin for Spi CLocK signal, or -1 if not used. - int quadwp_io_num; ///< GPIO pin for WP (Write Protect) signal which is used as D2 in 4-bit communication modes, or -1 if not used. - int quadhd_io_num; ///< GPIO pin for HD (HolD) signal which is used as D3 in 4-bit communication modes, or -1 if not used. - int max_transfer_sz; ///< Maximum transfer size, in bytes. Defaults to 4094 if 0. -} spi_lobo_bus_config_t; - - -#define LB_SPI_DEVICE_TXBIT_LSBFIRST (1<<0) ///< Transmit command/address/data LSB first instead of the default MSB first -#define LB_SPI_DEVICE_RXBIT_LSBFIRST (1<<1) ///< Receive data LSB first instead of the default MSB first -#define LB_SPI_DEVICE_BIT_LSBFIRST (SPI_TXBIT_LSBFIRST|SPI_RXBIT_LSBFIRST); ///< Transmit and receive LSB first -#define LB_SPI_DEVICE_3WIRE (1<<2) ///< Use spiq for both sending and receiving data -#define LB_SPI_DEVICE_POSITIVE_CS (1<<3) ///< Make CS positive during a transaction instead of negative -#define LB_SPI_DEVICE_HALFDUPLEX (1<<4) ///< Transmit data before receiving it, instead of simultaneously -#define LB_SPI_DEVICE_CLK_AS_CS (1<<5) ///< Output clock on CS line if CS is active - -#define SPI_ERR_OTHER_CONFIG 7001 - -typedef struct spi_lobo_transaction_t spi_lobo_transaction_t; -typedef void(*spi_lobo_transaction_cb_t)(spi_lobo_transaction_t *trans); - -/** - * @brief This is a configuration for a SPI slave device that is connected to one of the SPI buses. - */ -typedef struct { - uint8_t command_bits; ///< Amount of bits in command phase (0-16) - uint8_t address_bits; ///< Amount of bits in address phase (0-64) - uint8_t dummy_bits; ///< Amount of dummy bits to insert between address and data phase - uint8_t mode; ///< SPI mode (0-3) - uint8_t duty_cycle_pos; ///< Duty cycle of positive clock, in 1/256th increments (128 = 50%/50% duty). Setting this to 0 (=not setting it) is equivalent to setting this to 128. - uint8_t cs_ena_pretrans; ///< Amount of SPI bit-cycles the cs should be activated before the transmission (0-16). This only works on half-duplex transactions. - uint8_t cs_ena_posttrans; ///< Amount of SPI bit-cycles the cs should stay active after the transmission (0-16) - int clock_speed_hz; ///< Clock speed, in Hz - int spics_io_num; ///< CS GPIO pin for this device, handled by hardware; set to -1 if not used - int spics_ext_io_num; ///< CS GPIO pin for this device, handled by software (spi_lobo_device_select/spi_lobo_device_deselect); only used if spics_io_num=-1 - uint32_t flags; ///< Bitwise OR of LB_SPI_DEVICE_* flags - spi_lobo_transaction_cb_t pre_cb; ///< Callback to be called before a transmission is started. This callback from 'spi_lobo_transfer_data' function. - spi_lobo_transaction_cb_t post_cb; ///< Callback to be called after a transmission has completed. This callback from 'spi_lobo_transfer_data' function. - uint8_t selected; ///< **INTERNAL** 1 if the device's CS pin is active -} spi_lobo_device_interface_config_t; - - -#define LB_SPI_TRANS_MODE_DIO (1<<0) ///< Transmit/receive data in 2-bit mode -#define LB_SPI_TRANS_MODE_QIO (1<<1) ///< Transmit/receive data in 4-bit mode -#define LB_SPI_TRANS_MODE_DIOQIO_ADDR (1<<2) ///< Also transmit address in mode selected by SPI_MODE_DIO/SPI_MODE_QIO -#define LB_SPI_TRANS_USE_RXDATA (1<<3) ///< Receive into rx_data member of spi_lobo_transaction_t instead into memory at rx_buffer. -#define LB_SPI_TRANS_USE_TXDATA (1<<4) ///< Transmit tx_data member of spi_lobo_transaction_t instead of data at tx_buffer. Do not set tx_buffer when using this. - -/** - * This structure describes one SPI transmission - */ -struct spi_lobo_transaction_t { - uint32_t flags; ///< Bitwise OR of LB_SPI_TRANS_* flags - uint16_t command; ///< Command data. Specific length was given when device was added to the bus. - uint64_t address; ///< Address. Specific length was given when device was added to the bus. - size_t length; ///< Total data length to be transmitted to the device, in bits; if 0, no data is transmitted - size_t rxlength; ///< Total data length to be received from the device, in bits; if 0, no data is received - void *user; ///< User-defined variable. Can be used to store eg transaction ID or data to be used by pre_cb and/or post_cb callbacks. - union { - const void *tx_buffer; ///< Pointer to transmit buffer, or NULL for no MOSI phase - uint8_t tx_data[4]; ///< If SPI_USE_TXDATA is set, data set here is sent directly from this variable. - }; - union { - void *rx_buffer; ///< Pointer to receive buffer, or NULL for no MISO phase - uint8_t rx_data[4]; ///< If SPI_USE_RXDATA is set, data is received directly to this variable - }; -}; - -#define NO_CS 3 // Number of CS pins per SPI host -#define NO_DEV 6 // Number of spi devices per SPI host; more than 3 devices can be attached to the same bus if using software CS's -#define SPI_SEMAPHORE_WAIT 2000 // Time in ms to wait for SPI mutex - -typedef struct spi_lobo_device_t spi_lobo_device_t; - -typedef struct { - spi_lobo_device_t *device[NO_DEV]; - intr_handle_t intr; - spi_dev_t *hw; - //spi_lobo_transaction_t *cur_trans; - int cur_device; - lldesc_t *dmadesc_tx; - lldesc_t *dmadesc_rx; - bool no_gpio_matrix; - int dma_chan; - int max_transfer_sz; - QueueHandle_t spi_lobo_bus_mutex; - spi_lobo_bus_config_t cur_bus_config; -} spi_lobo_host_t; - -struct spi_lobo_device_t { - spi_lobo_device_interface_config_t cfg; - spi_lobo_host_t *host; - spi_lobo_bus_config_t bus_config; - spi_lobo_host_device_t host_dev; -}; - -typedef spi_lobo_device_t* spi_lobo_device_handle_t; ///< Handle for a device on a SPI bus -typedef spi_lobo_host_t* spi_lobo_host_handle_t; -typedef spi_lobo_device_interface_config_t* spi_lobo_device_interface_config_handle_t; - - -/** - * @brief Add a device. This allocates a CS line for the device, allocates memory for the device structure and hooks - * up the CS pin to whatever is specified. - * - * This initializes the internal structures for a device, plus allocates a CS pin on the indicated SPI master - * peripheral and routes it to the indicated GPIO. All SPI master devices have three hw CS pins and can thus control - * up to three devices. Software handled CS pin can also be used for additional devices on the same SPI bus. - * - * ### If selected SPI host device bus is not yet initialized, it is initialized first with 'bus_config' function ### - * - * @note While in general, speeds up to 80MHz on the dedicated SPI pins and 40MHz on GPIO-matrix-routed pins are - * supported, full-duplex transfers routed over the GPIO matrix only support speeds up to 26MHz. - * - * @param host SPI peripheral to allocate device on (HSPI or VSPI) - * @param dev_config SPI interface protocol config for the device - * @param bus_config Pointer to a spi_lobo_bus_config_t struct specifying how the host device bus should be initialized - * @param handle Pointer to variable to hold the device handle - * @return - * - ESP_ERR_INVALID_ARG if parameter is invalid - * - ESP_ERR_NOT_FOUND if host doesn't have any free CS slots - * - ESP_ERR_NO_MEM if out of memory - * - ESP_OK on success - */ -esp_err_t spi_lobo_bus_add_device(spi_lobo_host_device_t host, spi_lobo_bus_config_t *bus_config, spi_lobo_device_interface_config_t *dev_config, spi_lobo_device_handle_t *handle); - -/** - * @brief Remove a device from the SPI bus. If after removal no other device is attached to the spi bus device, it is freed. - * - * @param handle Device handle to free - * @return - * - ESP_ERR_INVALID_ARG if parameter is invalid - * - ESP_ERR_INVALID_STATE if device already is freed - * - ESP_OK on success - */ -esp_err_t spi_lobo_bus_remove_device(spi_lobo_device_handle_t handle); - - -/** - * @brief Return the actuall SPI bus speed for the spi device in Hz - * - * Some frequencies cannot be set, for example 30000000 will actually set SPI clock to 26666666 Hz - * - * @param handle Device handle obtained using spi_lobo_bus_add_device - * - * @return - * - actuall SPI clock - */ -uint32_t spi_lobo_get_speed(spi_lobo_device_handle_t handle); - -/** - * @brief Set the new clock speed for the device, return the actuall SPI bus speed set, in Hz - * This function can be used after the device is initialized - * - * Some frequencies cannot be set, for example 30000000 will actually set SPI clock to 26666666 Hz - * - * @param handle Device handle obtained using spi_lobo_bus_add_device - * @param speed New device spi clock to be set in Hz - * - * @return - * - actuall SPI clock - * - 0 if speed cannot be set - */ -uint32_t spi_lobo_set_speed(spi_lobo_device_handle_t handle, uint32_t speed); - -/** - * @brief Select spi device for transmission - * - * It configures spi bus with selected spi device parameters if previously selected device was different than the current - * If device's spics_io_num=-1 and spics_ext_io_num > 0 'spics_ext_io_num' pin is set to active state (low) - * - * spi bus device's semaphore is taken before selecting the device - * - * @param handle Device handle obtained using spi_lobo_bus_add_device - * @param force configure spi bus even if the previous device was the same - * - * @return - * - ESP_ERR_INVALID_ARG if parameter is invalid - * - ESP_OK on success - */ -esp_err_t spi_lobo_device_select(spi_lobo_device_handle_t handle, int force); - -/** - * @brief De-select spi device - * - * If device's spics_io_num=-1 and spics_ext_io_num > 0 'spics_ext_io_num' pin is set to inactive state (high) - * - * spi bus device's semaphore is given after selecting the device - * - * @param handle Device handle obtained using spi_lobo_bus_add_device - * - * @return - * - ESP_ERR_INVALID_ARG if parameter is invalid - * - ESP_OK on success - */ -esp_err_t spi_lobo_device_deselect(spi_lobo_device_handle_t handle); - - -/** - * @brief Check if spi bus uses native spi pins - * - * @param handle Device handle obtained using spi_lobo_bus_add_device - * - * @return - * - true if native spi pins are used - * - false if spi pins are routed through gpio matrix - */ -bool spi_lobo_uses_native_pins(spi_lobo_device_handle_t handle); - -/** - * @brief Get spi bus native spi pins - * - * @param handle Device handle obtained using spi_lobo_bus_add_device - * - * @return - * places spi bus native pins in provided pointers - */ -void spi_lobo_get_native_pins(int host, int *sdi, int *sdo, int *sck); - -/** - * @brief Transimit and receive data to/from spi device based on transaction data - * - * TRANSMIT 8-bit data to spi device from 'trans->tx_buffer' or 'trans->tx_data' (trans->lenght/8 bytes) - * and RECEIVE data to 'trans->rx_buffer' or 'trans->rx_data' (trans->rx_length/8 bytes) - * Lengths must be 8-bit multiples! - * If trans->rx_buffer is NULL or trans->rx_length is 0, only transmits data - * If trans->tx_buffer is NULL or trans->length is 0, only receives data - * If the device is in duplex mode (LB_SPI_DEVICE_HALFDUPLEX flag NOT set), data are transmitted and received simultaneously. - * If the device is in half duplex mode (LB_SPI_DEVICE_HALFDUPLEX flag IS set), data are received after transmission - * 'address', 'command' and 'dummy bits' are transmitted before data phase IF set in device's configuration - * and IF 'trans->length' and 'trans->rx_length' are NOT both 0 - * If device was not previously selected, it will be selected before transmission and deselected after transmission. - * - * @param handle Device handle obtained using spi_lobo_bus_add_device - * - * @param trans Pointer to variable containing the description of the transaction that is executed - * - * @return - * - ESP_ERR_INVALID_ARG if parameter is invalid - * - ESP error code if device cannot be selected - * - ESP_OK on success - * - */ -esp_err_t spi_lobo_transfer_data(spi_lobo_device_handle_t handle, spi_lobo_transaction_t *trans); - - -/* - * SPI transactions uses the semaphore (taken in select function) to protect the transfer - */ -esp_err_t spi_lobo_device_TakeSemaphore(spi_lobo_device_handle_t handle); -void spi_lobo_device_GiveSemaphore(spi_lobo_device_handle_t handle); - - -/** - * @brief Setup a DMA link chain - * - * This routine will set up a chain of linked DMA descriptors in the array pointed to by - * ``dmadesc``. Enough DMA descriptors will be used to fit the buffer of ``len`` bytes in, and the - * descriptors will point to the corresponding positions in ``buffer`` and linked together. The - * end result is that feeding ``dmadesc[0]`` into DMA hardware results in the entirety ``len`` bytes - * of ``data`` being read or written. - * - * @param dmadesc Pointer to array of DMA descriptors big enough to be able to convey ``len`` bytes - * @param len Length of buffer - * @param data Data buffer to use for DMA transfer - * @param isrx True if data is to be written into ``data``, false if it's to be read from ``data``. - */ -void spi_lobo_setup_dma_desc_links(lldesc_t *dmadesc, int len, const uint8_t *data, bool isrx); - -/** - * @brief Check if a DMA reset is requested but has not completed yet - * - * @return True when a DMA reset is requested but hasn't completed yet. False otherwise. - */ -bool spi_lobo_dmaworkaround_reset_in_progress(); - - -/** - * @brief Mark a DMA channel as idle. - * - * A call to this function tells the workaround logic that this channel will - * not be affected by a global SPI DMA reset. - */ -void spi_lobo_dmaworkaround_idle(int dmachan); - -/** - * @brief Mark a DMA channel as active. - * - * A call to this function tells the workaround logic that this channel will - * be affected by a global SPI DMA reset, and a reset like that should not be attempted. - */ -void spi_lobo_dmaworkaround_transfer_active(int dmachan); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/MicroPython_BUILD/components/micropython/genhdr/qstrdefs.generated.h b/MicroPython_BUILD/components/micropython/genhdr/qstrdefs.generated.h new file mode 100644 index 0000000..27b0407 --- /dev/null +++ b/MicroPython_BUILD/components/micropython/genhdr/qstrdefs.generated.h @@ -0,0 +1,1112 @@ +// This file was automatically generated by makeqstrdata.py + +QDEF(MP_QSTR_NULL, (const byte*)"\x00\x00\x00" "") +QDEF(MP_QSTR_, (const byte*)"\x05\x15\x00" "") +QDEF(MP_QSTR___abs__, (const byte*)"\x95\xd6\x07" "__abs__") +QDEF(MP_QSTR___add__, (const byte*)"\xc4\x82\x07" "__add__") +QDEF(MP_QSTR___aenter__, (const byte*)"\x4c\x84\x0a" "__aenter__") +QDEF(MP_QSTR___aexit__, (const byte*)"\xc4\xcf\x09" "__aexit__") +QDEF(MP_QSTR___aiter__, (const byte*)"\x4e\x2b\x09" "__aiter__") +QDEF(MP_QSTR___and__, (const byte*)"\x0e\xdb\x07" "__and__") +QDEF(MP_QSTR___anext__, (const byte*)"\x83\xb4\x09" "__anext__") +QDEF(MP_QSTR___bool__, (const byte*)"\x2b\x65\x08" "__bool__") +QDEF(MP_QSTR___build_class__, (const byte*)"\x42\x88\x0f" "__build_class__") +QDEF(MP_QSTR___call__, (const byte*)"\xa7\xf9\x08" "__call__") +QDEF(MP_QSTR___class__, (const byte*)"\x2b\xc5\x09" "__class__") +QDEF(MP_QSTR___contains__, (const byte*)"\xc6\x5f\x0c" "__contains__") +QDEF(MP_QSTR___del__, (const byte*)"\x68\x37\x07" "__del__") +QDEF(MP_QSTR___delitem__, (const byte*)"\xfd\x35\x0b" "__delitem__") +QDEF(MP_QSTR___dict__, (const byte*)"\x7f\x54\x08" "__dict__") +QDEF(MP_QSTR___divmod__, (const byte*)"\x78\x11\x0a" "__divmod__") +QDEF(MP_QSTR___enter__, (const byte*)"\x6d\xba\x09" "__enter__") +QDEF(MP_QSTR___eq__, (const byte*)"\x71\x3e\x06" "__eq__") +QDEF(MP_QSTR___exit__, (const byte*)"\x45\xf8\x08" "__exit__") +QDEF(MP_QSTR___file__, (const byte*)"\x03\x54\x08" "__file__") +QDEF(MP_QSTR___floordiv__, (const byte*)"\x46\x5f\x0c" "__floordiv__") +QDEF(MP_QSTR___ge__, (const byte*)"\xa7\x46\x06" "__ge__") +QDEF(MP_QSTR___getattr__, (const byte*)"\x40\xf8\x0b" "__getattr__") +QDEF(MP_QSTR___getitem__, (const byte*)"\x26\x39\x0b" "__getitem__") +QDEF(MP_QSTR___gt__, (const byte*)"\xb6\x82\x06" "__gt__") +QDEF(MP_QSTR___hash__, (const byte*)"\xf7\xc8\x08" "__hash__") +QDEF(MP_QSTR___iadd__, (const byte*)"\x6d\x4a\x08" "__iadd__") +QDEF(MP_QSTR___import__, (const byte*)"\x38\x3e\x0a" "__import__") +QDEF(MP_QSTR___init__, (const byte*)"\x5f\xa5\x08" "__init__") +QDEF(MP_QSTR___invert__, (const byte*)"\xf7\x77\x0a" "__invert__") +QDEF(MP_QSTR___isub__, (const byte*)"\x08\x78\x08" "__isub__") +QDEF(MP_QSTR___iter__, (const byte*)"\xcf\x32\x08" "__iter__") +QDEF(MP_QSTR___le__, (const byte*)"\xcc\x13\x06" "__le__") +QDEF(MP_QSTR___len__, (const byte*)"\xe2\xb0\x07" "__len__") +QDEF(MP_QSTR___lshift__, (const byte*)"\x09\x88\x0a" "__lshift__") +QDEF(MP_QSTR___lt__, (const byte*)"\x5d\x68\x06" "__lt__") +QDEF(MP_QSTR___main__, (const byte*)"\x8e\x13\x08" "__main__") +QDEF(MP_QSTR___mod__, (const byte*)"\x63\x37\x07" "__mod__") +QDEF(MP_QSTR___module__, (const byte*)"\xff\x30\x0a" "__module__") +QDEF(MP_QSTR___mul__, (const byte*)"\x31\x42\x07" "__mul__") +QDEF(MP_QSTR___name__, (const byte*)"\xe2\x38\x08" "__name__") +QDEF(MP_QSTR___neg__, (const byte*)"\x69\xd5\x07" "__neg__") +QDEF(MP_QSTR___new__, (const byte*)"\x79\x15\x07" "__new__") +QDEF(MP_QSTR___next__, (const byte*)"\x02\x73\x08" "__next__") +QDEF(MP_QSTR___or__, (const byte*)"\x38\xbb\x06" "__or__") +QDEF(MP_QSTR___path__, (const byte*)"\xc8\x23\x08" "__path__") +QDEF(MP_QSTR___pos__, (const byte*)"\x29\xf0\x07" "__pos__") +QDEF(MP_QSTR___pow__, (const byte*)"\x2d\x00\x07" "__pow__") +QDEF(MP_QSTR___qualname__, (const byte*)"\x6b\x00\x0c" "__qualname__") +QDEF(MP_QSTR___repl_print__, (const byte*)"\x00\xbb\x0e" "__repl_print__") +QDEF(MP_QSTR___repr__, (const byte*)"\x10\x0b\x08" "__repr__") +QDEF(MP_QSTR___reversed__, (const byte*)"\x61\xff\x0c" "__reversed__") +QDEF(MP_QSTR___rshift__, (const byte*)"\x57\x98\x0a" "__rshift__") +QDEF(MP_QSTR___setitem__, (const byte*)"\x32\x3e\x0b" "__setitem__") +QDEF(MP_QSTR___str__, (const byte*)"\xd0\xcd\x07" "__str__") +QDEF(MP_QSTR___sub__, (const byte*)"\x21\x09\x07" "__sub__") +QDEF(MP_QSTR___traceback__, (const byte*)"\x4f\xcf\x0d" "__traceback__") +QDEF(MP_QSTR___truediv__, (const byte*)"\x88\xef\x0b" "__truediv__") +QDEF(MP_QSTR___xor__, (const byte*)"\x20\xec\x07" "__xor__") +QDEF(MP_QSTR__star_, (const byte*)"\x8f\xb5\x01" "*") +QDEF(MP_QSTR__, (const byte*)"\xfa\xb5\x01" "_") +QDEF(MP_QSTR__slash_, (const byte*)"\x8a\xb5\x01" "/") +QDEF(MP_QSTR__percent__hash_o, (const byte*)"\x6c\x1a\x03" "%#o") +QDEF(MP_QSTR__percent__hash_x, (const byte*)"\x7b\x1a\x03" "%#x") +QDEF(MP_QSTR__brace_open__colon__hash_b_brace_close_, (const byte*)"\x58\x37\x05" "{:#b}") +QDEF(MP_QSTR__0x0a_, (const byte*)"\xaf\xb5\x01" "\x0a") +QDEF(MP_QSTR_maximum_space_recursion_space_depth_space_exceeded, (const byte*)"\x73\x1e\x20" "maximum recursion depth exceeded") +QDEF(MP_QSTR__lt_module_gt_, (const byte*)"\xbd\x94\x08" "") +QDEF(MP_QSTR__lt_lambda_gt_, (const byte*)"\x80\x8c\x08" "") +QDEF(MP_QSTR__lt_listcomp_gt_, (const byte*)"\xd4\x15\x0a" "") +QDEF(MP_QSTR__lt_dictcomp_gt_, (const byte*)"\xcc\x8d\x0a" "") +QDEF(MP_QSTR__lt_setcomp_gt_, (const byte*)"\x54\x51\x09" "") +QDEF(MP_QSTR__lt_genexpr_gt_, (const byte*)"\x34\x6a\x09" "") +QDEF(MP_QSTR__lt_string_gt_, (const byte*)"\x52\x53\x08" "") +QDEF(MP_QSTR__lt_stdin_gt_, (const byte*)"\xe3\x63\x07" "") +QDEF(MP_QSTR_utf_hyphen_8, (const byte*)"\xb7\x82\x05" "utf-8") +QDEF(MP_QSTR__slash_lib, (const byte*)"\x8d\x9c\x04" "/lib") +QDEF(MP_QSTR_ADC, (const byte*)"\x63\xb6\x03" "ADC") +QDEF(MP_QSTR_AF_INET, (const byte*)"\xeb\xb7\x07" "AF_INET") +QDEF(MP_QSTR_AF_INET6, (const byte*)"\x7d\xb5\x08" "AF_INET6") +QDEF(MP_QSTR_AP_IF, (const byte*)"\x04\x96\x05" "AP_IF") +QDEF(MP_QSTR_ARRAY, (const byte*)"\x5c\x7a\x05" "ARRAY") +QDEF(MP_QSTR_ATTN_0DB, (const byte*)"\x23\x45\x08" "ATTN_0DB") +QDEF(MP_QSTR_ATTN_11DB, (const byte*)"\x13\x1d\x09" "ATTN_11DB") +QDEF(MP_QSTR_ATTN_2_5DB, (const byte*)"\xeb\xf6\x0a" "ATTN_2_5DB") +QDEF(MP_QSTR_ATTN_6DB, (const byte*)"\x25\x2d\x08" "ATTN_6DB") +QDEF(MP_QSTR_AUTH_MAX, (const byte*)"\x66\x8d\x08" "AUTH_MAX") +QDEF(MP_QSTR_AUTH_OPEN, (const byte*)"\x46\xb3\x09" "AUTH_OPEN") +QDEF(MP_QSTR_AUTH_WEP, (const byte*)"\xf0\x0d\x08" "AUTH_WEP") +QDEF(MP_QSTR_AUTH_WPA2_PSK, (const byte*)"\xf1\xfe\x0d" "AUTH_WPA2_PSK") +QDEF(MP_QSTR_AUTH_WPA_PSK, (const byte*)"\xc3\x6c\x0c" "AUTH_WPA_PSK") +QDEF(MP_QSTR_AUTH_WPA_WPA2_PSK, (const byte*)"\xe8\x79\x11" "AUTH_WPA_WPA2_PSK") +QDEF(MP_QSTR_ArithmeticError, (const byte*)"\x2d\x8c\x0f" "ArithmeticError") +QDEF(MP_QSTR_AssertionError, (const byte*)"\x97\x5a\x0e" "AssertionError") +QDEF(MP_QSTR_AttributeError, (const byte*)"\x21\xde\x0e" "AttributeError") +QDEF(MP_QSTR_BFINT16, (const byte*)"\x95\xe2\x07" "BFINT16") +QDEF(MP_QSTR_BFINT32, (const byte*)"\x53\xe2\x07" "BFINT32") +QDEF(MP_QSTR_BFINT8, (const byte*)"\x4a\x9a\x06" "BFINT8") +QDEF(MP_QSTR_BFUINT16, (const byte*)"\x40\xa6\x08" "BFUINT16") +QDEF(MP_QSTR_BFUINT32, (const byte*)"\x06\xa6\x08" "BFUINT32") +QDEF(MP_QSTR_BFUINT8, (const byte*)"\xbf\xaf\x07" "BFUINT8") +QDEF(MP_QSTR_BF_LEN, (const byte*)"\x19\xb0\x06" "BF_LEN") +QDEF(MP_QSTR_BF_POS, (const byte*)"\x52\x9d\x06" "BF_POS") +QDEF(MP_QSTR_BIG_ENDIAN, (const byte*)"\xff\x51\x0a" "BIG_ENDIAN") +QDEF(MP_QSTR_BLACK, (const byte*)"\x82\x4d\x05" "BLACK") +QDEF(MP_QSTR_BLUE, (const byte*)"\x3b\x3b\x04" "BLUE") +QDEF(MP_QSTR_BMP, (const byte*)"\x9a\xc3\x03" "BMP") +QDEF(MP_QSTR_BOTTOM, (const byte*)"\x6a\x29\x06" "BOTTOM") +QDEF(MP_QSTR_BaseException, (const byte*)"\x07\x92\x0d" "BaseException") +QDEF(MP_QSTR_BufferedWriter, (const byte*)"\xeb\x2c\x0e" "BufferedWriter") +QDEF(MP_QSTR_BytesIO, (const byte*)"\x1a\xb7\x07" "BytesIO") +QDEF(MP_QSTR_CBTYPE_DATA, (const byte*)"\xb3\x6c\x0b" "CBTYPE_DATA") +QDEF(MP_QSTR_CBTYPE_ERROR, (const byte*)"\xbb\xe6\x0c" "CBTYPE_ERROR") +QDEF(MP_QSTR_CBTYPE_PATTERN, (const byte*)"\xab\xb3\x0e" "CBTYPE_PATTERN") +QDEF(MP_QSTR_CB_DATA, (const byte*)"\x6b\x50\x07" "CB_DATA") +QDEF(MP_QSTR_CB_READ, (const byte*)"\x49\x33\x07" "CB_READ") +QDEF(MP_QSTR_CB_WRITE, (const byte*)"\xc6\xca\x08" "CB_WRITE") +QDEF(MP_QSTR_CENTER, (const byte*)"\x8e\xdb\x06" "CENTER") +QDEF(MP_QSTR_CHRONO, (const byte*)"\x32\xd2\x06" "CHRONO") +QDEF(MP_QSTR_COLOR_BITS16, (const byte*)"\x8c\x23\x0c" "COLOR_BITS16") +QDEF(MP_QSTR_COLOR_BITS24, (const byte*)"\xad\x23\x0c" "COLOR_BITS24") +QDEF(MP_QSTR_CYAN, (const byte*)"\x10\x26\x04" "CYAN") +QDEF(MP_QSTR_DAC, (const byte*)"\x03\xba\x03" "DAC") +QDEF(MP_QSTR_DARKCYAN, (const byte*)"\x0c\xab\x08" "DARKCYAN") +QDEF(MP_QSTR_DARKGREEN, (const byte*)"\x42\x23\x09" "DARKGREEN") +QDEF(MP_QSTR_DARKGREY, (const byte*)"\x90\xf1\x08" "DARKGREY") +QDEF(MP_QSTR_DEBUG, (const byte*)"\x34\x6d\x05" "DEBUG") +QDEF(MP_QSTR_DESC, (const byte*)"\x34\x0d\x04" "DESC") +QDEF(MP_QSTR_DHT, (const byte*)"\x3d\xbb\x03" "DHT") +QDEF(MP_QSTR_DHT11, (const byte*)"\x5d\x80\x05" "DHT11") +QDEF(MP_QSTR_DHT2X, (const byte*)"\x97\x80\x05" "DHT2X") +QDEF(MP_QSTR_DecompIO, (const byte*)"\x93\xb7\x08" "DecompIO") +QDEF(MP_QSTR_EACCES, (const byte*)"\x37\xc2\x06" "EACCES") +QDEF(MP_QSTR_EADDRINUSE, (const byte*)"\x17\x11\x0a" "EADDRINUSE") +QDEF(MP_QSTR_EAGAIN, (const byte*)"\x20\xec\x06" "EAGAIN") +QDEF(MP_QSTR_EALREADY, (const byte*)"\x46\x15\x08" "EALREADY") +QDEF(MP_QSTR_EBADF, (const byte*)"\x61\xa3\x05" "EBADF") +QDEF(MP_QSTR_ECONNABORTED, (const byte*)"\x27\xab\x0c" "ECONNABORTED") +QDEF(MP_QSTR_ECONNREFUSED, (const byte*)"\x3a\x2c\x0c" "ECONNREFUSED") +QDEF(MP_QSTR_ECONNRESET, (const byte*)"\x19\xfb\x0a" "ECONNRESET") +QDEF(MP_QSTR_EEXIST, (const byte*)"\x53\xad\x06" "EEXIST") +QDEF(MP_QSTR_EHOSTUNREACH, (const byte*)"\x86\x25\x0c" "EHOSTUNREACH") +QDEF(MP_QSTR_EINPROGRESS, (const byte*)"\x9a\xa0\x0b" "EINPROGRESS") +QDEF(MP_QSTR_EINVAL, (const byte*)"\x5c\xff\x06" "EINVAL") +QDEF(MP_QSTR_EIO, (const byte*)"\x86\xa6\x03" "EIO") +QDEF(MP_QSTR_EISDIR, (const byte*)"\xa5\x4f\x06" "EISDIR") +QDEF(MP_QSTR_ENOBUFS, (const byte*)"\xe3\x87\x07" "ENOBUFS") +QDEF(MP_QSTR_ENODEV, (const byte*)"\xb6\x67\x06" "ENODEV") +QDEF(MP_QSTR_ENOENT, (const byte*)"\x5e\x65\x06" "ENOENT") +QDEF(MP_QSTR_ENOMEM, (const byte*)"\xa4\x85\x06" "ENOMEM") +QDEF(MP_QSTR_ENOTCONN, (const byte*)"\x79\xd7\x08" "ENOTCONN") +QDEF(MP_QSTR_EOFError, (const byte*)"\x91\xbf\x08" "EOFError") +QDEF(MP_QSTR_EOPNOTSUPP, (const byte*)"\xac\x97\x0a" "EOPNOTSUPP") +QDEF(MP_QSTR_EPERM, (const byte*)"\xea\x7f\x05" "EPERM") +QDEF(MP_QSTR_ETIMEDOUT, (const byte*)"\xff\xf8\x09" "ETIMEDOUT") +QDEF(MP_QSTR_EXIT, (const byte*)"\x45\xc7\x04" "EXIT") +QDEF(MP_QSTR_EXTBASE, (const byte*)"\x19\x3d\x07" "EXTBASE") +QDEF(MP_QSTR_EXTENDED, (const byte*)"\x42\x69\x08" "EXTENDED") +QDEF(MP_QSTR_Ellipsis, (const byte*)"\xf0\xe0\x08" "Ellipsis") +QDEF(MP_QSTR_Exception, (const byte*)"\xf2\x29\x09" "Exception") +QDEF(MP_QSTR_FLOAT32, (const byte*)"\xb4\x87\x07" "FLOAT32") +QDEF(MP_QSTR_FLOAT64, (const byte*)"\x17\x87\x07" "FLOAT64") +QDEF(MP_QSTR_FONT_7seg, (const byte*)"\x0f\x87\x09" "FONT_7seg") +QDEF(MP_QSTR_FONT_Comic, (const byte*)"\xa2\xd2\x0a" "FONT_Comic") +QDEF(MP_QSTR_FONT_Default, (const byte*)"\x22\xdc\x0c" "FONT_Default") +QDEF(MP_QSTR_FONT_DefaultSmall, (const byte*)"\x5d\x0b\x11" "FONT_DefaultSmall") +QDEF(MP_QSTR_FONT_DejaVu18, (const byte*)"\xa9\xa8\x0d" "FONT_DejaVu18") +QDEF(MP_QSTR_FONT_DejaVu24, (const byte*)"\x86\xa8\x0d" "FONT_DejaVu24") +QDEF(MP_QSTR_FONT_Minya, (const byte*)"\x3b\xc1\x0a" "FONT_Minya") +QDEF(MP_QSTR_FONT_Small, (const byte*)"\x16\x43\x0a" "FONT_Small") +QDEF(MP_QSTR_FONT_Tooney, (const byte*)"\xef\xf6\x0b" "FONT_Tooney") +QDEF(MP_QSTR_FONT_Ubuntu, (const byte*)"\xa4\xfb\x0b" "FONT_Ubuntu") +QDEF(MP_QSTR_FileIO, (const byte*)"\xc5\x15\x06" "FileIO") +QDEF(MP_QSTR_FrameBuffer, (const byte*)"\xd8\xbe\x0b" "FrameBuffer") +QDEF(MP_QSTR_FrameBuffer1, (const byte*)"\xe9\x99\x0c" "FrameBuffer1") +QDEF(MP_QSTR_GENERIC, (const byte*)"\x54\x0c\x07" "GENERIC") +QDEF(MP_QSTR_GRAY, (const byte*)"\x08\xc6\x04" "GRAY") +QDEF(MP_QSTR_GREEN, (const byte*)"\xde\x98\x05" "GREEN") +QDEF(MP_QSTR_GREENYELLOW, (const byte*)"\xda\x02\x0b" "GREENYELLOW") +QDEF(MP_QSTR_GS4_HMSB, (const byte*)"\x6e\x73\x08" "GS4_HMSB") +QDEF(MP_QSTR_GeneratorExit, (const byte*)"\x16\x62\x0d" "GeneratorExit") +QDEF(MP_QSTR_HALL, (const byte*)"\x4c\x8d\x04" "HALL") +QDEF(MP_QSTR_HSBtoRGB, (const byte*)"\xd0\x92\x08" "HSBtoRGB") +QDEF(MP_QSTR_HSBtoRGBint, (const byte*)"\xe3\xfa\x0b" "HSBtoRGBint") +QDEF(MP_QSTR_HSPI, (const byte*)"\xc7\xe9\x04" "HSPI") +QDEF(MP_QSTR_I2C, (const byte*)"\x5d\xdf\x03" "I2C") +QDEF(MP_QSTR_ILI9341, (const byte*)"\x86\x05\x07" "ILI9341") +QDEF(MP_QSTR_ILI9488, (const byte*)"\x84\x12\x07" "ILI9488") +QDEF(MP_QSTR_IN, (const byte*)"\x22\x73\x02" "IN") +QDEF(MP_QSTR_INCL, (const byte*)"\x0d\xbb\x04" "INCL") +QDEF(MP_QSTR_INT16, (const byte*)"\x91\x76\x05" "INT16") +QDEF(MP_QSTR_INT32, (const byte*)"\x57\x76\x05" "INT32") +QDEF(MP_QSTR_INT64, (const byte*)"\xf4\x75\x05" "INT64") +QDEF(MP_QSTR_INT8, (const byte*)"\xce\xbd\x04" "INT8") +QDEF(MP_QSTR_IPPROTO_IP, (const byte*)"\x0c\x8e\x0a" "IPPROTO_IP") +QDEF(MP_QSTR_IPPROTO_TCP, (const byte*)"\xb2\xde\x0b" "IPPROTO_TCP") +QDEF(MP_QSTR_IPPROTO_UDP, (const byte*)"\x54\xdb\x0b" "IPPROTO_UDP") +QDEF(MP_QSTR_IP_ADD_MEMBERSHIP, (const byte*)"\x6f\x5b\x11" "IP_ADD_MEMBERSHIP") +QDEF(MP_QSTR_IRQ, (const byte*)"\xaf\xda\x03" "IRQ") +QDEF(MP_QSTR_IRQ_FALLING, (const byte*)"\x37\xc0\x0b" "IRQ_FALLING") +QDEF(MP_QSTR_IRQ_RISING, (const byte*)"\x78\xed\x0a" "IRQ_RISING") +QDEF(MP_QSTR_ImportError, (const byte*)"\x20\x9c\x0b" "ImportError") +QDEF(MP_QSTR_IndentationError, (const byte*)"\x5c\x20\x10" "IndentationError") +QDEF(MP_QSTR_IndexError, (const byte*)"\x83\xad\x0a" "IndexError") +QDEF(MP_QSTR_JPG, (const byte*)"\x38\xe7\x03" "JPG") +QDEF(MP_QSTR_KeyError, (const byte*)"\xea\x00\x08" "KeyError") +QDEF(MP_QSTR_KeyboardInterrupt, (const byte*)"\xaf\xe2\x11" "KeyboardInterrupt") +QDEF(MP_QSTR_LAN, (const byte*)"\x06\xdc\x03" "LAN") +QDEF(MP_QSTR_LANDSCAPE, (const byte*)"\xa6\x7b\x09" "LANDSCAPE") +QDEF(MP_QSTR_LANDSCAPE_FLIP, (const byte*)"\xca\x5c\x0e" "LANDSCAPE_FLIP") +QDEF(MP_QSTR_LASTX, (const byte*)"\x57\x45\x05" "LASTX") +QDEF(MP_QSTR_LASTY, (const byte*)"\x56\x45\x05" "LASTY") +QDEF(MP_QSTR_LIGHTGREY, (const byte*)"\xd2\x77\x09" "LIGHTGREY") +QDEF(MP_QSTR_LIME, (const byte*)"\xe8\x3c\x04" "LIME") +QDEF(MP_QSTR_LITTLE_ENDIAN, (const byte*)"\xbf\x5b\x0d" "LITTLE_ENDIAN") +QDEF(MP_QSTR_LOG_DEBUG, (const byte*)"\x6f\xdb\x09" "LOG_DEBUG") +QDEF(MP_QSTR_LOG_ERROR, (const byte*)"\x06\xce\x09" "LOG_ERROR") +QDEF(MP_QSTR_LOG_INFO, (const byte*)"\xd0\x75\x08" "LOG_INFO") +QDEF(MP_QSTR_LOG_NONE, (const byte*)"\xf4\xd3\x08" "LOG_NONE") +QDEF(MP_QSTR_LOG_VERBOSE, (const byte*)"\x24\xbd\x0b" "LOG_VERBOSE") +QDEF(MP_QSTR_LOG_WARN, (const byte*)"\x54\xad\x08" "LOG_WARN") +QDEF(MP_QSTR_LSB, (const byte*)"\xd8\xde\x03" "LSB") +QDEF(MP_QSTR_LookupError, (const byte*)"\xff\x69\x0b" "LookupError") +QDEF(MP_QSTR_M5STACK, (const byte*)"\x13\xad\x07" "M5STACK") +QDEF(MP_QSTR_MAGENTA, (const byte*)"\xf0\xf0\x07" "MAGENTA") +QDEF(MP_QSTR_MAROON, (const byte*)"\x95\x40\x06" "MAROON") +QDEF(MP_QSTR_MASTER, (const byte*)"\x39\x8d\x06" "MASTER") +QDEF(MP_QSTR_MODE_11B, (const byte*)"\xfb\x44\x08" "MODE_11B") +QDEF(MP_QSTR_MODE_11G, (const byte*)"\xfe\x44\x08" "MODE_11G") +QDEF(MP_QSTR_MODE_11N, (const byte*)"\xf7\x44\x08" "MODE_11N") +QDEF(MP_QSTR_MONO_HLSB, (const byte*)"\x4c\x98\x09" "MONO_HLSB") +QDEF(MP_QSTR_MONO_HMSB, (const byte*)"\xcd\x83\x09" "MONO_HMSB") +QDEF(MP_QSTR_MONO_VLSB, (const byte*)"\x12\xfc\x09" "MONO_VLSB") +QDEF(MP_QSTR_MSB, (const byte*)"\x59\xca\x03" "MSB") +QDEF(MP_QSTR_MVLSB, (const byte*)"\x03\x14\x05" "MVLSB") +QDEF(MP_QSTR_MemoryError, (const byte*)"\xdc\x83\x0b" "MemoryError") +QDEF(MP_QSTR_Message, (const byte*)"\x8e\x9c\x07" "Message") +QDEF(MP_QSTR_Mqtt, (const byte*)"\x19\x7f\x04" "Mqtt") +QDEF(MP_QSTR_NATIVE, (const byte*)"\x04\x8e\x06" "NATIVE") +QDEF(MP_QSTR_NAVY, (const byte*)"\xc5\x57\x04" "NAVY") +QDEF(MP_QSTR_NameError, (const byte*)"\xba\x2d\x09" "NameError") +QDEF(MP_QSTR_Neopixel, (const byte*)"\x49\x42\x08" "Neopixel") +QDEF(MP_QSTR_NoneType, (const byte*)"\x17\x68\x08" "NoneType") +QDEF(MP_QSTR_NotImplemented, (const byte*)"\x3e\xc6\x0e" "NotImplemented") +QDEF(MP_QSTR_NotImplementedError, (const byte*)"\xc6\x98\x13" "NotImplementedError") +QDEF(MP_QSTR_OLIVE, (const byte*)"\x7c\xb1\x05" "OLIVE") +QDEF(MP_QSTR_ONE_SHOT, (const byte*)"\x5e\xff\x08" "ONE_SHOT") +QDEF(MP_QSTR_OPEN_DRAIN, (const byte*)"\x5e\x48\x0a" "OPEN_DRAIN") +QDEF(MP_QSTR_ORANGE, (const byte*)"\xf5\xc1\x06" "ORANGE") +QDEF(MP_QSTR_OSError, (const byte*)"\xa1\x65\x07" "OSError") +QDEF(MP_QSTR_OUT, (const byte*)"\x0b\xe3\x03" "OUT") +QDEF(MP_QSTR_Onewire, (const byte*)"\x48\x3b\x07" "Onewire") +QDEF(MP_QSTR_OrderedDict, (const byte*)"\xf0\x7e\x0b" "OrderedDict") +QDEF(MP_QSTR_OverflowError, (const byte*)"\x81\xe1\x0d" "OverflowError") +QDEF(MP_QSTR_PAUSE, (const byte*)"\xf7\xdd\x05" "PAUSE") +QDEF(MP_QSTR_PERIODIC, (const byte*)"\x0a\x35\x08" "PERIODIC") +QDEF(MP_QSTR_PHY_LAN8720, (const byte*)"\xf5\x1f\x0b" "PHY_LAN8720") +QDEF(MP_QSTR_PHY_TLK110, (const byte*)"\x98\xf7\x0a" "PHY_TLK110") +QDEF(MP_QSTR_PINK, (const byte*)"\x19\x12\x04" "PINK") +QDEF(MP_QSTR_POLLERR, (const byte*)"\xdf\xc0\x07" "POLLERR") +QDEF(MP_QSTR_POLLHUP, (const byte*)"\x77\x8a\x07" "POLLHUP") +QDEF(MP_QSTR_POLLIN, (const byte*)"\x7d\x61\x06" "POLLIN") +QDEF(MP_QSTR_POLLOUT, (const byte*)"\x74\x85\x07" "POLLOUT") +QDEF(MP_QSTR_PORTRAIT, (const byte*)"\xf2\xcd\x08" "PORTRAIT") +QDEF(MP_QSTR_PORTRAIT_FLIP, (const byte*)"\x1e\xf2\x0d" "PORTRAIT_FLIP") +QDEF(MP_QSTR_PTR, (const byte*)"\xb3\x0c\x03" "PTR") +QDEF(MP_QSTR_PULL_DOWN, (const byte*)"\xad\xfb\x09" "PULL_DOWN") +QDEF(MP_QSTR_PULL_UP, (const byte*)"\xba\x5e\x07" "PULL_UP") +QDEF(MP_QSTR_PURPLE, (const byte*)"\x0b\x40\x06" "PURPLE") +QDEF(MP_QSTR_PWM, (const byte*)"\x4f\x0d\x03" "PWM") +QDEF(MP_QSTR_Pin, (const byte*)"\x12\x14\x03" "Pin") +QDEF(MP_QSTR_PinBase, (const byte*)"\x47\x43\x07" "PinBase") +QDEF(MP_QSTR_READ, (const byte*)"\xb7\xd8\x04" "READ") +QDEF(MP_QSTR_RED, (const byte*)"\x96\x06\x03" "RED") +QDEF(MP_QSTR_RESUME, (const byte*)"\x1c\x5c\x06" "RESUME") +QDEF(MP_QSTR_RGB565, (const byte*)"\x64\xcc\x06" "RGB565") +QDEF(MP_QSTR_RGBtoHSB, (const byte*)"\x10\x1d\x08" "RGBtoHSB") +QDEF(MP_QSTR_RIGHT, (const byte*)"\xc5\x79\x05" "RIGHT") +QDEF(MP_QSTR_RTC, (const byte*)"\xa0\x04\x03" "RTC") +QDEF(MP_QSTR_RUNNING, (const byte*)"\x42\x45\x07" "RUNNING") +QDEF(MP_QSTR_RuntimeError, (const byte*)"\x61\xf1\x0c" "RuntimeError") +QDEF(MP_QSTR_SDMODE_1LINE, (const byte*)"\x91\xff\x0c" "SDMODE_1LINE") +QDEF(MP_QSTR_SDMODE_4LINE, (const byte*)"\x94\xbe\x0c" "SDMODE_4LINE") +QDEF(MP_QSTR_SDMODE_SPI, (const byte*)"\x24\xb9\x0a" "SDMODE_SPI") +QDEF(MP_QSTR_SILVER, (const byte*)"\x52\xdb\x06" "SILVER") +QDEF(MP_QSTR_SLAVE, (const byte*)"\x68\x15\x05" "SLAVE") +QDEF(MP_QSTR_SMS_ALL, (const byte*)"\xf6\x3e\x07" "SMS_ALL") +QDEF(MP_QSTR_SMS_READ, (const byte*)"\x65\x95\x08" "SMS_READ") +QDEF(MP_QSTR_SMS_UNREAD, (const byte*)"\xde\x94\x0a" "SMS_UNREAD") +QDEF(MP_QSTR_SMTP, (const byte*)"\xbf\x95\x04" "SMTP") +QDEF(MP_QSTR_SMTPS, (const byte*)"\xcc\x4d\x05" "SMTPS") +QDEF(MP_QSTR_SOCK_DGRAM, (const byte*)"\xb3\x14\x0a" "SOCK_DGRAM") +QDEF(MP_QSTR_SOCK_RAW, (const byte*)"\xca\x96\x08" "SOCK_RAW") +QDEF(MP_QSTR_SOCK_STREAM, (const byte*)"\x32\xbe\x0b" "SOCK_STREAM") +QDEF(MP_QSTR_SOL_SOCKET, (const byte*)"\x0f\xdf\x0a" "SOL_SOCKET") +QDEF(MP_QSTR_SORT_ASC, (const byte*)"\xb1\x7b\x08" "SORT_ASC") +QDEF(MP_QSTR_SORT_DESC, (const byte*)"\xf1\x54\x09" "SORT_DESC") +QDEF(MP_QSTR_SORT_NONE, (const byte*)"\xca\xb5\x09" "SORT_NONE") +QDEF(MP_QSTR_SO_REUSEADDR, (const byte*)"\x21\x53\x0c" "SO_REUSEADDR") +QDEF(MP_QSTR_SPI, (const byte*)"\xef\x11\x03" "SPI") +QDEF(MP_QSTR_ST7735, (const byte*)"\x24\x22\x06" "ST7735") +QDEF(MP_QSTR_ST7735B, (const byte*)"\xe6\x66\x07" "ST7735B") +QDEF(MP_QSTR_ST7735R, (const byte*)"\xf6\x66\x07" "ST7735R") +QDEF(MP_QSTR_ST7789, (const byte*)"\x03\x23\x06" "ST7789") +QDEF(MP_QSTR_STATUS, (const byte*)"\x31\xf4\x06" "STATUS") +QDEF(MP_QSTR_STA_IF, (const byte*)"\xb3\x1b\x06" "STA_IF") +QDEF(MP_QSTR_STOP, (const byte*)"\x5d\x3f\x04" "STOP") +QDEF(MP_QSTR_SUSPEND, (const byte*)"\x0f\x79\x07" "SUSPEND") +QDEF(MP_QSTR_SUSPENDED, (const byte*)"\xae\xef\x09" "SUSPENDED") +QDEF(MP_QSTR_Signal, (const byte*)"\x9b\xe4\x06" "Signal") +QDEF(MP_QSTR_StopAsyncIteration, (const byte*)"\xec\xf0\x12" "StopAsyncIteration") +QDEF(MP_QSTR_StopIteration, (const byte*)"\xea\x1c\x0d" "StopIteration") +QDEF(MP_QSTR_StringIO, (const byte*)"\x76\x76\x08" "StringIO") +QDEF(MP_QSTR_SyntaxError, (const byte*)"\x94\x8f\x0b" "SyntaxError") +QDEF(MP_QSTR_SystemExit, (const byte*)"\x20\xff\x0a" "SystemExit") +QDEF(MP_QSTR_TEAL, (const byte*)"\x79\xd1\x04" "TEAL") +QDEF(MP_QSTR_TERMINATED, (const byte*)"\x78\xca\x0a" "TERMINATED") +QDEF(MP_QSTR_TFT, (const byte*)"\x63\xff\x03" "TFT") +QDEF(MP_QSTR_TOUCH_NONE, (const byte*)"\xb5\x0a\x0a" "TOUCH_NONE") +QDEF(MP_QSTR_TOUCH_STMPE, (const byte*)"\xc0\x76\x0b" "TOUCH_STMPE") +QDEF(MP_QSTR_TOUCH_XPT, (const byte*)"\x43\x32\x09" "TOUCH_XPT") +QDEF(MP_QSTR_TRACE_ALL, (const byte*)"\xba\x6e\x09" "TRACE_ALL") +QDEF(MP_QSTR_TRACE_AUTH, (const byte*)"\xf3\x39\x0a" "TRACE_AUTH") +QDEF(MP_QSTR_TRACE_CONN, (const byte*)"\x77\x5a\x0a" "TRACE_CONN") +QDEF(MP_QSTR_TRACE_ERROR, (const byte*)"\xc3\x1c\x0b" "TRACE_ERROR") +QDEF(MP_QSTR_TRACE_KEX, (const byte*)"\x4d\x56\x09" "TRACE_KEX") +QDEF(MP_QSTR_TRACE_NONE, (const byte*)"\x51\xad\x0a" "TRACE_NONE") +QDEF(MP_QSTR_TRACE_PUBLICKEY, (const byte*)"\xcd\x1a\x0f" "TRACE_PUBLICKEY") +QDEF(MP_QSTR_TRACE_SCP, (const byte*)"\x9b\x33\x09" "TRACE_SCP") +QDEF(MP_QSTR_TRACE_SFTP, (const byte*)"\xea\xc3\x0a" "TRACE_SFTP") +QDEF(MP_QSTR_TRACE_SOCKET, (const byte*)"\x7e\xcb\x0c" "TRACE_SOCKET") +QDEF(MP_QSTR_TRACE_TRANS, (const byte*)"\xe1\xf8\x0b" "TRACE_TRANS") +QDEF(MP_QSTR_TYPE_RGB, (const byte*)"\x95\xd4\x08" "TYPE_RGB") +QDEF(MP_QSTR_TYPE_RGBW, (const byte*)"\x62\x67\x09" "TYPE_RGBW") +QDEF(MP_QSTR_TextIOWrapper, (const byte*)"\xad\x8d\x0d" "TextIOWrapper") +QDEF(MP_QSTR_ThreadID, (const byte*)"\x26\x9d\x08" "ThreadID") +QDEF(MP_QSTR_TimeoutError, (const byte*)"\x66\x4b\x0c" "TimeoutError") +QDEF(MP_QSTR_Timer, (const byte*)"\xa2\x1f\x05" "Timer") +QDEF(MP_QSTR_TouchPad, (const byte*)"\xd5\x8a\x08" "TouchPad") +QDEF(MP_QSTR_TypeError, (const byte*)"\x25\x96\x09" "TypeError") +QDEF(MP_QSTR_UART, (const byte*)"\xb7\x19\x04" "UART") +QDEF(MP_QSTR_UINT16, (const byte*)"\xc4\x17\x06" "UINT16") +QDEF(MP_QSTR_UINT32, (const byte*)"\x82\x17\x06" "UINT32") +QDEF(MP_QSTR_UINT64, (const byte*)"\x61\x18\x06" "UINT64") +QDEF(MP_QSTR_UINT8, (const byte*)"\xbb\xe1\x05" "UINT8") +QDEF(MP_QSTR_UnicodeError, (const byte*)"\x22\xd1\x0c" "UnicodeError") +QDEF(MP_QSTR_VOID, (const byte*)"\x31\xf2\x04" "VOID") +QDEF(MP_QSTR_VSPI, (const byte*)"\x19\x7e\x04" "VSPI") +QDEF(MP_QSTR_ValueError, (const byte*)"\x96\x87\x0a" "ValueError") +QDEF(MP_QSTR_VfsNative, (const byte*)"\x07\xdf\x09" "VfsNative") +QDEF(MP_QSTR_WAITING, (const byte*)"\x8e\xdc\x07" "WAITING") +QDEF(MP_QSTR_WHITE, (const byte*)"\xa2\xc2\x05" "WHITE") +QDEF(MP_QSTR_WIDTH_10BIT, (const byte*)"\xc2\x7c\x0b" "WIDTH_10BIT") +QDEF(MP_QSTR_WIDTH_11BIT, (const byte*)"\xa3\xdf\x0b" "WIDTH_11BIT") +QDEF(MP_QSTR_WIDTH_12BIT, (const byte*)"\x80\xa4\x0b" "WIDTH_12BIT") +QDEF(MP_QSTR_WIDTH_9BIT, (const byte*)"\x5a\x2c\x0a" "WIDTH_9BIT") +QDEF(MP_QSTR_WLAN, (const byte*)"\x11\x94\x04" "WLAN") +QDEF(MP_QSTR_WRITE, (const byte*)"\xf8\xa8\x05" "WRITE") +QDEF(MP_QSTR_YELLOW, (const byte*)"\x41\x49\x06" "YELLOW") +QDEF(MP_QSTR_ZeroDivisionError, (const byte*)"\xb6\x27\x11" "ZeroDivisionError") +QDEF(MP_QSTR__thread, (const byte*)"\xd4\x02\x07" "_thread") +QDEF(MP_QSTR_a2b_base64, (const byte*)"\x3c\x0b\x0a" "a2b_base64") +QDEF(MP_QSTR_abs, (const byte*)"\x95\x32\x03" "abs") +QDEF(MP_QSTR_accept, (const byte*)"\x85\x89\x06" "accept") +QDEF(MP_QSTR_accepted, (const byte*)"\x24\x02\x08" "accepted") +QDEF(MP_QSTR_acos, (const byte*)"\x1b\xa0\x04" "acos") +QDEF(MP_QSTR_acosh, (const byte*)"\x13\xa3\x05" "acosh") +QDEF(MP_QSTR_active, (const byte*)"\x69\xea\x06" "active") +QDEF(MP_QSTR_add, (const byte*)"\x44\x32\x03" "add") +QDEF(MP_QSTR_addService, (const byte*)"\xd9\x55\x0a" "addService") +QDEF(MP_QSTR_addr, (const byte*)"\xb6\x7a\x04" "addr") +QDEF(MP_QSTR_address, (const byte*)"\x73\x53\x07" "address") +QDEF(MP_QSTR_addressof, (const byte*)"\x5a\xf9\x09" "addressof") +QDEF(MP_QSTR_addrlen, (const byte*)"\x71\x7c\x07" "addrlen") +QDEF(MP_QSTR_adrlen, (const byte*)"\x55\xb8\x06" "adrlen") +QDEF(MP_QSTR_all, (const byte*)"\x44\x33\x03" "all") +QDEF(MP_QSTR_alloc_emergency_exception_buf, (const byte*)"\x78\x2a\x1d" "alloc_emergency_exception_buf") +QDEF(MP_QSTR_allowsuspend, (const byte*)"\x76\xc3\x0c" "allowsuspend") +QDEF(MP_QSTR_angle, (const byte*)"\x84\x2c\x05" "angle") +QDEF(MP_QSTR_any, (const byte*)"\x13\x33\x03" "any") +QDEF(MP_QSTR_apn, (const byte*)"\xda\x34\x03" "apn") +QDEF(MP_QSTR_append, (const byte*)"\x6b\x97\x06" "append") +QDEF(MP_QSTR_arc, (const byte*)"\x95\x34\x03" "arc") +QDEF(MP_QSTR_arg, (const byte*)"\x91\x34\x03" "arg") +QDEF(MP_QSTR_args, (const byte*)"\xc2\xc6\x04" "args") +QDEF(MP_QSTR_argv, (const byte*)"\xc7\xc6\x04" "argv") +QDEF(MP_QSTR_array, (const byte*)"\x7c\x72\x05" "array") +QDEF(MP_QSTR_asin, (const byte*)"\x50\xe5\x04" "asin") +QDEF(MP_QSTR_asinh, (const byte*)"\x38\x8f\x05" "asinh") +QDEF(MP_QSTR_asnum, (const byte*)"\x01\x82\x05" "asnum") +QDEF(MP_QSTR_atan, (const byte*)"\x1f\xbe\x04" "atan") +QDEF(MP_QSTR_atan2, (const byte*)"\xcd\x81\x05" "atan2") +QDEF(MP_QSTR_atanh, (const byte*)"\x97\x81\x05" "atanh") +QDEF(MP_QSTR_atcmd, (const byte*)"\xfa\x9a\x05" "atcmd") +QDEF(MP_QSTR_attach, (const byte*)"\x8e\x75\x06" "attach") +QDEF(MP_QSTR_atten, (const byte*)"\xaf\x50\x05" "atten") +QDEF(MP_QSTR_attrib7seg, (const byte*)"\xdb\x79\x0a" "attrib7seg") +QDEF(MP_QSTR_authmode, (const byte*)"\xce\x65\x08" "authmode") +QDEF(MP_QSTR_autoreconnect, (const byte*)"\xe3\x51\x0d" "autoreconnect") +QDEF(MP_QSTR_b2a_base64, (const byte*)"\x3c\x8f\x0a" "b2a_base64") +QDEF(MP_QSTR_backl_on, (const byte*)"\xbc\x78\x08" "backl_on") +QDEF(MP_QSTR_backl_pin, (const byte*)"\xaa\x80\x09" "backl_pin") +QDEF(MP_QSTR_backlight, (const byte*)"\xb0\x86\x09" "backlight") +QDEF(MP_QSTR_baudrate, (const byte*)"\xf5\xd8\x08" "baudrate") +QDEF(MP_QSTR_begin, (const byte*)"\x82\xc1\x05" "begin") +QDEF(MP_QSTR_bgcolor, (const byte*)"\xbd\xb6\x07" "bgcolor") +QDEF(MP_QSTR_bgr, (const byte*)"\xb2\x46\x03" "bgr") +QDEF(MP_QSTR_bin, (const byte*)"\xe0\x48\x03" "bin") +QDEF(MP_QSTR_binascii, (const byte*)"\x91\x3c\x08" "binascii") +QDEF(MP_QSTR_bind, (const byte*)"\x84\x64\x04" "bind") +QDEF(MP_QSTR_bits, (const byte*)"\x49\x68\x04" "bits") +QDEF(MP_QSTR_blit, (const byte*)"\xf6\x50\x04" "blit") +QDEF(MP_QSTR_bodylen, (const byte*)"\x32\x36\x07" "bodylen") +QDEF(MP_QSTR_bool, (const byte*)"\xeb\x3c\x04" "bool") +QDEF(MP_QSTR_bound_method, (const byte*)"\x97\xa2\x0c" "bound_method") +QDEF(MP_QSTR_brightness, (const byte*)"\x4c\xc6\x0a" "brightness") +QDEF(MP_QSTR_btree, (const byte*)"\xe1\x91\x05" "btree") +QDEF(MP_QSTR_buf, (const byte*)"\x74\x49\x03" "buf") +QDEF(MP_QSTR_buffer, (const byte*)"\xe5\xa0\x06" "buffer") +QDEF(MP_QSTR_buffer_size, (const byte*)"\xbf\xd5\x0b" "buffer_size") +QDEF(MP_QSTR_buffering, (const byte*)"\x25\xdb\x09" "buffering") +QDEF(MP_QSTR_buffsize, (const byte*)"\x77\xad\x08" "buffsize") +QDEF(MP_QSTR_builtins, (const byte*)"\xf7\x31\x08" "builtins") +QDEF(MP_QSTR_bytearray, (const byte*)"\x76\xa3\x09" "bytearray") +QDEF(MP_QSTR_bytearray_at, (const byte*)"\x9c\x5c\x0c" "bytearray_at") +QDEF(MP_QSTR_bytecode, (const byte*)"\x22\x7d\x08" "bytecode") +QDEF(MP_QSTR_byteorder, (const byte*)"\x61\x99\x09" "byteorder") +QDEF(MP_QSTR_bytes, (const byte*)"\x5c\xb2\x05" "bytes") +QDEF(MP_QSTR_bytes_at, (const byte*)"\xb6\x5d\x08" "bytes_at") +QDEF(MP_QSTR_cachesize, (const byte*)"\xcc\x78\x09" "cachesize") +QDEF(MP_QSTR_calcsize, (const byte*)"\x4d\x38\x08" "calcsize") +QDEF(MP_QSTR_callable, (const byte*)"\x0d\x70\x08" "callable") +QDEF(MP_QSTR_callback, (const byte*)"\x4c\xf0\x08" "callback") +QDEF(MP_QSTR_calx, (const byte*)"\x73\xc1\x04" "calx") +QDEF(MP_QSTR_caly, (const byte*)"\x72\xc1\x04" "caly") +QDEF(MP_QSTR_cc, (const byte*)"\xe5\x6e\x02" "cc") +QDEF(MP_QSTR_ceil, (const byte*)"\x06\xb0\x04" "ceil") +QDEF(MP_QSTR_center, (const byte*)"\x4e\xbf\x06" "center") +QDEF(MP_QSTR_cert, (const byte*)"\x25\xb1\x04" "cert") +QDEF(MP_QSTR_channel, (const byte*)"\x26\x91\x07" "channel") +QDEF(MP_QSTR_chdir, (const byte*)"\xb1\xb2\x05" "chdir") +QDEF(MP_QSTR_checkSMS, (const byte*)"\x6e\xc1\x08" "checkSMS") +QDEF(MP_QSTR_choice, (const byte*)"\x2e\x33\x06" "choice") +QDEF(MP_QSTR_chr, (const byte*)"\xdc\x4c\x03" "chr") +QDEF(MP_QSTR_circle, (const byte*)"\xb7\xdd\x06" "circle") +QDEF(MP_QSTR_classmethod, (const byte*)"\xb4\x8c\x0b" "classmethod") +QDEF(MP_QSTR_cleansession, (const byte*)"\x7e\x01\x0c" "cleansession") +QDEF(MP_QSTR_clear, (const byte*)"\x7c\xa0\x05" "clear") +QDEF(MP_QSTR_clearwin, (const byte*)"\xac\xb0\x08" "clearwin") +QDEF(MP_QSTR_clientid, (const byte*)"\x71\x4d\x08" "clientid") +QDEF(MP_QSTR_clk, (const byte*)"\x41\x4c\x03" "clk") +QDEF(MP_QSTR_close, (const byte*)"\x33\x67\x05" "close") +QDEF(MP_QSTR_closure, (const byte*)"\x74\xca\x07" "closure") +QDEF(MP_QSTR_cmath, (const byte*)"\xb6\xf4\x05" "cmath") +QDEF(MP_QSTR_cmd, (const byte*)"\x2f\x4c\x03" "cmd") +QDEF(MP_QSTR_cmddata, (const byte*)"\x3f\xa8\x07" "cmddata") +QDEF(MP_QSTR_code, (const byte*)"\x68\xda\x04" "code") +QDEF(MP_QSTR_collect, (const byte*)"\x9b\x65\x07" "collect") +QDEF(MP_QSTR_collections, (const byte*)"\xe0\xc8\x0b" "collections") +QDEF(MP_QSTR_color, (const byte*)"\xd8\x06\x05" "color") +QDEF(MP_QSTR_color_bits, (const byte*)"\x4b\x33\x0a" "color_bits") +QDEF(MP_QSTR_color_order, (const byte*)"\x29\xfe\x0b" "color_order") +QDEF(MP_QSTR_compile, (const byte*)"\xf4\xc9\x07" "compile") +QDEF(MP_QSTR_compileFont, (const byte*)"\x47\x0c\x0b" "compileFont") +QDEF(MP_QSTR_complex, (const byte*)"\xc5\x9d\x07" "complex") +QDEF(MP_QSTR_config, (const byte*)"\x4f\xa2\x06" "config") +QDEF(MP_QSTR_connect, (const byte*)"\xdb\x3d\x07" "connect") +QDEF(MP_QSTR_connected_cb, (const byte*)"\xc4\xae\x0c" "connected_cb") +QDEF(MP_QSTR_const, (const byte*)"\xc0\xff\x05" "const") +QDEF(MP_QSTR_conv_time, (const byte*)"\x3b\x1d\x09" "conv_time") +QDEF(MP_QSTR_convert, (const byte*)"\xf2\x9e\x07" "convert") +QDEF(MP_QSTR_convert_read, (const byte*)"\x1f\x45\x0c" "convert_read") +QDEF(MP_QSTR_convert_readint, (const byte*)"\x4c\x62\x0f" "convert_readint") +QDEF(MP_QSTR_copy, (const byte*)"\xe0\xdb\x04" "copy") +QDEF(MP_QSTR_copysign, (const byte*)"\x33\x14\x08" "copysign") +QDEF(MP_QSTR_cos, (const byte*)"\x7a\x4c\x03" "cos") +QDEF(MP_QSTR_cosh, (const byte*)"\xd2\xdb\x04" "cosh") +QDEF(MP_QSTR_count, (const byte*)"\xa6\x4d\x05" "count") +QDEF(MP_QSTR_crc32, (const byte*)"\x76\xe8\x05" "crc32") +QDEF(MP_QSTR_crc8, (const byte*)"\xcf\xef\x04" "crc8") +QDEF(MP_QSTR_cs, (const byte*)"\xf5\x6e\x02" "cs") +QDEF(MP_QSTR_cts, (const byte*)"\x41\x4d\x03" "cts") +QDEF(MP_QSTR_curl, (const byte*)"\x2d\xf1\x04" "curl") +QDEF(MP_QSTR_data_cb, (const byte*)"\x0b\xc5\x07" "data_cb") +QDEF(MP_QSTR_data_len, (const byte*)"\xad\x71\x08" "data_len") +QDEF(MP_QSTR_dbgpin, (const byte*)"\x53\x30\x06" "dbgpin") +QDEF(MP_QSTR_dc, (const byte*)"\x82\x6d\x02" "dc") +QDEF(MP_QSTR_debug, (const byte*)"\xd4\x55\x05" "debug") +QDEF(MP_QSTR_decode, (const byte*)"\xa9\x59\x06" "decode") +QDEF(MP_QSTR_decompress, (const byte*)"\x62\xfb\x0a" "decompress") +QDEF(MP_QSTR_deepsleep, (const byte*)"\x9e\xd2\x09" "deepsleep") +QDEF(MP_QSTR_default, (const byte*)"\xce\x7d\x07" "default") +QDEF(MP_QSTR_degrees, (const byte*)"\x02\x41\x07" "degrees") +QDEF(MP_QSTR_deinit, (const byte*)"\x9e\x8d\x06" "deinit") +QDEF(MP_QSTR_delattr, (const byte*)"\xdb\xc8\x07" "delattr") +QDEF(MP_QSTR_deleteSMS, (const byte*)"\xf1\xf1\x09" "deleteSMS") +QDEF(MP_QSTR_deleter, (const byte*)"\x6e\xdb\x07" "deleter") +QDEF(MP_QSTR_deselect, (const byte*)"\x0c\x9d\x08" "deselect") +QDEF(MP_QSTR_device, (const byte*)"\x3d\x93\x06" "device") +QDEF(MP_QSTR_dict, (const byte*)"\x3f\xfc\x04" "dict") +QDEF(MP_QSTR_dict_view, (const byte*)"\x2d\xa9\x09" "dict_view") +QDEF(MP_QSTR_difference, (const byte*)"\x72\x24\x0a" "difference") +QDEF(MP_QSTR_difference_update, (const byte*)"\x9c\xfa\x11" "difference_update") +QDEF(MP_QSTR_digest, (const byte*)"\xcd\xc4\x06" "digest") +QDEF(MP_QSTR_dir, (const byte*)"\xfa\x1e\x03" "dir") +QDEF(MP_QSTR_disable, (const byte*)"\x91\x76\x07" "disable") +QDEF(MP_QSTR_disable_irq, (const byte*)"\x04\x3a\x0b" "disable_irq") +QDEF(MP_QSTR_discard, (const byte*)"\x0f\x71\x07" "discard") +QDEF(MP_QSTR_disconnect, (const byte*)"\xa5\x85\x0a" "disconnect") +QDEF(MP_QSTR_disconnected_cb, (const byte*)"\xfa\x4c\x0f" "disconnected_cb") +QDEF(MP_QSTR_display, (const byte*)"\x1f\x55\x07" "display") +QDEF(MP_QSTR_dist, (const byte*)"\x2f\xfe\x04" "dist") +QDEF(MP_QSTR_divmod, (const byte*)"\xb8\x04\x06" "divmod") +QDEF(MP_QSTR_doc, (const byte*)"\x2d\x1f\x03" "doc") +QDEF(MP_QSTR_ds18x20, (const byte*)"\x61\x26\x07" "ds18x20") +QDEF(MP_QSTR_dumps, (const byte*)"\x7a\x2d\x05" "dumps") +QDEF(MP_QSTR_duplex, (const byte*)"\xf5\x7b\x06" "duplex") +QDEF(MP_QSTR_duty, (const byte*)"\x19\x2c\x04" "duty") +QDEF(MP_QSTR_e, (const byte*)"\xc0\xb5\x01" "e") +QDEF(MP_QSTR_ellipse, (const byte*)"\x0f\xdc\x07" "ellipse") +QDEF(MP_QSTR_enable, (const byte*)"\x04\xde\x06" "enable") +QDEF(MP_QSTR_enable_irq, (const byte*)"\x91\x60\x0a" "enable_irq") +QDEF(MP_QSTR_encode, (const byte*)"\x43\xca\x06" "encode") +QDEF(MP_QSTR_encoding, (const byte*)"\x06\x9c\x08" "encoding") +QDEF(MP_QSTR_end, (const byte*)"\x0a\x23\x03" "end") +QDEF(MP_QSTR_endswith, (const byte*)"\x1b\xa3\x08" "endswith") +QDEF(MP_QSTR_endtask, (const byte*)"\xe7\x60\x07" "endtask") +QDEF(MP_QSTR_enumerate, (const byte*)"\x71\xba\x09" "enumerate") +QDEF(MP_QSTR_erf, (const byte*)"\x94\x23\x03" "erf") +QDEF(MP_QSTR_erfc, (const byte*)"\x77\x96\x04" "erfc") +QDEF(MP_QSTR_errno, (const byte*)"\xc1\x11\x05" "errno") +QDEF(MP_QSTR_errorcode, (const byte*)"\x10\xdd\x09" "errorcode") +QDEF(MP_QSTR_essid, (const byte*)"\x4d\xb1\x05" "essid") +QDEF(MP_QSTR_eval, (const byte*)"\x9b\xa6\x04" "eval") +QDEF(MP_QSTR_eventCB, (const byte*)"\xa8\xf7\x07" "eventCB") +QDEF(MP_QSTR_events, (const byte*)"\x9a\xa2\x06" "events") +QDEF(MP_QSTR_exc_info, (const byte*)"\x0a\xff\x08" "exc_info") +QDEF(MP_QSTR_exec, (const byte*)"\x1e\xc0\x04" "exec") +QDEF(MP_QSTR_execfile, (const byte*)"\x58\x28\x08" "execfile") +QDEF(MP_QSTR_exit, (const byte*)"\x85\xbe\x04" "exit") +QDEF(MP_QSTR_exp, (const byte*)"\xc8\x24\x03" "exp") +QDEF(MP_QSTR_expm1, (const byte*)"\x74\x72\x05" "expm1") +QDEF(MP_QSTR_extend, (const byte*)"\x63\xe8\x06" "extend") +QDEF(MP_QSTR_fabs, (const byte*)"\x93\x12\x04" "fabs") +QDEF(MP_QSTR_file, (const byte*)"\xc3\x34\x04" "file") +QDEF(MP_QSTR_fileno, (const byte*)"\x82\x76\x06" "fileno") +QDEF(MP_QSTR_fill, (const byte*)"\xca\x34\x04" "fill") +QDEF(MP_QSTR_fill_rect, (const byte*)"\x35\xed\x09" "fill_rect") +QDEF(MP_QSTR_fillcolor, (const byte*)"\x77\x7f\x09" "fillcolor") +QDEF(MP_QSTR_filter, (const byte*)"\x25\xbe\x06" "filter") +QDEF(MP_QSTR_find, (const byte*)"\x00\x34\x04" "find") +QDEF(MP_QSTR_firstbit, (const byte*)"\x20\x39\x08" "firstbit") +QDEF(MP_QSTR_fixedwidth, (const byte*)"\x35\x36\x0a" "fixedwidth") +QDEF(MP_QSTR_flags, (const byte*)"\xfa\x8f\x05" "flags") +QDEF(MP_QSTR_float, (const byte*)"\x35\x44\x05" "float") +QDEF(MP_QSTR_floor, (const byte*)"\x7d\x46\x05" "floor") +QDEF(MP_QSTR_flush, (const byte*)"\x61\xc1\x05" "flush") +QDEF(MP_QSTR_fmod, (const byte*)"\xe5\x44\x04" "fmod") +QDEF(MP_QSTR_font, (const byte*)"\x96\x2b\x04" "font") +QDEF(MP_QSTR_fontSize, (const byte*)"\x93\x3e\x08" "fontSize") +QDEF(MP_QSTR_format, (const byte*)"\x26\x33\x06" "format") +QDEF(MP_QSTR_framebuf, (const byte*)"\x69\x82\x08" "framebuf") +QDEF(MP_QSTR_free, (const byte*)"\xf1\x3a\x04" "free") +QDEF(MP_QSTR_freq, (const byte*)"\xe5\x3a\x04" "freq") +QDEF(MP_QSTR_frexp, (const byte*)"\x1c\x98\x05" "frexp") +QDEF(MP_QSTR_from_bytes, (const byte*)"\x35\x74\x0a" "from_bytes") +QDEF(MP_QSTR_from_nvs, (const byte*)"\x67\x62\x08" "from_nvs") +QDEF(MP_QSTR_fromkeys, (const byte*)"\x37\xbd\x08" "fromkeys") +QDEF(MP_QSTR_frozenset, (const byte*)"\xed\x9c\x09" "frozenset") +QDEF(MP_QSTR_ftp, (const byte*)"\x47\x39\x03" "ftp") +QDEF(MP_QSTR_ftp_get, (const byte*)"\xae\x67\x07" "ftp_get") +QDEF(MP_QSTR_ftp_list, (const byte*)"\xda\xd1\x08" "ftp_list") +QDEF(MP_QSTR_ftp_put, (const byte*)"\x69\x22\x07" "ftp_put") +QDEF(MP_QSTR_func, (const byte*)"\x1b\x68\x04" "func") +QDEF(MP_QSTR_function, (const byte*)"\x27\x02\x08" "function") +QDEF(MP_QSTR_gamma, (const byte*)"\x02\x90\x05" "gamma") +QDEF(MP_QSTR_gc, (const byte*)"\x61\x6e\x02" "gc") +QDEF(MP_QSTR_generator, (const byte*)"\x96\xc3\x09" "generator") +QDEF(MP_QSTR_get, (const byte*)"\x33\x3b\x03" "get") +QDEF(MP_QSTR_getCalib, (const byte*)"\xd6\xaf\x08" "getCalib") +QDEF(MP_QSTR_getReplID, (const byte*)"\xb5\xe5\x09" "getReplID") +QDEF(MP_QSTR_getSelfName, (const byte*)"\x68\xaf\x0b" "getSelfName") +QDEF(MP_QSTR_getThreadName, (const byte*)"\xba\xa7\x0d" "getThreadName") +QDEF(MP_QSTR_getTouchType, (const byte*)"\x2e\x4a\x0c" "getTouchType") +QDEF(MP_QSTR_get_pwrmode, (const byte*)"\x7a\x71\x0b" "get_pwrmode") +QDEF(MP_QSTR_get_res, (const byte*)"\x88\x95\x07" "get_res") +QDEF(MP_QSTR_getaddrinfo, (const byte*)"\x6e\x18\x0b" "getaddrinfo") +QDEF(MP_QSTR_getattr, (const byte*)"\xc0\x17\x07" "getattr") +QDEF(MP_QSTR_getcwd, (const byte*)"\x03\xd0\x06" "getcwd") +QDEF(MP_QSTR_getdata, (const byte*)"\x23\xd7\x07" "getdata") +QDEF(MP_QSTR_getmsg, (const byte*)"\x0a\x1b\x06" "getmsg") +QDEF(MP_QSTR_getnotification, (const byte*)"\x3e\xa6\x0f" "getnotification") +QDEF(MP_QSTR_getpeercert, (const byte*)"\xb1\x92\x0b" "getpeercert") +QDEF(MP_QSTR_getrandbits, (const byte*)"\x66\x7d\x0b" "getrandbits") +QDEF(MP_QSTR_getter, (const byte*)"\x90\xb2\x06" "getter") +QDEF(MP_QSTR_gettouch, (const byte*)"\xb6\x12\x08" "gettouch") +QDEF(MP_QSTR_getvalue, (const byte*)"\x78\xac\x08" "getvalue") +QDEF(MP_QSTR_globals, (const byte*)"\x9d\x49\x07" "globals") +QDEF(MP_QSTR_gmtime, (const byte*)"\x5a\x8e\x06" "gmtime") +QDEF(MP_QSTR_group, (const byte*)"\xba\xb0\x05" "group") +QDEF(MP_QSTR_gsm, (const byte*)"\xfc\x3c\x03" "gsm") +QDEF(MP_QSTR_gsmnum, (const byte*)"\x6a\x23\x06" "gsmnum") +QDEF(MP_QSTR_handler, (const byte*)"\xdd\x5d\x07" "handler") +QDEF(MP_QSTR_hasattr, (const byte*)"\x8c\xb0\x07" "hasattr") +QDEF(MP_QSTR_hash, (const byte*)"\xb7\x70\x04" "hash") +QDEF(MP_QSTR_hashlib, (const byte*)"\x10\x6d\x07" "hashlib") +QDEF(MP_QSTR_hastouch, (const byte*)"\x7a\x3f\x08" "hastouch") +QDEF(MP_QSTR_hdrlen, (const byte*)"\x7c\xb1\x06" "hdrlen") +QDEF(MP_QSTR_heap_info, (const byte*)"\x68\x1d\x09" "heap_info") +QDEF(MP_QSTR_heap_lock, (const byte*)"\xad\x8c\x09" "heap_lock") +QDEF(MP_QSTR_heap_unlock, (const byte*)"\x56\x2d\x0b" "heap_unlock") +QDEF(MP_QSTR_heapify, (const byte*)"\xaf\x2d\x07" "heapify") +QDEF(MP_QSTR_heappop, (const byte*)"\xd6\x27\x07" "heappop") +QDEF(MP_QSTR_heappush, (const byte*)"\x87\x6b\x08" "heappush") +QDEF(MP_QSTR_heapq, (const byte*)"\x68\x1d\x05" "heapq") +QDEF(MP_QSTR_height, (const byte*)"\xfa\x33\x06" "height") +QDEF(MP_QSTR_help, (const byte*)"\x94\x5c\x04" "help") +QDEF(MP_QSTR_hex, (const byte*)"\x70\x50\x03" "hex") +QDEF(MP_QSTR_hexlify, (const byte*)"\x2a\x7f\x07" "hexlify") +QDEF(MP_QSTR_hidden, (const byte*)"\xef\x48\x06" "hidden") +QDEF(MP_QSTR_hline, (const byte*)"\x83\x3c\x05" "hline") +QDEF(MP_QSTR_hostname, (const byte*)"\xc2\x95\x08" "hostname") +QDEF(MP_QSTR_hsb2rgb, (const byte*)"\xd9\xce\x07" "hsb2rgb") +QDEF(MP_QSTR_hue, (const byte*)"\x7d\x52\x03" "hue") +QDEF(MP_QSTR_id, (const byte*)"\x28\x6f\x02" "id") +QDEF(MP_QSTR_idle, (const byte*)"\xa1\xdc\x04" "idle") +QDEF(MP_QSTR_ifconfig, (const byte*)"\xe0\x41\x08" "ifconfig") +QDEF(MP_QSTR_ilistdir, (const byte*)"\x71\x6a\x08" "ilistdir") +QDEF(MP_QSTR_imag, (const byte*)"\x47\xb7\x04" "imag") +QDEF(MP_QSTR_image, (const byte*)"\x42\xa0\x05" "image") +QDEF(MP_QSTR_implementation, (const byte*)"\x17\x2d\x0e" "implementation") +QDEF(MP_QSTR_index, (const byte*)"\x7b\x28\x05" "index") +QDEF(MP_QSTR_info, (const byte*)"\xeb\xb3\x04" "info") +QDEF(MP_QSTR_init, (const byte*)"\x1f\xb4\x04" "init") +QDEF(MP_QSTR_input, (const byte*)"\x73\x5a\x05" "input") +QDEF(MP_QSTR_insert, (const byte*)"\x12\x54\x06" "insert") +QDEF(MP_QSTR_instance, (const byte*)"\x8c\x54\x08" "instance") +QDEF(MP_QSTR_int, (const byte*)"\x16\x53\x03" "int") +QDEF(MP_QSTR_internal_temp, (const byte*)"\xf1\x46\x0d" "internal_temp") +QDEF(MP_QSTR_intersection, (const byte*)"\x28\x2a\x0c" "intersection") +QDEF(MP_QSTR_intersection_update, (const byte*)"\x06\xdd\x13" "intersection_update") +QDEF(MP_QSTR_invert, (const byte*)"\xb7\x00\x06" "invert") +QDEF(MP_QSTR_invrot, (const byte*)"\x9d\xcb\x06" "invrot") +QDEF(MP_QSTR_io, (const byte*)"\x23\x6f\x02" "io") +QDEF(MP_QSTR_ioctl, (const byte*)"\x78\xc2\x05" "ioctl") +QDEF(MP_QSTR_ipoll, (const byte*)"\x53\x5d\x05" "ipoll") +QDEF(MP_QSTR_irq, (const byte*)"\x8f\x56\x03" "irq") +QDEF(MP_QSTR_isalpha, (const byte*)"\xeb\x37\x07" "isalpha") +QDEF(MP_QSTR_isconnected, (const byte*)"\x80\x99\x0b" "isconnected") +QDEF(MP_QSTR_isdigit, (const byte*)"\xa8\x9a\x07" "isdigit") +QDEF(MP_QSTR_isdisjoint, (const byte*)"\xf7\x68\x0a" "isdisjoint") +QDEF(MP_QSTR_isenabled, (const byte*)"\x9a\xe5\x09" "isenabled") +QDEF(MP_QSTR_isfinite, (const byte*)"\xa6\xab\x08" "isfinite") +QDEF(MP_QSTR_isinf, (const byte*)"\x3e\x11\x05" "isinf") +QDEF(MP_QSTR_isinstance, (const byte*)"\xb6\xbe\x0a" "isinstance") +QDEF(MP_QSTR_islower, (const byte*)"\xfc\x80\x07" "islower") +QDEF(MP_QSTR_isnan, (const byte*)"\x9e\x03\x05" "isnan") +QDEF(MP_QSTR_isnotified, (const byte*)"\x8d\xde\x0a" "isnotified") +QDEF(MP_QSTR_isrunning, (const byte*)"\x18\xfb\x09" "isrunning") +QDEF(MP_QSTR_isspace, (const byte*)"\x5b\xf8\x07" "isspace") +QDEF(MP_QSTR_issubclass, (const byte*)"\xb5\x7f\x0a" "issubclass") +QDEF(MP_QSTR_issubset, (const byte*)"\xb9\xc1\x08" "issubset") +QDEF(MP_QSTR_issuperset, (const byte*)"\xfc\xec\x0a" "issuperset") +QDEF(MP_QSTR_isupper, (const byte*)"\xdd\xa7\x07" "isupper") +QDEF(MP_QSTR_items, (const byte*)"\xe3\x53\x05" "items") +QDEF(MP_QSTR_iter, (const byte*)"\x8f\x21\x04" "iter") +QDEF(MP_QSTR_iterable, (const byte*)"\x25\x92\x08" "iterable") +QDEF(MP_QSTR_iterator, (const byte*)"\x47\xbe\x08" "iterator") +QDEF(MP_QSTR_join, (const byte*)"\xa7\x5c\x04" "join") +QDEF(MP_QSTR_json, (const byte*)"\xfd\xd1\x04" "json") +QDEF(MP_QSTR_kbd_intr, (const byte*)"\xf6\x13\x08" "kbd_intr") +QDEF(MP_QSTR_keepalive, (const byte*)"\x69\x05\x09" "keepalive") +QDEF(MP_QSTR_keepends, (const byte*)"\x62\x8b\x08" "keepends") +QDEF(MP_QSTR_key, (const byte*)"\x32\x6d\x03" "key") +QDEF(MP_QSTR_keys, (const byte*)"\x01\x13\x04" "keys") +QDEF(MP_QSTR_kwarg, (const byte*)"\x2d\x1f\x05" "kwarg") +QDEF(MP_QSTR_ldexp, (const byte*)"\x40\x6f\x05" "ldexp") +QDEF(MP_QSTR_len, (const byte*)"\x62\x40\x03" "len") +QDEF(MP_QSTR_length, (const byte*)"\x59\x87\x06" "length") +QDEF(MP_QSTR_level, (const byte*)"\xd3\x4b\x05" "level") +QDEF(MP_QSTR_lgamma, (const byte*)"\xce\x6c\x06" "lgamma") +QDEF(MP_QSTR_line, (const byte*)"\xcb\x1c\x04" "line") +QDEF(MP_QSTR_lineByAngle, (const byte*)"\x71\x01\x0b" "lineByAngle") +QDEF(MP_QSTR_lineend, (const byte*)"\x04\x8c\x07" "lineend") +QDEF(MP_QSTR_list, (const byte*)"\x27\x1d\x04" "list") +QDEF(MP_QSTR_listdir, (const byte*)"\x98\xe3\x07" "listdir") +QDEF(MP_QSTR_listen, (const byte*)"\xcc\x0e\x06" "listen") +QDEF(MP_QSTR_little, (const byte*)"\x89\x6a\x06" "little") +QDEF(MP_QSTR_llist, (const byte*)"\xeb\x40\x05" "llist") +QDEF(MP_QSTR_load, (const byte*)"\x63\x24\x04" "load") +QDEF(MP_QSTR_loads, (const byte*)"\xb0\xb0\x05" "loads") +QDEF(MP_QSTR_locals, (const byte*)"\x3b\xa1\x06" "locals") +QDEF(MP_QSTR_localtime, (const byte*)"\x7d\x46\x09" "localtime") +QDEF(MP_QSTR_lock, (const byte*)"\xae\x23\x04" "lock") +QDEF(MP_QSTR_log, (const byte*)"\x21\x3f\x03" "log") +QDEF(MP_QSTR_log10, (const byte*)"\x40\x91\x05" "log10") +QDEF(MP_QSTR_log2, (const byte*)"\x73\x23\x04" "log2") +QDEF(MP_QSTR_loglevel, (const byte*)"\x37\x99\x08" "loglevel") +QDEF(MP_QSTR_lower, (const byte*)"\xc6\xcb\x05" "lower") +QDEF(MP_QSTR_lstrip, (const byte*)"\xe5\xb9\x06" "lstrip") +QDEF(MP_QSTR_mDNS, (const byte*)"\xd1\x48\x04" "mDNS") +QDEF(MP_QSTR_mac, (const byte*)"\xaa\x43\x03" "mac") +QDEF(MP_QSTR_machine, (const byte*)"\x60\xab\x07" "machine") +QDEF(MP_QSTR_makefile, (const byte*)"\xc1\xd5\x08" "makefile") +QDEF(MP_QSTR_map, (const byte*)"\xb9\x43\x03" "map") +QDEF(MP_QSTR_match, (const byte*)"\x96\x22\x05" "match") +QDEF(MP_QSTR_math, (const byte*)"\x35\xbb\x04" "math") +QDEF(MP_QSTR_max, (const byte*)"\xb1\x43\x03" "max") +QDEF(MP_QSTR_maxfsize, (const byte*)"\xd2\x89\x08" "maxfsize") +QDEF(MP_QSTR_maxres, (const byte*)"\x55\xbb\x06" "maxres") +QDEF(MP_QSTR_maxsize, (const byte*)"\xd4\x70\x07" "maxsize") +QDEF(MP_QSTR_mdc, (const byte*)"\x4f\x44\x03" "mdc") +QDEF(MP_QSTR_mdio, (const byte*)"\x8a\xcc\x04" "mdio") +QDEF(MP_QSTR_mem, (const byte*)"\x20\x44\x03" "mem") +QDEF(MP_QSTR_mem16, (const byte*)"\x07\xca\x05" "mem16") +QDEF(MP_QSTR_mem32, (const byte*)"\x41\xca\x05" "mem32") +QDEF(MP_QSTR_mem8, (const byte*)"\x18\xc8\x04" "mem8") +QDEF(MP_QSTR_mem_alloc, (const byte*)"\x52\x2b\x09" "mem_alloc") +QDEF(MP_QSTR_mem_free, (const byte*)"\xcb\x62\x08" "mem_free") +QDEF(MP_QSTR_mem_info, (const byte*)"\xd1\xf1\x08" "mem_info") +QDEF(MP_QSTR_memaddr, (const byte*)"\x93\xe8\x07" "memaddr") +QDEF(MP_QSTR_memoryview, (const byte*)"\x69\x44\x0a" "memoryview") +QDEF(MP_QSTR_micropython, (const byte*)"\x0b\x7c\x0b" "micropython") +QDEF(MP_QSTR_min, (const byte*)"\xaf\x42\x03" "min") +QDEF(MP_QSTR_minkeypage, (const byte*)"\xab\x6f\x0a" "minkeypage") +QDEF(MP_QSTR_miso, (const byte*)"\x9d\x98\x04" "miso") +QDEF(MP_QSTR_mkdir, (const byte*)"\x9c\xb5\x05" "mkdir") +QDEF(MP_QSTR_mkfs, (const byte*)"\x76\xb0\x04" "mkfs") +QDEF(MP_QSTR_mktime, (const byte*)"\x96\x2b\x06" "mktime") +QDEF(MP_QSTR_mode, (const byte*)"\x26\xc0\x04" "mode") +QDEF(MP_QSTR_modf, (const byte*)"\x25\xc0\x04" "modf") +QDEF(MP_QSTR_modify, (const byte*)"\xf5\x66\x06" "modify") +QDEF(MP_QSTR_module, (const byte*)"\xbf\x99\x06" "module") +QDEF(MP_QSTR_modules, (const byte*)"\xec\xd1\x07" "modules") +QDEF(MP_QSTR_mosi, (const byte*)"\x1d\xc2\x04" "mosi") +QDEF(MP_QSTR_mount, (const byte*)"\xa8\x0d\x05" "mount") +QDEF(MP_QSTR_mountsd, (const byte*)"\x5f\x1e\x07" "mountsd") +QDEF(MP_QSTR_mqtt, (const byte*)"\x39\xfb\x04" "mqtt") +QDEF(MP_QSTR_msg, (const byte*)"\x7c\x46\x03" "msg") +QDEF(MP_QSTR_name, (const byte*)"\xa2\x75\x04" "name") +QDEF(MP_QSTR_namedtuple, (const byte*)"\x1e\x16\x0a" "namedtuple") +QDEF(MP_QSTR_nbytes, (const byte*)"\xd2\x76\x06" "nbytes") +QDEF(MP_QSTR_network, (const byte*)"\x5b\x28\x07" "network") +QDEF(MP_QSTR_next, (const byte*)"\x42\x88\x04" "next") +QDEF(MP_QSTR_nodecode, (const byte*)"\x28\x0f\x08" "nodecode") +QDEF(MP_QSTR_nodename, (const byte*)"\x62\xab\x08" "nodename") +QDEF(MP_QSTR_notify, (const byte*)"\x06\x1c\x06" "notify") +QDEF(MP_QSTR_now, (const byte*)"\xb3\x57\x03" "now") +QDEF(MP_QSTR_ntp_state, (const byte*)"\x07\xec\x09" "ntp_state") +QDEF(MP_QSTR_ntp_sync, (const byte*)"\xd7\xfc\x08" "ntp_sync") +QDEF(MP_QSTR_num, (const byte*)"\x73\x5b\x03" "num") +QDEF(MP_QSTR_nvs_erase, (const byte*)"\x71\x60\x09" "nvs_erase") +QDEF(MP_QSTR_nvs_erase_all, (const byte*)"\x6f\x3b\x0d" "nvs_erase_all") +QDEF(MP_QSTR_nvs_getint, (const byte*)"\xb4\x12\x0a" "nvs_getint") +QDEF(MP_QSTR_nvs_getstr, (const byte*)"\x72\x1b\x0a" "nvs_getstr") +QDEF(MP_QSTR_nvs_setint, (const byte*)"\x20\xd4\x0a" "nvs_setint") +QDEF(MP_QSTR_nvs_setstr, (const byte*)"\xe6\x58\x0a" "nvs_setstr") +QDEF(MP_QSTR_object, (const byte*)"\x90\x8d\x06" "object") +QDEF(MP_QSTR_oct, (const byte*)"\xfd\x5c\x03" "oct") +QDEF(MP_QSTR_off, (const byte*)"\x8a\x5c\x03" "off") +QDEF(MP_QSTR_on, (const byte*)"\x64\x6f\x02" "on") +QDEF(MP_QSTR_open, (const byte*)"\xd1\x3a\x04" "open") +QDEF(MP_QSTR_opt, (const byte*)"\xce\x5e\x03" "opt") +QDEF(MP_QSTR_opt_level, (const byte*)"\x87\x67\x09" "opt_level") +QDEF(MP_QSTR_options, (const byte*)"\xf5\x63\x07" "options") +QDEF(MP_QSTR_ord, (const byte*)"\x1c\x5e\x03" "ord") +QDEF(MP_QSTR_orient, (const byte*)"\x8e\x81\x06" "orient") +QDEF(MP_QSTR_os, (const byte*)"\x79\x6f\x02" "os") +QDEF(MP_QSTR_outline, (const byte*)"\x65\xf7\x07" "outline") +QDEF(MP_QSTR_owb, (const byte*)"\x7f\x5f\x03" "owb") +QDEF(MP_QSTR_pack, (const byte*)"\xbc\xd1\x04" "pack") +QDEF(MP_QSTR_pack_into, (const byte*)"\x1f\xa9\x09" "pack_into") +QDEF(MP_QSTR_pagesize, (const byte*)"\x13\x28\x08" "pagesize") +QDEF(MP_QSTR_params, (const byte*)"\x79\xe2\x06" "params") +QDEF(MP_QSTR_parity, (const byte*)"\x42\x05\x06" "parity") +QDEF(MP_QSTR_partition, (const byte*)"\x87\xe5\x09" "partition") +QDEF(MP_QSTR_password, (const byte*)"\x9a\x6f\x08" "password") +QDEF(MP_QSTR_path, (const byte*)"\x88\xce\x04" "path") +QDEF(MP_QSTR_pattern, (const byte*)"\x2d\xcc\x07" "pattern") +QDEF(MP_QSTR_pause, (const byte*)"\xd7\xbd\x05" "pause") +QDEF(MP_QSTR_peektime, (const byte*)"\x8b\x5c\x08" "peektime") +QDEF(MP_QSTR_period, (const byte*)"\xa0\xa0\x06" "period") +QDEF(MP_QSTR_phase, (const byte*)"\x6a\xd5\x05" "phase") +QDEF(MP_QSTR_phy_addr, (const byte*)"\xa8\xcc\x08" "phy_addr") +QDEF(MP_QSTR_phy_mode, (const byte*)"\x38\xa0\x08" "phy_mode") +QDEF(MP_QSTR_phy_type, (const byte*)"\x83\xc7\x08" "phy_type") +QDEF(MP_QSTR_pi, (const byte*)"\x1c\x70\x02" "pi") +QDEF(MP_QSTR_pin, (const byte*)"\xf2\x73\x03" "pin") +QDEF(MP_QSTR_pins, (const byte*)"\x41\xf2\x04" "pins") +QDEF(MP_QSTR_pixel, (const byte*)"\x4d\xf0\x05" "pixel") +QDEF(MP_QSTR_pixels, (const byte*)"\x9e\xf9\x06" "pixels") +QDEF(MP_QSTR_platform, (const byte*)"\x3a\x19\x08" "platform") +QDEF(MP_QSTR_polar, (const byte*)"\x05\x0c\x05" "polar") +QDEF(MP_QSTR_polarity, (const byte*)"\x41\xed\x08" "polarity") +QDEF(MP_QSTR_poll, (const byte*)"\x9a\xd9\x04" "poll") +QDEF(MP_QSTR_polygon, (const byte*)"\x29\xf9\x07" "polygon") +QDEF(MP_QSTR_pop, (const byte*)"\x2a\x73\x03" "pop") +QDEF(MP_QSTR_popitem, (const byte*)"\xbf\x2c\x07" "popitem") +QDEF(MP_QSTR_port, (const byte*)"\x5c\xd8\x04" "port") +QDEF(MP_QSTR_pos, (const byte*)"\x29\x73\x03" "pos") +QDEF(MP_QSTR_post, (const byte*)"\x3d\xd8\x04" "post") +QDEF(MP_QSTR_pow, (const byte*)"\x2d\x73\x03" "pow") +QDEF(MP_QSTR_power, (const byte*)"\xda\xed\x05" "power") +QDEF(MP_QSTR_print, (const byte*)"\x54\xc6\x05" "print") +QDEF(MP_QSTR_print_exception, (const byte*)"\x1c\x22\x0f" "print_exception") +QDEF(MP_QSTR_printable, (const byte*)"\xbe\x5d\x09" "printable") +QDEF(MP_QSTR_probereqCB, (const byte*)"\xc8\x0e\x0a" "probereqCB") +QDEF(MP_QSTR_progress, (const byte*)"\xd8\x67\x08" "progress") +QDEF(MP_QSTR_property, (const byte*)"\xc2\x29\x08" "property") +QDEF(MP_QSTR_protocol, (const byte*)"\x33\xf5\x08" "protocol") +QDEF(MP_QSTR_publish, (const byte*)"\x5c\x6a\x07" "publish") +QDEF(MP_QSTR_published_cb, (const byte*)"\x23\x08\x0c" "published_cb") +QDEF(MP_QSTR_pull, (const byte*)"\x80\x7d\x04" "pull") +QDEF(MP_QSTR_push, (const byte*)"\xbb\x7e\x04" "push") +QDEF(MP_QSTR_put, (const byte*)"\x74\x70\x03" "put") +QDEF(MP_QSTR_qos, (const byte*)"\xe8\x77\x03" "qos") +QDEF(MP_QSTR_qstr_info, (const byte*)"\xb0\x81\x09" "qstr_info") +QDEF(MP_QSTR_queryHost, (const byte*)"\xaf\x72\x09" "queryHost") +QDEF(MP_QSTR_queryService, (const byte*)"\x52\x9b\x0c" "queryService") +QDEF(MP_QSTR_r, (const byte*)"\xd7\xb5\x01" "r") +QDEF(MP_QSTR_radians, (const byte*)"\x87\x3f\x07" "radians") +QDEF(MP_QSTR_rainbow, (const byte*)"\x8b\xc7\x07" "rainbow") +QDEF(MP_QSTR_randint, (const byte*)"\xaf\xdc\x07" "randint") +QDEF(MP_QSTR_random, (const byte*)"\xbe\x2c\x06" "random") +QDEF(MP_QSTR_randrange, (const byte*)"\xa3\x3e\x09" "randrange") +QDEF(MP_QSTR_range, (const byte*)"\x1a\x5e\x05" "range") +QDEF(MP_QSTR_raw, (const byte*)"\xe1\x8b\x03" "raw") +QDEF(MP_QSTR_re, (const byte*)"\xd2\x70\x02" "re") +QDEF(MP_QSTR_read, (const byte*)"\xb7\xf9\x04" "read") +QDEF(MP_QSTR_readPixel, (const byte*)"\x5f\x5d\x09" "readPixel") +QDEF(MP_QSTR_readSMS, (const byte*)"\x7a\x6a\x07" "readSMS") +QDEF(MP_QSTR_read_byte, (const byte*)"\x02\x61\x09" "read_byte") +QDEF(MP_QSTR_read_bytes, (const byte*)"\x31\x81\x0a" "read_bytes") +QDEF(MP_QSTR_read_string, (const byte*)"\xfd\x18\x0b" "read_string") +QDEF(MP_QSTR_read_temp, (const byte*)"\xe4\x2e\x09" "read_temp") +QDEF(MP_QSTR_read_tempint, (const byte*)"\x57\x05\x0c" "read_tempint") +QDEF(MP_QSTR_readbyte, (const byte*)"\x7d\xf0\x08" "readbyte") +QDEF(MP_QSTR_readbytes, (const byte*)"\x6e\x00\x09" "readbytes") +QDEF(MP_QSTR_readfrom, (const byte*)"\x41\xb1\x08" "readfrom") +QDEF(MP_QSTR_readfrom_into, (const byte*)"\x82\x3f\x0d" "readfrom_into") +QDEF(MP_QSTR_readfrom_mem, (const byte*)"\x3b\x65\x0c" "readfrom_mem") +QDEF(MP_QSTR_readfrom_mem_into, (const byte*)"\x38\x8e\x11" "readfrom_mem_into") +QDEF(MP_QSTR_readinto, (const byte*)"\x4b\xbf\x08" "readinto") +QDEF(MP_QSTR_readline, (const byte*)"\xf9\x19\x08" "readline") +QDEF(MP_QSTR_readlines, (const byte*)"\x6a\x59\x09" "readlines") +QDEF(MP_QSTR_readln, (const byte*)"\x35\x50\x06" "readln") +QDEF(MP_QSTR_readonly, (const byte*)"\x03\x89\x08" "readonly") +QDEF(MP_QSTR_readraw, (const byte*)"\x13\x0a\x07" "readraw") +QDEF(MP_QSTR_real, (const byte*)"\xbf\xf9\x04" "real") +QDEF(MP_QSTR_rect, (const byte*)"\xe5\xf9\x04" "rect") +QDEF(MP_QSTR_recv, (const byte*)"\xe7\xf9\x04" "recv") +QDEF(MP_QSTR_recvfrom, (const byte*)"\x91\x90\x08" "recvfrom") +QDEF(MP_QSTR_redirectlog, (const byte*)"\x5b\x4c\x0b" "redirectlog") +QDEF(MP_QSTR_register, (const byte*)"\xac\xa1\x08" "register") +QDEF(MP_QSTR_release, (const byte*)"\xec\x8f\x07" "release") +QDEF(MP_QSTR_remove, (const byte*)"\x63\x8a\x06" "remove") +QDEF(MP_QSTR_removeService, (const byte*)"\x5e\xed\x0d" "removeService") +QDEF(MP_QSTR_rename, (const byte*)"\x35\x18\x06" "rename") +QDEF(MP_QSTR_replAcceptMsg, (const byte*)"\xd7\x84\x0d" "replAcceptMsg") +QDEF(MP_QSTR_replace, (const byte*)"\x49\x25\x07" "replace") +QDEF(MP_QSTR_repr, (const byte*)"\xd0\xf7\x04" "repr") +QDEF(MP_QSTR_reset, (const byte*)"\x10\xf4\x05" "reset") +QDEF(MP_QSTR_resetwin, (const byte*)"\x80\xa8\x08" "resetwin") +QDEF(MP_QSTR_reshot, (const byte*)"\x52\xa2\x06" "reshot") +QDEF(MP_QSTR_response, (const byte*)"\xe6\x94\x08" "response") +QDEF(MP_QSTR_restorelog, (const byte*)"\x09\x2e\x0a" "restorelog") +QDEF(MP_QSTR_restorewin, (const byte*)"\x9d\x8d\x0a" "restorewin") +QDEF(MP_QSTR_resume, (const byte*)"\x5c\xb9\x06" "resume") +QDEF(MP_QSTR_retain, (const byte*)"\x60\x2b\x06" "retain") +QDEF(MP_QSTR_reverse, (const byte*)"\x25\x2a\x07" "reverse") +QDEF(MP_QSTR_reversed, (const byte*)"\xa1\x6e\x08" "reversed") +QDEF(MP_QSTR_rfind, (const byte*)"\xd2\x9c\x05" "rfind") +QDEF(MP_QSTR_rfoff, (const byte*)"\x5e\xa5\x05" "rfoff") +QDEF(MP_QSTR_rindex, (const byte*)"\xe9\x2b\x06" "rindex") +QDEF(MP_QSTR_rmdir, (const byte*)"\x45\xa7\x05" "rmdir") +QDEF(MP_QSTR_rom_code, (const byte*)"\xa7\x3c\x08" "rom_code") +QDEF(MP_QSTR_rot, (const byte*)"\xac\x8b\x03" "rot") +QDEF(MP_QSTR_rotate, (const byte*)"\xdc\x7d\x06" "rotate") +QDEF(MP_QSTR_round, (const byte*)"\xe7\x25\x05" "round") +QDEF(MP_QSTR_roundrect, (const byte*)"\xc7\x49\x09" "roundrect") +QDEF(MP_QSTR_rpartition, (const byte*)"\x15\xd0\x0a" "rpartition") +QDEF(MP_QSTR_rsplit, (const byte*)"\xa5\x00\x06" "rsplit") +QDEF(MP_QSTR_rst_pin, (const byte*)"\x58\xf4\x07" "rst_pin") +QDEF(MP_QSTR_rstrip, (const byte*)"\x3b\x95\x06" "rstrip") +QDEF(MP_QSTR_rts, (const byte*)"\x50\x89\x03" "rts") +QDEF(MP_QSTR_rx, (const byte*)"\xcf\x70\x02" "rx") +QDEF(MP_QSTR_ry, (const byte*)"\xce\x70\x02" "ry") +QDEF(MP_QSTR_samecore, (const byte*)"\x24\xe0\x08" "samecore") +QDEF(MP_QSTR_saturation, (const byte*)"\x59\x68\x0a" "saturation") +QDEF(MP_QSTR_savewin, (const byte*)"\x74\x5e\x07" "savewin") +QDEF(MP_QSTR_scale, (const byte*)"\x7d\x51\x05" "scale") +QDEF(MP_QSTR_scan, (const byte*)"\x1a\x8e\x04" "scan") +QDEF(MP_QSTR_schedule, (const byte*)"\xe0\xac\x08" "schedule") +QDEF(MP_QSTR_sck, (const byte*)"\xfe\x8f\x03" "sck") +QDEF(MP_QSTR_scl, (const byte*)"\xf9\x8f\x03" "scl") +QDEF(MP_QSTR_screensize, (const byte*)"\x2c\xe1\x0a" "screensize") +QDEF(MP_QSTR_scroll, (const byte*)"\x28\x5a\x06" "scroll") +QDEF(MP_QSTR_sda, (const byte*)"\x53\x8f\x03" "sda") +QDEF(MP_QSTR_sdconfig, (const byte*)"\xb8\x4d\x08" "sdconfig") +QDEF(MP_QSTR_search, (const byte*)"\xab\xc1\x06" "search") +QDEF(MP_QSTR_secs, (const byte*)"\x43\x75\x04" "secs") +QDEF(MP_QSTR_secure, (const byte*)"\x12\xd0\x06" "secure") +QDEF(MP_QSTR_seed, (const byte*)"\x92\x75\x04" "seed") +QDEF(MP_QSTR_seek, (const byte*)"\x9d\x75\x04" "seek") +QDEF(MP_QSTR_select, (const byte*)"\x8d\x41\x06" "select") +QDEF(MP_QSTR_send, (const byte*)"\xb9\x76\x04" "send") +QDEF(MP_QSTR_sendSMS, (const byte*)"\x34\xcf\x07" "sendSMS") +QDEF(MP_QSTR_sendall, (const byte*)"\x38\x9f\x07" "sendall") +QDEF(MP_QSTR_sendmail, (const byte*)"\x70\x62\x08" "sendmail") +QDEF(MP_QSTR_sendmsg, (const byte*)"\x40\x8d\x07" "sendmsg") +QDEF(MP_QSTR_sendto, (const byte*)"\x22\x03\x06" "sendto") +QDEF(MP_QSTR_sep, (const byte*)"\x23\x8f\x03" "sep") +QDEF(MP_QSTR_seq, (const byte*)"\x22\x8f\x03" "seq") +QDEF(MP_QSTR_server, (const byte*)"\xc0\x28\x06" "server") +QDEF(MP_QSTR_server_hostname, (const byte*)"\x58\xef\x0f" "server_hostname") +QDEF(MP_QSTR_server_side, (const byte*)"\x64\xef\x0b" "server_side") +QDEF(MP_QSTR_service, (const byte*)"\x98\x75\x07" "service") +QDEF(MP_QSTR_set, (const byte*)"\x27\x8f\x03" "set") +QDEF(MP_QSTR_setCalib, (const byte*)"\x42\x7a\x08" "setCalib") +QDEF(MP_QSTR_setHSB, (const byte*)"\xbe\xcd\x06" "setHSB") +QDEF(MP_QSTR_setHSBint, (const byte*)"\xcd\x1a\x09" "setHSBint") +QDEF(MP_QSTR_setWhite, (const byte*)"\xc0\x4f\x08" "setWhite") +QDEF(MP_QSTR_set_res, (const byte*)"\x9c\x65\x07" "set_res") +QDEF(MP_QSTR_setattr, (const byte*)"\xd4\xa8\x07" "setattr") +QDEF(MP_QSTR_setblocking, (const byte*)"\x6e\x18\x0b" "setblocking") +QDEF(MP_QSTR_setdata, (const byte*)"\x37\xa7\x07" "setdata") +QDEF(MP_QSTR_setdefault, (const byte*)"\x6c\xa3\x0a" "setdefault") +QDEF(MP_QSTR_setsockopt, (const byte*)"\x38\xe8\x0a" "setsockopt") +QDEF(MP_QSTR_setter, (const byte*)"\x04\x59\x06" "setter") +QDEF(MP_QSTR_settimeout, (const byte*)"\xdc\x8a\x0a" "settimeout") +QDEF(MP_QSTR_setwin, (const byte*)"\x57\x45\x06" "setwin") +QDEF(MP_QSTR_sha1, (const byte*)"\x8e\xac\x04" "sha1") +QDEF(MP_QSTR_sha256, (const byte*)"\x2e\x01\x06" "sha256") +QDEF(MP_QSTR_show, (const byte*)"\x86\xaa\x04" "show") +QDEF(MP_QSTR_sides, (const byte*)"\x4d\xb8\x05" "sides") +QDEF(MP_QSTR_sin, (const byte*)"\xb1\x90\x03" "sin") +QDEF(MP_QSTR_single, (const byte*)"\x3f\x20\x06" "single") +QDEF(MP_QSTR_sinh, (const byte*)"\xb9\xa6\x04" "sinh") +QDEF(MP_QSTR_sizeof, (const byte*)"\x49\x73\x06" "sizeof") +QDEF(MP_QSTR_slave_addr, (const byte*)"\xe4\x95\x0a" "slave_addr") +QDEF(MP_QSTR_slave_bufflen, (const byte*)"\x07\x8f\x0d" "slave_bufflen") +QDEF(MP_QSTR_slavewrite, (const byte*)"\x35\xca\x0a" "slavewrite") +QDEF(MP_QSTR_sleep, (const byte*)"\xea\x27\x05" "sleep") +QDEF(MP_QSTR_sleep_ms, (const byte*)"\x0b\x63\x08" "sleep_ms") +QDEF(MP_QSTR_sleep_us, (const byte*)"\x13\x60\x08" "sleep_us") +QDEF(MP_QSTR_slice, (const byte*)"\xb5\xf4\x05" "slice") +QDEF(MP_QSTR_sms_cb, (const byte*)"\xd6\xca\x06" "sms_cb") +QDEF(MP_QSTR_socket, (const byte*)"\x60\xcc\x06" "socket") +QDEF(MP_QSTR_sort, (const byte*)"\xbf\x9d\x04" "sort") +QDEF(MP_QSTR_sorted, (const byte*)"\x5e\x15\x06" "sorted") +QDEF(MP_QSTR_speed, (const byte*)"\x62\x0f\x05" "speed") +QDEF(MP_QSTR_spihost, (const byte*)"\x6f\x91\x07" "spihost") +QDEF(MP_QSTR_splash, (const byte*)"\xd0\xcb\x06" "splash") +QDEF(MP_QSTR_split, (const byte*)"\xb7\x33\x05" "split") +QDEF(MP_QSTR_splitlines, (const byte*)"\x6a\xd3\x0a" "splitlines") +QDEF(MP_QSTR_sqrt, (const byte*)"\x21\x44\x04" "sqrt") +QDEF(MP_QSTR_ssh, (const byte*)"\xed\x8d\x03" "ssh") +QDEF(MP_QSTR_ssl, (const byte*)"\xe9\x8d\x03" "ssl") +QDEF(MP_QSTR_stack, (const byte*)"\xab\xed\x05" "stack") +QDEF(MP_QSTR_stack_size, (const byte*)"\x31\x3b\x0a" "stack_size") +QDEF(MP_QSTR_stack_use, (const byte*)"\x97\xf7\x09" "stack_use") +QDEF(MP_QSTR_stacksize, (const byte*)"\xce\xdd\x09" "stacksize") +QDEF(MP_QSTR_start, (const byte*)"\x85\xef\x05" "start") +QDEF(MP_QSTR_start_new_thread, (const byte*)"\xd7\x25\x10" "start_new_thread") +QDEF(MP_QSTR_startswith, (const byte*)"\x74\xe8\x0a" "startswith") +QDEF(MP_QSTR_stat, (const byte*)"\xd7\x35\x04" "stat") +QDEF(MP_QSTR_staticmethod, (const byte*)"\x62\xaf\x0c" "staticmethod") +QDEF(MP_QSTR_status, (const byte*)"\x71\x09\x06" "status") +QDEF(MP_QSTR_statvfs, (const byte*)"\x14\x19\x07" "statvfs") +QDEF(MP_QSTR_stderr, (const byte*)"\xa3\x58\x06" "stderr") +QDEF(MP_QSTR_stdin, (const byte*)"\x21\x04\x05" "stdin") +QDEF(MP_QSTR_stdin_disable, (const byte*)"\xea\x63\x0d" "stdin_disable") +QDEF(MP_QSTR_stdin_get, (const byte*)"\x48\x5a\x09" "stdin_get") +QDEF(MP_QSTR_stdout, (const byte*)"\x08\x83\x06" "stdout") +QDEF(MP_QSTR_stdout_put, (const byte*)"\xe6\x62\x0a" "stdout_put") +QDEF(MP_QSTR_step, (const byte*)"\x57\x36\x04" "step") +QDEF(MP_QSTR_stop, (const byte*)"\x9d\x36\x04" "stop") +QDEF(MP_QSTR_str, (const byte*)"\x50\x8d\x03" "str") +QDEF(MP_QSTR_strftime, (const byte*)"\x43\xf0\x08" "strftime") +QDEF(MP_QSTR_strip, (const byte*)"\x29\x1e\x05" "strip") +QDEF(MP_QSTR_struct, (const byte*)"\x12\x90\x06" "struct") +QDEF(MP_QSTR_subject, (const byte*)"\x19\xce\x07" "subject") +QDEF(MP_QSTR_subscribe, (const byte*)"\x0d\x08\x09" "subscribe") +QDEF(MP_QSTR_subscribed_cb, (const byte*)"\xd7\xbb\x0d" "subscribed_cb") +QDEF(MP_QSTR_sum, (const byte*)"\x2e\x8d\x03" "sum") +QDEF(MP_QSTR_super, (const byte*)"\xc4\xb2\x05" "super") +QDEF(MP_QSTR_suspend, (const byte*)"\x6f\xf5\x07" "suspend") +QDEF(MP_QSTR_symmetric_difference, (const byte*)"\xce\x67\x14" "symmetric_difference") +QDEF(MP_QSTR_symmetric_difference_update, (const byte*)"\x60\xf8\x1b" "symmetric_difference_update") +QDEF(MP_QSTR_synced, (const byte*)"\x03\x87\x06" "synced") +QDEF(MP_QSTR_sys, (const byte*)"\xbc\x8e\x03" "sys") +QDEF(MP_QSTR_sysname, (const byte*)"\x9b\x36\x07" "sysname") +QDEF(MP_QSTR_tan, (const byte*)"\xfe\x61\x03" "tan") +QDEF(MP_QSTR_tanh, (const byte*)"\xd6\xa1\x04" "tanh") +QDEF(MP_QSTR_tcs, (const byte*)"\xa1\x61\x03" "tcs") +QDEF(MP_QSTR_tell, (const byte*)"\x14\xb1\x04" "tell") +QDEF(MP_QSTR_telnet, (const byte*)"\x67\x4a\x06" "telnet") +QDEF(MP_QSTR_text, (const byte*)"\x98\xaf\x04" "text") +QDEF(MP_QSTR_textClear, (const byte*)"\x21\x72\x09" "textClear") +QDEF(MP_QSTR_textWidth, (const byte*)"\x7e\x9d\x09" "textWidth") +QDEF(MP_QSTR_tft_deselect, (const byte*)"\x35\x87\x0c" "tft_deselect") +QDEF(MP_QSTR_tft_readcmd, (const byte*)"\x44\x21\x0b" "tft_readcmd") +QDEF(MP_QSTR_tft_select, (const byte*)"\xb4\xea\x0a" "tft_select") +QDEF(MP_QSTR_tft_setspeed, (const byte*)"\xb9\xbc\x0c" "tft_setspeed") +QDEF(MP_QSTR_tft_writecmd, (const byte*)"\x2b\x33\x0c" "tft_writecmd") +QDEF(MP_QSTR_tft_writecmddata, (const byte*)"\x3b\x0f\x10" "tft_writecmddata") +QDEF(MP_QSTR_thick, (const byte*)"\x78\x53\x05" "thick") +QDEF(MP_QSTR_threshold, (const byte*)"\xf2\x2f\x09" "threshold") +QDEF(MP_QSTR_throw, (const byte*)"\xb3\x44\x05" "throw") +QDEF(MP_QSTR_ticks_add, (const byte*)"\x9d\xae\x09" "ticks_add") +QDEF(MP_QSTR_ticks_base, (const byte*)"\x09\x29\x0a" "ticks_base") +QDEF(MP_QSTR_ticks_cpu, (const byte*)"\x1a\xa5\x09" "ticks_cpu") +QDEF(MP_QSTR_ticks_diff, (const byte*)"\xb1\xe0\x0a" "ticks_diff") +QDEF(MP_QSTR_ticks_ms, (const byte*)"\x42\x32\x08" "ticks_ms") +QDEF(MP_QSTR_ticks_us, (const byte*)"\x5a\x31\x08" "ticks_us") +QDEF(MP_QSTR_tickscpu_diff, (const byte*)"\x77\x17\x0d" "tickscpu_diff") +QDEF(MP_QSTR_time, (const byte*)"\xf0\xc1\x04" "time") +QDEF(MP_QSTR_time_pulse_us, (const byte*)"\x89\x0c\x0d" "time_pulse_us") +QDEF(MP_QSTR_timeout, (const byte*)"\x3e\x54\x07" "timeout") +QDEF(MP_QSTR_timer, (const byte*)"\x82\xff\x05" "timer") +QDEF(MP_QSTR_timernum, (const byte*)"\x14\x90\x08" "timernum") +QDEF(MP_QSTR_timings, (const byte*)"\xa6\x89\x07" "timings") +QDEF(MP_QSTR_to, (const byte*)"\x9e\x6f\x02" "to") +QDEF(MP_QSTR_to_bytes, (const byte*)"\xd8\x3e\x08" "to_bytes") +QDEF(MP_QSTR_trace, (const byte*)"\xa4\x43\x05" "trace") +QDEF(MP_QSTR_transparent, (const byte*)"\xc3\xc2\x0b" "transparent") +QDEF(MP_QSTR_triangle, (const byte*)"\xeb\x99\x08" "triangle") +QDEF(MP_QSTR_trigger, (const byte*)"\x9d\x8c\x07" "trigger") +QDEF(MP_QSTR_trunc, (const byte*)"\x5b\x99\x05" "trunc") +QDEF(MP_QSTR_tuple, (const byte*)"\xfd\x41\x05" "tuple") +QDEF(MP_QSTR_tx, (const byte*)"\x89\x6f\x02" "tx") +QDEF(MP_QSTR_txdata, (const byte*)"\x99\x3a\x06" "txdata") +QDEF(MP_QSTR_type, (const byte*)"\x9d\x7f\x04" "type") +QDEF(MP_QSTR_tz, (const byte*)"\x8b\x6f\x02" "tz") +QDEF(MP_QSTR_ubinascii, (const byte*)"\xc4\x88\x09" "ubinascii") +QDEF(MP_QSTR_ucollections, (const byte*)"\x15\x9a\x0c" "ucollections") +QDEF(MP_QSTR_uctypes, (const byte*)"\xf8\x71\x07" "uctypes") +QDEF(MP_QSTR_uerrno, (const byte*)"\xb4\xe9\x06" "uerrno") +QDEF(MP_QSTR_uhashlib, (const byte*)"\x65\x9d\x08" "uhashlib") +QDEF(MP_QSTR_uheapq, (const byte*)"\x1d\x43\x06" "uheapq") +QDEF(MP_QSTR_uio, (const byte*)"\xb6\x66\x03" "uio") +QDEF(MP_QSTR_ujson, (const byte*)"\xe8\x30\x05" "ujson") +QDEF(MP_QSTR_umachine, (const byte*)"\x95\x7f\x08" "umachine") +QDEF(MP_QSTR_umount, (const byte*)"\xdd\x9e\x06" "umount") +QDEF(MP_QSTR_umountsd, (const byte*)"\xaa\xbb\x08" "umountsd") +QDEF(MP_QSTR_uname, (const byte*)"\xb7\x9c\x05" "uname") +QDEF(MP_QSTR_unhexlify, (const byte*)"\xb1\xb9\x09" "unhexlify") +QDEF(MP_QSTR_uniform, (const byte*)"\x01\xf5\x07" "uniform") +QDEF(MP_QSTR_union, (const byte*)"\xf6\x7c\x05" "union") +QDEF(MP_QSTR_unique_id, (const byte*)"\x04\x89\x09" "unique_id") +QDEF(MP_QSTR_unlock, (const byte*)"\x15\x88\x06" "unlock") +QDEF(MP_QSTR_unpack, (const byte*)"\x07\x3c\x06" "unpack") +QDEF(MP_QSTR_unpack_from, (const byte*)"\x0e\x6d\x0b" "unpack_from") +QDEF(MP_QSTR_unregister, (const byte*)"\x17\xd4\x0a" "unregister") +QDEF(MP_QSTR_unsubscribe, (const byte*)"\xd6\xa0\x0b" "unsubscribe") +QDEF(MP_QSTR_unsubscribed_cb, (const byte*)"\x4c\x96\x0f" "unsubscribed_cb") +QDEF(MP_QSTR_uos, (const byte*)"\xec\x67\x03" "uos") +QDEF(MP_QSTR_update, (const byte*)"\xb4\x76\x06" "update") +QDEF(MP_QSTR_update_period, (const byte*)"\x0e\x65\x0d" "update_period") +QDEF(MP_QSTR_upper, (const byte*)"\x27\x94\x05" "upper") +QDEF(MP_QSTR_urandom, (const byte*)"\xab\xae\x07" "urandom") +QDEF(MP_QSTR_ure, (const byte*)"\x87\x63\x03" "ure") +QDEF(MP_QSTR_url, (const byte*)"\x8e\x63\x03" "url") +QDEF(MP_QSTR_uselect, (const byte*)"\x58\x8e\x07" "uselect") +QDEF(MP_QSTR_user, (const byte*)"\x54\xf1\x04" "user") +QDEF(MP_QSTR_usocket, (const byte*)"\x75\x00\x07" "usocket") +QDEF(MP_QSTR_ussl, (const byte*)"\x1c\xf2\x04" "ussl") +QDEF(MP_QSTR_ustruct, (const byte*)"\x47\x08\x07" "ustruct") +QDEF(MP_QSTR_utime, (const byte*)"\xe5\x9d\x05" "utime") +QDEF(MP_QSTR_utimeq, (const byte*)"\xf4\x5a\x06" "utimeq") +QDEF(MP_QSTR_uzlib, (const byte*)"\x6d\x9b\x05" "uzlib") +QDEF(MP_QSTR_value, (const byte*)"\x4e\x34\x05" "value") +QDEF(MP_QSTR_values, (const byte*)"\x7d\xbe\x06" "values") +QDEF(MP_QSTR_verbose, (const byte*)"\x1f\x84\x07" "verbose") +QDEF(MP_QSTR_version, (const byte*)"\xbf\xd3\x07" "version") +QDEF(MP_QSTR_version_info, (const byte*)"\x6e\x0a\x0c" "version_info") +QDEF(MP_QSTR_vline, (const byte*)"\x1d\xf6\x05" "vline") +QDEF(MP_QSTR_vref, (const byte*)"\xe2\x78\x04" "vref") +QDEF(MP_QSTR_vref_topin, (const byte*)"\xb1\xaa\x0a" "vref_topin") +QDEF(MP_QSTR_wait, (const byte*)"\x8e\x55\x04" "wait") +QDEF(MP_QSTR_wake_description, (const byte*)"\x04\x8d\x10" "wake_description") +QDEF(MP_QSTR_wake_on_ext0, (const byte*)"\x05\xdc\x0c" "wake_on_ext0") +QDEF(MP_QSTR_wake_on_ext1, (const byte*)"\x04\xdc\x0c" "wake_on_ext1") +QDEF(MP_QSTR_wake_reason, (const byte*)"\x66\xc6\x0b" "wake_reason") +QDEF(MP_QSTR_websocket, (const byte*)"\x90\x8d\x09" "websocket") +QDEF(MP_QSTR_white, (const byte*)"\x42\xc3\x05" "white") +QDEF(MP_QSTR_width, (const byte*)"\x23\x75\x05" "width") +QDEF(MP_QSTR_winsize, (const byte*)"\xd0\x0e\x07" "winsize") +QDEF(MP_QSTR_wrap, (const byte*)"\x51\xfc\x04" "wrap") +QDEF(MP_QSTR_wrap_socket, (const byte*)"\xcb\xf3\x0b" "wrap_socket") +QDEF(MP_QSTR_write, (const byte*)"\x98\xa8\x05" "write") +QDEF(MP_QSTR_write_byte, (const byte*)"\x8d\x8d\x0a" "write_byte") +QDEF(MP_QSTR_write_bytes, (const byte*)"\x5e\x3f\x0b" "write_bytes") +QDEF(MP_QSTR_write_readinto, (const byte*)"\x89\x84\x0e" "write_readinto") +QDEF(MP_QSTR_write_string, (const byte*)"\xb2\x83\x0c" "write_string") +QDEF(MP_QSTR_writebyte, (const byte*)"\xd2\x1e\x09" "writebyte") +QDEF(MP_QSTR_writebytes, (const byte*)"\x61\xf9\x0a" "writebytes") +QDEF(MP_QSTR_writeto, (const byte*)"\x03\x39\x07" "writeto") +QDEF(MP_QSTR_writeto_mem, (const byte*)"\x79\xed\x0b" "writeto_mem") +QDEF(MP_QSTR_x, (const byte*)"\xdd\xb5\x01" "x") +QDEF(MP_QSTR_x1, (const byte*)"\x4c\x71\x02" "x1") +QDEF(MP_QSTR_x2, (const byte*)"\x4f\x71\x02" "x2") +QDEF(MP_QSTR_y, (const byte*)"\xdc\xb5\x01" "y") +QDEF(MP_QSTR_y1, (const byte*)"\x6d\x71\x02" "y1") +QDEF(MP_QSTR_y2, (const byte*)"\x6e\x71\x02" "y2") +QDEF(MP_QSTR_ymodem, (const byte*)"\xf2\x89\x06" "ymodem") +QDEF(MP_QSTR_zip, (const byte*)"\xe6\xac\x03" "zip") +QDEF(MP_QSTR_zlib, (const byte*)"\xf8\x37\x04" "zlib") diff --git a/MicroPython_BUILD/components/micropython/hisbazahtml_orig.py b/MicroPython_BUILD/components/micropython/hisbazahtml_orig.py deleted file mode 100755 index 8ff7f24..0000000 --- a/MicroPython_BUILD/components/micropython/hisbazahtml_orig.py +++ /dev/null @@ -1,684 +0,0 @@ -#!/usr/bin/env python -# -*- coding: UTF8 -*- - -import fdb -import os -import time -import datetime -import cgi -import cgitb -cgitb.enable(context=1, format='text') -#import base64 -#import struct -#import md5 -#import json - -# konfiguriramo vrijeme za prikaz u UTC -os.environ["TZ"] = "UTC" -time.tzset() - -# uzmemo informaciju o posiljatelju -form = cgi.FieldStorage() - -from hisveza import * - -print "Content-type: text/html\r\n\r\n" - -fbcon = None - -# povezemo se na bazu -try: - fbcon = fdb.connect(dsn=DB_HOST + ':' + DB_BASE, user=DB_USER, password=DB_PASS, charset='UTF8') - #print "Povezano na bazu" -except fdb.Error: - fbcon = None - #print "Greska pri povezivanju na bazu: " + str(e) - - -# uzmemo trenutno vrijeme u CET zoni -#============= -def vrijeme(): - # struktura vremena (GMT) - vrm = time.gmtime() - # unix vrijeme (CEST) - lvrm = int(time.mktime(vrm)) + 3600 - # date time struktura (y,m,d,h,mn,s) (CEST) - vrmd = datetime.datetime.fromtimestamp(lvrm) - # struktura vremena (CEST) - vrm = time.gmtime(lvrm) - # gsm string vremena - vrms = time.strftime('"%y/%m/%d, %H:%M:%S"', vrm) - return (lvrm, vrms, vrmd) - - -#================== -def izvrsisql(sql): - if fbcon: - try: - cur = fbcon.cursor() - cur.execute(sql) - return cur - except: - return None - else: - return None - - -#==================== -def poljatabele(tbl): - try: - cur = izvrsisql('SELECT * FROM ' + tbl) - res = '' - if cur: - desc = cur.description - res = '' - for polje in desc: - res = res + "%s;" % (polje[0]) - res = res + '\r\n' - cur.close() - except fdb.Error, e: - res = "Error %d: %s" % (e.args[0], e.args[1]) - return res - - -#=============== -def tabela(tbl): - try: - cur = izvrsisql('SELECT * FROM ' + tbl) - res = '' - if cur: - rows = cur.fetchall() - res = '' - for red in rows: - for polje in red: - res = res + "%s;" % (polje) - res = res + '\r\n' - cur.close() - except fdb.Error, e: - res = "Error %d: %s" % (e.args[0], e.args[1]) - return res - - -#===================== -def saljiVrijeme(tip): - vmr = vrijeme() - res = '' - if tip == '2': - res = vmr[1] - else: - res = str(vmr[0]) - return '[>vrm]' + res + '[<]\r\n' - - -#=============== -def divGreska(): - print '
' - print '
' - print 'Greška' - print '
' - print '
' - - -#========================================== -def TabelaBilten(cur, zag, align, stermin): - if 'mini' in form: - fonts = '70%' - zagl = ['Vodotok', 'Postaja', 'Trend', 'Vodost (cm)', 'Dnevna tendenc.', 'Protok m3/s'] - else: - fonts = '85%' - zagl = ['Vodotok', 'Postaja', 'Trend', 'Vodostaj (cm)', 'Dnevna tendencija', 'Protok m3/s'] - - shtml = '
' +\ - 'Dnevni hidrološki izvještaj za ' + stermin + ' (UTC+1)
' - - #table header - shtml = shtml + '' - - if zag > 0: - #desc = cur.description - shtml = shtml + '' - for polje in zagl: - shtml = shtml + '' - shtml = shtml + '' - - #table body - rows = cur.fetchall() - - nisti = 1 - svod = '??' - tred = '' - for red in rows: - idx = 0 - for polje in red: - if type(polje) is int: - spolje = str(polje) - else: - polje = polje.encode('utf8') - spolje = str(polje) - - if idx == 0: - # prvo poje (vodotok) - if spolje != svod: - # novi vodotok - if tred != '': - # zapisemo do sada formirame redove - if nisti > 1: - nisti = nisti + 1 - tred = tred.replace('', '') - tred = tred.replace('' + tred + '' - shtml = shtml + tred - tred = '' - nisti = 1 - tred = tred + '' - svod = spolje - else: - nisti = nisti + 1 - tred = tred + '' - else: - tred = tred + '' - - idx = idx + 1 - tred = tred + '' - - if nisti > 1: - nisti = nisti + 1 - tred = tred.replace('', '') - tred = tred.replace('' + tred + '' - shtml = shtml + tred - return shtml - - -#================================ -def Tabela2html(cur, zag, align): - shtml = '' - #table header - shtml = shtml + '
' - shtml = shtml + '' + polje + '' - shtml = shtml + '
', '') - tred = tred.replace('
', '') - tred = '
' - if str(polje) == 'None': - tred = tred + ' ' - else: - tred = tred + '' + spolje + '' - tred = tred + '
' - if str(polje) == 'None': - tred = tred + ' ' - else: - if idx == 2: - if spolje == '1': - spolje = '' - elif spolje == '-1': - spolje = '' - else: - spolje = '' - tred = tred + spolje - tred = tred + '
', '') - tred = tred.replace('
', '') - tred = '
' - - rcl = 0 - if zag > 0: - desc = cur.description - shtml = shtml + '' - for polje in desc: - shtml = shtml + '' - shtml = shtml + '' - rcl = 1 - - #table body - rows = cur.fetchall() - - for red in rows: - shtml = shtml + '' - - idx = 0 - for polje in red: - polje = polje.encode('utf8') - if rcl == 1: - shtml = shtml + '' - idx = idx + 1 - - shtml = shtml + '' - rcl = rcl + 1 - if rcl > 1: - rcl = 0 - - shtml = shtml + '
' - shtml = shtml + '' + polje[0] + '' - shtml = shtml + '
' - else: - shtml = shtml + '' - - if str(polje) == 'None': - shtml = shtml + ' ' - else: - spolje = str(polje) - if spolje.find('m3/s') != -1: - spolje = spolje.replace('m3/s', 'm3/s') - shtml = shtml + spolje - - shtml = shtml + '
' - return shtml - - -#=================== -def Zapis2html(cur): - shtml = '' - #table header - shtml = shtml + '' - try: - #table body - rows = cur.fetchall() - desc = cur.description - if len(rows) > 0: - rcl = 0 - idx = 0 - for polje in desc: - shtml = shtml + '' - - if rcl == 1: - shtml = shtml + '' - - if rcl == 1: - shtml = shtml + '' - - shtml = shtml + '' - rcl = rcl + 1 - if rcl > 1: - rcl = 0 - idx = idx + 1 - except: - pass - - shtml = shtml + '
' - else: - shtml = shtml + '' - if str(polje) == 'None': - shtml = shtml + ' ' - else: - imep = polje[0] - if imep.find('Topografska') != -1: - imep = 'Topografska površina sliva (km2)' - shtml = shtml + imep - shtml = shtml + '' - else: - shtml = shtml + '' - if rows[0][idx]: - if type(rows[0][idx]) is datetime.date: - shtml = shtml + "%02d. %02d. %04d." % (rows[0][idx].day, rows[0][idx].month, rows[0][idx].year) - elif type(rows[0][idx]) is float: - spod = "%.3f" % rows[0][idx] - spod = spod.replace('.', ',') - shtml = shtml + spod - elif type(rows[0][idx]) is int: - shtml = shtml + str(rows[0][idx]) - else: - shtml = shtml + rows[0][idx].encode('utf8') - else: - shtml = shtml + ' --' - - shtml = shtml + '
' - return shtml - - -#==================== -def mjerenjaPostaje(): - post = '' - cur = izvrsisql("select IME, IME_VODOTOKA from POSTAJE_SVE where KOD = " + form.getvalue('kpost')) - try: - if cur: - rows = cur.fetchall() - if len(rows) > 0: - post = rows[0][0].encode('utf8') + ', ' + rows[0][1].encode('utf8') - except: - post = '??' - - try: - print '
' - print '
' - print 'Mjerenja postaje: ' + post + '' - print '
' - print '
' - - cur = izvrsisql('select VRSTA_MJERENJA as "Vrsta mjerenja",' - ' (select * FROM PROC_GODINE_MJERENJA(KOD_POSTAJE,TIP_MJERENJA)) as "Godine/broj mjerenja"' - ' from MJERENJA where KOD_POSTAJE = ' + form.getvalue('kpost') + " order by RBR_TIPA") - if cur: - print Tabela2html(cur, 1, ['right', 'left']) - cur.close() - else: - print 'g1' - except: - divGreska() - - -#================= -def infoPostaje(): - try: - print '
' - print '
' - print 'Osnovni podaci postaje' - print '
' - print '
' - - if form.getvalue('kpost') > 0: - cur = izvrsisql('select IME as "Ime", SIFRA as "Šifra", IME_VODOTOKA as "Vodotok", ' - 'IME_SLIVA as "Slivno područje", POCETAK_RADA as "Početak rada", KRAJ_RADA as "Kraj rada",' - ' KOTA_NULE as "Kota nule vodokaza (m n/m)" from POSTAJE_SVE where KOD = ' + - form.getvalue('kpost')) - if cur: - print Zapis2html(cur) - cur.close() - else: - divGreska() - except: - divGreska() - - -#========================= -def infoMjerenjaPostaje(): - try: - print '
' - print '
' - print 'Mjerenja postaje' - print '
' - print '
' - - cur = izvrsisql('select MJERENJE as "Vrsta mjerenja", INFO as "Info" from TINFO_MJERENJA_POSTAJE(' + - form.getvalue('kpost') + ')') - if cur: - print Tabela2html(cur, 1, ['right', 'left']) - cur.close() - else: - divGreska() - - except: - divGreska() - - -#============ -def Bilten(): - try: - tip = 1 - if 'btip' in form: - tip = int(form.getvalue('btip')) - except: - tip = 1 - - tip = 1 - try: - if 'zadpod' in form: - term = datetime.datetime.utcnow() + datetime.timedelta(0, 3600) - if term.hour < 7: - term = term - datetime.timedelta(days=1) - strm = str(term.year) + '-' + str(term.month) + '-' + str(term.day) + ' ' + str(term.hour) + ':00:00' - sstrm = str(term.day) + '. ' + str(term.month) + '. ' + str(term.year) + '. ' + str(term.hour) + ':00:00' - else: - term = datetime.datetime.utcnow() + datetime.timedelta(0, 3600) - if term.hour < 8: - term = term - datetime.timedelta(days=1) - strm = str(term.year) + '-' + str(term.month) + '-' + str(term.day) + ' 07:00:00' - sstrm = str(term.day) + '. ' + str(term.month) + '. ' + str(term.year) + '. 07:00:00' - - cur = izvrsisql("select VODOTOK,POSTAJA,TREND,VODOSTAJ,TENDENCIJA,PROTOK from WEB_BILTEN('" + strm + "', " + str(tip) + ")") - if cur: - print TabelaBilten(cur, 1, ['center', 'left', 'center', 'center', 'center', 'center'], sstrm) - cur.close() - else: - print 'cur greska' - #divGreska() - - except Exception, e: - print 'GRESKA ' + str(e) - #divGreska() - - -#============= -def BiltenX(): - try: - tip = 1 - if 'btip' in form: - tip = int(form.getvalue('btip')) - except: - tip = 1 - - try: - if 'zadpod' in form: - term = datetime.datetime.utcnow() + datetime.timedelta(0, 3600) - if term.hour < 7: - term = term - datetime.timedelta(days=1) - strm = str(term.year) + '-' + str(term.month) + '-' + str(term.day) + ' ' + str(term.hour) + ':00:00' - sstrm = str(term.day) + '. ' + str(term.month) + '. ' + str(term.year) + '. ' + str(term.hour) + ':00:00' - else: - term = datetime.datetime.utcnow() + datetime.timedelta(0, 3600) - if term.hour < 8: - term = term - datetime.timedelta(days=1) - strm = str(term.year) + '-' + str(term.month) + '-' + str(term.day) + ' 07:00:00' - sstrm = str(term.day) + '. ' + str(term.month) + '. ' + str(term.year) + '. 07:00:00' - - cur = izvrsisql("select VODOTOK,POSTAJA,TREND,VODOSTAJ,TENDENCIJA,PROTOK from WEB_BILTEN_X('" + strm + "', " + str(tip) + ")") - if cur: - print TabelaBilten(cur, 1, ['center', 'left', 'center', 'center', 'center', 'center'], sstrm) - cur.close() - else: - print 'cur greska' - #divGreska() - - except Exception, e: - print 'GRESKA ' + str(e) - #divGreska() - - -#================= -def punInfoPostaje(): - sirprof = 40 - if ('sirina' in form) and ('visina' in form): - try: - sirprof = int(form.getvalue('sirina')) - visprof = int(form.getvalue('visina')) + 220 - sirprof = (sirprof * 100) / visprof - except: - sirprof = 40 - - post = '??' - koment = 'None' - cur = izvrsisql("select SIFRA, KOMENTAR from POSTAJE where KOD = " + form.getvalue('kpost')) - try: - if cur: - rows = cur.fetchall() - if len(rows) > 0: - post = str(rows[0][0]) - try: - koment = rows[0][1].encode('utf8') - except: - koment = 'None' - except: - post = '??' - - try: - # slika - if post != '??': - lpath = os.getcwd() - sifpost = post - - lpost = lpath[0:lpath.rfind('/')] + '/slike/' + sifpost + '.jpg' - post = '../slike/' + sifpost + '.jpg' - if os.path.isfile(lpost): - print '
' - print '
' - print 'Postaja' - if koment != 'None': - print '•••' - print '
' - - if koment != 'None': - print '
' - #print '
' - print koment - print '
' - - print '
' - print '
' - print 'Osnovni podaci postaje' - print '
' - print '
' - - if form.getvalue('kpost') > 0: - cur = izvrsisql('select * FROM INFO_POSTAJE(' + form.getvalue('kpost') + ')') - if cur: - print Zapis2html(cur) - cur.close() - else: - divGreska() - - infoMjerenjaPostaje() - - lpost = lpath[0:lpath.rfind('/')] + '/slike/' + sifpost + '.svg' - post = '../slike/' + sifpost + '.svg' - if os.path.isfile(lpost): - #print '
' - print '
' - print 'SVG nije podržan!' - #print '' - #print '
' - - print '
' - print '
' - print '
' - except: - divGreska() - - -#=================== -def profilPostaje(): - post = '??' - cur = izvrsisql("select SIFRA from POSTAJE where KOD = " + form.getvalue('kpost')) - try: - if cur: - rows = cur.fetchall() - if len(rows) > 0: - post = str(rows[0][0]) - except: - post = '??' - - try: - # slika - if post != '??': - lpath = os.getcwd() - sifpost = post - lpost = lpath[0:lpath.rfind('/')] + '/slike/' + sifpost + '.svg' - post = '../slike/' + sifpost + '.svg' - if os.path.isfile(lpost): - #print '
' - if 'fullsize' in form: - print 'SVG nije podržan!' - else: - print 'SVG nije podržan!' - #print '' - #print '
' - else: - print '
' - print 'Nema profila postaje.' - print '
' - else: - divGreska() - except: - divGreska() - - -#================= -def slivVodInfo(): - try: - print '
' - cur = izvrsisql('select IME as "Slivno područje", BROJ_VODOTOKOVA as "Broj vodotokova", ' - 'BROJ_POSTAJA as "Broj postaja" from SLIVNA_PODRUCJA where KOD=' + form.getvalue('ksliv')) - if cur: - print Zapis2html(cur) - cur.close() - else: - pass - print '
' - print '
' - cur = izvrsisql('select IME as "Vodotok", BROJ_POSTAJA as "Broj postaja" from VODOTOCI where KOD=' + - form.getvalue('kvod')) - if cur: - print Zapis2html(cur) - cur.close() - else: - pass - print '
' - except: - pass - - -#============== -def pozadina(): - try: - print '
' - print '
' - - except: - divGreska() - - -#========================================================================================== - -print '' - -if 'funkc' in form: - #--------------------------------------- - if form.getvalue('funkc') == 'mjerpost': - if 'kpost' in form: - mjerenjaPostaje() - - #--------------------------------------- - if form.getvalue('funkc') == 'infopost': - if 'kpost' in form: - infoPostaje() - - #------------------------------------------ - if form.getvalue('funkc') == 'puninfopost': - if 'kpost' in form: - punInfoPostaje() - - #------------------------------------------ - if form.getvalue('funkc') == 'bilten': - Bilten() - - #------------------------------------------ - if form.getvalue('funkc') == 'xbilten': - BiltenX() - - #------------------------------------------ - if form.getvalue('funkc') == 'profilpost': - if 'kpost' in form: - profilPostaje() - - #--------------------------------------- - if form.getvalue('funkc') == 'slivvod': - if ('ksliv' in form) and ('kvod' in form): - slivVodInfo() - - #--------------------------------------- - if form.getvalue('funkc') == 'pozadina': - pozadina() - -print '' - -if fbcon: - fbcon.close()