Crate arduino_hal

source ·
Expand description


Common HAL (hardware abstraction layer) for Arduino boards.

Note: This version of the documentation was built for Arduino Uno. This means that only items which are available for this board are visible. If you are using a different board, try building the documentation locally with

cargo doc --open

in your project (where arduino-hal is included with the feature-flag for your board).


For setting up a new project, the avr-hal-template is the recommended baseline. Applications should be built ontop of the following skeleton:


use panic_halt as _;

fn main() -> ! {
    let dp = arduino_hal::Peripherals::take().unwrap();
    let pins = arduino_hal::pins!(dp);

    loop { }

For examples, please check the avr-hal examples:




  • Convenience macro to instantiate the Usart driver for this board.
  • Convenience macro to instantiate the Pins struct for this board.


  • Delay execution for a number of milliseconds.
  • Delay execution for a number of microseconds.

Type Aliases§

  • Default clock speed for this board.
  • Delay type for embedded-hal compatibility.

Attribute Macros§

  • Attribute to declare the entry point of the program