mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-22 06:42:32 +00:00
stm32/eth: rename new_rmii to new, update metapac to fix issues with PC2_C.
This commit is contained in:
parent
42d8f3930a
commit
e613324e16
@ -68,7 +68,7 @@ rand_core = "0.6.3"
|
||||
sdio-host = "0.5.0"
|
||||
critical-section = "1.1"
|
||||
#stm32-metapac = { version = "15" }
|
||||
stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-ab2bc2a739324793656ca1640e1caee2d88df72d" }
|
||||
stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-0cb3a4fcaec702c93b3700715de796636d562b15" }
|
||||
vcell = "0.1.3"
|
||||
bxcan = "0.7.0"
|
||||
nb = "1.0.0"
|
||||
@ -89,7 +89,7 @@ critical-section = { version = "1.1", features = ["std"] }
|
||||
proc-macro2 = "1.0.36"
|
||||
quote = "1.0.15"
|
||||
#stm32-metapac = { version = "15", default-features = false, features = ["metadata"]}
|
||||
stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-ab2bc2a739324793656ca1640e1caee2d88df72d", default-features = false, features = ["metadata"]}
|
||||
stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-0cb3a4fcaec702c93b3700715de796636d562b15", default-features = false, features = ["metadata"]}
|
||||
|
||||
|
||||
[features]
|
||||
|
@ -64,7 +64,7 @@ macro_rules! config_pins {
|
||||
|
||||
impl<'d, T: Instance, P: PHY> Ethernet<'d, T, P> {
|
||||
/// Create a new RMII ethernet driver using 9 pins.
|
||||
pub fn new_rmii<const TX: usize, const RX: usize>(
|
||||
pub fn new<const TX: usize, const RX: usize>(
|
||||
queue: &'d mut PacketQueue<TX, RX>,
|
||||
peri: impl Peripheral<P = T> + 'd,
|
||||
irq: impl interrupt::typelevel::Binding<interrupt::typelevel::ETH, InterruptHandler> + 'd,
|
||||
|
@ -63,7 +63,7 @@ async fn main(spawner: Spawner) -> ! {
|
||||
let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF];
|
||||
|
||||
static PACKETS: StaticCell<PacketQueue<16, 16>> = StaticCell::new();
|
||||
let device = Ethernet::new_rmii(
|
||||
let device = Ethernet::new(
|
||||
PACKETS.init(PacketQueue::<16, 16>::new()),
|
||||
p.ETH,
|
||||
Irqs,
|
||||
|
@ -64,7 +64,7 @@ async fn main(spawner: Spawner) -> ! {
|
||||
let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF];
|
||||
|
||||
static PACKETS: StaticCell<PacketQueue<16, 16>> = StaticCell::new();
|
||||
let device = Ethernet::new_rmii(
|
||||
let device = Ethernet::new(
|
||||
PACKETS.init(PacketQueue::<16, 16>::new()),
|
||||
p.ETH,
|
||||
Irqs,
|
||||
|
@ -67,7 +67,7 @@ async fn main(spawner: Spawner) -> ! {
|
||||
let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF];
|
||||
|
||||
static PACKETS: StaticCell<PacketQueue<4, 4>> = StaticCell::new();
|
||||
let device = Ethernet::new_rmii(
|
||||
let device = Ethernet::new(
|
||||
PACKETS.init(PacketQueue::<4, 4>::new()),
|
||||
p.ETH,
|
||||
Irqs,
|
||||
|
@ -64,7 +64,7 @@ async fn main(spawner: Spawner) -> ! {
|
||||
let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF];
|
||||
|
||||
static PACKETS: StaticCell<PacketQueue<4, 4>> = StaticCell::new();
|
||||
let device = Ethernet::new_rmii(
|
||||
let device = Ethernet::new(
|
||||
PACKETS.init(PacketQueue::<4, 4>::new()),
|
||||
p.ETH,
|
||||
Irqs,
|
||||
|
@ -65,7 +65,8 @@ async fn main(spawner: Spawner) -> ! {
|
||||
let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF];
|
||||
|
||||
static PACKETS: StaticCell<PacketQueue<16, 16>> = StaticCell::new();
|
||||
let device = Ethernet::new_rmii(
|
||||
|
||||
let device = Ethernet::new(
|
||||
PACKETS.init(PacketQueue::<16, 16>::new()),
|
||||
p.ETH,
|
||||
Irqs,
|
||||
|
@ -71,7 +71,6 @@ async fn main(spawner: Spawner) {
|
||||
const PACKET_QUEUE_SIZE: usize = 4;
|
||||
|
||||
static PACKETS: StaticCell<PacketQueue<PACKET_QUEUE_SIZE, PACKET_QUEUE_SIZE>> = StaticCell::new();
|
||||
#[cfg(not(eth_v2))]
|
||||
let device = Ethernet::new(
|
||||
PACKETS.init(PacketQueue::<PACKET_QUEUE_SIZE, PACKET_QUEUE_SIZE>::new()),
|
||||
p.ETH,
|
||||
@ -91,26 +90,6 @@ async fn main(spawner: Spawner) {
|
||||
GenericSMI::new(0),
|
||||
mac_addr,
|
||||
);
|
||||
#[cfg(eth_v2)]
|
||||
let device = Ethernet::new_rmii(
|
||||
PACKETS.init(PacketQueue::<PACKET_QUEUE_SIZE, PACKET_QUEUE_SIZE>::new()),
|
||||
p.ETH,
|
||||
Irqs,
|
||||
p.PA1,
|
||||
p.PA2,
|
||||
p.PC1,
|
||||
p.PA7,
|
||||
p.PC4,
|
||||
p.PC5,
|
||||
p.PG13,
|
||||
#[cfg(not(feature = "stm32h563zi"))]
|
||||
p.PB13,
|
||||
#[cfg(feature = "stm32h563zi")]
|
||||
p.PB15,
|
||||
p.PG11,
|
||||
GenericSMI::new(0),
|
||||
mac_addr,
|
||||
);
|
||||
|
||||
let config = embassy_net::Config::dhcpv4(Default::default());
|
||||
//let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 {
|
||||
|
Loading…
Reference in New Issue
Block a user