Commit Graph

160 Commits

Author SHA1 Message Date
Daniel Campora e800db562f cc3200: Add uhashlib. Supports SHA1 and SHA256. 2015-05-20 11:44:24 +02:00
Daniel Campora 5e38b48dd6 cc3200: Fix time.localtime() so that it returns the correct fields. 2015-05-20 11:44:22 +02:00
Daniel Campora 56053c37cf cc3200: Rewrite WLAN.ifconfig(). Add WLAN.info() and WLAN.connections(). 2015-05-20 11:44:21 +02:00
Daniel Campora 514ba15d6a cc3200: Disable UCTYPES and enable ARRAY_SLICE_ASSIGN. 2015-05-20 11:44:19 +02:00
Daniel Campora 6f848b6dba cc3200: Set the timer edge count interrupt value in the calbback const. 2015-05-17 16:11:12 +02:00
Daniel Campora 95a4f61499 cc3200: Make sure RTC wake value is >= 1ms. 2015-05-17 16:09:27 +02:00
Daniel Campora c27dc38e85 cc3200: Re-name 'intmode' to 'mode' in the callback API. 2015-05-17 14:49:17 +02:00
Daniel Campora cd3f2523f1 cc3200: Disable WLAN.urn() by default.
Can be enabled by defining MICROPY_PORT_WLAN_URN=1 in mpconfigport.h.
2015-05-17 14:20:24 +02:00
Daniel Campora a379b6ed11 cc3200: Add optional timeout param to WLAN.connect(). 2015-05-17 14:05:44 +02:00
Daniel Campora fb9e4cf463 cc3200: Make sure to handle all pending pin interrupts.
When entering the interrupt handler of a given GPIO port, more than
one pin could have pending interrupts, therefore care must be taken
to service each interrupt one by one before leaving.
2015-05-17 13:42:15 +02:00
Daniel Campora 8e611e8414 cc3200: Add Timer module. Supports free running, PWM and capture modes. 2015-05-17 12:34:49 +02:00
Daniel Campora 9466e154b4 cc3200: Fix power mode param check in the UART callback constructor. 2015-05-17 12:26:40 +02:00
Daniel Campora 2b62707051 cc3200: Add os.rename() 2015-05-17 12:22:17 +02:00
Josef Gajdusek 1db4253886 lib: Move time utility functions to common library. 2015-05-13 00:12:54 +01:00
Damien George c50772d19f py: Add mp_obj_get_int_truncated and use it where appropriate.
mp_obj_get_int_truncated will raise a TypeError if the argument is not
an integral type.  Use mp_obj_int_get_truncated only when you know the
argument is a small or big int.
2015-05-12 23:05:53 +01:00
Daniel Campora 2bdefea9d6 cc3200: Enable MICROPY_MODULE_WEAK_LINKS. 2015-05-07 12:19:31 +02:00
Daniel Campora e04aa96b4d cc3200: Define MICROPY_CPYTHON_COMPAT=0.
This only disables some corner case functionality to keep C Python
compatibility, and saves ~600 bytes.
2015-05-05 11:23:06 +02:00
Josef Gajdusek 04ee5983fe lib: Move some common mod_network_* functions to lib/netutils. 2015-05-04 11:48:40 +01:00
Daniel Campora 8c8d7f3c60 cc3200: Clean up pyb.Pin
Remove unused and unneeded functions, also create Pin.get_config() that
returns the whole configuration of the pin.

This reduces code size by ~500 bytes.
2015-05-03 11:26:56 +02:00
Daniel Campora e4c899a08c cc3200: WLAN.ifconfig returns an attrtuple instead of a dictionary. 2015-05-03 11:26:25 +02:00
Daniel Campora f54bdecff2 cc3200: Implement Sleep.wake_reason() 2015-05-03 11:21:14 +02:00
Daniel Campora 71d482df47 cc3200: Clear the pending interrupt flag when disabling RTC callbacks. 2015-05-03 11:21:12 +02:00
Daniel Campora 6f218d7472 cc3200: Move wlan_init0() to the boot section.
This one creates a semaphore, therefore it must be executed only
after a hard reset (or when coming out of hibernation).
2015-04-29 16:10:40 +02:00
Daniel Campora d8713d78f5 cc3200: Correct Sleep module name. Must be 'Sleep', not 'sleep'. 2015-04-29 15:27:28 +02:00
Daniel Campora e282884e54 cc3200: When requesting safe boot, blink the led 3 times, not 4. 2015-04-29 15:27:21 +02:00
Daniel Campora dbb4aef5e3 cc3200: Make WLAN.isconnected() also work in AP mode.
While in STA mode isconnected() returns True when connected to an AP
and the IP has been acquired. In AP mode, WLAN.isconnected() returns
True if at least one connected station is present.
2015-04-29 15:26:21 +02:00
Daniel Campora bf4576dc91 cc3200: Clean-up servers enable/disable algorithm. 2015-04-29 14:25:44 +02:00
Damien George 95f53461c2 py: Replace py-version.sh with makeversionhdr.py, written in Python.
Also rename py-version.h to mpversion.h for consistency with mpconfig.h.
2015-04-28 23:52:36 +01:00
Daniel Campora d11317bcab cc3200: Make WLAN scan results a list of attrtupple.
Each result is displayed like this:

ssid='MySSID', bssid=b'\xc0J\x00z.\xcc', security=2, channel=None, rssi=-74

The CC3200 doesn't provide channel info, that why is 'None'.
2015-04-29 00:04:01 +02:00
Daniel Campora 5225e29ce7 cc3200: Remove unneeded -lgcc in Makefile. 2015-04-29 00:03:58 +02:00
Daniel Campora f81684141e cc3200: Implement os.uname() to get details of the OS and hardware. 2015-04-29 00:03:56 +02:00
Daniel Campora 6fefd5d330 cc3200: Move telnet_process_credential with the other private functions.
Just for consistency.
2015-04-29 00:03:54 +02:00
Daniel Campora f1ed8c8a2e cc3200: Improve telnet_parse_input() in case of an incomplete option. 2015-04-28 16:48:33 +02:00
Matt Anderson 0458833072 cc3200: Make telnet login procedure work with Tera Term.
This is actually a workaround Ter Term's issue of not obeying to the
telnet options that the server is sending. Therefore, we must buffer
chars until either a '\r' or the max length of the username/password
is received.
2015-04-28 16:48:26 +02:00
Daniel Campora 9fbc265eb8 cc3200: Add delays to allow the servers to start and stop properly. 2015-04-28 15:16:33 +02:00
Daniel Campora d34c4784a5 cc3200: Select NIC when the socket is created.
This makes sense since only WLAN is supported here.
2015-04-28 15:14:36 +02:00
Daniel Campora 7c8b4c1a8b cc3200: Correct MAKE_SOCKADDR and UNPACK_SOCKADDR byte order. 2015-04-25 23:36:45 +02:00
Daniel Campora eaefc8b9d6 cc3200: Add WiPy specific information to README.md 2015-04-22 21:03:10 +02:00
Daniel Campora df5d9c77f4 cc3200: Fix bootloader and modpyb after printf overhaul.
The bootloader needs string0.c because of memset, memcpy and others,
without string0.c it magically links, but calling any of those
functions results in a hard fault.
In debug mode, modpyb needs printf, and including stdio.h leads to
conflicts due to the redefinitions made in the simplelink drivers.
2015-04-19 20:59:10 +02:00
Damien George 259eaab9a9 cc3200: Clean up and reduce use/include of std.h. 2015-04-18 14:29:28 +01:00
Daniel Campora c1a77a0c9f cc3200: Use new %q format to print qstr's where appropiate. 2015-04-17 10:15:55 +02:00
Daniel Campora 2cd247e819 cc3200: Clean up bootloader makefile and remove superflous assert. 2015-04-17 09:55:24 +02:00
Damien George a86d40ccd4 cc3200: Get bootloader compiling with latest overhaul of printf code. 2015-04-16 14:30:17 +00:00
Damien George 7f9d1d6ab9 py: Overhaul and simplify printf/pfenv mechanism.
Previous to this patch the printing mechanism was a bit of a tangled
mess.  This patch attempts to consolidate printing into one interface.

All (non-debug) printing now uses the mp_print* family of functions,
mainly mp_printf.  All these functions take an mp_print_t structure as
their first argument, and this structure defines the printing backend
through the "print_strn" function of said structure.

Printing from the uPy core can reach the platform-defined print code via
two paths: either through mp_sys_stdout_obj (defined pert port) in
conjunction with mp_stream_write; or through the mp_plat_print structure
which uses the MP_PLAT_PRINT_STRN macro to define how string are printed
on the platform.  The former is only used when MICROPY_PY_IO is defined.

With this new scheme printing is generally more efficient (less layers
to go through, less arguments to pass), and, given an mp_print_t*
structure, one can call mp_print_str for efficiency instead of
mp_printf("%s", ...).  Code size is also reduced by around 200 bytes on
Thumb2 archs.
2015-04-16 14:30:16 +00:00
Daniel Campora 4c37489f4c cc3200: Correct the IP address byte order in the FTP server. 2015-04-14 01:57:29 +02:00
Daniel Campora f7a26472af cc3200: Add IPPROTO_SEC to be able to create secure sockets. 2015-04-14 01:57:27 +02:00
Daniel Campora 99f7184073 cc3200: Disable MICROPY_COMP_TRIPLE_TUPLE_ASSIGN.
Because it's only a compiler optimization and increases code size.
2015-04-13 00:03:41 +02:00
Daniel Campora c69b4310c8 cc3200: Add WLAN.config_ip().
This new method allows to assign an static IP to the device.
2015-04-13 00:02:56 +02:00
Daniel Campora d278e49475 cc3200: Enable TRIPLE_TUPLE_ASSIGN and UBINASCII. 2015-04-11 13:35:07 +02:00
Daniel Campora 6e25d955f4 cc3200: Enable long filename support in FatFS.
This has implications all over the place. I have to admit that
you can instantly see that usability improves, but it costs 3K.
At the same time I took the oportunity to rename the '/SFLASH'
drive to '/flash' which improves compatibility with the pyboard.
2015-04-11 13:35:05 +02:00