Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4f92578
Add note about using the crate in its existing form with PIC32CXSG (#…
rnd-ash Nov 11, 2025
a68f040
Merge branch 'master' into feat/pic32cxsg
rnd-ash Nov 11, 2025
e9b5054
Add RAM size to description of PIC32s
rnd-ash Nov 11, 2025
adfcebf
Add pic32cxsg configurations to devices.yaml
rnd-ash Nov 12, 2025
cd0849c
Update crates to include pic32cxsg line
rnd-ash Nov 12, 2025
205ab5a
Add to define_pac macro
rnd-ash Nov 12, 2025
4b6be20
Move pic32cxsg series to existing d5x devices section
rnd-ash Nov 12, 2025
f708abb
Differentiate between 4x and 6x PIC32CXSGs, and add HSM flag
rnd-ash Nov 12, 2025
b7f3954
Update README and crates.json
rnd-ash Nov 12, 2025
0e19661
Remove PIC32CX flashing section
rnd-ash Nov 12, 2025
b5b3389
Fix devices.yml
rnd-ash Nov 12, 2025
50a5ea2
Feature gate some peripherals for SG60/61 (To disable pins used for H…
rnd-ash Nov 12, 2025
234e15c
Remove 1025 from the PIC names (Flash size)
rnd-ash Nov 12, 2025
8cf0b7e
Fix define_pac macro
rnd-ash Nov 12, 2025
ed0947b
Revert Cargo.toml auto-format
rnd-ash Nov 15, 2025
50d5ecf
Merge remote-tracking branch 'origin/master' into feat/pic32cxsg
rnd-ash Mar 16, 2026
6839739
Update update_pacs.sh to account for PIC32CXSG's naming convensions
rnd-ash Mar 16, 2026
bf263e4
Generate PIC32CXSG41s PAC from SVDs
rnd-ash Mar 16, 2026
8751e41
Update Cargo.toml
rnd-ash Mar 16, 2026
628087a
Update define_pac macro
rnd-ash Mar 16, 2026
17d0b42
Dedicate chip features to PIC32CXSG
rnd-ash Mar 17, 2026
bb950cc
Remove comment in SVD Patch
rnd-ash Mar 17, 2026
5697ebf
Uncomment crate cargo.toml
rnd-ash Mar 17, 2026
7a50018
Fix unused macro reference
rnd-ash Mar 17, 2026
71c1bb6
Add in PACs for SG60/61
rnd-ash Mar 17, 2026
d329091
Add missing DMA TrigSrc to SVD patches
rnd-ash Mar 18, 2026
1270d82
Update crates.json
rnd-ash Mar 18, 2026
39dbad4
Re-order PIC32 series in crate toml
rnd-ash Mar 18, 2026
85dbbb5
Remove ADC `tp_tc_to_temp` for Pic32
rnd-ash Mar 18, 2026
e195238
Patch in EIC Config1 for SG41064 (Missing from SVD)
rnd-ash Mar 18, 2026
65f6440
Fix crate name in crates.json
rnd-ash Mar 18, 2026
7bd8b34
Patch SG6x SVDs for minor inconsistencies
rnd-ash Mar 18, 2026
f93c8ba
Add immutable boot related code
rnd-ash Mar 19, 2026
13ecb2a
Update HAL Readme
rnd-ash Mar 19, 2026
81681bf
Merge branch 'atsamd-rs:master' into feat/pic32cxsg
rnd-ash Mar 23, 2026
7840c49
Merge branch 'master' into feat/pic32cxsg
rnd-ash Mar 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
7 changes: 1 addition & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
[workspace]
resolver = "2"
default-members = ["hal"]
members = [
"hal",
"atsamd-hal-macros",
"pac/*",
"boards/*",
]
members = ["hal", "atsamd-hal-macros", "pac/*", "boards/*"]

[profile.dev]
debug = true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# atsamd & atsame support for Rust

This repository holds various crates that support/enable working with Microchip (nee Atmel) `samd11`, `samd21`, `samd51` and `same5x` based devices using Rust.
This repository holds various crates that support/enable working with Microchip (nee Atmel) `samd11`, `samd21`, `samd51` and `same5x` based devices using Rust, and also the newer Microchip `PIC32CX SG` series
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This language makes the PIC32CX SG feel really "bolted on", maybe something like "working with Microchip SAMD family of devices including SAMD11, SAMD21...PIC32CX SG."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would

"This repository holds various crates that support/enable working with Atmel (Now Microchip) devices (samd11, samd21, samd51 and same5x), as well as Microchip's own PIC32CX SG series using Rust "

sound better then?

(We could change this into a list, to better future proof this if we eventually get around to 1 day adding the next generation PIC32C series of ICs)


![CI Build](https://github.com/atsamd-rs/atsamd/workflows/Build%20BSPs/badge.svg)

Expand Down
61 changes: 61 additions & 0 deletions atsamd-hal-macros/devices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pin-groups:
pins-48a: ["pins-48", "pa00", "pa01", "pb22", "pb23"]
pins-48l: ["pins-48", "pb00", "pb01", "pb04", "pb05"]
pins-64: ["pins-48a", "pins-48l", "pb06", "pb07", "pb12", "pb13", "pb14", "pb15", "pb16", "pb17", "pb30", "pb31"]
pins-80: ["pins-64", "pc06", "pc07", "pc12", "pc13", "pc14", "pc15", "pc16", "pc17", "pb18", "pb19", "pb20", "pb21", "pc27", "pc28"]
pins-100: ["pins-64", "pb18", "pb19", "pb20", "pb21", "pb24", "pb25", "pc00", "pc01", "pc02", "pc03", "pc05", "pc06", "pc07", "pc10", "pc11", "pc12", "pc13", "pc14", "pc15", "pc16", "pc17", "pc18", "pc19", "pc20", "pc21", "pc24", "pc25", "pc26", "pc27", "pc28"]
pins-128: ["pins-100", "pb26", "pb27", "pb28", "pb29", "pc04", "pc22", "pc23", "pc30", "pc31", "pd00", "pd01", "pd08", "pd09", "pd10", "pd11", "pd12", "pd20", "pd21"]

Expand Down Expand Up @@ -140,3 +141,63 @@ families:
- i2s: { except: ["samd51g"] }
- pcc
- pdec

pic32cxsg:
pins:
pic32cxsg41064: ["pins-64"]
pic32cxsg41080: ["pins-80"]
pic32cxsg41100: ["pins-100"]
pic32cxsg41128: ["pins-128"]
pic32cxsg60100: ["pins-100"]
pic32cxsg60128: ["pins-128"]
pic32cxsg61100: ["pins-100"]
pic32cxsg61128: ["pins-128"]
peripherals:
- nvic
- serial-numbers
- cmcc
- dsu
- clock
- gclk
- mclk
- rstc
- ramecc
- pm
- supc
- wdt
- rtc
- dmac
- eic
- gmac
- nvmctrl
- icm
- pac
- oscctrl
- osc32kctrl
- freqm
- evsys
- port
- sercom: { count: 6, only: ["pic32cxsg41064"] }
- sercom: { count: 8, except: ["pic32cxsg41064"] }
- qspi
- usb
- can: { count: 2 }
- sdhc: { count: 1, only: ["pic32cxsg41064"] }
- sdhc: { count: 2, except: ["pic32cxsg41064"] }
- ccl
- aes
- pukcc
- pukcl
- trng
- adc
- ac
- dac
- tc: { count: 6, only: ["pic32cxsg41064", "pic32cxsg41080"] }
- tc: { count: 8, only: ["pic32cxsg41100", "pic32cxsg41128", "pic32cxsg60100", "pic32cxsg60128", "pic32cxsg61100", "pic32cxsg61128"] }
- tcc: { count: 5 }
- ptc
- i2s
- pcc
- pdec
- hsm: {only: ["pic32cxsg60100", "pic32cxsg60128", "pic32cxsg61100", pic32cxsg61128"] }
- immutableboot: {only: ["pic32cxsg41100", pic32cxsg41128", "pic32cxsg61100", pic32cxsg61128"] }
117 changes: 114 additions & 3 deletions crates.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"boards": {

"atsame54_xpro": {
"tier": 1,
"build": "cargo build --examples --all-features",
Expand Down Expand Up @@ -36,7 +35,6 @@
"build": "cargo build --profile dev-optimized --examples --all-features",
"target": "thumbv6m-none-eabi"
},

"arduino_mkr1000": {
"tier": 2,
"build": "cargo build --examples --all-features",
Expand Down Expand Up @@ -335,7 +333,120 @@
"target": "thumbv7em-none-eabihf"
},
"same54p": {
"features": [ "same54p", "usb", "dma", "sdmmc", "rtic", "can", "defmt", "async", "undoc-features" ],
"features": [
"same54p",
"usb",
"dma",
"sdmmc",
"rtic",
"can",
"defmt",
"async"
],
"target": "thumbv7em-none-eabihf"
},
"pic32cxsg41064": {
"features": [
"pic32cxsg41064",
"usb",
"dma",
"sdmmc",
"rtic",
"can",
"defmt",
"async"
],
"target": "thumbv7em-none-eabihf"
},
"pic32cxsg41080": {
"features": [
"pic32cxsg41080",
"usb",
"dma",
"sdmmc",
"rtic",
"can",
"defmt",
"async"
],
"target": "thumbv7em-none-eabihf"
},
"pic32cxsg41100": {
"features": [
"pic32cxsg41100",
"usb",
"dma",
"sdmmc",
"rtic",
"can",
"defmt",
"async"
],
"target": "thumbv7em-none-eabihf"
},
"pic32cxsg41128": {
"features": [
"pic32cxsg41128",
"usb",
"dma",
"sdmmc",
"rtic",
"can",
"defmt",
"async"
],
"target": "thumbv7em-none-eabihf"
},
"pic32cxsg60100": {
"features": [
"pic32cxsg60100",
"usb",
"dma",
"sdmmc",
"rtic",
"can",
"defmt",
"async"
],
"target": "thumbv7em-none-eabihf"
},
"pic32cxsg60128": {
"features": [
"pic32cxsg60128",
"usb",
"dma",
"sdmmc",
"rtic",
"can",
"defmt",
"async"
],
"target": "thumbv7em-none-eabihf"
},
"pic32cxsg61100": {
"features": [
"pic32cxsg61100",
"usb",
"dma",
"sdmmc",
"rtic",
"can",
"defmt",
"async"
],
"target": "thumbv7em-none-eabihf"
},
"pic32cxsg61128": {
"features": [
"pic32cxsg61128",
"usb",
"dma",
"sdmmc",
"rtic",
"can",
"defmt",
"async"
],
"target": "thumbv7em-none-eabihf"
}
}
Expand Down
105 changes: 71 additions & 34 deletions hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,45 +31,51 @@ features = ["samd21g", "samd21g-rt", "usb", "dma", "async", "rtic"]

[dependencies]
aes = "0.8.4"
atsamd-hal-macros = {version = "0.3.0", path = "../atsamd-hal-macros"}
atsamd-hal-macros = { version = "0.3.0", path = "../atsamd-hal-macros" }
bitfield = "0.13"
bitflags = "2.6.0"
cipher = "0.4"
cortex-m = "0.7"
critical-section = "1.2.0"
embedded-hal-02 = {package = "embedded-hal", version = "0.2", features = ["unproven"]}
embedded-hal-1 = {package = "embedded-hal", version = "1.0.0"}
embedded-hal-02 = { package = "embedded-hal", version = "0.2", features = [
"unproven",
] }
embedded-hal-1 = { package = "embedded-hal", version = "1.0.0" }
embedded-hal-nb = "1.0.0"
embedded-io = "0.6"
fugit = "0.3"
heapless = "0.8"
modular-bitfield = "0.11"
nb = "1.1"
num-traits = {version = "0.2.19", default-features = false}
num-traits = { version = "0.2.19", default-features = false }
opaque-debug = "0.3.0"
paste = "1.0.15"
portable-atomic = {version = "1.10.0", optional = true, features = ["critical-section"]}
portable-atomic = { version = "1.10.0", optional = true, features = [
"critical-section",
] }
rand_core = "0.9.1"
seq-macro = "0.3"
sorted-hlist = "0.2.0"
typenum = "1.12.0"
void = {version = "1.0", default-features = false}
void = { version = "1.0", default-features = false }

#===============================================================================
# Optional depdendencies
#===============================================================================

defmt = {version = "1.0.1", optional = true}
embassy-sync = {version = "0.6.0", optional = true}
embedded-hal-async = {version = "1.0.0", optional = true}
embedded-io-async = {version = "0.6.1", optional = true}
embedded-sdmmc = {version = "0.8.1", optional = true}
futures = {version = "0.3.31", default-features = false, features = ["async-await"], optional = true}
jlink_rtt = {version = "0.2", optional = true}
mcan-core = {version = "0.2", optional = true}
rtic-monotonic = {version = "1.0", optional = true}
rtic-time = {version = "2.0", optional = true}
usb-device = {version = "0.3.2", optional = true}
defmt = { version = "1.0.1", optional = true }
embassy-sync = { version = "0.6.0", optional = true }
embedded-hal-async = { version = "1.0.0", optional = true }
embedded-io-async = { version = "0.6.1", optional = true }
embedded-sdmmc = { version = "0.8.1", optional = true }
futures = { version = "0.3.31", default-features = false, features = [
"async-await",
], optional = true }
jlink_rtt = { version = "0.2", optional = true }
mcan-core = { version = "0.2", optional = true }
rtic-monotonic = { version = "1.0", optional = true }
rtic-time = { version = "2.0", optional = true }
usb-device = { version = "0.3.2", optional = true }

#===============================================================================
# PACs
Expand All @@ -81,27 +87,38 @@ usb-device = {version = "0.3.2", optional = true}
# users should specify a corresponding variant (see below). The variant features
# will select the correct PAC, as well as other configuration features.

atsamd11c = {version = "0.14.2", path = "../pac/atsamd11c", optional = true}
atsamd11d = {version = "0.14.2", path = "../pac/atsamd11d", optional = true}
atsamd11c = { version = "0.14.2", path = "../pac/atsamd11c", optional = true }
atsamd11d = { version = "0.14.2", path = "../pac/atsamd11d", optional = true }

atsamd21e = {version = "0.14.2", path = "../pac/atsamd21e", optional = true}
atsamd21g = {version = "0.14.2", path = "../pac/atsamd21g", optional = true}
atsamd21j = {version = "0.14.2", path = "../pac/atsamd21j", optional = true}
atsamd21e = { version = "0.14.2", path = "../pac/atsamd21e", optional = true }
atsamd21g = { version = "0.14.2", path = "../pac/atsamd21g", optional = true }
atsamd21j = { version = "0.14.2", path = "../pac/atsamd21j", optional = true }

atsamd51g = {version = "0.14.2", path = "../pac/atsamd51g", optional = true}
atsamd51j = {version = "0.14.2", path = "../pac/atsamd51j", optional = true}
atsamd51n = {version = "0.14.2", path = "../pac/atsamd51n", optional = true}
atsamd51p = {version = "0.14.2", path = "../pac/atsamd51p", optional = true}
atsamd51g = { version = "0.14.2", path = "../pac/atsamd51g", optional = true }
atsamd51j = { version = "0.14.2", path = "../pac/atsamd51j", optional = true }
atsamd51n = { version = "0.14.2", path = "../pac/atsamd51n", optional = true }
atsamd51p = { version = "0.14.2", path = "../pac/atsamd51p", optional = true }

atsame51g = {version = "0.14.2", path = "../pac/atsame51g", optional = true}
atsame51j = {version = "0.14.2", path = "../pac/atsame51j", optional = true}
atsame51n = {version = "0.14.2", path = "../pac/atsame51n", optional = true}
atsame51g = { version = "0.14.2", path = "../pac/atsame51g", optional = true }
atsame51j = { version = "0.14.2", path = "../pac/atsame51j", optional = true }
atsame51n = { version = "0.14.2", path = "../pac/atsame51n", optional = true }

atsame53j = {version = "0.14.2", path = "../pac/atsame53j", optional = true}
atsame53n = {version = "0.14.2", path = "../pac/atsame53n", optional = true}
atsame53j = { version = "0.14.2", path = "../pac/atsame53j", optional = true }
atsame53n = { version = "0.14.2", path = "../pac/atsame53n", optional = true }

atsame54n = {version = "0.14.2", path = "../pac/atsame54n", optional = true}
atsame54p = {version = "0.14.2", path = "../pac/atsame54p", optional = true}
atsame54n = { version = "0.14.2", path = "../pac/atsame54n", optional = true }
atsame54p = { version = "0.14.2", path = "../pac/atsame54p", optional = true }

pic32cxsg41064 = { version = "0.1.0", path = "../pac/pic32cxsg41064", optional = true }
pic32cxsg41080 = { version = "0.1.0", path = "../pac/pic32cxsg41080", optional = true }
pic32cxsg41100 = { version = "0.1.0", path = "../pac/pic32cxsg41100", optional = true }
pic32cxsg41128 = { version = "0.1.0", path = "../pac/pic32cxsg41128", optional = true }

pic32cxsg60100 = { version = "0.1.0", path = "../pac/pic32cxsg60100", optional = true }
pic32cxsg60128 = { version = "0.1.0", path = "../pac/pic32cxsg60128", optional = true }

pic32cxsg61100 = { version = "0.1.0", path = "../pac/pic32cxsg61100", optional = true }
pic32cxsg61128 = { version = "0.1.0", path = "../pac/pic32cxsg61128", optional = true }

#===============================================================================
# Features
Expand Down Expand Up @@ -144,6 +161,15 @@ same53n = ["device", "dep:atsame53n"]
same54n = ["device", "dep:atsame54n"]
same54p = ["device", "dep:atsame54p"]

pic32cxsg41064 = ["device", "dep:pic32cxsg41064"]
pic32cxsg41080 = ["device", "dep:pic32cxsg41080"]
pic32cxsg41100 = ["device", "dep:pic32cxsg41100"]
pic32cxsg41128 = ["device", "dep:pic32cxsg41128"]
pic32cxsg60100 = ["device", "dep:pic32cxsg60100"]
pic32cxsg60128 = ["device", "dep:pic32cxsg60128"]
pic32cxsg61100 = ["device", "dep:pic32cxsg61100"]
pic32cxsg61128 = ["device", "dep:pic32cxsg61128"]

#-------------------------------------------------------------------------------
# RT features
#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -176,6 +202,15 @@ same53n-rt = ["same53n", "atsame53n/rt"]
same54n-rt = ["same54n", "atsame54n/rt"]
same54p-rt = ["same54p", "atsame54p/rt"]

pic32cxsg41064-rt = ["device", "pic32cxsg41064/rt"]
pic32cxsg41080-rt = ["device", "pic32cxsg41080/rt"]
pic32cxsg41100-rt = ["device", "pic32cxsg41100/rt"]
pic32cxsg41128-rt = ["device", "pic32cxsg41128/rt"]
pic32cxsg60100-rt = ["device", "pic32cxsg60100/rt"]
pic32cxsg60128-rt = ["device", "pic32cxsg60128/rt"]
pic32cxsg61100-rt = ["device", "pic32cxsg61100/rt"]
pic32cxsg61128-rt = ["device", "pic32cxsg61128/rt"]

#-------------------------------------------------------------------------------
# User-selectable features
#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -206,7 +241,9 @@ usb = ["usb-device"] # Default with 2048 byte buffer
# The buffer is split between all device endpoints equally

usb-buffer-1k = ["usb"] # 1024 byte buffer shared between all USB endpoints
usb-buffer-2k = ["usb"] # 2048 byte buffer shared between all USB endpoints (Default)
usb-buffer-2k = [
"usb",
] # 2048 byte buffer shared between all USB endpoints (Default)
usb-buffer-4k = ["usb"] # 4096 byte buffer shared between all USB endpoints
usb-buffer-8k = ["usb"] # 8192 byte buffer shared between all USB endpoints

Expand Down
Loading
Loading