Commit Graph

625 Commits

Author SHA1 Message Date
Scott Shawcroft 36a23e0fe3
Rework refresh API and factor common display stuff out
NOT TESTED! Just compiles

Fixes #1691
2019-08-22 14:23:27 -07:00
Scott Shawcroft c247e7df9c
Begin refresh rework. 2019-08-22 14:08:33 -07:00
Benny Meisels d37dd4d758
Updated ParallelBus implementation in nrf port 2019-08-22 14:08:33 -07:00
Dan Halbert 7cc15e56c8 make translate 2019-08-22 15:20:23 -04:00
Dan Halbert 0b7291d767 fix default crystal value; fix include order 2019-08-22 09:01:05 -04:00
Dan Halbert acc6df4959 merge similar fix in 2019-08-22 01:29:34 -04:00
Dan Halbert d94023e9b3 Fix CPBlue LFCLKSRC; CPB has no status neopixel 2019-08-22 01:04:00 -04:00
Scott Shawcroft 389e7cc35d
Merge pull request #2072 from bmeisels/nrf-no-crystal-support
Add support for nrf boards that don't have an external crystal
2019-08-21 13:01:26 -07:00
Benny Meisels fe2ec6c887 Add support for nrf boards that don't have an external crystal 2019-08-20 23:30:21 +03:00
Dan Halbert e00696de7f merge from upstream and make translate 2019-08-20 13:06:23 -04:00
Dan Halbert 44b28d1187 update tinyusb to 00c440cb 2019-08-19 19:42:45 -04:00
Dan Halbert e3dc5e3a66 Merge remote-tracking branch 'adafruit/master' into run-background-tasks
Restore dependencies indicated by indentation in circuitpy_mpconfig.h.
2019-08-19 12:41:20 -04:00
Jeff Epler 26a05d01dc Merge remote-tracking branch 'origin/master' into nrf-pdm-audioin 2019-08-18 21:30:14 -05:00
Jeff Epler 912fd7759d nrf: PDMIn: Implement
So far, this supports only 16kHz and 16-bit samples with a fixed gain.
This is enough to support the basic functionality of e.g., sensing
ambient audio levels.
2019-08-18 15:58:04 -05:00
Jeff Epler 79f8a85786 nrf: stub out audiobusio.PDMIn, audiobusio.I2SOut 2019-08-18 15:55:57 -05:00
Dan Halbert 3f7321af00
Merge pull request #2031 from jepler/nrf-lto
Enable link-time optimization for nrf targets
2019-08-18 12:35:26 -04:00
Dan Halbert e2a4c76a37 make nrf touchio be generic: now available for SAMD51 too 2019-08-18 08:44:10 -04:00
Scott Shawcroft 85d7398476
Merge pull request #2066 from dhalbert/ble-pairing
BLE: more features
2019-08-16 14:50:00 -07:00
Dan Halbert 630c92392a address review comments; avoid calling common_hal_bleio_device... routines from shared-bindings 2019-08-16 15:18:53 -04:00
Dan Halbert 5877bd6036 CPblue initial definition 2019-08-13 22:12:36 -04:00
Jeff Epler 11dd3a260e nrf: Use RUN_BACKGROUND_TASKS 2019-08-11 08:53:02 -05:00
Dan Halbert 1570ef2dd4 specifying attribute length; fix up value setting 2019-08-07 23:49:09 -04:00
Dan Halbert d047b73a9c fix newly-introduced bugs; UART client/server working again 2019-08-07 11:10:21 -04:00
Dan Halbert d74c8b9425 WIP: more Descriptor work; refactor gattc/gatts read/write 2019-08-06 22:55:25 -04:00
Dan Halbert 243334da75 Merge remote-tracking branch 'adafruit/master' into ble-pairing 2019-08-05 23:06:24 -04:00
Scott Shawcroft 59efce3035
Merge pull request #2039 from dhalbert/metro-52840
Metro nRF52840 rev A defn; remove '#define FEATHER52840' from mpconfigboard.h
2019-08-05 18:48:36 -07:00
Scott Shawcroft b675a27e16
Merge pull request #2000 from jepler/nrf-pwm-audio
Implement PWM audio out for the nrf port
2019-08-05 17:26:27 -07:00
Dan Halbert c56566179a Metro nRF52840 rev A defn; also remove '#define FEATHER52840' from mpconfigboard.h files 2019-08-05 18:10:27 -04:00
Dan Halbert b67d04a5b1 Merge remote-tracking branch 'adafruit/master' into ble-pairing 2019-08-05 16:35:44 -04:00
Jeff Epler 77bc1ba03e nrf: PWMAudioOut: Remove the need to wait in "pause"
The original formulation was because I saw the need to avoid a transition
from playing to stopped exactly when a resume was taking place.  However,
@tannewt was concerned about this pause causing trouble, because it could
be relatively lengthy (several ms even in a typical case).

After reflection, I've convinced myself that updating the registers
in this order in resume avoids a window where a "stopped" event can
be missed as long as the shortcut is updated first.

Testing re-performed: pause/resume testing of looped RawSample and
WaveFile audio sources.
2019-08-03 08:19:25 -05:00
Jeff Epler 4bae29b925 nrf: enable link-time optimization
Testing performed: installed freshly built .uf2 on a Particle Xenon.
Checked that circuitpython still starts.
Checked that the size of all .uf2 files for nrf builds are plausible.

Aside from memory savings, the performance of Python code (pystone)
increased by about +14%.

However, this adds about 12-16 seconds to each nrf build.

Timings & Sizes (build system: i5-3320M, -j5 parallelism on 4 threads):

Before:
$ make -j5 BOARD=particle_xenon
765004 bytes free in flash out of 1048576 bytes ( 1024.0 kb ).
232076 bytes free in ram for stack out of 245760 bytes ( 240.0 kb ).
68.54user 11.83system 0:34.34elapsed 234%CPU
pystones before: 570

After:
$ make -j5 BOARD=particle_xenon
804284 bytes free in flash out of 1048576 bytes ( 1024.0 kb ).
232072 bytes free in ram for stack out of 245760 bytes ( 240.0 kb ).
71.06user 11.77system 0:46.91elapsed 176%CPU
pystones after: 650

Timings on travis:

Before:
Build feather_nrf52840_express for pl took 55.79s and succeeded
Build feather_nrf52840_express for zh_Latn_pinyin took 3.18s and succeeded

After:
Build feather_nrf52840_express for pl took 62.72s and succeeded
Build feather_nrf52840_express for zh_Latn_pinyin took 19.10s

Closes: #1396
2019-08-02 20:59:47 -05:00
Dan Halbert 7ce3776b80 WIP: rework of Characteristic properties; enhance Descriptor; not tested 2019-08-02 17:57:31 -04:00
Jeff Epler 28b7cbfca6 nrf: Mark interrupt vectors as used 2019-08-02 07:53:35 -05:00
jepler 34e2bab96a nrf: Implement RUNMODE_BOOTLOADER and RUNMODE_SAFE_MODE 2019-08-01 18:53:07 -05:00
Jeff Epler 76f65ac694 Implement play/pause
.. and also incidentally fix a problem where a RawSample could only
be looped 131070 times.
2019-07-31 20:02:56 -05:00
Dan Halbert 91d791afd0 cleanup adapter.address; add uniquish suffix to BLE device name 2019-07-31 00:30:24 -04:00
Dan Halbert 83129b8c63 BLE: peripheral client pairing (not yet bonding); fix time doc formatting 2019-07-30 14:26:26 -04:00
Jeff Epler b72352949b PWM audio: Rename AudioOut -> PWMAudioOut, _audioio_ -> _audiopwmio_ 2019-07-29 18:39:00 -04:00
Dan Halbert 28ca05ccdc allow discovery from central or peripheral 2019-07-27 13:22:15 -04:00
Jeff Epler a183425e00 ports/nrf: Implement audioio.AudioOut using PWM
This implements AudioOut, with known caveats:
 * pause/resume are not yet implemented (this is just a bug)
 * at best, the sample fidelity is 8 bits (this is a hardware limitation)

Testing performed:

My test system is a Particle Xenon with a PAM8302 op-amp
https://www.adafruit.com/product/2130 and 8-ohm speaker.  There's no
analog filtering between the Xenon's PWM pin and the "A+" input of
the amplifier; the "A-" pin is disconnected.  It is powered from
VUSB.

I used pin D4, which is *NOT* listed as a low-speed-only pin, but
the code does NOT switch the pin to high drive.  This is related to
an open issue for general inability to set drive level for pins
being used by a "special function" on nrf:
https://github.com/adafruit/circuitpython/issues/1270

Nothing about the code I've written should limit the usable pins.

All samples I played were 16-bit, generally monophonic at 11025Hz
and 22050Hz from the Debian LibreOffice package.
2019-07-26 07:57:11 -05:00
Jeff Epler 2bc704fe07 ports/nrf: factor out routines for allocating, freeing pwm channels 2019-07-26 07:52:37 -05:00
Scott Shawcroft 8ec2d6ce49
Merge pull request #2007 from hierophect/F4xx-port-setup
Add STM32 Discovery F412ZG and F411RE support
2019-07-24 18:49:48 -07:00
hathach c921f6637f update tinyusb lib to 0.5.x 2019-07-24 16:46:31 +07:00
Dan Halbert 82ab998cd5
Merge pull request #1998 from tannewt/monocolor
Add support for grayscale displays
2019-07-22 22:30:28 -04:00
Hierophect 58630a844a Add feature conditionals and clean up 2019-07-22 12:58:28 -04:00
Tavish Naruka e4d92a3aad
Fix incorrect preprocessor define NRFX_TIMER3/4
Should be NRF_TIMER3 and NRF_TIMER4
2019-07-22 20:07:05 +05:30
Scott Shawcroft 6797ec6ed3
Add support for grayscale displays that are < 8 bit depth.
This also improves Palette so it stores the original RGB888 colors.

Lastly, it adds I2CDisplay as a display bus to talk over I2C. Particularly
useful for the SSD1306.

Fixes #1828. Fixes #1956
2019-07-19 16:06:11 -07:00
Scott Shawcroft a98bfa628e
Merge pull request #2002 from ntavish/blip_improvements
Blip improvements
2019-07-19 10:52:08 -07:00
Tavish Naruka 724ce4acba enable libraries needed by BlipBoy Shield 2019-07-19 18:48:08 +05:30
Hierophect 43e8a4110f Add missing files for DigitalIO 2019-07-17 14:18:01 -04:00