更多分享内容可访问我的个人博客
本系列教程全部置于stm32专栏。
本例程参考stm32fxxx-hal crate
(如stm32f1xx-hal
)官方例程,并在官方例程的基础上增加了一些注释,修正了一些错误。可以借鉴不同型号的 stm32 例程,毕竟固件库的核是一样的。
Don’t forget to enable can
feature of stm32f3xx_hal
crate.
#![no_main]
#![no_std]
use cortex_m::asm;
use hal::{
can::{Can, CanFilter, CanFrame, CanId, Filter, Frame, Receiver, Transmitter},
prelude::*,
rcc::RccExt,
watchdog::IndependentWatchDog,
};
use nb::block;
use panic_semihosting as _;
use stm32f3xx_hal as hal;
const ID: u16 = 0b100;
#[rtic::app(device = stm32f3xx_hal::pac, peripherals = true)]
const APP: () = {