Commit Graph

21 Commits

Author SHA1 Message Date
Timon a1052d5f73
Initial broadcom port for Raspberry Pi
This targets the 64-bit CPU Raspberry Pis. The BCM2711 on the Pi 4
and the BCM2837 on the Pi 3 and Zero 2W. There are 64-bit fixes
outside of the ports directory for it.

There are a couple other cleanups that were incidental:
* Use const mcu_pin_obj_t instead of omitting the const. The structs
  themselves are const because they are in ROM.
* Use PTR <-> OBJ conversions in more places. They were found when
  mp_obj_t was set to an integer type rather than pointer.
* Optimize submodule checkout because the Pi submodules are heavy
  and unnecessary for the vast majority of builds.

Fixes #4314
2021-11-22 14:54:44 -08:00
root cfd6ffc649 Adding files for cpu temperature fix 2021-01-28 16:06:30 -06:00
Scott Shawcroft 733094aead
Add initial RP2040 support
The RP2040 is new microcontroller from Raspberry Pi that features
two Cortex M0s and eight PIO state machines that are good for
crunching lots of data. It has 264k RAM and a built in UF2
bootloader too.

Datasheet: https://pico.raspberrypi.org/files/rp2040_datasheet.pdf
2021-01-20 19:16:56 -08:00
Dan Halbert 9391c8f9dd Make ResetReason and RunReason available 2020-12-06 12:00:00 -05:00
Dan Halbert 104a089677 deep sleep working; deep sleep delay when connected 2020-11-26 22:06:37 -05:00
Dan Halbert 7a45afc549 working, but need to avoid deep sleeping too fast before USB ready 2020-11-23 22:44:53 -05:00
Dan Halbert a0f1ec3c4a wip 2020-11-22 19:10:09 -05:00
Dan Halbert 75559f35cc wip: ResetReason to microcontroller.cpu 2020-11-21 23:29:52 -05:00
microDev 930cf14dce
Add check for invalid io, function to disable all alarms 2020-10-27 16:17:26 -07:00
microDev 4d8ffdca8d
restructure alarm modules 2020-10-27 16:15:09 -07:00
microDev e5ff55b15c
Renamed alarm modules 2020-10-27 16:13:25 -07:00
microDev 05a3f203db
Add function to get time elapsed during sleep 2020-10-27 16:13:25 -07:00
microDev 90b9ec6f2c
Initial Sleep Support 2020-10-27 16:13:22 -07:00
Sean Cross 08362c9cab watchdogtimer: refactor to new api
This refactors the WatchDogTimer API to use the format proposed in
https://github.com/adafruit/circuitpython/pull/2933#issuecomment-632268227

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27 11:28:49 +08:00
Sean Cross 595f6387c2 watchdog: rename module from `wdt` and move to `microcontroller`
This also places it under the `microcontroller` object.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27 11:28:49 +08:00
Dan Halbert 065e82015f merge from 2.2.0 + fix up board defs 2018-01-02 21:25:41 -05:00
Dan Halbert fdb97eda09 Add microcontroller.cpu.temperature, for use as a simple sensor on minimal boards. (#211)
* Add microcontroller.cpu, the sole instance of microcontroller.Processor.
microcontroller.cpu.frequency is the clock frequency, in Hz.
microcontroller.cpu.temperature is the reading from the internal temperature sensor, in Celsius. None if not available.

* Squeeze firmware size by using -finline-limit. Otherwise non-Express builds were slightly too big.

* Update submodules.

* Fix documentation glitches
2017-08-31 13:48:30 -04:00
Dan Halbert ef61b5ecb5 Initial merge of micropython v1.9.2 into circuitpython 2.0.0 (in development) master.
cpx build compiles and loads and works in repl; test suite not run yet
esp8266 not tested yet
2017-08-25 22:17:07 -04:00
Scott Shawcroft 266be30777 atmel-samd: Introduce a nvm module for non-volatile byte-level memory access. (#203)
* atmel-samd: Introduce a nvm module for non-volatile byte-level memory access.

This allows for persisting small configuration values even when the file system
is read-only from CircuitPython.

Fixes #160

* Review feedback:
* Add tests.
* Fix non-zero index.
* Fix len()
2017-08-25 16:00:27 -04:00
Scott Shawcroft 26229efe78 Add try_lock and unlock to I2C and SPI classes to make sure things
are shared well between threads and underlying MicroPython (SPI Flash
for example.)

It is recommended to use the bus device classes to manage the locks
and other transaction state.

https://github.com/adafruit/Adafruit_MicroPython_BusDevice

Fixed #58
Fixed #59
Fixed #60
2016-12-02 15:46:12 -08:00
Scott Shawcroft ccbb5e84f9 This introduces an alternative hardware API called nativeio structured around different functions that are typically accelerated by native hardware. Its not meant to reflect the structure of the hardware.
Docs are here: http://tannewt-micropython.readthedocs.io/en/microcontroller/

It differs from upstream's machine in the following ways:

* Python API is identical across ports due to code structure. (Lives in shared-bindings)
* Focuses on abstracting common functionality (AnalogIn) and not representing structure (ADC).
* Documentation lives with code making it easy to ensure they match.
* Pin is split into references (board.D13 and microcontroller.pin.PA17) and functionality (DigitalInOut).
* All nativeio classes claim underlying hardware resources when inited on construction, support Context Managers (aka with statements) and have deinit methods which release the claimed hardware.
* All constructors take pin references rather than peripheral ids. Its up to the implementation to find hardware or throw and exception.
2016-11-21 14:11:52 -08:00