teensycore 0.1.0

A kernel for the teensy4.0 microcontroller
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::phys::*;
use crate::phys::addrs;

pub fn xbar_start_clock() {
    assign(addrs::CCM_CCGR2, read_word(addrs::CCM_CCGR2) | (0x3 << 14) | (0x3 << 22) | (0x3 << 24));
}

pub fn xbar_connect(input: u32, output: u32) {
    let addr = addrs::IMXRT_XBARA1 + (output / 2);
    let val = read_16(addr);

    if !(output & 0x1) >= 1 {
        assign_16(addr, (val & 0xFF00) | (input as u16));
    } else {
        assign_16(addr, (val & 0x00FF) | ((input as u16) << 8));
    }
}