Skip to content

Commit c3aaab3

Browse files
authored
Convert stm32-lcd-logo to use mmio (#100)
Replaces the register definitions used by the stm32-lcd-logo example to use ones generated by svd2swift leveraging swift-mmio. Additionally refactors much of the example code to have fewer layers of abstraction as they make the code much harder to follow.
1 parent ec33a94 commit c3aaab3

35 files changed

+5885
-9810
lines changed

.swiftformatignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
./harmony/*
2+
./stm32-lcd-logo/Sources/Application/Registers/*
23
./stm32-neopixel/Sources/Application/Registers/*
34
./stm32-uart-echo/Sources/Application/Registers/*

stm32-lcd-logo/Package.resolved

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"originHash" : "5728b1ec253c3300a921ee6ddc3c43ff685abaa7f6ca8d86433af91b7883bf79",
3+
"pins" : [
4+
{
5+
"identity" : "swift-argument-parser",
6+
"kind" : "remoteSourceControl",
7+
"location" : "https://github.com/apple/swift-argument-parser.git",
8+
"state" : {
9+
"revision" : "41982a3656a71c768319979febd796c6fd111d5c",
10+
"version" : "1.5.0"
11+
}
12+
},
13+
{
14+
"identity" : "swift-mmio",
15+
"kind" : "remoteSourceControl",
16+
"location" : "https://github.com/apple/swift-mmio",
17+
"state" : {
18+
"branch" : "main",
19+
"revision" : "daf25ecacc0d9b71036c6af32cb7786a01802799"
20+
}
21+
},
22+
{
23+
"identity" : "swift-syntax",
24+
"kind" : "remoteSourceControl",
25+
"location" : "https://github.com/swiftlang/swift-syntax.git",
26+
"state" : {
27+
"revision" : "0687f71944021d616d34d922343dcef086855920",
28+
"version" : "600.0.1"
29+
}
30+
}
31+
],
32+
"version" : 3
33+
}

stm32-lcd-logo/Package.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ let package = Package(
1111
.executable(name: "Application", targets: ["Application"])
1212
],
1313
dependencies: [
14-
// .package(url: "https://github.com/apple/swift-mmio", branch: "main")
14+
.package(url: "https://github.com/apple/swift-mmio", branch: "main")
1515
],
1616
targets: [
1717
// SVD2Swift \
1818
// --input Tools/SVDs/stm32f7x6.patched.svd \
1919
// --output stm32-lcd-logo/Sources/STM32F7x6 \
20-
// --peripherals LTDC RCC GPIOA GPIOB GPIOC GPIOD GPIOE GPIOF GPIOG GPIOH GPIOI GPIOJ GPIOK
20+
// --peripherals FLASH GPIOA GPIOB GPIOC GPIOD GPIOE GPIOF GPIOG GPIOH GPIOI GPIOJ GPIOK LTDC RCC
2121
.executableTarget(
2222
name: "Application",
2323
dependencies: [
24-
// .product(name: "MMIO", package: "swift-mmio"),
25-
"Support"
24+
.product(name: "MMIO", package: "swift-mmio"),
25+
"Support",
2626
]),
2727
.target(name: "Support"),
2828
])

stm32-lcd-logo/Sources/Application/Board.swift

-81
This file was deleted.

0 commit comments

Comments
 (0)