Commit Graph

14250 Commits

Author SHA1 Message Date
Damien George 8b74048d2a extmod/machine_i2c: Expose soft I2C obj and readfrom/writeto funcs.
For external use by ports if needed.
2016-11-24 00:11:45 +11:00
Damien George 4c905616f0 extmod/machine_i2c: Remove trivial function wrappers. 2016-11-23 17:05:38 +11:00
Damien George 37333cb00a extmod/machine_i2c: Add 'stop' argument to i2c readfrom/writeto meths. 2016-11-23 17:05:38 +11:00
Damien George 0bc99b4836 extmod/machine_i2c: Make i2c.write[to] methods return num of ACKs recvd. 2016-11-23 17:05:38 +11:00
Damien George 07e83573c8 extmod/machine_i2c: Add 'nack' argument to i2c.readinto. 2016-11-23 17:05:38 +11:00
Damien George ced240e72a extmod/machine_i2c: Make C-level functions return -errno on I2C error. 2016-11-23 17:05:38 +11:00
Damien George 946f8dd46f extmod/machine_i2c: Remove unneeded i2c_write_mem/i2c_read_mem funcs. 2016-11-23 17:05:38 +11:00
Damien George 96c3911a0a extmod/machine_i2c: Rewrite mem xfer funcs in terms of C-level protocol. 2016-11-23 17:05:37 +11:00
Damien George c81247f1ab extmod/machine_i2c: Rewrite i2c.scan in terms of C-level protocol. 2016-11-23 17:05:37 +11:00
Damien George bc4ea69795 extmod/machine_i2c: Add argument to C funcs to control stop generation. 2016-11-23 17:05:37 +11:00
Damien George b983cfaf41 extmod/machine_i2c: Add a C-level I2C-protocol, refactoring soft I2C. 2016-11-23 17:05:37 +11:00
Damien George 63a5df3cb4 docs/library/machine.I2C: Refine definitions of I2C methods. 2016-11-23 17:05:02 +11:00
Scott Shawcroft ea1320bee7 Add uheap for debugging the size of objects. Still not perfect though. 2016-11-22 17:32:28 -08:00
Scott Shawcroft cc412a80ad atmel-samd: Support Trinket and Gemma M0 prototypes. 2016-11-22 12:03:42 -08:00
Damien George a3320e7811 stmhal/i2c: Remove use of legacy I2C_NOSTRETCH_DISABLED option.
In the new HAL this is renamed to I2C_NOSTRETCH_DISABLE.
2016-11-22 17:40:50 +11:00
Rami Ali 2eff9c29a1 tests/basics: Improve user class coverage. 2016-11-22 15:49:02 +11:00
Rami Ali 1b41cacac7 tests/extmod: Improve ujson coverage. 2016-11-22 15:48:42 +11:00
Scott Shawcroft 8d5c90b0d0 Add script to build bins for Adafruit boards. 2016-11-21 14:40:28 -08:00
Paul Sokolovsky 037e6912c6 py/objtype: Implement __call__ handling for an instance w/o heap alloc.
By refactoring and reusing code from objboundmeth.
2016-11-22 01:33:55 +03:00
Scott Shawcroft 575d2e7998 atmel-samd: Default to code.txt instead of main.py (main.py will still work on its own.) 2016-11-21 14:32:11 -08:00
Scott Shawcroft 3b1109c47b Merge pull request #50 from tannewt/microcontroller
Introduce shared APIs: nativeio, microcontroller and board modules. These are the only hardware API on the atmel-samd port.
2016-11-21 14:30:57 -08:00
Scott Shawcroft ccbb5e84f9 This introduces an alternative hardware API called nativeio structured around different functions that are typically accelerated by native hardware. Its not meant to reflect the structure of the hardware.
Docs are here: http://tannewt-micropython.readthedocs.io/en/microcontroller/

It differs from upstream's machine in the following ways:

* Python API is identical across ports due to code structure. (Lives in shared-bindings)
* Focuses on abstracting common functionality (AnalogIn) and not representing structure (ADC).
* Documentation lives with code making it easy to ensure they match.
* Pin is split into references (board.D13 and microcontroller.pin.PA17) and functionality (DigitalInOut).
* All nativeio classes claim underlying hardware resources when inited on construction, support Context Managers (aka with statements) and have deinit methods which release the claimed hardware.
* All constructors take pin references rather than peripheral ids. Its up to the implementation to find hardware or throw and exception.
2016-11-21 14:11:52 -08:00
Scott Shawcroft 9321828158 py: Add ability to manually mark blocks during collect. 2016-11-21 14:11:49 -08:00
Damien George 7e820792da stmhal: Updates to get F411 MCUs compiling with latest ST HAL. 2016-11-21 23:24:24 +11:00
Damien George 1f43d49f9e tests/micropython: Move alloc-less traceback test to separate test file.
The native emitter doesn't provide proper traceback info so this test
should not be run in that case.
2016-11-21 17:39:23 +11:00
Damien George d70f87aaa2 tests/micropython: Add test for creating traceback without allocation. 2016-11-21 17:10:17 +11:00
Damien George 21d82421cd stmhal/i2c: Use the HAL's I2C IRQ handler for F7 and L4 MCUs.
The custom IRQ handler only works for F4 MCUs, which have the SR1
register.
2016-11-21 16:12:09 +11:00
Damien George e30ca0e102 unix/Makefile: Update freedos target for change of USELECT config name. 2016-11-21 15:49:46 +11:00
Damien George 0d56c65d3e extmod/moduselect: Fix comment describing endif. 2016-11-21 15:47:48 +11:00
Paul Sokolovsky 5362bcc487 extmod/machine_mem: Typo fix in comment. 2016-11-21 01:09:17 +03:00
Paul Sokolovsky f14e9187ac cc3200: Update for moduselect moved to extmod/. 2016-11-21 01:08:15 +03:00
Paul Sokolovsky 87dfc76570 unix: Rename define for unix moduselect to MICROPY_PY_USELECT_POSIX.
To not conflict with recently made available globally baremetal
moduselect.
2016-11-21 00:48:55 +03:00
Paul Sokolovsky 8f5bc3ffc0 stmhal/moduselect: Move to extmod/ for reuse by other ports. 2016-11-21 00:05:56 +03:00
Scott Shawcroft f03a9ac505 py: Add support for properties on native objects when they are in the locals dict. 2016-11-18 16:18:14 -08:00
Scott Shawcroft ceeac4791e atmel-samd: Add Feather M0 with flash 2016-11-18 16:18:13 -08:00
Scott Shawcroft fe9c28538c atmel-samd: Turn off using the red LED to show mass storage writes. 2016-11-18 16:18:13 -08:00
Scott Shawcroft 3cfa5b993d py: Change frozen build to not use -printf which isn't available on Mac OSX. 2016-11-18 16:18:12 -08:00
Scott Shawcroft 6e30b8ea92 atmel-samd: Move neopixel out of internal flash. 2016-11-18 16:17:56 -08:00
Scott Shawcroft 84edec4fad py: Fix typo in comment. 2016-11-18 16:17:56 -08:00
Damien George c28fed6b64 examples/accellog.py: Change 1: to /sd/, and update comment about FS. 2016-11-18 17:00:54 +11:00
Paul Sokolovsky 00d6f99cf1 examples/hwapi: Add hwconfig for console tracing of LED operations. 2016-11-18 07:20:26 +03:00
Radomir Dopieralski e81a5353cb extmod/machine_i2c: Release SDA on bus error 2016-11-17 12:43:13 +11:00
Radomir Dopieralski 9a82b67f39 extmod/machine_i2c: Raise an error when clock stretching times out 2016-11-17 12:43:13 +11:00
Radomir Dopieralski 702928915c extmod/machine_i2c: Make the clock stretching timeout configurable 2016-11-17 12:43:12 +11:00
Glenn Ruben Bakke ea75d9919f Removing unused 'NRF_SOFTDEVICE' compile variable from all board .mk softdevice targets. 2016-11-17 00:33:37 +01:00
Glenn Ruben Bakke 60686a3b75 Fixing main Makefile CFLAGS concatination error when setting softdevice param 2016-11-17 00:29:16 +01:00
Daniel Tralamazza 839d04f768 ignore default build folders 2016-11-16 23:40:38 +01:00
Daniel Tralamazza 3e31d31f3e move softdevice (SD) specific code from the main Makefile to their respective board/SD makefiles 2016-11-16 23:40:38 +01:00
Paul Sokolovsky b188d6e9db examples/hwapi: Add example for machine.time_pulse_us(). 2016-11-17 01:10:00 +03:00
Glenn Ruben Bakke ae99d95c1a Updating Makefile by removing unwanted LDFLAG setting cpu to cortex-m0 in all cases. 2016-11-16 22:51:53 +01:00