Expand description
In the prelude, we export helper macros.
Macros§
- access_
global - Syntax helper for getting global variables of the form
Mutex<RefCell<Option>>>
from an interrupt-free context - eg in interrupt handlers. - access_
globals - Similar to
access_global
, but combining multiple calls. - copy_be
- Syntax helper for converting primitives to multi-byte fields.
- copy_le
- Syntax helper for converting primitives to multi-byte fields.
- init_
globals - Initialize one or more globals inside a critical section.
- make_
globals - Syntax helper for setting global variables of the form
Mutex<RefCell<Option>>>
. eg in interrupt handlers. Ideal for non-copy-type variables that can’t be initialized immediatiately. - make_
simple_ globals - Syntax helper for setting global variables of the form
Mutex<Cell<>>>
. eg in interrupt handlers. Ideal for copy-type variables. - parse_
be - Syntax helper for parsing multi-byte fields into primitives.
- parse_
le - Syntax helper for parsing multi-byte fields into primitives.
- setup_
nvic - Automates Cortex-M NVIC setup. The second value is NVIC priority; lower is higher priority. Example use: setup_nvic!([ (TIM2, 6), (TIM3, 7), (EXTI0, 4), ], cp);