pub fn instances() -> Instances
Expand description
Acquire peripheral instances.
These are the resources supplied to a resource constructor. They can also be used to initialize your own drivers.
use teensy4_bsp as bsp;
use bsp::board;
let instances = board::instances();
§Panics
Panics if the instances have already been taken from this function.
If you’re using RTIC, know that RTIC may take these instances before
calling your init
function.
ⓘ
let instances = board::instances();
// Sometime later...
board::instances(); // Panics! Instances already taken.
§Safety
This function provides a safe, convenient way to acquire one Instances
object.
It’s considered safe for the use-cases that teensy4-bsp
intends to support;
specifically, you’re building one binary that represents the entire firmware
image, and that there’s no other software which is acquiring these resources.