Commit Graph

28 Commits

Author SHA1 Message Date
Scott Shawcroft 40118bcf57
Add `board_deinit` for use with sleep
This changes lots of files to unify `board.h` across ports. It adds
`board_deinit` when CIRCUITPY_ALARM is set. `main.c` uses it to
deinit the board before deep sleeping (even when pretending.)

Deep sleep is now a two step process for the port. First, the
port should prepare to deep sleep based on the given alarms. It
should set alarms for both deep and pretend sleep. In particular,
the pretend versions should be set immediately so that we don't
miss an alarm as we shutdown. These alarms should also wake from
`port_idle_until_interrupt` which is used when pretending to deep
sleep.

Second, when real deep sleeping, `alarm_enter_deep_sleep` is called.
The port should set any alarms it didn't during prepare based on
data it saved internally during prepare.

ESP32-S2 sleep is a bit reorganized to locate more logic with
TimeAlarm. This will help it scale to more alarm types.

Fixes #3786
2020-12-08 10:52:25 -08:00
Lucian Copeland 00517b2600 Move missing pin warning to shared-bindings 2020-09-23 11:39:39 -04:00
Lucian Copeland 00ee94d24b Add SPI memset, optional flags 2020-09-16 14:22:18 -04:00
Jeff Epler 6a99a7b551 stm: Use 'Invalid %q pin selection' more places 2020-07-30 07:18:02 -05:00
Jeff Epler 4adbd23b75 stm: Add sdioio support for feather_stm32f405_express
Currently, only the bus specs of the stm32f405xx have been coded.
Other stm-family chips need (at a minimum) the specs added in their
periph.[ch] files.
2020-07-30 07:18:02 -05:00
Lucian Copeland c1f731d62e Claim USB pins at startup to prevent overwrites 2020-07-22 14:22:05 -04:00
Jeff Epler 57ab4f1329 stm: SPI: revamp pin search code
I discussed with Hierophect on Discord about how to "de-nest" the code
for configuring SPI objects on STM, because the problems with one
nesting level per pin becomes unmanageable with the up to 10 pins of
SDIO.

This code (which is only compile-tested so far) demonstrates the concept
we discussed.

The SCK pin is always required.  Loop over all possibilities of the SCK
pin.  When we are considering a particular item in the mcu_spi_sck_list
we have now become committed to using a particular periph_index.  If all
the other pins can be satisfied by that periph_index, then we have a
working combination.  Once we have a working combination that is not
reserved, we can return that combination.  On reaching the end, we have
checked all the possible possibilities and can give the same errors as
before: One if there was a possibility that worked but was reserved;
and another if no possibility worked.
2020-07-07 14:37:50 -05:00
Jeff Epler fcddfd0f39
Merge pull request #3083 from tannewt/esp32s2_busio
Add busio support for the ESP32-S2
2020-07-01 21:02:08 -05:00
Scott Shawcroft c5fa9730a8
Compiles! 2020-06-24 12:47:59 -07:00
Scott Shawcroft a26102607e
Add UART support 2020-06-24 12:47:58 -07:00
Lucian Copeland 2aac3cbdce Revert I2C timing overrides, reduce scope to module only 2020-06-15 13:51:09 -04:00
Lucian Copeland 724637faa3 Move I2C speed to clock-style definition 2020-06-11 11:17:51 -04:00
Lucian Copeland c08702414e Add macros for setting correct F7 and H7 I2C timing 2020-06-10 16:36:44 -04:00
Diego Elio Pettenò dd5d7c86d2 Fix up end of file and trailing whitespace.
This can be enforced by pre-commit, but correct it separately to make it easier to review.
2020-06-03 10:56:35 +01:00
Lucian Copeland fe75c7793c Fix SWO/Analog overlap, style changes 2020-05-29 12:19:37 -04:00
Lucian Copeland 53fb699436 Add pin resetting across boards, fix array size detection issue 2020-05-27 11:45:15 -04:00
Lucian Copeland 66c09efae2 Add UART one-way instance search, fix bugs in stm32 implementation 2020-05-20 12:48:01 -04:00
Mark Olsson 007c92ee6a Enable showing the console on a debug uart 2020-05-19 02:02:52 +02:00
Dan Halbert bae7a5e433 make translate again 2020-05-04 17:26:59 -04:00
Dan Halbert fbc8719fad ringbuf tested 2020-04-21 22:40:12 -04:00
Dan Halbert 38ec3bc574 further ringbuf cleanup 2020-04-21 17:38:20 -04:00
Scott Shawcroft bebf27e733
Merge remote-tracking branch 'adafruit/master' into lower_power
This isn't perfect and needs a bit more testing.
2020-04-20 18:25:13 -07:00
Lucian Copeland 5ac38c95cc Various requested fixes 2020-04-13 12:03:05 -04:00
Lucian Copeland 92a0621e59 Add busio support, cleanup 2020-04-09 13:43:19 -04:00
Scott Shawcroft 01941c027b
Fix up STM
Enable the Alarm IRQ earlier and correct bit clearing.
2020-04-08 14:41:57 -07:00
Lucian Copeland c4db8b87e2 Add F7 and H7 Support to the STM32 port
Restructures the STM port of Circuitpython to be more generic about the STM32 chip lines to support
the F7 and H7 series of chips. Adds the new Packages directory to organize different chip layouts
between lines. Makes general changes to the Makefile to condense board-level flags to the minimum
and support the new chip series. Adds the new chip line to the Peripherals directory, along with
new python tools used to generate peripheral text automatically in the tools/ directory.
2020-03-26 18:01:17 -04:00
Scott Shawcroft 2623022c84
Initial work for STM32. Need to fix us delay and PulseIn still. 2020-03-20 12:58:34 -07:00
Lucian Copeland 53b1544f41 create copy 2020-03-11 18:13:06 -04:00