Commit Graph

36 Commits

Author SHA1 Message Date
microDev
a52eb88031
run code formatting script 2021-03-15 19:27:36 +05:30
Taku Fukada
56c898da80 Modify some Python stubs 2020-08-07 01:01:28 +09:00
Taku Fukada
d356581651 Fix several type hints 2020-07-27 18:05:13 +09:00
dherrada
d0d949cd24 Made every init return None 2020-07-03 14:23:34 -04:00
dherrada
9b4ffc0571 Changed unions to ReadableBuffer and WriteableBuffer 2020-07-02 17:47:52 -04:00
dherrada
54cb1feea0 Removed all 'self, )' 2020-07-02 13:28:36 -04:00
dherrada
522b17ca93 Made suggested changes 2020-07-02 13:25:07 -04:00
dherrada
ac113fdc81 Changed bytearray to a union 2020-07-02 12:39:17 -04:00
dherrada
ffc5f0c338 Added type hints to bitbangio 2020-07-02 12:37:03 -04:00
Jeff Epler
9110e36636 Use main/selected terminology in docstrings
Also copy some notes from busio docstrings to bitbangio docstrings
2020-06-25 11:42:23 -05:00
Scott Shawcroft
4e8de3c554
Swap sphinx to autoapi and the inline stubs 2020-05-12 17:28:24 -07:00
dherrada
0e465e63b9
Did audiopwmio, bitbangio, and _bleio 2020-05-01 18:23:27 -04:00
Dan Halbert
817b5be320 rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
Dan Halbert
b6206406de new pin validation routines; don't use mp_const_none if NULL will do 2020-02-28 23:43:04 -05:00
Scott Shawcroft
966a48b23a
More size_t usage 2019-08-27 12:49:46 -07:00
Scott Shawcroft
a35d9b469d
Refactor deinit check to reduce code size. 2019-06-12 11:36:43 -07:00
Scott Shawcroft
cfe24b8532
Improve rST consistency for rst2pyi use 2019-05-30 19:02:47 -07:00
Scott Shawcroft
747f2cfe26
Add subclass support to displayio.
Also, swap make_news to accept a kwarg map and refine param checking.

Fixes #1237
2019-01-14 17:29:19 -08:00
Scott Shawcroft
933add6cd8
Support internationalisation. 2018-08-07 14:58:57 -07:00
dean
82b5efa7bc remove unnecessary comment 2018-05-09 15:14:26 -04:00
dean
fba1e221c6 DM: add kwargs to bitbangio spi 2018-05-09 15:12:42 -04:00
dean
68309c3fac replace tabs with spaces 2018-02-05 10:44:29 -05:00
dean
0e13aba2fe DM: fix sytling 2018-01-30 17:45:04 -05:00
dean
a7f72eb2d8 DM: added write_readinto to bitbangio 2018-01-30 17:18:57 -05:00
Dan Halbert
065e82015f merge from 2.2.0 + fix up board defs 2018-01-02 21:25:41 -05:00
Dan Halbert
c478c10923 Do not allow a *io object to be used after deinit().
Fixes #278, #277, #276, #275.
2017-10-03 12:07:17 -07:00
Scott Shawcroft
714521a4c7 shared-bindings: Update docs to remove with statements from examples but add more detail to the design guide about their use. 2017-06-07 14:39:12 -07:00
Scott Shawcroft
939c0045db Switch to a shared piece of code to compute start and length of a
buffer from start, end and length. The old code miscomputed length
leading to writing and reading from memory past the end of the buffer.
Consolidating the code should make it easier to get right everywhere.
2017-04-20 11:24:05 -07:00
Scott Shawcroft
4aaa0ea008 shared-bindings: Do a pass on the docs and make sure keyword only arguments make sense and are documented correctly. Fixes #109 2017-03-07 12:58:57 +01:00
Scott Shawcroft
7ecbc3a148 shared-bindings: Fix two more try_locks. Copy and paste failed me. 2017-02-28 12:31:27 +01:00
Scott Shawcroft
12fa5b3a66 Switch exception throwing to mp_raise helpers. It saves a little code space each time to share the call. 2017-02-24 15:13:07 +01:00
Scott Shawcroft
e9659e61f8 Switch enum-like attributes to all caps and add print support for them. Make room for this functionality by adding a shared __enter__ function object. #76 2017-02-19 16:11:33 +01:00
Scott Shawcroft
26229efe78 Add try_lock and unlock to I2C and SPI classes to make sure things
are shared well between threads and underlying MicroPython (SPI Flash
for example.)

It is recommended to use the bus device classes to manage the locks
and other transaction state.

https://github.com/adafruit/Adafruit_MicroPython_BusDevice

Fixed #58
Fixed #59
Fixed #60
2016-12-02 15:46:12 -08:00
Scott Shawcroft
9b3afc7b37 shared-bindings: Make MOSI and MISO optional for SPI. 2016-11-29 16:54:20 -08:00
Scott Shawcroft
4933fa1c27 shared-bindings: Ensure pin objects are actually pins.
Fixes #12
2016-11-29 15:50:01 -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