Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

Commit 05096d6

Browse files
authored
Merge pull request #15 from jessebraham/feature/chip-support
Add support for the ESP32-C6
2 parents 869afb2 + a175463 commit 05096d6

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ default = ["uart"]
2626
esp32 = []
2727
esp32c2 = []
2828
esp32c3 = []
29+
esp32c6 = []
2930
esp32s2 = []
3031
esp32s3 = []
3132
esp8266 = []
3233

3334
# You must enable exactly 1 of the below features to enable to intended
3435
# communication method (note that "uart" is enabled by default):
3536
uart = []
36-
jtag_serial = [] # C3 + S3 only!
37+
jtag_serial = [] # C3, C6, and S3 only!
3738
rtt = []

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Provides `print!` and `println!` implementations various Espressif devices.
44

5-
- Supports ESP32, ESP32-C2, ESP32-C3, ESP32-S2, ESP32-S3, and ESP8266
5+
- Supports ESP32, ESP32-C2, ESP32-C3, ESP32-C6, ESP32-S2, ESP32-S3, and ESP8266
66
- Dependency free (not even depending on `esp-hal`, one optional dependency is `log`, another is `critical-section`)
77
- Supports JTAG-Serial output where available
88
- Supports RTT (lacking working RTT hosts besides _probe-rs_ for ESP32-C3)

build.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ fn main() {
44
cfg!(feature = "esp32"),
55
cfg!(feature = "esp32c2"),
66
cfg!(feature = "esp32c3"),
7+
cfg!(feature = "esp32c6"),
78
cfg!(feature = "esp32s2"),
89
cfg!(feature = "esp32s3"),
910
cfg!(feature = "esp8266"),
@@ -28,9 +29,13 @@ fn main() {
2829
),
2930
}
3031

31-
// Ensure that, if the `jtag_serial` communication method feature is
32-
// enabled, either the `esp32c3` or `esp32s3` chip feature is enabled.
33-
if cfg!(feature = "jtag_serial") && !(cfg!(feature = "esp32c3") || cfg!(feature = "esp32s3")) {
34-
panic!("The `jtag_serial` feature is only supported by the ESP32-C3 and ESP32-S3");
32+
// Ensure that, if the `jtag_serial` communication method feature is enabled,
33+
// either the `esp32c3`, `esp32c6` or `esp32s3` chip feature is enabled.
34+
if cfg!(feature = "jtag_serial")
35+
&& !(cfg!(feature = "esp32c3") || cfg!(feature = "esp32c6") || cfg!(feature = "esp32s3"))
36+
{
37+
panic!(
38+
"The `jtag_serial` feature is only supported by the ESP32-C3, ESP32-C6, and ESP32-S3"
39+
);
3540
}
3641
}

src/lib.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub mod logger;
2525

2626
#[cfg(feature = "esp32")]
2727
const UART_TX_ONE_CHAR: usize = 0x40009200;
28-
#[cfg(feature = "esp32c2")]
28+
#[cfg(any(feature = "esp32c2", feature = "esp32c6"))]
2929
const UART_TX_ONE_CHAR: usize = 0x40000058;
3030
#[cfg(feature = "esp32c3")]
3131
const UART_TX_ONE_CHAR: usize = 0x40000068;
@@ -81,12 +81,20 @@ const SERIAL_JTAG_FIFO_REG: usize = 0x6004_3000;
8181
#[cfg(all(feature = "jtag_serial", feature = "esp32c3"))]
8282
const SERIAL_JTAG_CONF_REG: usize = 0x6004_3004;
8383

84+
#[cfg(all(feature = "jtag_serial", feature = "esp32c6"))]
85+
const SERIAL_JTAG_FIFO_REG: usize = 0x6000_F000;
86+
#[cfg(all(feature = "jtag_serial", feature = "esp32c6"))]
87+
const SERIAL_JTAG_CONF_REG: usize = 0x6000_F004;
88+
8489
#[cfg(all(feature = "jtag_serial", feature = "esp32s3"))]
8590
const SERIAL_JTAG_FIFO_REG: usize = 0x6003_8000;
8691
#[cfg(all(feature = "jtag_serial", feature = "esp32s3"))]
8792
const SERIAL_JTAG_CONF_REG: usize = 0x6003_8004;
8893

89-
#[cfg(all(feature = "jtag_serial", any(feature = "esp32c3", feature = "esp32s3")))]
94+
#[cfg(all(
95+
feature = "jtag_serial",
96+
any(feature = "esp32c3", feature = "esp32c6", feature = "esp32s3")
97+
))]
9098
impl core::fmt::Write for Printer {
9199
fn write_str(&mut self, s: &str) -> core::fmt::Result {
92100
with(|| {

0 commit comments

Comments
 (0)