aboutsummaryrefslogtreecommitdiff
path: root/shared-bindings
AgeCommit message (Collapse)Author
2018-01-11Fix example for gamepadRadomir Dopieralski
The example code for the gamepad module would skip detected button presses in the code that waits for a button to be released, because it would run it even when no button is pressed. Also updated the example pin names to not use RX and TX.
2017-12-13Fix PDMIn MEMS microphone support (#479)Dan Halbert
Changes: * New faster filter loop, by @ladyada. New filter coefficients as well. * Turn on microphone clock when PDMIn object is created, and run it all the time, so the user code doesn't have to wait for microphone startup, which can be 10ms or even 100ms. * Wait for microphone startup when PDMIn is first created, based on new optional parameter microphone_startup in seconds (takes a float). * record() returns number of samples actually recorded, so you can see if it's not keeping up. * Fix buffer overflow errors when buffer size was not a multiple of 16 or something like that. * Tweak a few peripheral settings. * Minimum sampling frequency is now 16kHZ or so, because 8kHz runs microphone at only 0.5MHz, which is too slow for many mics. Note: I tried 128x oversampling instead of 64x, but the code cannot keep up at 24kHz or above sampling. 128x would reduce the high-frequency noise by 6db.
2017-12-05Fix a couple spelling errors.Scott Shawcroft
2017-12-05Introduce reset mechanics to microcontroller.Scott Shawcroft
This allows one to configure how a subsequent reset will behave and also trigger a reset. Fixes #350 and fixes #173
2017-12-05add SPI.write_readinto() - bidirectional SPIDan Halbert
2017-11-07Add a _stage module (#398)Radomir Dopieralski
This is a C module with some low-level functions required for the CircuitPython "stage" library. It provides support for fast rendering of tile grids and sprites on SPI-based RGB displays.
2017-11-03Allow empty reads and writes for busio.SPIRadomir Dopieralski
This is mostly for convenience, so that user code doesn't need to add additional checks. Also, bring the bitbangio into compatibility with busio wrt. empty buffers.
2017-10-30Allow writing buffer of length zero to I2C device; it can be used to poll ↵Dan Halbert
for existence.
2017-10-25shared-bindings: Check that I2C and SPI reads and writes are given a buffer ↵Scott Shawcroft
of at least 1. (#370) Fixes #358
2017-10-17redo time.monotonic() to avoid double precision2.1.0Dan Halbert
2017-10-16Turn on pulseio now that there's room.Dan Halbert
https://github.com/adafruit/circuitpython/issues/325#issuecomment-336733842
2017-10-03Add a `gamepad` module for handling buttons in the background. (#295)Radomir Dopieralski
The `GamePad` singleton monitors buttons in the background to make sure a button press is never missed and debouncing happens consistently.
2017-10-03Do not allow a *io object to be used after deinit().Dan Halbert
Fixes #278, #277, #276, #275.
2017-10-02Make touch more sensitive. Add .raw_value and .threshold attributes.Dan Halbert
2017-09-06Add Processor to microcontroller documentation TOC (#237)Dan Halbert
2017-09-06shared-bindings: Prevent check_lock from being optimized away. (#240)Scott Shawcroft
Fixes #229
2017-09-05atmel-samd: Enable 8-bit audio recording support even though it'll beScott Shawcroft
quiet. Also update the examples. Fixes #226
2017-08-31Add microcontroller.cpu.temperature, for use as a simple sensor on minimal ↵Dan Halbert
boards. (#211) * Add microcontroller.cpu, the sole instance of microcontroller.Processor. microcontroller.cpu.frequency is the clock frequency, in Hz. microcontroller.cpu.temperature is the reading from the internal temperature sensor, in Celsius. None if not available. * Squeeze firmware size by using -finline-limit. Otherwise non-Express builds were slightly too big. * Update submodules. * Fix documentation glitches
2017-08-29shared-bindings: Clarify that UART.read() is slow. (#209)Scott Shawcroft
2017-08-28Merge pull request #208 from adafruit/merge-v1.9.2Scott Shawcroft
Merge MicroPython v1.9.2
2017-08-27Modernize module and class static dicts; update freetouchDan Halbert
2017-08-26Fix blinky exampleScott Shawcroft
Thanks to @Kurticus and @scruffynerf from [discord](http://adafru.it/discord) for finding it.
2017-08-25Initial merge of micropython v1.9.2 into circuitpython 2.0.0 (in ↵Dan Halbert
development) master. cpx build compiles and loads and works in repl; test suite not run yet esp8266 not tested yet
2017-08-25atmel-samd: Introduce a nvm module for non-volatile byte-level memory ↵Scott Shawcroft
access. (#203) * atmel-samd: Introduce a nvm module for non-volatile byte-level memory access. This allows for persisting small configuration values even when the file system is read-only from CircuitPython. Fixes #160 * Review feedback: * Add tests. * Fix non-zero index. * Fix len()
2017-08-22shared-bindings: Check that extra args aren't provided to ↵Scott Shawcroft
digitalio.DigitalInOut on construction. (#189)
2017-08-22shared-bindings: Update DigitalIO.pull docs and validate that third (#188)Scott Shawcroft
state is None and not anything. Fixes #187
2017-08-10shared-bindings/atmel-samd: Fix and improve trigger duration timing on ↵Scott Shawcroft
PulseIn.resume.
2017-08-07shared-bindings: Add stub documentation of storage.VfsFat so other docs can ↵2.0.0-beta.1Scott Shawcroft
link to it.
2017-08-07esp8266: Introduce `multiterminal` module for managing a secondaryScott Shawcroft
serial connection such as WebREPL. Fixes #181.
2017-07-28atmel-samd: Introduce audiobusio.PDMIn for recording audio from PDMScott Shawcroft
microphones.
2017-07-27fixed naming on pulseIn example for docsbrentru
2017-07-23Measure and report maximum stack usage. (#175)Dan Halbert
Add max stack usage tracking, visible via debug module ustack. Add separate cpp flag for enabling modules: MICROPY_DEBUG_MODULES
2017-07-12shared-bindings: Fix neopixel_write example. I forgot to save in the editor. ↵Scott Shawcroft
Fixes #163
2017-07-12atmel-samd: Fix AudioOut buffer playback by supporting bytes_per_sample.Scott Shawcroft
Thanks to @ntoll for finding this bug!
2017-07-12shared-bindings: Add neopixel_write example. Fixes #163Scott Shawcroft
2017-06-28shared-bindings: Introduce storage.remount() so you can set root asScott Shawcroft
writeable and prevent USB from editing it.
2017-06-27Introduce a random module that is a subset of CPython's random. ItScott Shawcroft
also initializes in the same way where it takes from a true random source when available through os.urandom(). After initializing, it produces deterministic results until the seed is set. This replaces urandom! Fixes #139.
2017-06-27Split uos module into os and storage.Scott Shawcroft
os is a subset of CPython's os. storage contains additional file system mounting functionality based on UNIX's mount management. Fixes #140
2017-06-20Merge tag 'v1.9.1'2.0.0-alpha.0Scott Shawcroft
Fixes for stmhal USB mass storage, lwIP bindings and VFS regressions This release provides an important fix for the USB mass storage device in the stmhal port by implementing the SCSI SYNCHRONIZE_CACHE command, which is now require by some Operating Systems. There are also fixes for the lwIP bindings to improve non-blocking sockets and error codes. The VFS has some regressions fixed including the ability to statvfs the root. All changes are listed below. py core: - modbuiltins: add core-provided version of input() function - objstr: catch case of negative "maxsplit" arg to str.rsplit() - persistentcode: allow to compile with complex numbers disabled - objstr: allow to compile with obj-repr D, and unicode disabled - modsys: allow to compile with obj-repr D and PY_ATTRTUPLE disabled - provide mp_decode_uint_skip() to help reduce stack usage - makeqstrdefs.py: make script run correctly with Python 2.6 - objstringio: if created from immutable object, follow copy on write policy extmod: - modlwip: connect: for non-blocking mode, return EINPROGRESS - modlwip: fix error codes for duplicate calls to connect() - modlwip: accept: fix error code for non-blocking mode - vfs: allow to statvfs the root directory - vfs: allow "buffering" and "encoding" args to VFS's open() - modframebuf: fix signed/unsigned comparison pendantic warning lib: - libm: use isfinite instead of finitef, for C99 compatibility - utils/interrupt_char: remove support for KBD_EXCEPTION disabled tests: - basics/string_rsplit: add tests for negative "maxsplit" argument - float: convert "sys.exit()" to "raise SystemExit" - float/builtin_float_minmax: PEP8 fixes - basics: convert "sys.exit()" to "raise SystemExit" - convert remaining "sys.exit()" to "raise SystemExit" unix port: - convert to use core-provided version of built-in import() - Makefile: replace references to make with $(MAKE) windows port: - convert to use core-provided version of built-in import() qemu-arm port: - Makefile: adjust object-file lists to get correct dependencies - enable micropython.mem_*() functions to allow more tests stmhal port: - boards: enable DAC for NUCLEO_F767ZI board - add support for NUCLEO_F446RE board - pass USB handler as parameter to allow more than one USB handler - usb: use local USB handler variable in Start-of-Frame handler - usb: make state for USB device private to top-level USB driver - usbdev: for MSC implement SCSI SYNCHRONIZE_CACHE command - convert from using stmhal's input() to core provided version cc3200 port: - convert from using stmhal's input() to core provided version teensy port: - convert from using stmhal's input() to core provided version esp8266 port: - Makefile: replace references to make with $(MAKE) - Makefile: add clean-modules target - convert from using stmhal's input() to core provided version zephyr port: - modusocket: getaddrinfo: Fix mp_obj_len() usage - define MICROPY_PY_SYS_PLATFORM (to "zephyr") - machine_pin: use native Zephyr types for Zephyr API calls docs: - machine.Pin: remove out_value() method - machine.Pin: add on() and off() methods - esp8266: consistently replace Pin.high/low methods with .on/off - esp8266/quickref: polish Pin.on()/off() examples - network: move confusingly-named cc3200 Server class to its reference - uos: deconditionalize, remove minor port-specific details - uos: move cc3200 port legacy VFS mounting functions to its ref doc - machine: sort machine classes in logical order, not alphabetically - network: first step to describe standard network class interface examples: - embedding: use core-provided KeyboardInterrupt object
2017-06-16shared-bindings: Move enum-like classes out of DigitalInOut into digitalio.Scott Shawcroft
Also, rename Direction.IN to Direction.INPUT and Direction.OUT to Direction.OUTPUT. This simplifies using them. Prior to the nativeio split this would have led to clutter in the top-level namespace but having digitalio prevents this. Fixes #152
2017-06-07shared-bindings: Update docs to remove with statements from examples but add ↵Scott Shawcroft
more detail to the design guide about their use.
2017-06-07docs: Add module support matrix.Scott Shawcroft
2017-06-07docs: Fix header lines that are too short.Scott Shawcroft
2017-06-06shared-bindings: Allow for switching direction with the attribute.Scott Shawcroft
2017-06-06shared-bindings: Fix duty_cycle parameter description and error message.Scott Shawcroft
2017-05-24Doc tweaks to clarify external libraries, new boards and add HID library.Scott Shawcroft
2017-05-15atmel-samd: Support wav file playback. Tested up to 16bit 22.1khz. Must be ↵Scott Shawcroft
mono file! SD card support may work but likely needs buffer tuning. Its untested. Fixes #105
2017-05-08shared-bindings: Correct PulseIn.resume to match docs. Fixes #125Scott Shawcroft
2017-05-01atmel-samd: Introduce audio sample playback via audioio.AudioOut.Scott Shawcroft
2017-04-20Switch to a shared piece of code to compute start and length of aScott Shawcroft
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.