Commit Graph

639 Commits

Author SHA1 Message Date
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
Dan Halbert 364ee62d10 Address review comments. 2019-07-16 19:53:36 -04:00
Dan Halbert 1cf8a3e8d8 Merge remote-tracking branch 'adafruit/master' into ble-scanner 2019-07-11 18:42:16 -04:00
Scott Shawcroft 6fad383367
Merge pull request #1925 from C47D/rgb_status
Initial support for RGB led as Status indicator, fixes #1382
2019-07-09 10:31:34 -07:00
Dan Halbert 6a001786a9 merge from master 2019-07-09 08:58:49 -04:00
Dan Halbert 118b26b335 UARTClient now works both directions 2019-07-09 00:21:46 -04:00
Dan Halbert 09ddff8df1 WIP: Need descriptors for Central CCCD discovery; not done yet 2019-07-07 00:07:47 -04:00
Scott Shawcroft 5610e05b8c
Fix up nrf so that it is initialized properly. Also, do not reset
it's pins.
2019-07-06 12:48:16 -07:00
iot49 6e5d70fa19 changed type of receiver_buffer_size to uint16_t 2019-07-03 12:02:01 -07:00
Dan Halbert bf8a35b2f8 WIP: CharacteristicBuffer for Central; not working: need to set remote Characteristic Service 2019-07-02 22:34:54 -04:00
Dan Halbert 6ea01ea9b0 Central is connecting; characteristics can be read and written 2019-06-29 00:20:06 -04:00
Hierophect 16ba035ba7 first commit, very crude 2019-06-28 15:36:08 -04:00
Dan Halbert 140904ec84 getting Scanner to work 2019-06-22 22:10:15 -04:00
Dan Halbert 4881e1ff55 WIP: Central compiles; now will test 2019-06-21 18:04:04 -04:00
Dan Halbert 23bd861c9a nrf: fix neopixel_write pwm buf size calc 2019-06-20 18:02:14 -04:00
Dan Halbert 24ac1fdcab WIP: backup only; not compiled 2019-06-19 21:54:28 -04:00
Dan Halbert a1b5d800f3 Update copyrights; get ready for Central 2019-06-19 10:42:36 -04:00
Dan Halbert 35b9191857 Don't operate directly on bleio objects in shared-bindings: use common_hal
routines instead. Changes made but not yet tested.
2019-06-18 23:46:20 -04:00
Dan Halbert 1356819de1 Handle None for BLE name; fix ScanEntry bug; compile issue 2019-06-17 23:16:40 -04:00
Dan Halbert bed6d43a76 merge from upstream; WIP redo Address; no more AddressType 2019-06-13 21:55:07 -04:00
Dan Halbert 62de2506e4 Include display objects in gc. 2019-06-06 17:49:32 -04:00
Dan Halbert 1905d90eaa Make advertising data buffers long-lived 2019-06-05 20:08:53 -04:00
Tavish Naruka 4a7122d354 boards: add support for Electronut labs Blip
Signed-off-by: Tavish Naruka <tavishnaruka@gmail.com>
2019-06-05 00:49:29 +05:30
Dan Halbert 613e12f99f Replace Broadcaster with enhanced Peripheral 2019-06-03 20:40:05 -04:00
Dan Halbert 63ac37946d 1. Remove advertising data construction in C: it's all done in Python now
2. Add scan response capability to advertising.
2019-06-02 23:21:30 -04:00
Dan Halbert 12f1d9d30c fix advertisement length check; add Service.secondary attribute 2019-05-31 18:03:05 -04:00
Dan Halbert 6cec81bcb5 Need to enable ble before scanning 2019-05-23 22:05:16 -04:00
Dan Halbert 1639354e5f Scanner working, but not very first time 2019-05-23 16:07:54 -04:00
Scott Shawcroft 9feb844b7e
Fix crash in internal filesystem on nrf
Fixes #1842
2019-05-08 15:43:18 -07:00
Dan Halbert 15b7946fc4 Off-by-one error for usage of MAX_TX_IN_PROGRESS 2019-04-22 22:07:48 -04:00
Scott Shawcroft 713a38d1a2
Merge pull request #1754 from dmazzella/dmazzella-patch-1
add support for USER_C_MODULES
2019-04-17 09:41:20 -07:00
Dan Halbert c0ce820974
Merge pull request #1803 from nickzoic/circuitpython-nickzoic-1042-nrf-nvm-bytearray-3
Circuitpython nickzoic 1042 nrf nvm bytearray 3
2019-04-16 15:05:18 -04:00
Tavish Naruka 32a0855d18 Add support for Electronut Labs Papyr.
Signed-off-by: Tavish Naruka <tavishnaruka@gmail.com>
2019-04-16 12:59:42 +05:30
Nick Moore 9c42a72275 Fix up single-byte access to nvm.ByteArray 2019-04-16 14:53:44 +10:00
Nick Moore 83dad37562 Fixups for adafruit/circuitpython#1042 2019-04-16 14:53:44 +10:00
Nick Moore 02dd32da60 Make some space for NVM adafruit/circuitpython#1042 2019-04-16 14:53:44 +10:00
Nick Moore f22c01a05e Switch supervisor/internal_flash to use new nrf_nvm_safe_flash_page_write
adafruit/circuitpython#1610
2019-04-16 14:53:44 +10:00
Nick Moore 66e8ceafad switch nvm.ByteArray to use new nrf_nvm_safe_flash_page_write
adafruit/circuitpython#1610
2019-04-16 14:53:44 +10:00
Nick Moore fd83cf2048 Add a peripherals/nrf/nvm.c to wrap flash page writes safely 2019-04-16 14:53:44 +10:00
Nick Moore d0e5af3b09 Working flash pages for nvm.ByteArray adafruit/circuitpython#1042
import microcontroller

def dump(n = microcontroller.nvm):
    for i in range(0,len(n)):
        print ("%02X " % n[i], end="")
        if i % 16 == 15: print('')

microcontroller.nvm[0:4096] = bytes([1,2,3,4,5,6,7,8]) * 512
microcontroller.nvm[4096:8192] = bytes([16,17,18,19]) * 1024
microcontroller.nvm[4090:4101] = b'thisisatest'
microcontroller.nvm[100:105] = b'hello'
microcontroller.nvm[8000:8007] = b'goodbye'
dump()
2019-04-16 14:53:44 +10:00
Nick Moore 531cf7eb4c switch CIRCUITPY_NVM on! 2019-04-16 14:53:44 +10:00
Nick Moore 933500c448 nvm.ByteArray reads & writes but no sensible erase yet adafruit/circuitpython#1042 2019-04-16 14:53:44 +10:00
Nick Moore df89156f2f Start on nRF nvm.ByteArray adafruit/circuitpython#1042 (doesn't do anything yet) 2019-04-16 14:53:44 +10:00
Scott Shawcroft 254d0a53ac
Revert "nrf nvm: touchups to nickzoic PR #1768" 2019-04-15 18:50:33 -07:00
Dan Halbert 864910559b fix subscripting 2019-04-10 21:41:55 -04:00
Dan Halbert 3618461f9b Merge remote-tracking branch 'adafruit/master' into circuitpython-nickzoic-1042-nrf-nvm-bytearray-2 2019-04-10 14:09:26 -04:00
Scott Shawcroft ac2fd2fa80
Merge pull request #1773 from dhalbert/no-recursive-background-tasks
Don't let a background task call run_background_tasks()
2019-04-09 18:39:28 -07:00
Dan Halbert d633928a16 Don't let a background task call run_background_tasks() 2019-04-09 20:23:01 -04:00
Nick Moore 18908c21f7 Fixups for adafruit/circuitpython#1042 2019-04-09 12:53:11 +10:00
Nick Moore fdaff00c78 Make some space for NVM adafruit/circuitpython#1042 2019-04-09 10:56:53 +10:00
Nick Moore bcb87ffd6c Switch supervisor/internal_flash to use new nrf_nvm_safe_flash_page_write
adafruit/circuitpython#1610
2019-04-09 10:56:53 +10:00
Nick Moore bc92441803 switch nvm.ByteArray to use new nrf_nvm_safe_flash_page_write
adafruit/circuitpython#1610
2019-04-09 10:55:39 +10:00
Nick Moore cd69db7770 Add a peripherals/nrf/nvm.c to wrap flash page writes safely 2019-04-09 10:55:39 +10:00
Nick Moore 8e7fee2246 Working flash pages for nvm.ByteArray adafruit/circuitpython#1042
import microcontroller

def dump(n = microcontroller.nvm):
    for i in range(0,len(n)):
        print ("%02X " % n[i], end="")
        if i % 16 == 15: print('')

microcontroller.nvm[0:4096] = bytes([1,2,3,4,5,6,7,8]) * 512
microcontroller.nvm[4096:8192] = bytes([16,17,18,19]) * 1024
microcontroller.nvm[4090:4101] = b'thisisatest'
microcontroller.nvm[100:105] = b'hello'
microcontroller.nvm[8000:8007] = b'goodbye'
dump()
2019-04-09 10:55:39 +10:00
Nick Moore 592bd0140a switch CIRCUITPY_NVM on! 2019-04-09 10:55:15 +10:00
Nick Moore 492431a694 nvm.ByteArray reads & writes but no sensible erase yet adafruit/circuitpython#1042 2019-04-09 10:54:11 +10:00
Nick Moore f8e5e2da64 Start on nRF nvm.ByteArray adafruit/circuitpython#1042 (doesn't do anything yet) 2019-04-09 10:54:11 +10:00
Scott Shawcroft de48e4b262
Merge remote-tracking branch 'adafruit/master' into fix_cpx_display 2019-04-08 17:15:08 -07:00
Scott Shawcroft 0f003ac5b8
Reorganize board busses into shared-bindings and shared-module. 2019-04-08 16:58:50 -07:00
Scott Shawcroft 049b9ca094
Remove terse TODOs 2019-04-08 14:46:45 -07:00
Radomir Dopieralski 8323721232 Stop hard-coding SPI frequency in FourWire
Instead remember and use the frequency, polarity and phase that was
set when the bus was first created.
2019-04-06 15:15:29 +02:00
Damiano Mazzella 8428fa0f64
Update Makefile 2019-04-05 21:42:29 +02:00
Scott Shawcroft ceb6f2e4fc
Rework flash flush so it preserves the cache
This should make filesystem writes quicker and cause less heap
churn.
2019-04-03 18:28:27 -07:00
Nick Moore 781d301bb6 Remove unnecessary MP_WEAK declarations 2019-04-02 13:33:22 +11:00
Scott Shawcroft 92095eb666 Update comment 2019-04-02 13:28:35 +11:00
Nick Moore 94bda3bde1 Change nRF RTC implementation to use RTC2 #1046
(to avoid interference with Bluetooth Softdevice. See
https://github.com/adafruit/circuitpython/pull/1534#issuecomment-478776240
with thanks to @bboser for pointing it out)
2019-04-02 13:28:22 +11:00
Nick Moore 6afe23d0b0 There isn't really a good way to calibrate this RTC adafruit/circuitpython#1046 2019-04-02 13:28:03 +11:00
Nick Moore 6206fa9a82 adafruit/circuitpython#1046 handle overflows in the RTC counter 2019-04-02 13:27:45 +11:00
Nick Moore f846fa109e enable NRFX RTC adafruit/circuitpython#1046 2019-04-02 13:27:28 +11:00
Nick Moore f88f9fd748 more fake RTC code ... adafruit/circuitpython#1046
(works if MP_WEAK common_hal_rtc_get_time is removed)
2019-04-02 13:27:13 +11:00
Nick Moore 4a5c52fbd6 starting on #1046 rtc for nRF 2019-04-02 13:27:00 +11:00
Dan Halbert 0653bca323
Revert "Circuitpython nickzoic 1046 nrf rtc" 2019-03-29 16:41:29 -04:00
Scott Shawcroft 98811a9675
Update comment 2019-03-28 09:29:18 -07:00
Nick Moore 71622a4515 There isn't really a good way to calibrate this RTC adafruit/circuitpython#1046 2019-03-28 09:50:09 +11:00
Nick Moore 28254def0b adafruit/circuitpython#1046 handle overflows in the RTC counter 2019-03-28 09:50:09 +11:00
Nick Moore b09d2c3c62 enable NRFX RTC adafruit/circuitpython#1046 2019-03-28 09:50:09 +11:00
Nick Moore 69cf33e6a1 more fake RTC code ... adafruit/circuitpython#1046
(works if MP_WEAK common_hal_rtc_get_time is removed)
2019-03-28 09:50:09 +11:00
Nick Moore 77f307c642 starting on #1046 rtc for nRF 2019-03-28 09:50:09 +11:00
Scott Shawcroft 2c93ce5a28
Merge pull request #1672 from dhalbert/regular-fs-flush
flush flash filesystem once a second
2019-03-26 13:47:43 -07:00
Radomir Dopieralski f440e41819 Really fix the error messages in bleio, this time 2019-03-25 14:04:50 +01:00
Radomir Dopieralski bb10a8aaa1 Fix error messages in bleio 2019-03-25 09:19:48 +01:00
Dan Halbert fe555a4098 Allow NFC pins to be used for other purposes. 2019-03-21 11:22:58 -04:00
Dan Halbert fbf166af1a enable MICROPY_CPYTHON_COMPAT for most builds except CIRCUITPY_SMALL_BUILD; remove a few other things to make fit 2019-03-20 14:36:24 -04:00
Dan Halbert 2459eabd66 flush flash filesystem once a second 2019-03-20 12:21:36 -04:00
Dan Halbert 9cceea0d68 nrf: fix internal flash writes 2019-03-18 09:11:40 -04:00
Dan Halbert c4586c0531 nrf: Disable SPIM3; add SPIM1; remove TWIM1 2019-03-12 08:31:03 -04:00
sommersoft 2cd6a79016 better handle frequencyio inclusion 2019-03-01 22:46:57 -06:00