2015-04-10 20:02:07 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the Micro Python project, http://micropython.org/
|
|
|
|
*
|
|
|
|
* The MIT License (MIT)
|
|
|
|
*
|
|
|
|
* Copyright (c) 2013, 2014 Damien P. George
|
|
|
|
* Copyright (c) 2015 Daniel Campora
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
* THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2015-02-06 14:35:48 +00:00
|
|
|
// qstrs specific to this port
|
|
|
|
Q(__name__)
|
|
|
|
Q(help)
|
|
|
|
Q(pyb)
|
|
|
|
Q(info)
|
2015-03-04 12:52:39 +00:00
|
|
|
Q(reset)
|
2015-02-06 14:35:48 +00:00
|
|
|
Q(main)
|
|
|
|
Q(sync)
|
|
|
|
Q(gc)
|
|
|
|
Q(rng)
|
|
|
|
Q(delay)
|
|
|
|
Q(time)
|
|
|
|
Q(open)
|
|
|
|
Q(on)
|
|
|
|
Q(off)
|
|
|
|
Q(toggle)
|
|
|
|
Q(write)
|
|
|
|
Q(read)
|
|
|
|
Q(readall)
|
|
|
|
Q(readline)
|
|
|
|
Q(input)
|
|
|
|
Q(os)
|
|
|
|
Q(freq)
|
|
|
|
Q(repl_info)
|
|
|
|
Q(disable_irq)
|
|
|
|
Q(enable_irq)
|
|
|
|
Q(millis)
|
|
|
|
Q(micros)
|
|
|
|
Q(elapsed_millis)
|
|
|
|
Q(elapsed_micros)
|
|
|
|
Q(udelay)
|
|
|
|
Q(flush)
|
2015-02-25 10:08:51 +00:00
|
|
|
Q(FileIO)
|
|
|
|
Q(mkdisk)
|
2015-02-26 14:29:47 +00:00
|
|
|
Q(enable)
|
|
|
|
Q(disable)
|
2015-02-06 14:35:48 +00:00
|
|
|
// Entries for sys.path
|
2015-04-10 20:02:07 +01:00
|
|
|
Q(/flash)
|
|
|
|
Q(/flash/lib)
|
|
|
|
#if MICROPY_HW_HAS_SDCARD
|
|
|
|
Q(/sd)
|
|
|
|
Q(/sd/lib)
|
|
|
|
#endif
|
2015-02-06 14:35:48 +00:00
|
|
|
|
|
|
|
// for module weak links
|
|
|
|
Q(re)
|
|
|
|
Q(json)
|
|
|
|
Q(heapq)
|
|
|
|
|
|
|
|
// for os module
|
|
|
|
Q(uos)
|
|
|
|
Q(os)
|
2015-04-28 18:53:45 +01:00
|
|
|
Q(sysname)
|
|
|
|
Q(nodename)
|
|
|
|
Q(release)
|
|
|
|
Q(version)
|
|
|
|
Q(machine)
|
|
|
|
Q(uname)
|
2015-02-06 14:35:48 +00:00
|
|
|
Q(/)
|
2015-04-10 20:02:07 +01:00
|
|
|
Q(flash)
|
|
|
|
#if MICROPY_HW_HAS_SDCARD
|
|
|
|
Q(sd)
|
|
|
|
#endif
|
2015-02-06 14:35:48 +00:00
|
|
|
Q(chdir)
|
|
|
|
Q(getcwd)
|
|
|
|
Q(listdir)
|
|
|
|
Q(mkdir)
|
|
|
|
Q(remove)
|
|
|
|
Q(rmdir)
|
|
|
|
Q(unlink)
|
|
|
|
Q(sep)
|
|
|
|
Q(stat)
|
|
|
|
Q(urandom)
|
|
|
|
|
|
|
|
// for file class
|
|
|
|
Q(seek)
|
|
|
|
Q(tell)
|
|
|
|
|
2015-02-09 18:38:02 +00:00
|
|
|
// for Pin class
|
|
|
|
Q(Pin)
|
2015-02-06 14:35:48 +00:00
|
|
|
Q(init)
|
|
|
|
Q(value)
|
|
|
|
Q(low)
|
|
|
|
Q(high)
|
|
|
|
Q(name)
|
|
|
|
Q(port)
|
|
|
|
Q(pin)
|
|
|
|
Q(cpu)
|
|
|
|
Q(mode)
|
|
|
|
Q(pull)
|
|
|
|
Q(index)
|
|
|
|
Q(strength)
|
|
|
|
Q(af)
|
2015-03-04 12:51:01 +00:00
|
|
|
Q(intenable)
|
|
|
|
Q(intdisable)
|
|
|
|
Q(intmode)
|
|
|
|
Q(swint)
|
2015-02-06 14:35:48 +00:00
|
|
|
Q(IN)
|
|
|
|
Q(OUT)
|
|
|
|
Q(STD)
|
|
|
|
Q(STD_PU)
|
|
|
|
Q(STD_PD)
|
|
|
|
Q(OD)
|
|
|
|
Q(OD_PU)
|
|
|
|
Q(OD_PD)
|
2015-03-04 12:51:01 +00:00
|
|
|
Q(INT_RISING)
|
|
|
|
Q(INT_FALLING)
|
|
|
|
Q(INT_RISING_FALLING)
|
|
|
|
Q(INT_LOW_LEVEL)
|
|
|
|
Q(INT_HIGH_LEVEL)
|
2015-02-06 14:35:48 +00:00
|
|
|
Q(S2MA)
|
|
|
|
Q(S4MA)
|
|
|
|
Q(S6MA)
|
|
|
|
|
|
|
|
// for UART class
|
|
|
|
Q(UART)
|
|
|
|
Q(baudrate)
|
|
|
|
Q(bits)
|
|
|
|
Q(stop)
|
|
|
|
Q(parity)
|
|
|
|
Q(init)
|
|
|
|
Q(deinit)
|
|
|
|
Q(all)
|
|
|
|
Q(writechar)
|
|
|
|
Q(readchar)
|
|
|
|
Q(readinto)
|
|
|
|
Q(read_buf_len)
|
|
|
|
Q(timeout)
|
|
|
|
Q(timeout_char)
|
|
|
|
Q(repl_uart)
|
|
|
|
Q(flow)
|
|
|
|
Q(FLOW_NONE)
|
|
|
|
Q(FLOW_TX)
|
|
|
|
Q(FLOW_RX)
|
|
|
|
Q(FLOW_TXRX)
|
|
|
|
|
2015-02-10 12:11:27 +00:00
|
|
|
// for I2C class
|
|
|
|
Q(I2C)
|
|
|
|
Q(addr)
|
|
|
|
Q(data)
|
|
|
|
Q(memaddr)
|
|
|
|
Q(addr_size)
|
|
|
|
Q(init)
|
|
|
|
Q(deinit)
|
|
|
|
Q(is_ready)
|
|
|
|
Q(scan)
|
|
|
|
Q(send)
|
|
|
|
Q(recv)
|
|
|
|
Q(mem_read)
|
|
|
|
Q(mem_write)
|
|
|
|
|
2015-02-19 20:03:21 +00:00
|
|
|
// for ADC class
|
|
|
|
Q(ADC)
|
|
|
|
Q(read)
|
|
|
|
|
2015-04-10 20:02:07 +01:00
|
|
|
#if MICROPY_HW_HAS_SDCARD
|
2015-02-21 13:10:33 +00:00
|
|
|
// for SD class
|
|
|
|
Q(SD)
|
2015-03-19 14:17:39 +00:00
|
|
|
Q(enable)
|
|
|
|
Q(disable)
|
2015-04-10 20:02:07 +01:00
|
|
|
#endif
|
2015-02-21 13:10:33 +00:00
|
|
|
|
2015-02-06 14:35:48 +00:00
|
|
|
// for RTC class
|
|
|
|
Q(RTC)
|
|
|
|
Q(datetime)
|
|
|
|
|
|
|
|
// for time class
|
|
|
|
Q(utime)
|
|
|
|
Q(localtime)
|
|
|
|
Q(mktime)
|
|
|
|
Q(sleep)
|
|
|
|
Q(time)
|
|
|
|
|
|
|
|
// for select class
|
|
|
|
Q(select)
|
|
|
|
Q(uselect)
|
|
|
|
Q(register)
|
|
|
|
Q(unregister)
|
|
|
|
Q(modify)
|
|
|
|
Q(poll)
|
|
|
|
|
|
|
|
// for socket class
|
|
|
|
Q(socket)
|
|
|
|
Q(usocket)
|
|
|
|
Q(getaddrinfo)
|
|
|
|
Q(family)
|
|
|
|
Q(type)
|
|
|
|
Q(send)
|
|
|
|
Q(sendto)
|
|
|
|
Q(recv)
|
|
|
|
Q(recvfrom)
|
|
|
|
Q(listen)
|
|
|
|
Q(accept)
|
|
|
|
Q(bind)
|
|
|
|
Q(settimeout)
|
|
|
|
Q(setblocking)
|
|
|
|
Q(setsockopt)
|
|
|
|
Q(close)
|
|
|
|
Q(protocol)
|
|
|
|
Q(AF_INET)
|
|
|
|
Q(AF_INET6)
|
|
|
|
Q(SOCK_STREAM)
|
|
|
|
Q(SOCK_DGRAM)
|
|
|
|
Q(SOCK_RAW)
|
2015-04-13 15:42:02 +01:00
|
|
|
Q(IPPROTO_SEC)
|
2015-02-06 14:35:48 +00:00
|
|
|
Q(IPPROTO_TCP)
|
|
|
|
Q(IPPROTO_UDP)
|
|
|
|
Q(IPPROTO_RAW)
|
|
|
|
|
|
|
|
// for network class
|
|
|
|
Q(network)
|
|
|
|
Q(route)
|
2015-03-19 16:06:20 +00:00
|
|
|
Q(start_server)
|
|
|
|
Q(stop_server)
|
|
|
|
Q(server_enabled)
|
|
|
|
Q(server_login)
|
2015-02-06 14:35:48 +00:00
|
|
|
|
2015-02-22 17:43:01 +00:00
|
|
|
// for WLAN class
|
2015-02-06 14:35:48 +00:00
|
|
|
Q(WLAN)
|
|
|
|
Q(key)
|
|
|
|
Q(security)
|
|
|
|
Q(ssid)
|
|
|
|
Q(bssid)
|
|
|
|
Q(scan)
|
|
|
|
Q(connect)
|
2015-02-23 10:22:15 +00:00
|
|
|
Q(isconnected)
|
2015-02-06 14:35:48 +00:00
|
|
|
Q(disconnect)
|
|
|
|
Q(channel)
|
2015-04-28 22:52:26 +01:00
|
|
|
Q(rssi)
|
2015-02-23 10:22:15 +00:00
|
|
|
Q(ifconfig)
|
2015-02-22 17:43:01 +00:00
|
|
|
Q(urn)
|
2015-04-12 22:55:34 +01:00
|
|
|
Q(mode)
|
|
|
|
Q(config_ip)
|
|
|
|
Q(ip)
|
|
|
|
Q(subnet)
|
|
|
|
Q(gateway)
|
|
|
|
Q(dns)
|
2015-05-02 21:19:31 +01:00
|
|
|
Q(mac)
|
2015-02-06 14:35:48 +00:00
|
|
|
Q(STA)
|
|
|
|
Q(AP)
|
|
|
|
Q(P2P)
|
|
|
|
Q(OPEN)
|
|
|
|
Q(WEP)
|
|
|
|
Q(WPA_WPA2)
|
|
|
|
Q(WPA_ENT)
|
|
|
|
Q(WPS_PBC)
|
|
|
|
Q(WPS_PIN)
|
2015-04-12 22:55:34 +01:00
|
|
|
Q(DYNAMIC)
|
|
|
|
Q(STATIC)
|
2015-02-26 14:29:47 +00:00
|
|
|
|
|
|
|
// for WDT class
|
|
|
|
Q(WDT)
|
2015-03-19 14:17:39 +00:00
|
|
|
Q(enable)
|
2015-02-26 14:29:47 +00:00
|
|
|
Q(kick)
|
|
|
|
|
|
|
|
// for HeartBeat class
|
|
|
|
Q(HeartBeat)
|
2015-03-19 14:17:39 +00:00
|
|
|
Q(enable)
|
|
|
|
Q(disable)
|
2015-02-26 14:29:47 +00:00
|
|
|
|
2015-03-04 12:52:39 +00:00
|
|
|
// for callback class
|
|
|
|
Q(init)
|
|
|
|
Q(enable)
|
|
|
|
Q(disable)
|
|
|
|
Q(callback)
|
|
|
|
Q(handler)
|
|
|
|
Q(intmode)
|
|
|
|
Q(value)
|
|
|
|
Q(priority)
|
2015-03-26 09:25:28 +00:00
|
|
|
Q(wakes)
|
2015-03-04 12:52:39 +00:00
|
|
|
|
|
|
|
// for Sleep class
|
|
|
|
Q(Sleep)
|
|
|
|
Q(idle)
|
|
|
|
Q(suspend)
|
|
|
|
Q(hibernate)
|
2015-03-14 08:59:47 +00:00
|
|
|
Q(reset_cause)
|
|
|
|
Q(wake_reason)
|
2015-03-12 15:14:55 +00:00
|
|
|
Q(ACTIVE)
|
2015-03-04 12:52:39 +00:00
|
|
|
Q(SUSPENDED)
|
|
|
|
Q(HIBERNATING)
|
2015-05-01 22:09:29 +01:00
|
|
|
Q(POWER_ON)
|
2015-03-14 08:59:47 +00:00
|
|
|
Q(HARD_RESET)
|
|
|
|
Q(WDT_RESET)
|
|
|
|
Q(HIB_RESET)
|
|
|
|
Q(SOFT_RESET)
|
|
|
|
Q(WLAN_WAKE)
|
|
|
|
Q(PIN_WAKE)
|
|
|
|
Q(RTC_WAKE)
|
|
|
|
|
2015-03-19 14:17:39 +00:00
|
|
|
// for SPI class
|
|
|
|
Q(SPI)
|
|
|
|
Q(baudrate)
|
|
|
|
Q(bits)
|
|
|
|
Q(submode)
|
|
|
|
Q(cs)
|
|
|
|
Q(init)
|
|
|
|
Q(deinit)
|
|
|
|
Q(send)
|
|
|
|
Q(recv)
|
|
|
|
Q(send_recv)
|
|
|
|
Q(ACTIVE_LOW)
|
|
|
|
Q(ACTIVE_HIGH)
|
|
|
|
|