hp-core: add wifi connection
Signed-off-by: Thomas Klaehn <thomas.klaehn@perinet.io>
This commit is contained in:
parent
14fe370083
commit
b87e6c552f
@ -7,5 +7,10 @@ target = "riscv32imac-unknown-none-elf"
|
|||||||
[target.'cfg(target_arch = "riscv32")']
|
[target.'cfg(target_arch = "riscv32")']
|
||||||
runner = "espflash flash --monitor"
|
runner = "espflash flash --monitor"
|
||||||
|
|
||||||
|
[env]
|
||||||
|
ESP_LOG = "info"
|
||||||
|
SSID = "tkl"
|
||||||
|
PASSWORD = "hosenmuchte"
|
||||||
|
|
||||||
[unstable]
|
[unstable]
|
||||||
build-std = ["core"]
|
build-std = ["alloc", "core"]
|
||||||
|
115
Cargo.lock
generated
115
Cargo.lock
generated
@ -574,17 +574,6 @@ version = "0.1.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970"
|
checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "embassy-usb-synopsys-otg"
|
|
||||||
version = "0.2.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "08e753b23799329780c7ac434264026d0422044d6649ed70a73441b14a6436d7"
|
|
||||||
dependencies = [
|
|
||||||
"critical-section",
|
|
||||||
"embassy-sync 0.6.2",
|
|
||||||
"embassy-usb-driver",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "embedded-can"
|
name = "embedded-can"
|
||||||
version = "0.4.1"
|
version = "0.4.1"
|
||||||
@ -747,7 +736,6 @@ checksum = "3c83ca63fd02ca40644ae91ae63362e3a6e7f53458f6c1356decf892343d2418"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"esp-build 0.2.0",
|
"esp-build 0.2.0",
|
||||||
"esp-println",
|
"esp-println",
|
||||||
"semihosting",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -799,8 +787,6 @@ dependencies = [
|
|||||||
"embassy-embedded-hal",
|
"embassy-embedded-hal",
|
||||||
"embassy-futures",
|
"embassy-futures",
|
||||||
"embassy-sync 0.6.2",
|
"embassy-sync 0.6.2",
|
||||||
"embassy-usb-driver",
|
|
||||||
"embassy-usb-synopsys-otg",
|
|
||||||
"embedded-can",
|
"embedded-can",
|
||||||
"embedded-hal 1.0.0",
|
"embedded-hal 1.0.0",
|
||||||
"embedded-hal-async",
|
"embedded-hal-async",
|
||||||
@ -813,14 +799,7 @@ dependencies = [
|
|||||||
"esp-hal-procmacros 0.16.0",
|
"esp-hal-procmacros 0.16.0",
|
||||||
"esp-metadata",
|
"esp-metadata",
|
||||||
"esp-riscv-rt",
|
"esp-riscv-rt",
|
||||||
"esp-synopsys-usb-otg",
|
|
||||||
"esp32",
|
|
||||||
"esp32c2",
|
|
||||||
"esp32c3",
|
|
||||||
"esp32c6",
|
"esp32c6",
|
||||||
"esp32h2",
|
|
||||||
"esp32s2",
|
|
||||||
"esp32s3",
|
|
||||||
"fugit",
|
"fugit",
|
||||||
"instability",
|
"instability",
|
||||||
"log",
|
"log",
|
||||||
@ -832,7 +811,6 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
"strum",
|
"strum",
|
||||||
"ufmt-write",
|
"ufmt-write",
|
||||||
"usb-device",
|
|
||||||
"void",
|
"void",
|
||||||
"xtensa-lx",
|
"xtensa-lx",
|
||||||
"xtensa-lx-rt",
|
"xtensa-lx-rt",
|
||||||
@ -974,19 +952,6 @@ dependencies = [
|
|||||||
"esp-build 0.1.0",
|
"esp-build 0.1.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "esp-synopsys-usb-otg"
|
|
||||||
version = "0.4.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "8938451cb19032f13365328ea66ab38c8d16deecdf322067442297110eb74468"
|
|
||||||
dependencies = [
|
|
||||||
"critical-section",
|
|
||||||
"embedded-hal 0.2.7",
|
|
||||||
"ral-registers",
|
|
||||||
"usb-device",
|
|
||||||
"vcell",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "esp-wifi"
|
name = "esp-wifi"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
@ -996,8 +961,11 @@ dependencies = [
|
|||||||
"cfg-if",
|
"cfg-if",
|
||||||
"critical-section",
|
"critical-section",
|
||||||
"document-features",
|
"document-features",
|
||||||
|
"embassy-net-driver",
|
||||||
|
"embassy-sync 0.6.2",
|
||||||
"embedded-io",
|
"embedded-io",
|
||||||
"embedded-io-async",
|
"embedded-io-async",
|
||||||
|
"enumset",
|
||||||
"esp-alloc",
|
"esp-alloc",
|
||||||
"esp-build 0.2.0",
|
"esp-build 0.2.0",
|
||||||
"esp-config",
|
"esp-config",
|
||||||
@ -1013,7 +981,7 @@ dependencies = [
|
|||||||
"portable-atomic",
|
"portable-atomic",
|
||||||
"portable_atomic_enum",
|
"portable_atomic_enum",
|
||||||
"rand_core",
|
"rand_core",
|
||||||
"xtensa-lx-rt",
|
"smoltcp",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -1026,36 +994,6 @@ dependencies = [
|
|||||||
"log",
|
"log",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "esp32"
|
|
||||||
version = "0.35.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "19d3bff1d268a4b8d34b494c0e88466cd59a827bb330189773db299ff525ea13"
|
|
||||||
dependencies = [
|
|
||||||
"critical-section",
|
|
||||||
"vcell",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "esp32c2"
|
|
||||||
version = "0.24.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "0285be5b9dc4018d7f31fefe4c3d17f56461ef3ab46300ea1bf9d760968957f0"
|
|
||||||
dependencies = [
|
|
||||||
"critical-section",
|
|
||||||
"vcell",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "esp32c3"
|
|
||||||
version = "0.27.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "61655d48e45039dfac5ae769581fb50ea7f61dea3227b4b744a1a900d03fbbd4"
|
|
||||||
dependencies = [
|
|
||||||
"critical-section",
|
|
||||||
"vcell",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "esp32c6"
|
name = "esp32c6"
|
||||||
version = "0.18.0"
|
version = "0.18.0"
|
||||||
@ -1076,36 +1014,6 @@ dependencies = [
|
|||||||
"vcell",
|
"vcell",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "esp32h2"
|
|
||||||
version = "0.14.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a05aafc25d8c68ce504d8025750fc37915a2fc7d2605be3d3b51f8886a43411a"
|
|
||||||
dependencies = [
|
|
||||||
"critical-section",
|
|
||||||
"vcell",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "esp32s2"
|
|
||||||
version = "0.26.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "0eb30ae371e72436629a70affedd1e3570829f16a3b718d6ec96508791d9da5e"
|
|
||||||
dependencies = [
|
|
||||||
"critical-section",
|
|
||||||
"vcell",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "esp32s3"
|
|
||||||
version = "0.30.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "9f0ab39d5ae3b61b3a83f5616a03220a7dc9c4d6e4ed16d2da73d50bf8d798d7"
|
|
||||||
dependencies = [
|
|
||||||
"critical-section",
|
|
||||||
"vcell",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fnv"
|
name = "fnv"
|
||||||
version = "1.0.7"
|
version = "1.0.7"
|
||||||
@ -1692,9 +1600,6 @@ name = "portable-atomic"
|
|||||||
version = "1.10.0"
|
version = "1.10.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6"
|
checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6"
|
||||||
dependencies = [
|
|
||||||
"critical-section",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "portable_atomic_enum"
|
name = "portable_atomic_enum"
|
||||||
@ -1796,12 +1701,6 @@ version = "1.0.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bd7a31eed1591dcbc95d92ad7161908e72f4677f8fabf2a32ca49b4237cbf211"
|
checksum = "bd7a31eed1591dcbc95d92ad7161908e72f4677f8fabf2a32ca49b4237cbf211"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ral-registers"
|
|
||||||
version = "0.1.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "46b71a9d9206e8b46714c74255adcaea8b11e0350c1d8456165073c3f75fc81a"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rand_core"
|
name = "rand_core"
|
||||||
version = "0.6.4"
|
version = "0.6.4"
|
||||||
@ -1886,12 +1785,6 @@ version = "0.12.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6"
|
checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "semihosting"
|
|
||||||
version = "0.1.18"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "5d00d0037a88d97379cc27d815a471350923a1dc5880d5325c49695edcdc0d37"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "semver"
|
name = "semver"
|
||||||
version = "1.0.25"
|
version = "1.0.25"
|
||||||
|
@ -25,12 +25,12 @@ embedded-io-async = "0.6.1"
|
|||||||
embedded-storage = "0.3.1"
|
embedded-storage = "0.3.1"
|
||||||
esp-alloc = "0.6.0"
|
esp-alloc = "0.6.0"
|
||||||
esp-backtrace = { version = "0.15.0", features = ["esp32c6", "exception-handler", "panic-handler", "println"] }
|
esp-backtrace = { version = "0.15.0", features = ["esp32c6", "exception-handler", "panic-handler", "println"] }
|
||||||
esp-hal = { version = "0.23.1", features = ["log"] }
|
esp-hal = { version = "0.23.1", features = ["esp32c6", "log"] }
|
||||||
esp-hal-embassy = { version = "0.6.0", optional = true }
|
esp-hal-embassy = { version = "0.6.0", optional = true }
|
||||||
esp-ieee802154 = { version = "0.5.0", optional = true }
|
esp-ieee802154 = { version = "0.5.0", optional = true }
|
||||||
esp-println = { version = "0.13.0", features = ["log"] }
|
esp-println = { version = "0.13.0", features = ["log"] }
|
||||||
esp-storage = { version = "0.4.0", optional = true }
|
esp-storage = { version = "0.4.0", optional = true }
|
||||||
esp-wifi = { version = "0.12.0", features = ["log"], optional = true }
|
esp-wifi = { version = "0.12.0", features = ["log", "utils", "wifi"] }
|
||||||
heapless = "0.8.0"
|
heapless = "0.8.0"
|
||||||
hmac = { version = "0.12.1", default-features = false }
|
hmac = { version = "0.12.1", default-features = false }
|
||||||
ieee80211 = { version = "0.4.0", default-features = false }
|
ieee80211 = { version = "0.4.0", default-features = false }
|
||||||
@ -52,14 +52,8 @@ edge-nal-embassy = { version = "0.5.0" }
|
|||||||
[features]
|
[features]
|
||||||
default=["esp32c6"]
|
default=["esp32c6"]
|
||||||
|
|
||||||
esp32 = ["esp-hal/esp32", "esp-backtrace/esp32", "esp-hal-embassy?/esp32", "esp-println/esp32", "esp-storage?/esp32", "esp-wifi?/esp32"]
|
esp32c6 = ["esp-hal/esp32c6", "esp-backtrace/esp32c6", "esp-hal-embassy?/esp32c6", "esp-println/esp32c6", "esp-storage?/esp32c6", "esp-wifi/esp32c6", "esp-ieee802154?/esp32c6"]
|
||||||
esp32c2 = ["esp-hal/esp32c2", "esp-backtrace/esp32c2", "esp-hal-embassy?/esp32c2", "esp-println/esp32c2", "esp-storage?/esp32c2", "esp-wifi?/esp32c2", ]
|
|
||||||
esp32c3 = ["esp-hal/esp32c3", "esp-backtrace/esp32c3", "esp-hal-embassy?/esp32c3", "esp-println/esp32c3", "esp-storage?/esp32c3", "esp-wifi?/esp32c3"]
|
|
||||||
esp32c6 = ["esp-hal/esp32c6", "esp-backtrace/esp32c6", "esp-hal-embassy?/esp32c6", "esp-println/esp32c6", "esp-storage?/esp32c6", "esp-wifi?/esp32c6", "esp-ieee802154?/esp32c6"]
|
|
||||||
esp32h2 = ["esp-hal/esp32h2", "esp-backtrace/esp32h2", "esp-hal-embassy?/esp32h2", "esp-println/esp32h2", "esp-storage?/esp32h2", "esp-wifi?/esp32h2", "esp-ieee802154?/esp32h2"]
|
|
||||||
esp32s2 = ["esp-hal/esp32s2", "esp-backtrace/esp32s2", "esp-hal-embassy?/esp32s2", "esp-println/esp32s2", "esp-storage?/esp32s2", "esp-wifi?/esp32s2"]
|
|
||||||
esp32s3 = ["esp-hal/esp32s3", "esp-backtrace/esp32s3", "esp-hal-embassy?/esp32s3", "esp-println/esp32s3", "esp-storage?/esp32s3", "esp-wifi?/esp32s3"]
|
|
||||||
|
|
||||||
esp-wifi = ["dep:esp-wifi"]
|
# esp-wifi = ["dep:esp-wifi"]
|
||||||
|
|
||||||
embassy = ["dep:esp-hal-embassy"]
|
# embassy = ["dep:esp-hal-embassy"]
|
||||||
|
@ -1,45 +1,149 @@
|
|||||||
//! This shows a very basic example of running code on the LP core.
|
|
||||||
//!
|
|
||||||
//! Code on LP core increments a counter and continuously toggles LED. The
|
|
||||||
//! current value is printed by the HP core.
|
|
||||||
//!
|
|
||||||
//! Make sure to first compile the `esp-lp-hal/examples/blinky.rs` example
|
|
||||||
//!
|
|
||||||
//! The following wiring is assumed:
|
|
||||||
//! - LED => GPIO1
|
|
||||||
|
|
||||||
//% CHIPS: esp32c6
|
|
||||||
//% FEATURES: esp-hal/unstable
|
|
||||||
|
|
||||||
#![no_std]
|
#![no_std]
|
||||||
#![no_main]
|
#![no_main]
|
||||||
|
|
||||||
|
extern crate alloc;
|
||||||
|
|
||||||
|
use blocking_network_stack::Stack;
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_hal::{
|
use esp_hal::{
|
||||||
gpio::lp_io::{LowPowerInput, LowPowerOutput},
|
clock::CpuClock,
|
||||||
|
gpio::lp_io::{
|
||||||
|
LowPowerInput,
|
||||||
|
LowPowerOutput},
|
||||||
load_lp_code,
|
load_lp_code,
|
||||||
lp_core::{LpCore, LpCoreWakeupSource},
|
lp_core::{
|
||||||
|
LpCore,
|
||||||
|
LpCoreWakeupSource
|
||||||
|
},
|
||||||
main,
|
main,
|
||||||
rtc_cntl::{sleep::WakeFromLpCoreWakeupSource, Rtc},
|
rng::Rng,
|
||||||
uart::{Config, lp_uart::LpUart}
|
// rtc_cntl::{
|
||||||
|
// sleep::WakeFromLpCoreWakeupSource,
|
||||||
|
// Rtc
|
||||||
|
// },
|
||||||
|
time::{
|
||||||
|
self
|
||||||
|
},
|
||||||
|
timer::timg::TimerGroup,
|
||||||
|
uart::{
|
||||||
|
Config,
|
||||||
|
lp_uart::LpUart
|
||||||
|
}
|
||||||
};
|
};
|
||||||
use esp_println::{print, println};
|
use esp_println::{
|
||||||
|
print,
|
||||||
|
println
|
||||||
|
};
|
||||||
|
use esp_wifi::{
|
||||||
|
init,
|
||||||
|
wifi::{
|
||||||
|
utils::create_network_interface,
|
||||||
|
AccessPointInfo,
|
||||||
|
ClientConfiguration,
|
||||||
|
Configuration,
|
||||||
|
WifiError,
|
||||||
|
WifiStaDevice,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
use smoltcp::{
|
||||||
|
iface::{
|
||||||
|
SocketSet,
|
||||||
|
SocketStorage
|
||||||
|
},
|
||||||
|
wire::DhcpOption
|
||||||
|
};
|
||||||
|
|
||||||
|
const SSID: &str = env!("SSID");
|
||||||
|
const PASSWORD: &str = env!("PASSWORD");
|
||||||
|
|
||||||
|
fn as_millis() -> u64 {
|
||||||
|
time::now().duration_since_epoch().to_millis()
|
||||||
|
}
|
||||||
|
|
||||||
#[main]
|
#[main]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
let peripherals = esp_hal::init(esp_hal::Config::default());
|
esp_println::logger::init_logger_from_env();
|
||||||
|
let config = esp_hal::Config::default().with_cpu_clock(CpuClock::max());
|
||||||
|
let peripherals = esp_hal::init(config);
|
||||||
|
|
||||||
|
esp_alloc::heap_allocator!(72 * 1024);
|
||||||
|
let timg0 = TimerGroup::new(peripherals.TIMG0);
|
||||||
|
let mut rng = Rng::new(peripherals.RNG);
|
||||||
|
let init = init(timg0.timer0, rng, peripherals.RADIO_CLK).unwrap();
|
||||||
|
let mut wifi = peripherals.WIFI;
|
||||||
|
let (iface, device, mut controller) =
|
||||||
|
create_network_interface(&init, &mut wifi, WifiStaDevice).unwrap();
|
||||||
|
controller
|
||||||
|
.set_power_saving(esp_wifi::config::PowerSaveMode::None)
|
||||||
|
.unwrap();
|
||||||
|
let mut socket_set_entries: [SocketStorage; 3] = Default::default();
|
||||||
|
let mut socket_set = SocketSet::new(&mut socket_set_entries[..]);
|
||||||
|
let mut dhcp_socket = smoltcp::socket::dhcpv4::Socket::new();
|
||||||
|
// we can set a hostname here (or add other DHCP options)
|
||||||
|
dhcp_socket.set_outgoing_options(&[DhcpOption {
|
||||||
|
kind: 12,
|
||||||
|
data: b"esp32-c6",
|
||||||
|
}]);
|
||||||
|
socket_set.add(dhcp_socket);
|
||||||
|
|
||||||
|
let stack = Stack::new(iface, device, socket_set, as_millis, rng.random());
|
||||||
|
let client_config = Configuration::Client(ClientConfiguration {
|
||||||
|
ssid: SSID.try_into().unwrap(),
|
||||||
|
password: PASSWORD.try_into().unwrap(),
|
||||||
|
..Default::default()
|
||||||
|
});
|
||||||
|
let res = controller.set_configuration(&client_config);
|
||||||
|
println!("wifi_set_configuration returned {:?}", res);
|
||||||
|
|
||||||
|
controller.start().unwrap();
|
||||||
|
println!("is wifi started: {:?}", controller.is_started());
|
||||||
|
|
||||||
|
println!("Start Wifi Scan");
|
||||||
|
let res: Result<(heapless::Vec<AccessPointInfo, 10>, usize), WifiError> = controller.scan_n();
|
||||||
|
if let Ok((res, _count)) = res {
|
||||||
|
for ap in res {
|
||||||
|
println!("{:?}", ap.ssid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
println!("{:?}", controller.capabilities());
|
||||||
|
println!("wifi_connect {:?}", controller.connect());
|
||||||
|
|
||||||
|
// wait to get connected
|
||||||
|
println!("Wait to get connected");
|
||||||
|
loop {
|
||||||
|
match controller.is_connected() {
|
||||||
|
Ok(true) => break,
|
||||||
|
Ok(false) => {}
|
||||||
|
Err(err) => {
|
||||||
|
println!("{:?}", err);
|
||||||
|
// FIXME: Error handling
|
||||||
|
loop {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
println!("{:?}", controller.is_connected());
|
||||||
|
|
||||||
|
// wait for getting an ip address
|
||||||
|
println!("Wait to get an ip address");
|
||||||
|
loop {
|
||||||
|
stack.work();
|
||||||
|
|
||||||
|
if stack.is_iface_up() {
|
||||||
|
println!("got ip {:?}", stack.get_ip_info());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let lp_pin = LowPowerOutput::new(peripherals.GPIO1);
|
let lp_pin = LowPowerOutput::new(peripherals.GPIO1);
|
||||||
|
|
||||||
let uart_cfg = Config::default();
|
let uart_cfg = Config::default();
|
||||||
let tx = LowPowerOutput::new(peripherals.GPIO5);
|
let tx = LowPowerOutput::new(peripherals.GPIO5);
|
||||||
let rx = LowPowerInput::new(peripherals.GPIO4);
|
let rx = LowPowerInput::new(peripherals.GPIO4);
|
||||||
let lp_uart = LpUart::new(peripherals.LP_UART, uart_cfg, tx, rx);
|
let lp_uart = LpUart::new(peripherals.LP_UART, uart_cfg, tx, rx);
|
||||||
|
// let mut rtc = Rtc::new(peripherals.LPWR);
|
||||||
let mut rtc = Rtc::new(peripherals.LPWR);
|
// let reason = WakeFromLpCoreWakeupSource::default();
|
||||||
let reason = WakeFromLpCoreWakeupSource::default();
|
|
||||||
|
|
||||||
let mut lp_core = LpCore::new(peripherals.LP_CORE);
|
let mut lp_core = LpCore::new(peripherals.LP_CORE);
|
||||||
|
|
||||||
lp_core.stop();
|
lp_core.stop();
|
||||||
println!("lp-core -> stop");
|
println!("lp-core -> stop");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user