[][src]Crate metro_m4

Re-exports

pub extern crate atsamd_hal as hal;
pub use hal::target_device as pac;

Modules

calibration

NVM Software Calibration Area Mapping

clock

Configuring the system clock sources. You will typically need to create an instance of GenericClockController before you can set up most of the peripherals on the atsamd51 device. The other types in this module are used to enforce at compile time that the peripherals have been correctly configured.

delay

Delays

gpio

Working with GPIO pins. The pins are associated with the PORT hardware. This module defines a split method on the PORT type that is used to safely reference the individual pin configuration. The IO pins can be switched into alternate function modes, which routes the pins to different peripherals depending on the mode for the pin. The pin configuration is reflected through the use of type states to make the interface (ideally, or at least practically) impossible to misuse.

pad
prelude

Import the prelude to gain convenient access to helper traits

pwm
sercom

Working with the SERCOM peripherals.

time

Time units

timer

Working with timer counter hardware

trng
watchdog

Structs

Pins

Maps the pins to their arduino names and the numbers printed on the board.

Enums

ResetCause

ResetCause represents the reason the MCU was reset.

Functions

i2c_master

Convenience for setting up the labelled SDA, SCL pins to operate as an I2C master running at the specified frequency.

reset_cause

Returns the cause of the last reset.

serial_number

Returns the serial number of the chip as an array of bytes. The serial number is only guaranteed to be unique if all 16 bytes are used.

spi_master

Convenience for setting up the 2x3 header block for SPI. This powers up SERCOM2 and configures it for use as an SPI Master in SPI Mode 0. Unlike the flash_spi_master function, this one does not accept a CS pin; configuring a pin for CS is the responsibility of the caller, because it could be any OutputPin, or even a pulled up line on the slave.

split_serial_number

Returns the serial number of the chip as 4 32-bit integers. The serial number is only guaranteed to be unique if all 128 bits are used.

uart

Convenience for setting up the labelled RX, TX pins to operate as a UART device running at the specified baud.

Attribute Macros

entry

Attribute to declare the entry point of the program