Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
e015806
wip: initial implementation of transmission only.
alexbohm Sep 7, 2022
b8ec8b4
Moved TWAI to its own directory and added initial reception of packets.
alexbohm Sep 8, 2022
c8a2291
Added extended id transmit and receive.
alexbohm Sep 9, 2022
0e5e04f
Added maybe better code for making packet filters.
alexbohm Sep 11, 2022
69613cc
Fixed bug with ids and improved methods of copying data to the periph…
alexbohm Sep 12, 2022
c9404bc
Added some guards against Bus Off
alexbohm Sep 13, 2022
d675ac9
Added reception of remote frames.
alexbohm Sep 18, 2022
e08ef1f
Clean up of comments, etc
alexbohm Sep 18, 2022
cd343de
Updated TWAI naming and cleaned up example a bit.
alexbohm Sep 21, 2022
336e104
Updated bitselector to include better unpacking methods.
alexbohm Sep 29, 2022
3e4a46b
Add embedded-can and limit initial TWAI implementation to esp32c3.
alexbohm Nov 10, 2022
b28bb96
Added embedded-can to esp32c3 twai example.
alexbohm Nov 10, 2022
0389fe8
Switched twai filter to using bytestrings.
alexbohm Nov 12, 2022
f26d19a
Implemented new() for twai filters.
alexbohm Nov 13, 2022
3553a0c
Clean up TWAI docs and example.
alexbohm Nov 17, 2022
fc7a428
Fix filter constructors and add examples.
alexbohm Nov 18, 2022
54b5e5d
pre driver PeripheralRef update.
alexbohm Dec 17, 2022
2b6778d
PeripheralRef/twai
alexbohm Dec 17, 2022
a8e875e
Format comments with nightly rustfmt.
alexbohm Dec 17, 2022
d18a5cc
Add gpio PeripheralRef and use volatile for direct register access.
alexbohm Dec 22, 2022
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
3 changes: 2 additions & 1 deletion esp-hal-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ critical-section = "1.1.1"
embedded-hal = { version = "0.2.7", features = ["unproven"] }
embedded-hal-1 = { version = "=1.0.0-alpha.9", optional = true, package = "embedded-hal" }
embedded-hal-nb = { version = "=1.0.0-alpha.1", optional = true }
embedded-can = { version = "0.4.1", optional = true }
fugit = "0.3.6"
lock_api = { version = "0.4.9", optional = true }
nb = "1.0.0"
Expand Down Expand Up @@ -67,7 +68,7 @@ esp32c2_40mhz = []
esp32c2_26mhz = []

# Implement the `embedded-hal==1.0.0-alpha.x` traits
eh1 = ["embedded-hal-1", "embedded-hal-nb"]
eh1 = ["embedded-hal-1", "embedded-hal-nb", "embedded-can"]

# To use the external `smart_led` crate
smartled = ["smart-leds-trait"]
Expand Down
2 changes: 2 additions & 0 deletions esp-hal-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ pub mod system;
#[cfg(systimer)]
pub mod systimer;
pub mod timer;
#[cfg(any(esp32c3))]
pub mod twai;
pub mod uart;
#[cfg(usb_serial_jtag)]
pub mod usb_serial_jtag;
Expand Down
1 change: 1 addition & 0 deletions esp-hal-common/src/peripherals/esp32c3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@ mod peripherals {
TIMG0,
TIMG1,
APB_SARADC,
TWAI,
}
}
7 changes: 7 additions & 0 deletions esp-hal-common/src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ pub enum Peripheral {
I2s1,
#[cfg(usb_otg)]
Usb,
#[cfg(any(esp32c3))]
Twai,
}

/// Controls the enablement of peripheral clocks.
Expand Down Expand Up @@ -149,6 +151,11 @@ impl PeripheralClockControl {
perip_clk_en0.modify(|_, w| w.usb_clk_en().set_bit());
perip_rst_en0.modify(|_, w| w.usb_rst().clear_bit());
}
#[cfg(any(esp32c3))]
Peripheral::Twai => {
perip_clk_en0.modify(|_, w| w.can_clk_en().set_bit());
perip_rst_en0.modify(|_, w| w.can_rst().clear_bit());
}
}
}
}
Expand Down
Loading