close
Skip to content

MillerTechnologyPeru/swift-embedded-examples

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

141 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Embedded Swift Example Projects

This repository is a set of demonstration projects of Embedded Swift. Embedded Swift is a compilation and language mode that enables development of baremetal, embedded and standalone software in Swift. To learn more, see:

Building the examples

Each example in this repository contains build and deployment instructions, however there are a couple common steps needed for many of the examples included below:

  1. Install swift using the instructions here.

  2. Install uv, "an extremely fast Python package and project manager", using the instructions here.

Catalog of Examples

Name Platform SDK Description Photo
esp32-led-blink-sdk ESP32-C6-Bug ESP-IDF SDK Blink an LED repeatedly with Swift & the ESP-IDF. Image
esp32-led-strip-sdk ESP32-C6-DevKitC-1 ESP-IDF SDK Control NeoPixel LEDs with Swift & the ESP-IDF. Image
esp32-uart-echo ESP32-C6 ESP-IDF SDK UART echo example using Swift's print() and readLine().
harmony Raspberry Pi Pico W Pico SDK A bluetooth speaker and ferrofluidic music visualizer. Firmware, Electrical, and Mechanical designs fully available. Image
nrfx-blink-sdk nRF52840-DK Zephyr SDK Blink an LED repeatedly with Swift & Zephyr. Image
nuttx-riscv-blink QEMU NuttX Blink a virualized led in QEMU using the Apache NuttX RTOS
rpi-4b-blink Raspberry Pi 4B None Blink the Pi's status green LED repeatedly using Swift MMIO. Image
rpi-5-blink Raspberry Pi 5 None Blink the Pi's status green LED repeatedly with Swift MMIO. Image
rpi-pico-blink-sdk Raspberry Pi Pico, Pico 2 Pico SDK Blink an LED repeatedly with Swift & the Pico SDK. Image
rpi-pico-blink Raspberry Pi Pico None Blink an LED repeatedly. Image
rpi-pico2-neopixel Raspberry Pi Pico 2 None Control Neopixel LEDs using the RP2350 PIO. Image
rpi-picow-blink-sdk Raspberry Pi Pico W, Pico 2W Pico SDK Blink an LED to signal 'SOS' in Morse code repeatedly with Swift & the Pico SDK. Image
stm32-blink STM32F746G-DISCO None Blink an LED repeatedly. Image
stm32-lcd-logo STM32F746G-DISCO None Animate the Swift Logo on the built-in LCD. Image
stm32-lvgl STM32F746G-DISCO Baremetal setup of LCD, touch panel, DRAM, using the LLVM Embedded toolchain for ARM. Renders graphics, animations, and reacts to user input via LVGL. Includes a macOS/Linux SDL based host simulation app. Image
stm32-neopixel STM32F746G-DISCO None Control NeoPixel LEDs using SPI. Image
stm32-uart-echo STM32F746G-DISCO None Echo user input using UART. Image

Note that the SDK integration examples (Pico SDK, Zephyr SDK, etc.) are not recommendations or endorsement, the same is true for build system choice (Make, CMake, SwiftPM, shell scripts). Embedded Swift aims to be versatile and allowing integration into existing SDKs and build systems, and the example projects show some of the possibilities.

Community Examples

Warning

Community projects linked here are not officially supported by our team. They may not always be compatible with the latest nightly Swift toolchain builds.

Name Platform Description
swift-matter-examples ESP32 An Embedded Swift Matter application running on ESP32-C6.
swift-flipperzero-hello Flipper Zero A demonstration of running Swift apps on the Flipper Zero.
EmbeddedSwift nRF52 Examples nRF52840 (Development Kit) A collection of examples using Embedded Swift on top of nRF Connect SDK (Zephyr).
Swatak nRF52840 (Seeed Studio XIAO) A reaction time game inspired by BATAK© boards, implemented in Embedded Swift using nRF Connect SDK.
swift-picosystem-example PicoSystem An Embedded Swift demo running on the Pimoroni PicoSystem
pico-swift-sh1106 Pico 2 Display Driver for SH1106
swift-st7789-lcd Pico 2 Display Driver for ST7789
PlaydateKit Playdate A full featured framework for building Playdate games using Embedded Swift.
swift-playdate-examples Playdate An Embedded Swift game running on Playdate by Panic.
swift-stm32c011-examples STM32 Examples of running Embedded Swift on the STM32C011, which is a tiny MCU with only 6KB of SRAM and 32KB of flash.
flappy-swift Web A WebAssembly game written in Swift in ~100 KB.
swift-for-wasm-examples Web A "Swift Audio Workstation" example built with Swift for WebAssembly running in the browser using Embedded Swift.
CPicoSDK Pico 2 SwiftPM package that enables seamless Swift development for the Raspberry Pi Pico SDK

Please note that the presence of community repositories and devices in this list does not constitute a recommendation or endorsement. If there's a project you'd like to see included here, please submit an issue with the details.

Contributing to this repository

This repository contains code that is not continuously developed, instead it's presented "as is" for educational and demonstrational purposes. Making major improvements to existing examples is discouraged, but additions of new examples is welcome.

Code of Conduct

Like all Swift.org projects, we would like these Embedded Swift example projects to foster a diverse and friendly community. We expect contributors to adhere to the Swift.org Code of Conduct.

Contact information

The current code owners of this repository are Kuba Mracek (@kubamracek) and Rauhul Varma (@rauhul). You can contact them on the Swift forums via the handles @kubamracek and @rauhul.

In case of moderation issues, you can also directly contact a member of the Swift Core Team.

About

A collection of example projects using Embedded Swift

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Swift 87.1%
  • C 7.1%
  • CMake 2.5%
  • Makefile 1.2%
  • Python 0.9%
  • Assembly 0.6%
  • Other 0.6%