esp-hal/examples/src/bin/ieee802154_receive_frame.rs
Scott Mabin ba63beb3b2
Move binary logging to sys crate (#2183)
* Move binary logging to sys crate

* make ieee take radio clks by value

* rename wifi-logs to binary-logs and fix compilation

* update sys to use correct size types

* move rtc_clk_xtal_freq_get to esp-hal

* changelogs and migration guide

* s/wifi-logs/sys-logs/g

* activate log features for esp-wifi-sys

* ble log fix c2

* fix logs using latest sys rev

* fix warning
2024-09-19 15:19:54 +00:00

36 lines
821 B
Rust

//% CHIPS: esp32c6 esp32h2
#![no_std]
#![no_main]
use esp_backtrace as _;
use esp_hal::prelude::*;
use esp_ieee802154::{Config, Ieee802154};
use esp_println::println;
#[entry]
fn main() -> ! {
let peripherals = esp_hal::init(esp_hal::Config::default());
let mut ieee802154 = Ieee802154::new(peripherals.IEEE802154, peripherals.RADIO_CLK);
ieee802154.set_config(Config {
channel: 15,
promiscuous: false,
rx_when_idle: true,
auto_ack_rx: true,
auto_ack_tx: true,
pan_id: Some(0x4242),
short_addr: Some(0x2323),
..Default::default()
});
println!("Start receiving:");
ieee802154.start_receive();
loop {
if let Some(frame) = ieee802154.get_received() {
println!("Received {:?}\n", &frame);
}
}
}