Scott Shawcroft
7d8929c470
atmel-samd: Add I2C support.
...
This commit also introduces a new shared-bindings directory which is used to store the common Python -> C binding code. By having a shared directory we can ensure that the Python API across ports is the same. Each port will have a corresponding common-hal directory which provides definitions for the C api used in the shared-bindings code. That way the compiler can enforce the C api.
To migrate to this new shared API create a common-hal directory within your port and change the Makefile to compile both the shared-bindings and common-hal files. See atmel-samd/Makefile SRC_BINDINGS for an example.
2016-09-13 11:46:22 -07:00
Scott Shawcroft
05368d2c58
Include the precompiled math library from ASF.
2016-09-07 14:35:40 -07:00
Scott Shawcroft
c6c977070e
Merge remote-tracking branch 'micropython/master'
2016-09-02 19:39:50 -07:00
Scott Shawcroft
09be96a6aa
atmel/samd: Add filesystem support. 64k is stored in flash.
2016-09-02 17:00:30 -07:00
Paul Sokolovsky
f7c4611523
extmod/moduzlib: Use mperrno.h for error constants.
2016-09-03 00:34:57 +03:00
Paul Sokolovsky
fafd587514
tests/extmod: Add test for uzlib.DecompIO.
2016-09-03 00:20:30 +03:00
Paul Sokolovsky
a6864a13c7
extmod/moduzlib: Implement zlib stream decompressor class, DecompIO.
2016-09-03 00:19:35 +03:00
Damien George
c51c883cc8
tools/mpy-tool.py: Support freezing of complex numbers.
2016-09-03 00:19:02 +10:00
Radomir Dopieralski
41ec22632d
extmod/modframebuf: Fix fill and scroll when height not divisible by 8.
...
There was a bug in `framebuf1_fill` function, that makes it leave a few
lines unfilled at the bottom if the height is not divisible by 8.
A similar bug is fixed in the scroll method.
2016-09-02 23:58:34 +10:00
Damien George
b6bdf18deb
tools/mpy-tool.py: Compute the hash value for str/bytes objects.
...
This makes it more efficient at runtime to hash str/bytes objects.
2016-09-02 15:10:45 +10:00
Damien George
b4790afdaf
tools/mpy-tool.py: Store qstr config values in global config object.
...
Makes it easier to access them without passing around another dict of the
config values.
2016-09-02 15:09:21 +10:00
Damien George
58f3861358
tests/unix/extra_coverage: Add test for str/bytes with invalid hash.
2016-09-02 15:07:42 +10:00
Damien George
5f3bda422a
py: If str/bytes hash is 0 then explicitly compute it.
2016-09-02 14:49:50 +10:00
Damien George
f127bef3e4
py/makeqstrdata.py: Compute the qstr hash from bytes, not characters.
2016-09-02 14:32:47 +10:00
Delio Brignoli
f98bb2ddcb
py/mpprint: Fail an assertion with unsupported format specifiers.
...
Arguments of an unknown type cannot be skipped and continuing to parse a
format string after encountering an unknown format specifier leads to
undefined behaviour. This patch helps to find use of unsupported formats.
2016-09-01 18:09:44 +10:00
Radomir Dopieralski
ce1c786297
drivers/sdcard: Port the SDCard driver to new machine API.
...
With backwards compatibility for pyboard.
2016-09-01 17:44:07 +10:00
Damien George
49406b0ac6
stmhal/spi: Support new machine SPI methods in legacy SPI object.
2016-09-01 16:40:35 +10:00
Damien George
9b64d1966b
stmhal/spi: Factor out SPI transfer code to a single function.
2016-09-01 16:40:32 +10:00
Damien George
3be8b688c0
esp8266/modpybhspi: Simplify HSPI driver by using 1 function for xfers.
2016-09-01 16:40:12 +10:00
Damien George
5863e15a23
esp8266/modpybspi: Use generic SPI helper methods to implement SPI.
2016-09-01 16:39:42 +10:00
Damien George
0823c1baf8
extmod: Add machine_spi with generic SPI C-protocol and helper methods.
...
The idea is that all ports can use these helper methods and only need to
provide initialisation of the SPI bus, as well as a single transfer
function. The coding pattern follows the stream protocol and helper
methods.
2016-09-01 15:07:20 +10:00
Scott Shawcroft
559434afca
atmel-samd: Support floats.
2016-08-31 13:37:43 -07:00
ladyada
594ff413f4
trifecta tools
2016-08-31 13:38:13 -04:00
Scott Shawcroft
1725710feb
atmel-samd: Rename the Feather M0 BLE to Feather M0 Bluefruit LE.
2016-08-31 09:56:06 -07:00
Scott Shawcroft
a6bc701917
atmel-samd: Re-enable -Os (size) optimizations.
2016-08-31 00:16:39 -07:00
Scott Shawcroft
eff137a5f5
atmel/samd: Support CTRL-C on USB. This won't escape native code but it will cause Python code to stop.
2016-08-31 00:11:56 -07:00
Damien George
9c04ef2a67
unix,stmhal,esp8266: When find'ing frozen files don't use extra slash.
...
This extra forward slash for the starting-point directory is unnecessary
and leads to additional slashes on Max OS X which mean that the frozen
files cannot be imported.
Fixes #2374 .
2016-08-31 15:12:57 +10:00
Scott Shawcroft
ccb309bd5c
atmel/samd: Add basic PWM support which only allows for changing the duty.
2016-08-30 13:10:52 -07:00
Paul Sokolovsky
1f61fe07a2
py/mkrules.mk: Allow to override name of libmicropython.a
...
Or alternatively, refer to an exact library file, not just phony target
"lib".
2016-08-30 00:59:17 +03:00
Paul Sokolovsky
bae62d9abe
lib/utils/pyexec: qstr_pool_info() requires size_t* parameters.
2016-08-30 00:58:42 +03:00
Damien George
76dcaddc0f
docs/esp8266/quickref: Add internal links to docs for some modules.
2016-08-29 17:40:36 +10:00
Damien George
efc904c41d
docs/pyboard/quickref: Add section on "delay and timing" for utime mod.
...
And remove reference to deprecated pyb.delay() and pyb.millis().
2016-08-29 17:33:02 +10:00
Damien George
5c3a2f162e
docs/pyboard/quickref: Add links to pinouts for other pyboard variants.
2016-08-29 17:32:38 +10:00
Krzysztof Blazewicz
d1a366fdd4
.gitignore: Add *.pyc, because Python 2 doesn't use __pycache__.
2016-08-29 15:40:00 +10:00
Philip Potter
c777b6950e
stmhal: Update boot.py files to use VCP instead of CDC.
2016-08-29 15:17:34 +10:00
Philip Potter
0f8b1ba8a2
docs/library: Add reference for pyb.usb_mode and pyb.USB_HID.
2016-08-29 15:17:20 +10:00
Philip Potter
f2da6467a9
docs/pyboard: Update USB mouse tutorial to use pyb.USB_HID().
2016-08-29 15:16:51 +10:00
Philip Potter
57c92d90b0
docs/pyboard: Update USB mouse tutorial to use VCP instead of CDC.
2016-08-29 15:15:25 +10:00
Damien George
13c5a228c9
docs/esp8266: Update quickref and tutorial for OneWire/DS18X20 driver.
2016-08-29 12:52:50 +10:00
Damien George
59a9509703
esp8266/modules/ds18x20.py: Add support for DS18S20 devices.
2016-08-29 12:45:07 +10:00
Damien George
8e9b98e974
esp8266/modules/onewire: Change onewire.read() to onewire.readinto().
...
This allows 1-wire drivers (eg DS18X20) to perform in-place operations and
hence do less memory allocations.
2016-08-29 12:27:21 +10:00
Damien George
9fba618356
esp8266/modules: Split onewire.py into OneWire and DS18X20 driver.
...
The OneWire class is now in its own onewire.py module, and the temperature
sensor class is in its own ds18x20.py module. The latter is renamed to
DS18X20 to reflect the fact that it will support both the "S" and "B"
variants of the device.
These files are moved to the modules/ subdirectory to take advantage of
frozen bytecode.
2016-08-29 12:12:49 +10:00
Radomir Dopieralski
ed0a06a93f
docs/esp8266/quickref: Fix and update the SPI docs
...
Use the `SPI` factory function in the examples, and use
proper baud rate of 80 000 000.
2016-08-28 23:14:45 +10:00
Paul Sokolovsky
263aaa7030
esp8266/modmachinewdt: Implement machine.WDT class.
2016-08-28 14:48:49 +03:00
Scott Shawcroft
b883a15d82
atmel-samd: Rename module classes so they don't conflict with names from ASF.
2016-08-28 00:02:05 -07:00
Scott Shawcroft
16fc045509
atmel-samd: Add direct write access to the DAC output.
2016-08-27 15:04:34 -07:00
Damien George
8f8f699eb7
tests/run-tests: Disable thread_gc1.py test on Travis.
...
It has reliability issues (cause unknown at this time).
2016-08-27 23:41:16 +10:00
Damien George
f4ee9f8853
py/bc.h: Rename _mp_code_state to _mp_code_state_t.
...
This rename was missed in the previous patch.
2016-08-27 23:23:51 +10:00
Damien George
581a59a456
py: Rename struct mp_code_state to mp_code_state_t.
...
Also at _t to mp_exc_stack pre-declaration in struct typedef.
2016-08-27 23:21:00 +10:00
Damien George
531217a06b
extmod/modframebuf: Fix pixel accessor to return a 1-bit result.
2016-08-27 18:31:58 +10:00