Skip to content
Snippets Groups Projects
Commit 1cf3c85d authored by Per's avatar Per
Browse files

Initial commit

parent d17eff19
No related branches found
No related tags found
No related merge requests found
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "xargo build",
"command": "xargo",
"args": [
"build"
],
"problemMatcher": [
"$rustc"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
\ No newline at end of file
......@@ -26,10 +26,10 @@ rev = "7d904f515d15fd5fe7ea34e18820ea83e2651fa2"
[dependencies.nb]
git = "https://github.com/japaric/nb"
[dependencies.stm32f40x]
[dependencies.stm32f413]
features = ["rt"]
#version = "0.5.0"
git = "https://gitlab.henriktjader.com/pln/STM32F40x"
git = "https://gitlab.henriktjader.com/pln/stm32f413"
[dev-dependencies]
cortex-m = "0.3.0"
......
......@@ -23,7 +23,7 @@ use rtfm::{app, Threshold};
const FREQUENCY: Hertz = Hertz(1);
app! {
device: f4::stm32f40x,
device: f4::stm32f413,
idle: {
resources: [TIM11],
......
......@@ -17,7 +17,7 @@ const FREQUENCY: u32 = 1; // Hz
// TASKS & RESOURCES
app! {
device: f4::stm32f40x,
device: f4::stm32f413,
resources: {
static ON: bool = false;
......
......@@ -19,7 +19,7 @@ const RESOLUTION: Milliseconds = Milliseconds(1);
const CHANNELS: [Channel; 2] = [Channel::_1, Channel::_2];
app! {
device: f4::stm32f40x,
device: f4::stm32f413,
idle: {
resources: [ITM, TIM2],
......
......@@ -24,7 +24,7 @@ const DIVISOR: u32 = 4;
// TASKS & RESOURCES
app! {
device: f4::stm32f40x,
device: f4::stm32f413,
resources: {
static ON: bool = false;
......
......@@ -14,7 +14,7 @@ use rtfm::{app, Threshold};
use semihosting::hio::{self, HStdout};
app! {
device: f4::stm32f40x,
device: f4::stm32f413,
resources: {
static HSTDOUT: Option<HStdout> = None;
......
......@@ -11,7 +11,7 @@ extern crate f4;
use rtfm::app;
app! {
device: f4::stm32f40x,
device: f4::stm32f413,
}
fn init(_p: init::Peripherals) {}
......
......@@ -19,7 +19,7 @@ extern crate cortex_m_rtfm as rtfm;
#[macro_use]
extern crate f4;
extern crate heapless;
extern crate stm32f40x;
extern crate stm32f413;
use cortex_m::peripheral::SystClkSource;
use core::ops::Deref;
......@@ -36,7 +36,7 @@ const FREQUENCY: u32 = 10;
const MAX_TX_LEN: usize = 256;
app! {
device: f4::stm32f40x,
device: f4::stm32f413,
resources: {
static IMU_SETTINGS: ImuSettings = ImuSettings::new();
......
......@@ -31,7 +31,7 @@ extern crate f4;
use rtfm::{app, Threshold};
app! {
device: f4::stm32f40x,
device: f4::stm32f413,
idle: {
resources: [ITM],
......
......@@ -12,7 +12,7 @@ use rtfm::app;
// TASKS & RESOURCES
app! {
device: f4::stm32f40x,
device: f4::stm32f413,
}
// INITIALIZATION PHASE
......
......@@ -18,7 +18,7 @@ const BAUD_RATE: Hertz = Hertz(115_200);
// TASKS & RESOURCES
app! {
device: f4::stm32f40x,
device: f4::stm32f413,
tasks: {
USART2: {
......
//! Set the clock frequency on the Nucleo-64 stm32f40x
//! Set the clock frequency on the Nucleo-64 stm32f413
#![deny(warnings)]
#![feature(proc_macro)]
#![no_std]
......@@ -16,7 +16,7 @@ const FREQUENCY: u32 = 10; // Hz
// TASKS & RESOURCES
app! {
device: f4::stm32f40x,
device: f4::stm32f413,
resources: {
static ON: bool = false;
......
......@@ -34,7 +34,7 @@ const DIVISOR: u32 = 4;
// TASK & RESOURCES
app!{
device: f4::stm32f40x,
device: f4::stm32f413,
resources: {
static BUFFER: Vec<u8, [u8; 16]> = Vec::new([0; 16]);
......
......@@ -24,7 +24,7 @@ const BAUD_RATE: Hertz = Hertz(115_200);
const FREQUENCY: Hertz = Hertz(1_000);
app! {
device: f4::stm32f40x,
device: f4::stm32f413,
tasks: {
USART2: {
......
......@@ -14,7 +14,7 @@ use rtfm::app;
const FREQUENCY: Hertz = Hertz(10_000);
app! {
device: f4::stm32f40x,
device: f4::stm32f413,
}
fn init(p: init::Peripherals) {
......
......@@ -37,7 +37,7 @@ const DIVISOR: u32 = 4;
// TASKS & RESOURCES
app! {
device: f4::stm32f40x,
device: f4::stm32f413,
resources: {
// 16 byte buffer
......
......@@ -19,7 +19,7 @@ const DIVISOR: u32 = 4;
// TASKS & RESOURCES
app! {
device: f4::stm32f40x,
device: f4::stm32f413,
resources: {
static STATE: u8 = 0;
......
......@@ -15,15 +15,15 @@
extern crate cortex_m;
extern crate cortex_m_rtfm as rtfm;
extern crate f4;
extern crate stm32f40x;
extern crate stm32f413;
use f4::Spi;
use f4::prelude::*;
use rtfm::{app, Threshold};
use stm32f40x::GPIOA;
use stm32f413::GPIOA;
app! {
device: f4::stm32f40x,
device: f4::stm32f413,
idle: {
resources: [SPI3, GPIOA],
......@@ -79,7 +79,7 @@ fn disable_ag(gpioa: &mut GPIOA) {
gpioa.odr.modify(|_, w| w.odr8().bit(true));
}
fn send_receive(spi: &f4::Spi<f4::stm32f40x::SPI3>, addr: u8) -> u8 {
fn send_receive(spi: &f4::Spi<f4::stm32f413::SPI3>, addr: u8) -> u8 {
// Send and receive using the hal crate
while spi.send(addr).is_err() {}
while spi.read().is_err() {}
......
......@@ -38,7 +38,7 @@ enum CmdType {
}
app! {
device: f4::stm32f40x,
device: f4::stm32f413,
resources: {
static CMD_BUFFER: Vec<u8, [u8; MAX_CMD_LEN]> = Vec::new([0; MAX_CMD_LEN]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment