.. leading zeros are required for `frontmatter` to treat them as dates
rather than strings, apparently per the YAML specification.
This was done by script:
```py
import re
import datetime
import pathlib
import sys
import frontmatter
rx = re.compile(r'^(\s*)date_added:.*$', re.M)
for path_str in sys.argv[1:]:
print(path_str)
path = pathlib.Path(path_str)
post = frontmatter.load(path)
date_added = post.get("date_added", "")
if isinstance(date_added, datetime.date):
continue
if isinstance(date_added, str):
try:
date_added = datetime.datetime.strptime(date_added, "%Y-%m-%d")
except ValueError as exc:
print(f"Failed to parse date {date_added} in {path_str}: {exc}")
continue
date_added = date_added.date()
content = path.read_text("utf-8")
new_content = rx.sub(lambda m: f"{m.group(1)}date_added: {date_added}", content)
assert content != new_content
path.write_text(new_content, "utf-8")
```
2.1 KiB
| layout | board_id | title | name | manufacturer | board_url | board_image | date_added | family | features | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| download | swan_r5 | Swan R5 Download | Swan R5 | Blues Wireless |
|
swan_r5.jpg | 2021-09-29 | stm |
|
Swan is a low-cost embeddable STM32L4-based microcontroller designed to accelerate the development and deployment of battery-powered solutions. It is especially useful for applications requiring large memory or a high degree of I/O expandability at an affordable cost, such as edge inferencing and remote monitoring.
Uniquely for Feather-compatible boards, Swan is designed to satisfy developers’ needs that span from early prototyping through high-volume deployment. Developers may begin to use Swan in conjunction with Adafruit’s myriad sensors and FeatherWing-compatible carriers. Due to its novel design, for high-volume deployment the low-cost Swan can also be soldered directly to a parent PCB integrating those sensors, utilizing the full range of Swan’s I/O capabilities.
The board has three independent power options – USB, Battery, or Line power – and provides a software-switchable 2 Amp regulator for powering external sensors. When operating in its low-power operating mode, the entire Swan board commonly draws only about 8uA while retaining all of its memory, making it quite suitable for battery-powered devices.
Swan Features
- Ultra low-power Arm Cortex-M4 core clocked at 120Mhz
- STM32L4R5-based microcontroller
- 2MB of flash and 640KB of RAM
- Qwiic connector
- Support for Notecard Outboard Firmware Update in CircuitPython
- Castellated-edge access to 55 GPIO ports including:
- 8 analog
- 16 digital
- 4x I2C, 3x SPI
- USB OTG full speed
- 1x 14-channel DMA
- tRNG
- 12-bit ADC, 2 x 12-bit DAC
- low-power RTC, and CRC calculation peripherals