Commit Graph

169 Commits

Author SHA1 Message Date
Brandon Satrom 48f67d007e feat: add Blues Swan R5 support
complete pin mapping for Feather pins

stubbed out files needed for complilation. still to be modified

0 out all CPY modules in mpconfigboard.mk until we get the build running

add csv for pin generation for STM32L4R5

add F4R5 references in peripherals files

refactored out board files BECAUSE I AM AN IDIOT; add L4 series system clocks file from CubeMX

took a guess at the number of USB endpoint pairs to get the build done

guess was close, but wrong. It is 8

clean up peripheral DEFs

Fixes build error:
```
In file included from ../../py/mpstate.h:33,
                 from ../../py/mpstate.c:27:
../../py/misc.h: In function 'vstr_str':
../../py/misc.h:196:1: sorry, unimplemented: Thumb-1 hard-float VFP ABI
 static inline char *vstr_str(vstr_t *vstr) {
 ^~~~~~
```
Sleuthing steps:
* verify that the feather_stm32f4_express board builds correctly
* put a `#error` at the bottom of the `mpstate.c` file.
* build for the feather and swan boards, with V=2 to capture the build command for that file.
* use a differencing tool to inspect the differences between the two invocations
* inspecting the differences, I saw a missing `-mcpu=cortex-m4` I tested by adding that to the Swan build command. The file built fine (stopping at the hard error, but no other warnings.)

A grep through the sources revealed where this flag was being set for the stm ports.

With this commit, the build gets further, but does not complete. The next exciting episode in this unfolding coding saga is just a commit away!

working build with minimal set of modules for the Blues Swan r5

chore:change header copyright name to Blues Wireless Contributors

USB operational.  Fixed up clocks to be hardwired for LSE no HSE case. (Trying to combine HSE in there made the code much more complex, and I don't have a board to test it out on.)

USART working

adds support for `ENABLE_3V3` and `DISCHARGE_3V3` pins.  I am surprised that pin definitions are quite low-level and don't include default direction and state, so the code currently has to initialize `ENABLE_3V3` pin as output.  The LED takes over a second to discharge, so I wonder if the board startup code is not having the desired affect.

short circuit implementation of backup memory for the STM32L4

all the ports

remove company name from board name to be consistent with the Arduino board definition.

add default pins for I2C, SPI and UART, so that `board.I2C` et al. works as expected.  Confirmed I2C timing.

fix board name

fix incorrect pin definition. add test to allow manual check of each output pin

analog IO

code changes for WebUSB. Doesn't appear to work, will revisit later.

ensure that `sys.platform` is available

checkin missing file

feat: make room for a larger filesystem so the sensor tutorial will fit on the device.

fix:(stm32l4r5zi.csv): merged AF0-7 and AF8-15 into single lines and removed extraneous headers mixed in with the data.

fix(parse_af_csv.py): pin index in the csv is 0 not 1, and AF index made 1 larger

chore(Swan R5): update peripherals pins from `parse_af_csv.py` output

optimize flash sector access
2021-09-28 18:52:02 -07:00
Jeff Epler 468558896c remove paralleldisplay from ports where it was unimplemented 2021-08-29 07:33:54 -05:00
Jeff Epler 7520feed1c Move ParallelBus to its own module 2021-08-29 07:33:54 -05:00
Jeff Epler 6ea136987e run codeformat 2021-08-19 13:54:13 -05:00
Jeff Epler cabe96e188 canio: Run background tasks while waiting for message reception
Closes: #5004
2021-08-18 11:39:40 -05:00
Scott Shawcroft de796e2304
Move OneWire to `onewireio` from `busio`
This will allow finer grained inclusion in 8.0.0

Fixes #5135
2021-08-12 10:47:14 -07:00
Lucian Copeland da149b0a42 Merge remote-tracking branch 'upstream/main' into stm32-sleepmem 2021-07-30 15:35:55 -04:00
Scott Shawcroft 412eb87080
Switch to pin, frequency and duty_cycle PulseOut
Passing in a PWMOut still works but is deprecated. It will be
removed in CircuitPython 8.0.0

This also switches STM32 timer indices and channel indices to
0-based in our pin data rather than `- 1` everywhere. The latter is
more bug prone.

Most of the way for #3264

Tested on Metro M0, Metro M4, Feather S2, Feather nRF52840, Feather
STM32F4 and Arduino RP2040.
2021-07-26 18:35:49 -07:00
Lucian Copeland 696c035b67 Add STM32 sleep memory 2021-06-25 17:43:18 -04:00
Jeff Epler e1d7e46e88 fix keyboard interrupt 2021-06-18 11:15:51 -05:00
Scott Shawcroft 561ffec693
Merge remote-tracking branch 'adafruit/main' into simplify_status_led 2021-05-20 13:46:42 -07:00
Scott Shawcroft b78e9fcd19
Improve STM reset reason
This causes safe mode to skip the wait for reset when waking up
from an alarm. (It also means we don't flash the LED for it.)
2021-05-19 11:48:02 -07:00
Lucian Copeland bce541dcc5 Minor text fixes 2021-05-18 15:16:25 -04:00
Lucian Copeland 715f7ee490 Add STM32 and NRF52 compatibility 2021-05-14 14:34:35 -04:00
Scott Shawcroft 1a0b4193b7
Simplify the status LED to save power
This also removes the need to pin share because we don't use the
status LED while user code is running.

The status flashes fallback to the HW_STATUS LED if no RGB LED is
present. Each status has a unique blink pattern as well.

One caveat is the REPL state. In order to not pin share, we set the
RGB color once. PWM and single color will be shutoff immediately but
DotStars and NeoPixels will hold the color until the user overrides
it.

Fixes #4133
2021-05-13 14:41:20 -07:00
Lucian Copeland 849e3a7319 Style fixes, submodules 2021-05-13 11:24:27 -04:00
Lucian Copeland 525b34b042 Fix formatting and broken links
Implmements missed pre-commit changes for all files, and fixes links broken by
cleanup in #4698
2021-05-10 18:04:43 -04:00
Lucian Copeland 0d3c5222d8 Merge remote-tracking branch 'upstream/main' into stm-alarm 2021-05-10 17:30:33 -04:00
Jeff Epler e95e921ca1 codeformat: Fix filename matching
In #4683, tannewt noticed that uncrustify was not running on some
file in common-hal.

I investigated and found that it was not being run on a bunch of paths.

Rather than make incremental changes, I rewrote list_files to work
bsaed on regular expressions; these regular expressions are created from
the same git-style glob patterns.

I spot-checked some specific filenames after this change, and all looks good:

```
$ python3 tools/codeformat.py -v --dry-run tests/basics/int_small.py ports/raspberrypi/common-hal/pulseio/PulseIn.c extmod/virtpin.c tests/thread/thread_exit1.py  ports/raspberrypi/background.h extmod/re1.5/recursiveloop.c
tools/codeformat.py -v --dry-run tests/basics/int_small.py ports/raspberrypi/common-hal/pulseio/PulseIn.c extmod/virtpin.c tests/thread/thread_exit1.py ports/raspberrypi/background.h extmod/re1.5/recursiveloop.c
uncrustify -c /home/jepler/src/circuitpython/tools/uncrustify.cfg -lC --no-backup extmod/virtpin.c ports/raspberrypi/background.h ports/raspberrypi/common-hal/pulseio/PulseIn.c
black --fast --line-length=99 -v tests/thread/thread_exit1.py
```
recursiveloop and int_small are excluded, while PulseIn, virtpin,
and background are included.

Testing running from a subdirectory (not _specifically_ supported though):
```
(cd ports && python3 ../tools/codeformat.py -v --dry-run raspberrypi/common-hal/pulseio/PulseIn.c ../extmod/virtpin.c)
../tools/codeformat.py -v --dry-run raspberrypi/common-hal/pulseio/PulseIn.c ../extmod/virtpin.c
uncrustify -c /home/jepler/src/circuitpython/tools/uncrustify.cfg -lC --no-backup ../extmod/virtpin.c raspberrypi/common-hal/pulseio/PulseIn.
```

As a side-effect, a bunch more files are re-formatted now. :-P
2021-04-30 10:48:08 -05:00
Lucian Copeland 07b86fcb76 fix sleepmemory object redefine error 2021-04-29 17:28:06 -04:00
Lucian Copeland bab5a22f0c Fix build issues
H7 compatibility problems in port.c and peripherals/exti
NRF build failures due to new use of const for PinAlarm pin objects
Isolated board flash overage on blackpill_with_flash, remove audio modules
2021-04-29 14:48:16 -04:00
Lucian Copeland 9fe8d61656 Fix broken MP macros from 1.11 merge 2021-04-28 18:26:52 -04:00
Lucian Copeland e0024c70de Merge remote-tracking branch 'upstream/main' into stm-alarm 2021-04-15 16:32:30 -04:00
Lucian Copeland 8a2143f161 Clean up comments and debugging pins 2021-04-02 17:40:40 -04:00
Lucian Copeland 9240146b22 Make light sleep store true alarm object to global map 2021-04-02 16:58:42 -04:00
Lucian Copeland 66a1583183 Implement fake and true deep sleep alarm differentiation 2021-04-02 15:13:10 -04:00
Lucian Copeland 17585e1e07 Clean up API 2021-04-02 14:08:48 -04:00
Lucian Copeland 91e530d36c Resolve wake alarm crash 2021-04-02 13:42:22 -04:00
Lucian Copeland 4f52554eb3 Fix to RTC reset 2021-04-01 20:53:25 -04:00
Lucian Copeland d35a307ffa Merge branch 'sleep-api-update' into stm-alarm 2021-03-29 12:27:25 -04:00
Lucian Copeland 529fb52309 Style changes and wakeup detection 2021-03-27 13:16:12 -04:00
Artyom Skrobov b40d072648 [stm] implementation of audiopwmio
Based on nrf PWMAudioOut by @jepler and stm PulseOut by @hierophect

Tested on a Meowbit
2021-03-26 13:18:01 -04:00
Lucian Copeland d8a2d69e10 Working deep sleep via RTC reset, with debug pins 2021-03-21 13:15:44 -04:00
Dan Halbert d7a2ae9df7 fix stm compiler error 2021-03-19 11:04:46 -04:00
Dan Halbert b2d913412f merge from upstream 2021-03-18 23:14:43 -04:00
gamblor21 0890b54cd9 More formatting 2021-03-16 08:29:04 -05:00
gamblor21 fb437d8280 Formatting fixes 2021-03-16 08:22:02 -05:00
Mark e326d7ca80
Merge branch 'main' into rp_dp_parallel 2021-03-15 20:00:13 -05:00
microDev a52eb88031
run code formatting script 2021-03-15 19:27:36 +05:30
gamblor21 56a219911f Add frequency support to parallel bus 2021-03-11 19:32:43 -06:00
Lucian Copeland 6b2c9985ff Extract RTC, implement fake RTC deepsleep 2021-03-11 17:50:05 -05:00
Lucian Copeland 1ebbd14d0f Fix UART deinit 2021-03-11 11:02:13 -05:00
Dan Halbert 08c5dbb003 use return values in STM PWMOut constructor, not exceptions 2021-03-11 08:52:47 -05:00
Artyom Skrobov 4720dc179a
[stm] `curr_pulseout` can be `STATIC`
Not used outside of PulseOut.c
2021-03-05 12:52:13 +02:00
Lucian Copeland f1792c8474 Extract EXTI, create base sleep framework 2021-03-02 11:41:53 -05:00
Jeff Epler 1d1ff5f308 Merge remote-tracking branch 'origin/main' into update-protomatter-rp2 2021-02-26 09:56:35 -06:00
Dan Halbert 67406488d1 merge from upstream; re-alphabetize 2021-02-19 14:22:50 -05:00
Jeff Epler ff1942cff6 Enable protomatter on RP2040 builds
Also found a race condition between timer_disable and redraw, which
would happen if I debugger-paused inside common_hal_rgbmatrix_timer_disable
or put a delay or print inside it.  That's what pausing inside reconstruct
fixes.

So that the "right timer" can be chosen, `timer_allocate` now gets the `self`
pointer.  It's guaranteed at this point that the pin information is accurate,
so you can e.g., find a PWM unit related to the pins themselves.
This required touching each port to add the parameter even though it's
unused everywhere but raspberrypi.
2021-02-12 08:25:15 -06:00
Dan Halbert f0564b4986 merge from upstream; complicated webusb merge 2021-02-11 18:50:02 -05:00
Lucian Copeland d00bee2149 Fix I2C Repeated start error by converting to IT mode 2021-02-10 14:59:19 -05:00