# [−][src]Crate cortex_m

Low level access to Cortex-M processors

This crate provides:

- Access to core peripherals like NVIC, SCB and SysTick.
- Access to core registers like CONTROL, MSP and PSR.
- Interrupt manipulation mechanisms
- Safe wrappers around Cortex-M specific instructions like `bkpt`

# Optional features

## `inline-asm`

When this feature is enabled the implementation of all the functions inside the `asm` and `register` modules use inline assembly (`asm!`) instead of external assembly (FFI into separate assembly files pre-compiled using `arm-none-eabi-gcc`). The advantages of enabling `inline-asm` are:

- Reduced overhead. FFI eliminates the possibility of inlining so all operations include a function call overhead when `inline-asm` is not enabled.

- Some of the `register` API only becomes available only when `inline-asm` is enabled. Check the API docs for details.

The disadvantage is that `inline-asm` requires a nightly toolchain.

## `const-fn`

Enabling this feature turns the `Mutex.new` constructor into a `const fn`.

This feature requires a nightly toolchain.

## Re-exports

`pub use peripheral::Peripherals;`

## Modules

asm | Miscellaneous assembly instructions
interrupt | Interrupts
itm | Instrumentation Trace Macrocell
peripheral | Core peripherals
register | Processor core registers

## Macros

iprint | Macro for sending a formatted string through an ITM channel
iprintln | Macro for sending a formatted string through an ITM channel, with a newline.
singleton | Macro to create a mutable reference to a statically allocated value

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)