Commit Graph

153 Commits

Author SHA1 Message Date
Scott Shawcroft
601a910f4e
More improvements to Terminal:
* Fix Hallowing.
* Fix builds without displayio.
* Fix y bounds that appears as untrollable row of pixels.
* Add scrolling to TileGrid.
* Remove Sprite to save space. TileGrid is a drop in replacement.
2019-01-31 11:42:14 -08:00
Scott Shawcroft
fb0970ec6e
Add terminalio 2019-01-31 11:42:13 -08:00
Scott Shawcroft
73cf490635
Add TileGrid 2019-01-31 11:42:13 -08:00
Scott Shawcroft
a380865655
Merge remote-tracking branch 'adafruit/master' into HEAD 2019-01-22 14:02:07 -08:00
Roy Hooper
50af08a6f3 Merge branch 'master' into pixelbuf 2019-01-19 16:33:59 -05:00
Scott Shawcroft
760bd8d8a4
share fourwire and make nrf compile 2019-01-17 15:15:59 -08:00
Scott Shawcroft
05d8885a1a
Rework displays in prep for dynamic support and 8bit parallel. 2019-01-16 12:05:20 -08:00
Scott Shawcroft
a14762a16c
Add support for rendering a shape.
Fixes #1171
2019-01-14 17:29:15 -08:00
Roy Hooper
ffe734edf7 Fresh combined checkin of _pixelbuf library. 2019-01-13 23:51:13 -05:00
Dan Halbert
50ee5ef24c merge translations; add bleio comments; fix minor sphinx issues in midi 2019-01-10 21:12:17 -05:00
Scott Shawcroft
b5e40f52c2
Add USB MIDI support for SAMD and nRF.
The API should be identical to using a UART for MIDI.

Fixes #672
2019-01-09 14:02:11 -08:00
Dan Halbert
4167bf5b24 wip: advertising works, but not connection 2018-12-27 00:04:04 -05:00
Scott Shawcroft
f59c3bd726
Add flag comment 2018-12-04 18:22:23 -08:00
Scott Shawcroft
15c1fc873c
Add particle boards, fix cp32 and try to speed up atmel build 2018-12-04 18:20:48 -08:00
Scott Shawcroft
324301e3bc
Update tinyusb to include control fixes. 2018-11-23 13:28:10 -08:00
Scott Shawcroft
ed9db80760
Switch SAMD51 back to -Os
It messes up neopixel timing otherwise.

Fixes #1326
2018-11-13 10:43:18 -08:00
Scott Shawcroft
9d91111b1b
Move atmel-samd to tinyusb and support nRF flash.
This started while adding USB MIDI support (and descriptor support is
in this change.) When seeing that I'd have to implement the MIDI class
logic twice, once for atmel-samd and once for nrf, I decided to refactor
the USB stack so its shared across ports. This has led to a number of
changes that remove items from the ports folder and move them into
supervisor.

Furthermore, we had external SPI flash support for nrf pending so I
factored out the connection between the usb stack and the flash API as
well. This PR also includes the QSPI support for nRF.
2018-11-08 17:25:30 -08:00
Nick Moore
aab28748bb Merge remote-tracking branch 'origin/master' into circuitpython/nickzoic/703-wiznet-5500-native 2018-10-11 14:19:10 +11:00
Nick Moore
a60700b1c5 Get DHCP working ... 2018-10-09 16:28:30 +11:00
Nick Moore
6e624b9c6a Split wiznet.WIZNET5K off into its own file 2018-10-09 13:05:58 +11:00
Scott Shawcroft
76008ce304
Introduce audioio.Mixer which can mix multiple audio samples
to produce a single sample.

Only works with 16 bit samples on the M4.

Fixes #987
2018-10-05 15:12:23 -07:00
Nick Moore
f9bda0ff93 Makefile & mpconfigport for atmel-samd with wiznet 2018-10-04 22:02:25 +10:00
Dan Halbert
bc510e714f merge 3.0.2 to master 2018-09-18 15:38:12 -04:00
Scott Shawcroft
f21cf15c38
Add OnDiskBitmap which loads pixel data straight from disk.
Also, renamed Sprite's palette to pixel_shader so it can be
anything that produces colors based on values (including color values).
Added a ColorConverter that converts RGB888 (found in bitmaps) to
RGB565 for the display.

Fixes #1182
2018-09-12 15:25:59 -07:00
Dan Halbert
6a046f55c4 UART fixes and enhancements; default board object fix 2018-09-12 17:19:43 -04:00
Scott Shawcroft
6697544cdf
Introduce displayio to render graphics to displays.
It's designed to minimize RAM footprint by using Sprites to
represent objects on the screen. The object model also facilitates
partial screen updating which reduces the bandwidth needed to display.

This is all handled in C. Python simply manipulates the objects with
the ability to synchronize to frame timing.
2018-08-31 12:31:52 -07:00
Noralf Trønnes
11cbeb87ad ports/atmel-samd: Implement i2cslave.I2CSlave
This adds support for SAMD acting as a I2C slave in polled mode.
2018-08-16 17:20:49 +02:00
Dan Halbert
bbc034cd3d
Merge pull request #1104 from tannewt/more_strings
Fixes and translate more strings.
2018-08-09 20:00:18 -04:00
Scott Shawcroft
24e53ad591
Rework escaping and fix ESP build. 2018-08-09 15:58:45 -07:00
Scott Shawcroft
94c5ceab36
Initial SAMR board revision. 2018-08-09 05:36:46 -07:00
Scott Shawcroft
933add6cd8
Support internationalisation. 2018-08-07 14:58:57 -07:00
Dan Halbert
dfa2581ffd
Merge pull request #1057 from tannewt/flexible_heap
Add basic memory allocation outside Python runtime
2018-08-02 18:43:06 -04:00
Scott Shawcroft
5704bc8c93
Share memory.c and a bit of polish. 2018-08-02 14:35:46 -07:00
Scott Shawcroft
b50f46d4be
Rename to SRC_QSTR_PREPROCESSOR for clarity. 2018-08-02 11:07:22 -07:00
Scott Shawcroft
8cf03d2d00
Speed up QSTR creation by pre-filtering files before pre-processing. 2018-08-02 00:51:52 -07:00
Scott Shawcroft
b334289669
Reenable LTO for debug. 2018-07-31 05:18:23 -07:00
Scott Shawcroft
777542c716
Add basic memory allocation outside Python runtime
This allows for the heap to fill all space but the stack. It also
allows us to designate space for memory outside the runtime for
things such as USB descriptors, flash cache and main filename.

Fixes #754
2018-07-31 05:18:03 -07:00
Dan Halbert
a20ab40ed2 Merge 3.0.0 final bugfixes and changes to master 2018-07-16 09:01:46 -04:00
Scott Shawcroft
54179a0189
Use .s in samd Makefile too. 2018-07-05 04:44:00 -07:00
Scott Shawcroft
ec78d3cefd
Mark pointers in cpu registers as in use.
This prevents bugs where gc_collect is called from C code that did
a recent allocation.
2018-07-03 05:45:50 -07:00
Scott Shawcroft
bf00cde37d
Comment tweak after board change 2018-07-02 14:51:06 -07:00
mrmcwethy
df4469f92b Test the BOARD parameter for nullness; display a error if nothing provided 2018-06-29 12:22:31 -07:00
Dan Halbert
1f3de5174e Freeze Adafruit_CircuitPython_Crickit into crickit builds 2018-06-26 19:49:55 -04:00
Scott Shawcroft
a5e03b76a6 Split out the peripherals library in preparation of sharing with MakeCode. 2018-06-15 16:16:21 -07:00
Dan Halbert
fa814a32ce Make Trinket M0 build fit; make RAMFS in vfs_fat_* tests be compliant with expected API 2018-06-14 21:02:12 -04:00
Dan Halbert
e724bc1c4e Fix playing audio from SD card 2018-06-14 18:47:40 -04:00
Scott Shawcroft
d0fb6e7a2f atmel-samd: Add rotary encoder support.
Fixes #283
2018-06-01 15:08:48 -07:00
Scott Shawcroft
fd71e56891 atmel-samd: Re-org helper peripheral files into their own subdirectory.
Ideally in the future they won't depend on ASF4 or MicroPython.
2018-06-01 15:07:31 -07:00
Scott Shawcroft
641caaa6dd Gain space back in non-Express builds by using -finline-limit 2018-05-23 10:36:59 -07:00
Scott Shawcroft
99123a8621 Turn on touchio for M0 boards. M4 will come later once its supported
by FreeTouch.

Fixes #670
2018-05-22 13:49:08 -07:00
Dan Halbert
45db48bbaa make longint choice mechanism more readable 2018-05-22 08:04:14 -04:00
Dan Halbert
5680933483 refactor longint settings; make crickit cpx build 2018-05-21 23:58:03 -04:00
Matt Land
a10f04ad6e support for 2 2018-05-15 13:53:53 -04:00
Roy Hooper
1661cbb6e1 Make python detection more robust and allow setting PYTHON2 and PYTHON3 to override python executables during build. 2018-05-14 11:19:19 -04:00
Noralf Trønnes
5d5d14709f Add clock representation with calibration
Add a python representation of the clocks with the possibility to change
the calbration of clock sources.
2018-05-07 23:04:02 +02:00
Noralf Trønnes
4a2a553647 atmel-samd/clocks: Split out samd21_clocks.c and samd51_clocks.c
Enhance readability by separating the samd21 and samd51 clock code.

This patch should not introduce any functional changes.
2018-05-04 13:32:56 +02:00
Scott Shawcroft
cfea51ec68 Re-enable PDMIn without ASF and using the helpers added with
I2SOut.

The API is almost the same except the frequency attribute has been
renamed to sample_rate so that its less likely to be confused with
frequencies within the audio itself.

Fixes #263.
2018-05-01 14:35:43 -07:00
Scott Shawcroft
81d395d825
Merge pull request #745 from notro/time_rtc
RFC: Add rtc module
2018-04-16 15:26:54 -07:00
Noralf Trønnes
8e2080411f atmel-samd: Add rtc module support
Support the rtc module by using hal_calendar.
2018-04-16 13:15:08 +02:00
Scott Shawcroft
812fe0c93f Turn on nvm in 3.0.
Its 256b on M0 and 8k on M4 to match flash erase sizes.

Fixes #758
2018-04-13 16:22:28 -07:00
Scott Shawcroft
22194d5977 Tweaks based on dhalbert's feedback. 2018-04-13 10:51:01 -07:00
Scott Shawcroft
8dcfeb6240 Fix Makefile 2018-04-12 18:17:46 -07:00
Scott Shawcroft
28642ab10d Add audio output support!
This evolves the API from 2.x (and breaks it). Playback devices are now
separate from the samples themselves. This allows for greater playback
flexibility. Two sample sources are audioio.RawSample and audioio.WaveFile.
They can both be mono or stereo. They can be output to audioio.AudioOut or
audiobusio.I2SOut.

Internally, the dma tracking has changed from a TC counting block transfers
to an interrupt generated by the block event sent to the EVSYS. This reduces
the overhead of each DMA transfer so multiple can occure without using up TCs.

Fixes #652. Fixes #522. Huge progress on #263
2018-04-12 16:35:13 -07:00
Jeff Epler
88bbe425db Create genhdr/ directory in time 2018-04-09 13:31:44 -05:00
Scott Shawcroft
4e053cea0d
Merge pull request #628 from sommersoft/super_status
Added Function To Check the Serial Connection From CircuitPython Layer
2018-04-08 22:06:09 -07:00
Dan Halbert
beb6ad2e40 Add USB HID support, including Consumer Control 2018-04-02 21:37:44 -04:00
Dan Halbert
435e894fa0 Merge branch 'master' into 3.0_hid 2018-04-02 19:19:43 -04:00
Dan Halbert
df91878d2e WIP: works with just keyboard but not complex report descriptor 2018-03-30 23:24:00 -04:00
sommersoft
6ee573c7c9
Merge branch 'master' into super_status 2018-03-30 14:27:39 -05:00
Jeff Epler
d57397f9c8 Remove an unneeded -Wno-error=lto-type-mismtach 2018-03-25 22:04:15 -05:00
Dan Halbert
31f5b6a238 WIP: simple working HID 2018-03-24 18:29:12 -04:00
Scott Shawcroft
e7fc0b6aa7 Use DMA for long SPI transactions including those to the SPI Flash.
QSPI is not currently working so its commented out.

This is progress on #652.
2018-03-09 12:45:46 -08:00
sommersoft
c1c3a79ec4 atmel-samd: changed Status to Runtime; instituted runtime singleton 2018-03-09 02:19:51 +00:00
Dan Halbert
9b4477e1dc Implement UART for 3.0 + related fixes.
1. UART: ported to ASF4. Allow rx-only and tx-only. Add .baudrate r/w property.

2. Make NeoPixel timing deterministic by turning off caches during NeoPixel writes.
3. Incorporate asf4 updates:
  a. async USART driver
  b. bringing Atmel START configuration closer to what we use
  c. Clock initialization order now specified by CIRCUITPY_GCLK_INIT_1ST and _LAST.
4. supervisor/port.c: Move commented-out clock-test pin setting to correct location.
2018-02-21 17:18:49 -05:00
sommersoft
60d6ccc731 changed spaced supervisor/Status.c line to tabbed 2018-02-20 03:44:45 +00:00
Scott Shawcroft
f20d5723aa Reorganize things. Reading jdec works. 2018-02-19 14:02:04 -08:00
Scott Shawcroft
4710a2adba Compiles for m4. Untested on m0.
This introduces a new spi_flash_api.h that works for both SPI and
QSPI. The previous spi_flash functions are now called external_flash
to minimize confusion.
2018-02-19 14:02:04 -08:00
sommersoft
9ee4d13756 added Status submodule to ports/atmel-samd/common-hal/supervisor; issue #544 2018-02-19 20:49:18 +00:00
Scott Shawcroft
eb2b41810a Turn on lto 2018-02-15 16:12:58 -08:00
Scott Shawcroft
c7af17525b m4 pulseout works 2018-02-14 11:38:52 -08:00
Scott Shawcroft
6a7d889dd4 m0 pulseout works. Factored out shared timer code. 2018-02-13 18:17:20 -08:00
Scott Shawcroft
190e7d629e WIP 2018-02-09 16:37:27 -08:00
Dan Halbert
6be6df6ae4
Merge pull request #609 from tannewt/bitbangio
Enable bitbangio now that we have digitalio.
2018-02-08 21:24:32 -05:00
Scott Shawcroft
aeae0090af Enable bitbangio now that we have digitalio.
Also remove a rogue neopixel_write.
2018-02-08 16:03:05 -08:00
Scott Shawcroft
82bc11585e ports/atmel-samd: Re-enable analogio
This introduces SAMD51 support and re-enables SAMD21 support.

Fixes #263
2018-02-08 14:48:08 -08:00
Radomir Dopieralski
189c62ac7d Bring back the _stage library
I have tested the _stage module, and it works fine, so I'm including it
in he sources again. It's still disabled by default in the
mpconfigport.h.
2018-01-29 21:24:46 +01:00
Dan Halbert
065e82015f merge from 2.2.0 + fix up board defs 2018-01-02 21:25:41 -05:00
Dan Halbert
ce81c8dda9 Avoid gcc 7.2.1 compiler issues in nlr_push() (#506)
Avoid gcc 7.2.1 compiler issues in nlr_push()
2018-01-02 13:41:34 -08:00
Dan Halbert
72c911be97 Support SPI flash chips for CIRCUITPY, using non-DMA SPI for now. 2017-11-27 21:00:24 -05:00
Dan Halbert
a9f75a71c5
Merge pull request #443 from dhalbert/3.0_spi
non-DMA SPI working; adding this now for testing; will continue with DMA
2017-11-16 19:28:24 -05:00
Dan Halbert
312444bbd2 non-DMA SPI working; adding this now for testing; will continue with DMA
Also, fixed pin mappings for rev B Metro M4:
swap PA12 and PA13 on SPI 2x3 header
swap A3 and A5

Comment out all frozen modules in CPX again to make room while waiting
for SPI flash.
2017-11-16 19:09:35 -05:00
Scott Shawcroft
ecc47d5258 Create supervisor module.
It can control autoreload and the rgb status led.
2017-11-16 09:04:17 -08:00
Dan Halbert
7292984204 Implement busio.I2c.
* Added asf4_conf/samd*/hpl_sercom_config.h
* Adjusted clocks in peripheral_clk_config.h.
* Put some frozen libs back in CPX for testing.
* Implement common-hal I2C
* Add samd*_peripherals.h in parallel with samd*_pins.h for common
  functions and data.
* Store SERCOM index in pins table for convenience.
* Canonicalize some #include guard names in various .h files.

simpler reset of SERCOMs; remove unused routine
2017-11-07 09:59:54 -08:00
Scott Shawcroft
a8ee0012d7 atmel-samd: Enable -Os for SAMD51 and update neopixel accordingly. 2017-11-06 16:30:11 -08:00
Dan Halbert
3b17980822
Merge pull request #391 from tannewt/longint_usb_fix
Enable LONGINT on M4 + usb fix
2017-11-01 14:19:17 -04:00
Scott Shawcroft
cfbb74ffe7 atmel-samd: Reorder mpconfigport.mk and mpconfigboard.mk includes.
This allows mpconfigport.mk to set this conditionally based on
$(CHIP_FAMILY).
2017-11-01 11:01:34 -07:00
Tony DiCola
d023879bea atmel-samd: Update and enable neopixel_write for ASF4, tested on SAMD21 only. 2017-10-31 16:06:36 -07:00
Radomir Dopieralski
8c7571a75d Create the build directory before running gen_usb_descriptor
Otherwise it fails to create the file in that directory.
2017-10-31 13:35:22 -07:00
Scott Shawcroft
4aeef100f6 atmel-samd: More USB polish
* Introduce a python script to generate the USB descriptor instead of
  a bunch of C macros. In the future, we can use this dynamically in
  CircuitPython.
* Add support for detecting read-only mass storage mounts.

Fixes #377
2017-10-30 18:29:20 -07:00
Dan Halbert
10b3a90189 Check INTERNAL_LIBM make flag in a safer way. 2017-10-27 17:32:13 -04:00