-
Hi all - Long-time (intermittent) embedded programmer here, new to both Rust and Teensy! I've been playing around with examples in the teensy4-rs and imxrt-rs projects, getting the hang of reading Rust code and trying to assemble pieces. My medium-term goal is to write some Teensy4 DMA-to-SPI code, which seems like it should be pretty straightforward, after all there are DMA examples in the imxrt-rs project that seem to run on the Teensy. I think in part I'm struggling with not knowing all the Rust crate inclusion and visibility rules, but also there are some differences in the imxrt-rs project versus the teensy4-rs project that seem intentional but I don't understand. I'm hoping somebody here might be able to help me at least figure out which things are intentional and which things I'm just misunderstanding. Concretely, what I'm currently doing is trying to get the async_dma_uart.rs example from the imxrt-rs project running with the Maybe the general question I have is that there seems to be some useful stuff in More specifically, Slightly more generally, is there a reason why the General/Specific paradigm is only used in the testing/examples rather than being the way that the The one I'm really wondering about is I think I've read all the relevant documentation (e.g. The i.MX RT HAL book and references), but please let me know if I've missed something. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Besides selecting the function of pin 13, Here are some of the ways you can configure your Teensy 4's pins. There's more possibilities shown in this table. These show that pins 14 and 15 could be used for not just serial UART, but also SPDIF audio, PWM, or a quad timer, or a GPT input capture, or a FlexIO, or just a GPIO... Suppose I don't think
Moving the specificity down into the board means it's easier to maintain the examples, and to port the examples to new platforms. But that specificity might not work for all projects.
It's a simple way to constantly poll a future with the CPU, without interrupts. That might be suitable for your project! Otherwise, I'd recommend using a real async executor, like RTIC v2. |
Beta Was this translation helpful? Give feedback.
Besides selecting the function of pin 13,
imxrt_hal::board::new()
also decides that your only serial UART is using pins 14 and 15.When
imxrt_hal::board
makes decisions like this, they may not be in your interest.Here are some of the ways you can configure your Teensy 4's pins. There's more possibilities shown in this table. These show that pins 14 and 15 could be used for not just serial UART, but also SPDIF audio, PWM, or a quad timer, or a GPT input capture, or a FlexIO, or just a GPIO...
Suppose
teensy4_bsp
returned to you that specific LPUART peripheral on pins 14 and 15, likeimxrt_hal::board::new()
. What if you don't want that? You've already designed a carrier PCBA for your audio…