Skip to main content

init_ask_driver

Macro init_ask_driver 

Source
macro_rules! init_ask_driver {
    ($tx:ty, $rx:ty, $ptt:ty) => { ... };
}
Expand description

Declares a static global ASK_DRIVER instance protected by a critical_section mutex.

This macro creates a static singleton ASK_DRIVER suitable for use in interrupt-based environments, where both the main thread and an ISR need to safely access the shared driver state.

§Arguments

  • $tx: The concrete type of the TX pin (must implement OutputPin)
  • $rx: The concrete type of the RX pin (must implement InputPin)
  • $ptt: The concrete type of the PRR pin (must implement OutputPin). NOTE: While you might not have a PTT pin, it is imperative that you pass a type here.

§Example

use ask433::init_ask_driver;
use embedded_hal_mock::eh1::digital::{Mock as Pin};
init_ask_driver!(Pin, Pin, Pin);