Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
strategy:
matrix:
crate:
- stm32c0
- stm32f0
- stm32f1
- stm32f2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightlies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
cd stm32-rs
COMMIT=$(git rev-parse HEAD)
make -j2 form
mv stm32{f,g,h,l,mp,wl,wb}* ../nightly
mv stm32{c,f,g,h,l,mp,wl,wb}* ../nightly
cp .github/workflows/README-nightlies.md ../nightly/README.md
cd ../nightly
git init
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ SHELL := /usr/bin/env bash
# Path to `svd`/`svdtools`
SVDTOOLS ?= svdtools

CRATES ?= stm32f0 stm32f1 stm32f2 stm32f3 stm32f4 stm32f7 stm32h7 \
stm32l0 stm32l1 stm32l4 stm32l5 stm32g0 stm32g4 stm32mp1 \
stm32wl stm32wb stm32u5
CRATES ?= stm32c0 stm32f0 stm32f1 stm32f2 stm32f3 stm32f4 stm32f7 \
stm32h7 stm32l0 stm32l1 stm32l4 stm32l5 stm32g0 stm32g4 \
stm32mp1 stm32wl stm32wb stm32u5

# All yaml files in devices/ will be used to patch an SVD
YAMLS := $(foreach crate, $(CRATES), \
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# STM32 Peripheral Access Crates

[![CI](https://github.com/stm32-rs/stm32-rs/workflows/CI/badge.svg?branch=master)](https://github.com/stm32-rs/stm32-rs)
[![crates.io](https://img.shields.io/crates/v/stm32c0.svg?label=stm32c0)](https://crates.io/crates/stm32c0)
[![crates.io](https://img.shields.io/crates/v/stm32f0.svg?label=stm32f0)](https://crates.io/crates/stm32f0)
[![crates.io](https://img.shields.io/crates/v/stm32f1.svg?label=stm32f1)](https://crates.io/crates/stm32f1)
[![crates.io](https://img.shields.io/crates/v/stm32f2.svg?label=stm32f2)](https://crates.io/crates/stm32f2)
Expand Down Expand Up @@ -130,6 +131,7 @@ This project is still young and there's a lot to do!

## Supported Device Families

[![crates.io](https://img.shields.io/crates/v/stm32c0.svg?label=stm32c0)](https://crates.io/crates/stm32c0)
[![crates.io](https://img.shields.io/crates/v/stm32f0.svg?label=stm32f0)](https://crates.io/crates/stm32f0)
[![crates.io](https://img.shields.io/crates/v/stm32f1.svg?label=stm32f1)](https://crates.io/crates/stm32f1)
[![crates.io](https://img.shields.io/crates/v/stm32f2.svg?label=stm32f2)](https://crates.io/crates/stm32f2)
Expand Down
83 changes: 83 additions & 0 deletions devices/common_patches/c0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
_clear_fields: ["*"]

RCC:
_strip:
- "RCC_"

ADC:
_strip:
- "ADC_"
_modify:
CHSELR_MOD0:
name: CHSELR0
CHSELR_MOD1:
name: CHSELR1

DMA:
_strip:
- "DMA_"

DMAMUX:
_strip:
- "DMAMUX_"

CRC:
_strip:
- "CRC_"

RTC:
_strip:
- "RTC_"

EXTI:
_strip:
- "EXTI_"
_modify:
_interrupts:
EXTI4_5:
name: EXTI4_15
description: "EXTI line 4 to 15 interrupt"

GPIO?:
_strip:
- "GPIO?_"

USART?:
_strip:
- "USART_"

SPI:
_strip:
- "SPI_"

I2C:
_strip:
- "I2C_"

IWDG:
_strip:
- "IWDG_"

PWR:
_strip:
- "PWR_"

WWDG:
_strip:
- "WWDG_"

TIM[13]:
_strip:
- "TIM?_"

TIM3:
_delete:
- CNT
_modify:
CNT_alternate:
name: "CNT"

TIM*:
_strip:
- "TIM*__"
- "TIM?*_"
7 changes: 7 additions & 0 deletions devices/stm32c011.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
_svd: ../svd/stm32c011.svd

_modify:
name: STM32C011

_include:
- ./common_patches/c0.yaml
7 changes: 7 additions & 0 deletions devices/stm32c031.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
_svd: ../svd/stm32c031.svd

_modify:
name: STM32C031

_include:
- ./common_patches/c0.yaml
2 changes: 2 additions & 0 deletions scripts/makecrates.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
SVD2RUST_VERSION = "0.28.0"

CRATE_DOC_FEATURES = {
"stm32c0": ["critical-section", "rt", "stm32c011", "stm32c031"],
"stm32f0": ["critical-section", "rt", "stm32f0x0", "stm32f0x1", "stm32f0x2", "stm32f0x8"],
"stm32f1": ["critical-section", "rt", "stm32f100", "stm32f101", "stm32f102", "stm32f103", "stm32f107"],
"stm32f2": ["critical-section", "rt", "stm32f215", "stm32f217"],
Expand All @@ -40,6 +41,7 @@
}

CRATE_DOC_TARGETS = {
"stm32c0": "thumbv6m-none-eabi",
"stm32f0": "thumbv6m-none-eabi",
"stm32f1": "thumbv7m-none-eabi",
"stm32f2": "thumbv7m-none-eabi",
Expand Down
10 changes: 10 additions & 0 deletions stm32_part_table.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
#
# This data is used to generate more informative crate READMEs.

stm32c0:
stm32c0x1:
url: https://www.st.com/en/microcontrollers-microprocessors/stm32c0x1.html
rm: RM0490
rm_title: STM32C0x1
rm_url: https://www.st.com/resource/en/reference_manual/rm0490-stm32c0x1-advanced-armbased-32bit-mcus-stmicroelectronics.pdf
members:
- STM32C011
- STM32C031

stm32f0:
stm32f0x0:
url: https://www.st.com/en/microcontrollers-microprocessors/stm32f0x0-value-line.html
Expand Down
Binary file added svd/vendor/en.stm32c0_svd.zip
Binary file not shown.