1
0
mirror of https://github.com/skot/ESP-Miner.git synced 2025-03-18 05:42:16 +01:00

prepare bm_serial with UART from BitaxeMax v2.2

This commit is contained in:
Georges PALAUQUI 2023-05-05 13:07:52 +02:00
parent a03edbaeeb
commit a2854654b2
3 changed files with 41 additions and 1 deletions

26
Cargo.lock generated

@ -356,6 +356,15 @@ dependencies = [
"heapless",
]
[[package]]
name = "embedded-can"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9d2e857f87ac832df68fa498d18ddc679175cf3d2e4aa893988e5601baf9438"
dependencies = [
"nb 1.1.0",
]
[[package]]
name = "embedded-dma"
version = "0.2.0"
@ -390,6 +399,16 @@ dependencies = [
"embedded-hal 1.0.0-alpha.10",
]
[[package]]
name = "embedded-hal-nb"
version = "1.0.0-alpha.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1465fffd56a95bbc105c17965bca1c1d5815027b1cc6bb183bc05d04563d065c"
dependencies = [
"embedded-hal 1.0.0-alpha.10",
"nb 1.1.0",
]
[[package]]
name = "embedded-io"
version = "0.3.1"
@ -490,9 +509,15 @@ dependencies = [
"bitflags 2.2.1",
"cfg-if",
"critical-section",
"embassy-futures",
"embassy-sync 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"embassy-time 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"embedded-can",
"embedded-dma",
"embedded-hal 0.2.7",
"embedded-hal 1.0.0-alpha.10",
"embedded-hal-async",
"embedded-hal-nb",
"esp-hal-procmacros",
"esp-synopsys-usb-otg",
"esp32s3",
@ -598,6 +623,7 @@ dependencies = [
"bare-metal",
"embassy-time 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"embedded-hal 0.2.7",
"embedded-hal-async",
"esp-hal-common",
]

@ -40,6 +40,7 @@ esp-backtrace = { version = "0.7.0", features = [
esp32s3-hal = { version = "0.9.0", package = "esp32s3-hal", features = [
"embassy",
"embassy-time-timg0",
"async",
] }
esp-println = { version = "0.5.0", features = ["esp32s3"] }
esp-wifi = { version = "0.1.0", git = "https://github.com/esp-rs/esp-wifi", rev = "c446177984b82b5e1658d6b24318e7214460ded8", features = [

@ -21,7 +21,8 @@ use esp32s3_hal::{
peripherals::Peripherals,
prelude::*,
timer::TimerGroup,
Delay, Rng, Rtc,
uart::TxRxPins,
Delay, Rng, Rtc, Uart,
};
use esp_backtrace as _;
use esp_println::println;
@ -130,6 +131,18 @@ fn main() -> ! {
bm_rst.set_high().unwrap();
println!("Release BM1397 RST with gpio1 HIGH");
// will be use to init the bm1397 chain
let _bm_serial = Uart::new_with_config(
peripherals.UART1,
None,
Some(TxRxPins::new_tx_rx(
io.pins.gpio17.into_push_pull_output(),
io.pins.gpio18.into_floating_input(),
)),
&clocks,
&mut system.peripheral_clock_control,
);
let wifi_config = Config::Dhcp(Default::default());
let wifi_seed = 1234; // very random, very secure seed